diff --git a/.gitmodules b/.gitmodules index 281ddbda3..4cca9a4a8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,4 +5,4 @@ [submodule "test/data-visual"] path = test/data-visual url = https://github.com/mapnik/test-data-visual.git - branch = master + branch = master \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index bfad888ba..763444947 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,25 @@ Developers: Please commit along with changes. For a complete change history, see the git log. -## Future +## 3.0.1 +Released: July 27th, 2015 + +(Packaged from 28f6f4d) + +#### Summary + +The 3.0.1 fixes a few bugs in geojson parsing, svg parsing, and rendering. It also avoids a potential hang when using `line-geometry-transform` and includes a speedup for text rendering compared to v3.0.0. It is fully back compatibility with v3.0.0 and everyone is encouraged to upgrade. + +- Fixed text placement performance after #2949 (#2963) +- Fixed rendering behavior for `text-minimum-path-length` which regressed in 3.0.0 (#2990) +- Fixed handling of `xml:id` in SVG parsing (#2989) +- Fixed handling of out of range `rx` and `ry` in SVG `rect` (#2991) +- Fixed reporting of envelope from `mapnik::memory_datasource` when new features are added (#2985) +- Fixed parsing of GeoJSON when unknown properties encountered at `FeatureCollection` level (#2983) - Fixed parsing of GeoJSON when properties contained `{}` (#2964) - Fixed potential hang due to invalid use of `line-geometry-transform` (6d6cb15) +- Moved unmaintained plugins out of core: `osm`, `occi`, and `rasterlite` (#2980) ## 3.0.0 diff --git a/Makefile b/Makefile index ef02f71f7..3ff06a59c 100755 --- a/Makefile +++ b/Makefile @@ -12,6 +12,25 @@ all: mapnik install: $(PYTHON) scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 install +release: + export MAPNIK_VERSION=$(shell ./utils/mapnik-config/mapnik-config --version) && \ + export TARBALL_NAME="mapnik-v$${MAPNIK_VERSION}" && \ + cd /tmp/ && \ + rm -rf $${TARBALL_NAME} && \ + git clone --depth 1 --branch v$${MAPNIK_VERSION} git@github.com:mapnik/mapnik.git $${TARBALL_NAME} && \ + cd $${TARBALL_NAME} && \ + git checkout "tags/v$${MAPNIK_VERSION}" && \ + git submodule update --depth 1 --init && \ + rm -rf test/data/.git && \ + rm -rf test/data/.gitignore && \ + rm -rf test/data-visual/.git && \ + rm -rf test/data-visual/.gitignore && \ + rm -rf .git && \ + rm -rf .gitignore && \ + cd ../ && \ + tar cjf $${TARBALL_NAME}.tar.bz2 $${TARBALL_NAME}/ && \ + aws s3 cp --acl public-read $${TARBALL_NAME}.tar.bz2 s3://mapnik/dist/v$${MAPNIK_VERSION}/ + python: if [ ! -d ./bindings/python ]; then git clone git@github.com:mapnik/python-mapnik.git --recursive ./bindings/python; else (cd bindings/python && git pull && git submodule update --init); fi; make diff --git a/SConstruct b/SConstruct index 488431df4..9f3c0f4a9 100644 --- a/SConstruct +++ b/SConstruct @@ -1897,6 +1897,8 @@ if not HELP_REQUESTED: # Build the requested and able-to-be-compiled input plug-ins GDAL_BUILT = False OGR_BUILT = False + POSTGIS_BUILT = False + PGRASTER_BUILT = False for plugin in env['PLUGINS']: if env['PLUGIN_LINKING'] == 'static' or plugin not in env['REQUESTED_PLUGINS']: if os.path.exists('plugins/input/%s.input' % plugin): @@ -1906,11 +1908,17 @@ if not HELP_REQUESTED: if details['lib'] in env['LIBS']: if env['PLUGIN_LINKING'] == 'shared': SConscript('plugins/input/%s/build.py' % plugin) + # hack to avoid breaking on plugins with the same dep if plugin == 'ogr': OGR_BUILT = True if plugin == 'gdal': GDAL_BUILT = True + if plugin == 'postgis': POSTGIS_BUILT = True + if plugin == 'pgraster': PGRASTER_BUILT = True if plugin == 'ogr' or plugin == 'gdal': if GDAL_BUILT and OGR_BUILT: env['LIBS'].remove(details['lib']) + elif plugin == 'postgis' or plugin == 'pgraster': + if POSTGIS_BUILT and PGRASTER_BUILT: + env['LIBS'].remove(details['lib']) else: env['LIBS'].remove(details['lib']) elif not details['lib']: diff --git a/include/mapnik/json/geometry_generator_grammar_impl.hpp b/include/mapnik/json/geometry_generator_grammar_impl.hpp index c6968cfc0..f94498065 100644 --- a/include/mapnik/json/geometry_generator_grammar_impl.hpp +++ b/include/mapnik/json/geometry_generator_grammar_impl.hpp @@ -23,13 +23,21 @@ // mapnik #include #include +#include // boost +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include #include #include +#pragma GCC diagnostic pop namespace mapnik { namespace json { diff --git a/include/mapnik/label_collision_detector.hpp b/include/mapnik/label_collision_detector.hpp index 6dce9ff2c..74a76be7f 100644 --- a/include/mapnik/label_collision_detector.hpp +++ b/include/mapnik/label_collision_detector.hpp @@ -212,12 +212,18 @@ public: void insert(box2d const& box) { - tree_.insert(label(box), box); + if (tree_.extent().intersects(box)) + { + tree_.insert(label(box), box); + } } void insert(box2d const& box, mapnik::value_unicode_string const& text) { - tree_.insert(label(box, text), box); + if (tree_.extent().intersects(box)) + { + tree_.insert(label(box, text), box); + } } void clear() diff --git a/include/mapnik/text/glyph_positions.hpp b/include/mapnik/text/glyph_positions.hpp index 604de8c7c..e956edda8 100644 --- a/include/mapnik/text/glyph_positions.hpp +++ b/include/mapnik/text/glyph_positions.hpp @@ -26,6 +26,7 @@ #include #include #include +#include // agg #include "agg_trans_affine.h" @@ -37,8 +38,6 @@ namespace mapnik { -struct glyph_info; - struct glyph_position { glyph_position(glyph_info const& _glyph, pixel_position const& _pos, rotation const& _rot) diff --git a/include/mapnik/text/itemizer.hpp b/include/mapnik/text/itemizer.hpp index 4f11bba57..b8589448d 100644 --- a/include/mapnik/text/itemizer.hpp +++ b/include/mapnik/text/itemizer.hpp @@ -72,7 +72,7 @@ struct MAPNIK_DECL text_item : util::noncopyable // - format // - script (http://en.wikipedia.org/wiki/Scripts_in_Unicode) -class MAPNIK_DECL text_itemizer +class MAPNIK_DECL text_itemizer : util::noncopyable { public: text_itemizer(); diff --git a/include/mapnik/text/placement_finder.hpp b/include/mapnik/text/placement_finder.hpp index f2bd36db3..0460b2c52 100644 --- a/include/mapnik/text/placement_finder.hpp +++ b/include/mapnik/text/placement_finder.hpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/include/mapnik/text/placement_finder_impl.hpp b/include/mapnik/text/placement_finder_impl.hpp index 739238924..1b8f84147 100644 --- a/include/mapnik/text/placement_finder_impl.hpp +++ b/include/mapnik/text/placement_finder_impl.hpp @@ -19,23 +19,19 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *****************************************************************************/ -//mapnik -#include -#include -#include -#include + +// mapnik +//#include +//#include #include #include #include -#include +//#include #include #include +#include -// agg -#include "agg_conv_clip_polyline.h" - -// stl -#include +#include namespace mapnik { diff --git a/include/mapnik/text/symbolizer_helpers.hpp b/include/mapnik/text/symbolizer_helpers.hpp index 714d566ba..8a44bddfc 100644 --- a/include/mapnik/text/symbolizer_helpers.hpp +++ b/include/mapnik/text/symbolizer_helpers.hpp @@ -22,10 +22,13 @@ #ifndef SYMBOLIZER_HELPERS_HPP #define SYMBOLIZER_HELPERS_HPP -//mapnik +// mapnik #include +#include #include #include +#include +#include namespace mapnik { diff --git a/include/mapnik/text/text_line.hpp b/include/mapnik/text/text_line.hpp index a00fb79cf..cf47026df 100644 --- a/include/mapnik/text/text_line.hpp +++ b/include/mapnik/text/text_line.hpp @@ -26,12 +26,11 @@ #include #include #include +#include namespace mapnik { -struct glyph_info; - // This class stores all glyphs of a line in left to right order. // It can be used for rendering but no text processing (like line breaking) // should be done! @@ -98,6 +97,6 @@ private: unsigned space_count_; }; -} //namespace mapnik +} // namespace mapnik #endif // MAPNIK_TEXT_LINE_HPP diff --git a/include/mapnik/util/spirit_transform_attribute.hpp b/include/mapnik/util/spirit_transform_attribute.hpp index 1c0bdac54..e924fd822 100644 --- a/include/mapnik/util/spirit_transform_attribute.hpp +++ b/include/mapnik/util/spirit_transform_attribute.hpp @@ -24,6 +24,20 @@ #define MAPNIK_UTIL_SPIRIT_TRANSFORM_ATTRIBUTE_HPP #include +#include + +#include +#include + +// boost +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" +#include +#pragma GCC diagnostic pop namespace boost { namespace spirit { namespace traits { diff --git a/include/mapnik/version.hpp b/include/mapnik/version.hpp index 47a200e8f..a0a7b9d8b 100644 --- a/include/mapnik/version.hpp +++ b/include/mapnik/version.hpp @@ -23,13 +23,13 @@ #ifndef MAPNIK_VERSION_HPP #define MAPNIK_VERSION_HPP -#define MAPNIK_VERSION_IS_RELEASE 1 +#define MAPNIK_VERSION_IS_RELEASE 0 #define MAPNIK_MAJOR_VERSION 3 #define MAPNIK_MINOR_VERSION 0 -#define MAPNIK_PATCH_VERSION 0 +#define MAPNIK_PATCH_VERSION 1 -// translates to 300000 +// translates to 300001 #define MAPNIK_VERSION (MAPNIK_MAJOR_VERSION*100000) + (MAPNIK_MINOR_VERSION*100) + (MAPNIK_PATCH_VERSION) #ifndef MAPNIK_STRINGIFY diff --git a/localize.sh b/localize.sh index ee62e5987..31c6a6ea5 100755 --- a/localize.sh +++ b/localize.sh @@ -8,6 +8,7 @@ else fi export PATH=$(pwd)/utils/nik2img/:${PATH} +export PATH=$(pwd)/utils/mapnik-config/:${PATH} # mapnik-settings.env is an optional file to store # environment variables that should be used before diff --git a/src/agg/process_group_symbolizer.cpp b/src/agg/process_group_symbolizer.cpp index 68c54f2c3..f2c8adf48 100644 --- a/src/agg/process_group_symbolizer.cpp +++ b/src/agg/process_group_symbolizer.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/src/agg/process_line_pattern_symbolizer.cpp b/src/agg/process_line_pattern_symbolizer.cpp index 7cdd16648..a6be6b154 100644 --- a/src/agg/process_line_pattern_symbolizer.cpp +++ b/src/agg/process_line_pattern_symbolizer.cpp @@ -50,7 +50,6 @@ #include "agg_span_allocator.h" #include "agg_span_pattern_rgba.h" #include "agg_renderer_outline_image.h" -#include "agg_conv_clip_polyline.h" namespace mapnik { diff --git a/src/agg/process_markers_symbolizer.cpp b/src/agg/process_markers_symbolizer.cpp index ab06ed30c..cb9428260 100644 --- a/src/agg/process_markers_symbolizer.cpp +++ b/src/agg/process_markers_symbolizer.cpp @@ -50,7 +50,6 @@ #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_path_storage.h" -#include "agg_conv_clip_polyline.h" #include "agg_conv_transform.h" diff --git a/src/agg/process_shield_symbolizer.cpp b/src/agg/process_shield_symbolizer.cpp index 67fe8de0d..3d28eff60 100644 --- a/src/agg/process_shield_symbolizer.cpp +++ b/src/agg/process_shield_symbolizer.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include namespace mapnik { diff --git a/src/agg/process_text_symbolizer.cpp b/src/agg/process_text_symbolizer.cpp index 078a7abaa..b3794bcf5 100644 --- a/src/agg/process_text_symbolizer.cpp +++ b/src/agg/process_text_symbolizer.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include namespace mapnik { diff --git a/src/cairo/process_group_symbolizer.cpp b/src/cairo/process_group_symbolizer.cpp index d32afcf67..a2dc4abbe 100644 --- a/src/cairo/process_group_symbolizer.cpp +++ b/src/cairo/process_group_symbolizer.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include diff --git a/src/cairo/process_text_symbolizer.cpp b/src/cairo/process_text_symbolizer.cpp index 06b56cb2d..2d34e213c 100644 --- a/src/cairo/process_text_symbolizer.cpp +++ b/src/cairo/process_text_symbolizer.cpp @@ -27,6 +27,7 @@ #include #include #include +#include namespace mapnik { diff --git a/src/grid/process_group_symbolizer.cpp b/src/grid/process_group_symbolizer.cpp index a672f6b8f..f73118969 100644 --- a/src/grid/process_group_symbolizer.cpp +++ b/src/grid/process_group_symbolizer.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/src/grid/process_shield_symbolizer.cpp b/src/grid/process_shield_symbolizer.cpp index 781989384..50bc8209f 100644 --- a/src/grid/process_shield_symbolizer.cpp +++ b/src/grid/process_shield_symbolizer.cpp @@ -31,6 +31,7 @@ #include #include #include +#include // agg #include "agg_trans_affine.h" diff --git a/src/grid/process_text_symbolizer.cpp b/src/grid/process_text_symbolizer.cpp index 3df4ad24f..7fe0ff377 100644 --- a/src/grid/process_text_symbolizer.cpp +++ b/src/grid/process_text_symbolizer.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include namespace mapnik { diff --git a/src/group/group_symbolizer_helper.cpp b/src/group/group_symbolizer_helper.cpp index a8e453a69..2ba70ff9b 100644 --- a/src/group/group_symbolizer_helper.cpp +++ b/src/group/group_symbolizer_helper.cpp @@ -34,9 +34,6 @@ #include #include -//agg -#include "agg_conv_clip_polyline.h" - namespace mapnik { namespace detail { template diff --git a/src/text/placement_finder.cpp b/src/text/placement_finder.cpp index 7c09e56f2..53dda7da7 100644 --- a/src/text/placement_finder.cpp +++ b/src/text/placement_finder.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -32,9 +33,6 @@ #include #include -// agg -#include "agg_conv_clip_polyline.h" - // stl #include diff --git a/src/text/symbolizer_helpers.cpp b/src/text/symbolizer_helpers.cpp index 99c7c0356..860359af6 100644 --- a/src/text/symbolizer_helpers.cpp +++ b/src/text/symbolizer_helpers.cpp @@ -41,8 +41,6 @@ #include #include -//agg -#include "agg_conv_clip_polyline.h" namespace mapnik { namespace detail { @@ -79,11 +77,10 @@ struct split_multi_geometries { using container_type = T; split_multi_geometries(container_type & cont, view_transform const& t, - proj_transform const& prj_trans, double minimum_path_length) + proj_transform const& prj_trans) : cont_(cont), t_(t), - prj_trans_(prj_trans), - minimum_path_length_(minimum_path_length) {} + prj_trans_(prj_trans) { } void operator() (geometry::geometry_empty const&) const {} void operator() (geometry::multi_point const& multi_pt) const @@ -95,18 +92,7 @@ struct split_multi_geometries } void operator() (geometry::line_string const& line) const { - if (minimum_path_length_ > 0) - { - box2d bbox = t_.forward(geometry::envelope(line), prj_trans_); - if (bbox.width() >= minimum_path_length_) - { - cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(line))); - } - } - else - { - cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(line))); - } + cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(line))); } void operator() (geometry::multi_line_string const& multi_line) const @@ -119,18 +105,7 @@ struct split_multi_geometries void operator() (geometry::polygon const& poly) const { - if (minimum_path_length_ > 0) - { - box2d bbox = t_.forward(geometry::envelope(poly), prj_trans_); - if (bbox.width() >= minimum_path_length_) - { - cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(poly))); - } - } - else - { - cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(poly))); - } + cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(poly))); } void operator() (geometry::multi_polygon const& multi_poly) const @@ -158,7 +133,6 @@ struct split_multi_geometries container_type & cont_; view_transform const& t_; proj_transform const& prj_trans_; - double minimum_path_length_; }; } // ns detail @@ -207,10 +181,9 @@ struct largest_bbox_first void base_symbolizer_helper::initialize_geometries() const { - double minimum_path_length = text_props_->minimum_path_length; auto const& geom = feature_.get_geometry(); util::apply_visitor(detail::split_multi_geometries - (geometries_to_process_, t_, prj_trans_, minimum_path_length ), geom); + (geometries_to_process_, t_, prj_trans_), geom); if (!geometries_to_process_.empty()) { auto type = geometry::geometry_type(geom); diff --git a/test/data-visual b/test/data-visual index 80c744348..e3d79ed49 160000 --- a/test/data-visual +++ b/test/data-visual @@ -1 +1 @@ -Subproject commit 80c744348de8cb03a519e451129a243610e55f52 +Subproject commit e3d79ed493485afbb5c79cd90913c8db488561b6 diff --git a/test/unit/core/copy_move_test.cpp b/test/unit/core/copy_move_test.cpp index 690537920..a219178a9 100644 --- a/test/unit/core/copy_move_test.cpp +++ b/test/unit/core/copy_move_test.cpp @@ -23,7 +23,6 @@ SECTION("layers") { std::string shape_plugin("./plugins/input/shape.input"); if (mapnik::util::exists(shape_plugin)) { - mapnik::datasource_cache::instance().register_datasources("plugins/input/shape.input"); mapnik::parameters p; p["type"]="shape"; p["file"]="demo/data/boundaries"; diff --git a/test/unit/core/exceptions_test.cpp b/test/unit/core/exceptions_test.cpp index 332460082..46abcce55 100644 --- a/test/unit/core/exceptions_test.cpp +++ b/test/unit/core/exceptions_test.cpp @@ -62,7 +62,6 @@ SECTION("handling") { std::string csv_plugin("./plugins/input/csv.input"); if (mapnik::util::exists(csv_plugin)) { try { - mapnik::datasource_cache::instance().register_datasource(csv_plugin); mapnik::parameters p; p["type"]="csv"; p["inline"]="x,y\n0,0"; @@ -88,7 +87,6 @@ SECTION("handling") { std::string shape_plugin("./plugins/input/shape.input"); if (mapnik::util::exists(shape_plugin)) { try { - mapnik::datasource_cache::instance().register_datasource(shape_plugin); mapnik::parameters p2; p2["type"]="shape"; p2["file"]="foo"; diff --git a/test/unit/datasource/geojson.cpp b/test/unit/datasource/geojson.cpp index 4fe4f0792..9bcacca95 100644 --- a/test/unit/datasource/geojson.cpp +++ b/test/unit/datasource/geojson.cpp @@ -33,7 +33,6 @@ TEST_CASE("geojson") { std::string geojson_plugin("./plugins/input/geojson.input"); if (mapnik::util::exists(geojson_plugin)) { - mapnik::datasource_cache::instance().register_datasources("plugins/input/geojson.input"); SECTION("json feature cache-feature=\"true\"") { // Create datasource @@ -50,6 +49,7 @@ TEST_CASE("geojson") { query.add_property_name(field.get_name()); } auto features = ds->features(query); + REQUIRE(features != nullptr); auto feature = features->next(); REQUIRE(feature != nullptr); } @@ -69,11 +69,11 @@ TEST_CASE("geojson") { query.add_property_name(field.get_name()); } auto features = ds->features(query); + REQUIRE(features != nullptr); auto feature = features->next(); REQUIRE(feature != nullptr); } - mapnik::datasource_cache::instance().register_datasources("plugins/input/geojson.input"); SECTION("json extra properties cache-feature=\"true\"") { // Create datasource @@ -90,12 +90,12 @@ TEST_CASE("geojson") { query.add_property_name(field.get_name()); } auto features = ds->features(query); + REQUIRE(features != nullptr); auto feature = features->next(); REQUIRE(feature != nullptr); REQUIRE(feature->envelope() == mapnik::box2d(123,456,123,456)); } - mapnik::datasource_cache::instance().register_datasources("plugins/input/geojson.input"); SECTION("json extra properties cache-feature=\"false\"") { // Create datasource @@ -112,6 +112,7 @@ TEST_CASE("geojson") { query.add_property_name(field.get_name()); } auto features = ds->features(query); + REQUIRE(features != nullptr); auto feature = features->next(); REQUIRE(feature != nullptr); REQUIRE(feature->envelope() == mapnik::box2d(123,456,123,456)); diff --git a/test/unit/imaging/image_painted_test.cpp b/test/unit/imaging/image_painted_test.cpp index a1fbbc979..5d0b403f7 100644 --- a/test/unit/imaging/image_painted_test.cpp +++ b/test/unit/imaging/image_painted_test.cpp @@ -21,8 +21,6 @@ SECTION("painting") { std::string csv_plugin("./plugins/input/csv.input"); if (mapnik::util::exists(csv_plugin)) { - datasource_cache::instance().register_datasources(csv_plugin); - Map m(256, 256); feature_type_style lines_style; diff --git a/test/unit/run.cpp b/test/unit/run.cpp index 15ad0991a..8ae4ddc73 100644 --- a/test/unit/run.cpp +++ b/test/unit/run.cpp @@ -1,10 +1,14 @@ #define CATCH_CONFIG_RUNNER #include "catch.hpp" +#include + #include "cleanup.hpp" // run_cleanup() int main (int argc, char* const argv[]) { + mapnik::datasource_cache::instance().register_datasources("plugins/input/"); + int result = Catch::Session().run( argc, argv ); testing::run_cleanup();