diff --git a/.travis.yml b/.travis.yml index bf3060a6f..dc6c106cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -106,10 +106,7 @@ script: # (and might work) for the next build - DURATION=2400 - scripts/travis-command-wrapper.py -s "date" -i 120 --deadline=$(( $(date +%s) + ${DURATION} )) make - - RESULT=0 - - make test || RESULT=$? - # we allow visual failures with g++ for now: https://github.com/mapnik/mapnik/issues/3567 - - if [[ ${RESULT} != 0 ]] && [[ ${CXX} =~ 'clang++' ]]; then false; fi; + - make test - enabled ${COVERAGE} coverage - enabled ${BENCH} make bench - ./scripts/check_glibcxx.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index e8ce27bdc..6bd8eb76f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,191 +6,229 @@ Developers: Please commit along with changes. For a complete change history, see the git log. + +## UNRELEASED + +#### Notice + +- Mapnik now requires C++14 compliant compiler (`-std=c++14`) + +#### Core + +- Rewrote parser grammars using Boost.Spirit X3 (replacing Boost.Spirit Qi) +- Fixed bbox reprojection ([#3935](https://github.com/mapnik/mapnik/issues/3935)) +- Fixed missing MarkersSymbolizer placement on zero-length lines ([#3899](https://github.com/mapnik/mapnik/issues/3899)) +- Fixed segfault when ShieldSymbolizer has invalid placements ([5464ae9](https://github.com/mapnik/mapnik/commit/5464ae9cdfd32983883463bcc2396dc0e51d885f), [#3604](https://github.com/mapnik/mapnik/issues/3604#issuecomment-281542148)) +- Fixed `apply_color_blind_filter` ([#3862](https://github.com/mapnik/mapnik/issues/3862)) +- Fixed GroupSymbolizer crash, `svg::path_attributes` are now stored in `std::deque` ([#3455](https://github.com/mapnik/mapnik/issues/3455)) +- Duplicate Style name in map XML now throws `config_error` in strict mode ([#3770](https://github.com/mapnik/mapnik/issues/3770), [#3917](https://github.com/mapnik/mapnik/issues/3917)) +- Improved padding calculation for polygon/line clipping ([#3909](https://github.com/mapnik/mapnik/issues/3909)) +- Slightly improved `sql_utils::table_from_sql` ([2587bb3](https://github.com/mapnik/mapnik/commit/2587bb3a1d8db397acfa8dcc2d332da3a8a9399f)) +- Added wrappers for proper quoting in SQL query construction: `sql_utils::identifier`, `sql_utils::literal` ([7b21713](https://github.com/mapnik/mapnik/commit/7b217133e2749b82c2638551045c4edbece15086)) +- Added two-argument `sql_utils::unquote`, `sql_utils::unquote_copy` that also collapse inner quotes ([a4e8ea2](https://github.com/mapnik/mapnik/commit/a4e8ea21be297d89bbf36ba594d6c661a7a9ac81)) + +#### Plugins + +- PostGIS: changed syntax for user `@variable` interpolation to `!@variable!` ([#3618](https://github.com/mapnik/mapnik/issues/3618)) +- PostGIS: using parameter `estimate_extent` now requires PostGIS >= 2.1.0 ([#3624](https://github.com/mapnik/mapnik/issues/3624)) +- PGraster: added variable interpolation like in PostGIS plugin ([#3618](https://github.com/mapnik/mapnik/issues/3618)) +- PGraster: using parameter `estimate_extent` now requires PostGIS >= 2.1.0 ([#3624](https://github.com/mapnik/mapnik/issues/3624)) + + +## 3.0.20 + +Released: April 12, 2018 + +(Packaged from [f02c7bc](https://github.com/mapnik/mapnik/commit/f02c7bcdb)) + +- Make `max_image_area` a datasource parameter for GDAL. +- GDAL Driver Overview Fix and Memory Reduction ([#3872](https://github.com/mapnik/mapnik/issues/3872)) +- Raster colorizer: check image bounds ([#3879](https://github.com/mapnik/mapnik/issues/3879)) +- Removed usage of `typename` in template template declarations (available in C++17) ([#3882](https://github.com/mapnik/mapnik/issues/3882)) + + ## 3.0.19 Released: March 06, 2018 -(Packaged from d50562d54) +(Packaged from [d50562d](https://github.com/mapnik/mapnik/commit/d50562d54)) + +- Backported scaling of precision by polygon size ([#3844](https://github.com/mapnik/mapnik/issues/3844)) +- Backported GRID placement ([#3847](https://github.com/mapnik/mapnik/issues/3847), [#3854](https://github.com/mapnik/mapnik/issues/3854), [#3855](https://github.com/mapnik/mapnik/issues/3855)) +- Added missing `MAPNIK_DECL` to all `text_placement_` types ([7ce142a](https://github.com/mapnik/mapnik/commit/7ce142a5aa8e9da5ddd11266a054c1e69052230d)) +- Fixed invalid memory access if input buffer size is zero ([a602c65](https://github.com/mapnik/mapnik/commit/a602c65354a4b595821d2300f38ebc107d07e2a9)) +- Fixed handling of an empty polygon in `grid_vertex_converter` ([2f2dcf1](https://github.com/mapnik/mapnik/commit/2f2dcf1eeae71aaa7878f4bc9a39741321f07e68)) +- Fixed `PROJ_LIB` detection logic ([44f1ae3](https://github.com/mapnik/mapnik/commit/44f1ae3a6e9e9979d1a93343f40db6cd7dbf51d5)) +- Default to `icu-config` for obtaining `ICU_DATA` if `u_getDataDirectory` fails ([2cef98d](https://github.com/mapnik/mapnik/commit/2cef98d7f76cdd302afcf15f1c585379537e8f1d)) - - Backported scaling of precision by polygon size (#3844) - - Backported GRID placement (#3847, #3854, #3855) - - Added missing `MAPNIK_DECL` to all `text_placement_` types (7ce142a5aa8e9da5ddd11266a054c1e69052230d) - - Fixed invalid memory access if input_buffer size is zero (a602c65354a4b595821d2300f38ebc107d07e2a9) - - Fixed handling of an empty polygon in grid_vertex_converter (2f2dcf1eeae71aaa7878f4bc9a39741321f07e68) - - Fixed PROJ_LIB detection logic (44f1ae3a6e9e9979d1a93343f40db6cd7dbf51d5) - - Default to `icu-config` for obtaining `ICU_DATA` if `u_getDataDirectory fails (2cef98d7f76cdd302afcf15f1c585379537e8f1d) ## 3.0.18 Released: January 26, 2018 -(Packaged from 44ef46c81) +(Packaged from [44ef46c](https://github.com/mapnik/mapnik/commit/44ef46c81)) + +- SVG parser - fixed logic for calculating dimensions when `width` and `height` expressed in + percentage units ([#3812](https://github.com/mapnik/mapnik/issues/3812)) +- New improved `interior` placement algorithm ([#3839](https://github.com/mapnik/mapnik/issues/3839)) +- Fixed handling of an empty interior rings in `polygon_vertex_processor` ([#3833](https://github.com/mapnik/mapnik/issues/3833)) +- Fixed handling of an empty interior rings in `vertex_adapter` ([#3842](https://github.com/mapnik/mapnik/issues/3842))([#3838](https://github.com/mapnik/mapnik/issues/3838)) - - SVG parser - fixed logic for calculating dimensions when `width` and `height` expressed in - percentage units (#3812) - - New improved `interior` placement algorithm (#3839) - - Fixed handling of an empty interior rings in `polygon_vertex_processor` (#3833) - - Fixed handling of an empty interior rings in `vertex_adapter' (#3842)(#3838) ## 3.0.17 Released: November 29, 2017 -(Packaged from ebdd96c61) +(Packaged from [ebdd96c](https://github.com/mapnik/mapnik/commit/ebdd96c61)) + +- Use `Scons 3` as an internal build sytsem + support both Python 2 and 3. +- Added glibcxx workaround to support libstdc++-4.8 - - Use `Scons 3` as an internal build sytsem + support both Python 2 and 3. - - Added glibcxx workaround to support libstdc++-4.8 ## 3.0.16 Released: November 16, 2017 -(Packaged from 8d7b75e) +(Packaged from [8d7b75e](https://github.com/mapnik/mapnik/commit/8d7b75e)) + +- Added "strict" SVG parsing mode with consistent error handling and disabled processing of unsupported attributes. +- Added support for `` element. +- Implemented compile time string literal to integer conversion, to be able to convert large `if/else if/else` statements to `switch`. +- WKB reader - pre-allocate optimisations in `multi_polygon` and `geometry_collection`. +- Set alpha values in RGBA TIFFs even when `NODATA` value is present. ([#3714](https://github.com/mapnik/mapnik/issues/3714)) +- Support building with ICU >= 59. +- SCons - added `ICU_DATA`, `PROJ_LIB` and `GDAL_DATA` settings, available via `mapnik-config` +- Fixed centroid and interior text placement algorithms ([#3771](https://github.com/mapnik/mapnik/issues/3771)) +- Fixed memory leak ([#3775](https://github.com/mapnik/mapnik/issues/3775)) +- SVG parser - fixed default gradient vector in linear gradient. +- Fixed bounding box collection logic ([#3709](https://github.com/mapnik/mapnik/issues/3709)) - - Added "strict" SVG parsing mode with consistent error handling and disabled processing of unsupported attributes. - - Added support for `` element. - - Implemented compile time string literal to integer conversion, to be able to convert large `if/else if/else` statements to `switch`. - - WKB reader - pre-allocate optimisations in `multi_polygon` and `geometry_collection`. - - Set alpha values in RGBA TIFFs even when `NODATA` value is pesent. - - Support building with ICU >= 59. - - SCons - added ICU_DATA, PROJ_LIB and GDAL_DATA settings, available via `mapnik-config` - - Fixed centroid and interior text placement algorithms (#3771) - - Fixed memory leak (#3775) - - SVG parser - fixed default gradient vector in linear gradient. - - Fixed bounding box collection logic (#3709) ## 3.0.15 Released: June 16, 2017 -#### Summary +(Packaged from [6e6cf84](https://github.com/mapnik/mapnik/commit/6e6cf84)) -(Packaged from 6e6cf84) - -- Restored `filter_factor` logic in `gdal.input` and added to `raster.input` (#3699) - (updated tests https://github.com/mapnik/test-data-visual/commit/fd518f1f512b8aea4ac740c2ce12c249616a291c) -- Fixed bug related to rows swapping implementation in `tiff_reader` ref #3679 +- Restored `filter_factor` logic in `gdal.input` and added to `raster.input` ([#3699](https://github.com/mapnik/mapnik/issues/3699)) + (updated tests [mapnik/test-data-visual@fd518f1](https://github.com/mapnik/test-data-visual/commit/fd518f1f512b8aea4ac740c2ce12c249616a291c)) +- Fixed bug related to rows swapping implementation in `tiff_reader` ref [#3679](https://github.com/mapnik/mapnik/issues/3679) (updated visual tests to catch this regression in the future - https://github.com/mapnik/test-data-visual/commit/be0ba965cd2240576a8edfca84801cbb7a4832d6) + [mapnik/test-data-visual@be0ba96](https://github.com/mapnik/test-data-visual/commit/be0ba965cd2240576a8edfca84801cbb7a4832d6)) - TIFF I/O - port memory mapped based I/O from master + ## 3.0.14 Released: June 5, 2017 -(Packaged from 2b42e17) - -#### Summary +(Packaged from [2b42e17](https://github.com/mapnik/mapnik/commit/2b42e17)) - Fixed problems with high levels of overzooming in the GDAL and raster plugin where data would be slightly offset - High levels of overzooming on raster data no longer results in the return of a transparent image. -- Fixed bug in `mapnik::util::file::data()` (a220bda05d2aa1) +- Fixed bug in `mapnik::util::file::data()` ([a220bda](https://github.com/mapnik/mapnik/commit/a220bda05d2aa1)) - TIFF I/O - added support for grey scale multiband images + fixed and made generic `read_stripped` and `read_generic`. -- shapeindex - return error code when no features can read from shapefile (#3198) +- shapeindex - return error code when no features can read from shapefile ([#3198](https://github.com/mapnik/mapnik/issues/3198)) - Upgrade Scons to `2.5.1` -- Fixed bug (typo) in `raster_featureset.cpp` (#3696) -- Made `freetype_engine` singleton again. This allows for better control of its life-time. Original interface is preserved via adding static methods (#3688) +- Fixed bug (typo) in `raster_featureset.cpp` ([#3696](https://github.com/mapnik/mapnik/issues/3696)) +- Made `freetype_engine` singleton again. This allows for better control of its life-time. Original interface is preserved via adding static methods ([#3688](https://github.com/mapnik/mapnik/issues/3688)) + ## 3.0.13 Released: February 8, 2017 -(Packaged from 2a153c0) - -#### Summary +(Packaged from [2a153c0](https://github.com/mapnik/mapnik/commit/2a153c0)) - Unbundle `unifont` font from distribution -- GeoJSON: improved parsing grammar avoiding temp synthesised attribute (#3507) -- GeoJSON: expose `num_features_to_query` datasource parameter + unit test (#3515) -- Fixed intersecting extents in different projections (PR #3525 ) +- GeoJSON: improved parsing grammar avoiding temp synthesised attribute ([#3507](https://github.com/mapnik/mapnik/issues/3507)) +- GeoJSON: expose `num_features_to_query` datasource parameter + unit test ([#3515](https://github.com/mapnik/mapnik/issues/3515)) +- Fixed intersecting extents in different projections (PR [#3525](https://github.com/mapnik/mapnik/issues/3525) ) - Fixed `blur` implementation by taking into account `scale_factor` -- postgis.input - use 2D box for pgraster bounding box (PR #3551) -- Fixed GroupSymbolizer PairLayout with 3+ items (#3526) -- Simplified `hash` implementation (204d30e58d3553278ab6bcda2d4122b0f13f6392) -- Simplified `mapnik::value` conversion rules (#3570) -- Changed `render_thunk_list` to `std::list` (PR #3585) +- postgis.input - use 2D box for pgraster bounding box (PR [#3551](https://github.com/mapnik/mapnik/issues/3551)) +- Fixed GroupSymbolizer PairLayout with 3+ items ([#3526](https://github.com/mapnik/mapnik/issues/3526)) +- Simplified `hash` implementation ([204d30e](https://github.com/mapnik/mapnik/commit/204d30e58d3553278ab6bcda2d4122b0f13f6392)) +- Simplified `mapnik::value` conversion rules ([#3570](https://github.com/mapnik/mapnik/issues/3570)) +- Changed `render_thunk_list` to `std::list` (PR [#3585](https://github.com/mapnik/mapnik/issues/3585)) - Upgraded to variant `v1.1.5` -- CSV.input - fixed `blank` line test (8a3a380b3b5c64681f2478b4f0d06f6a907f5eed) -- GeoJSON - handle empty elements in position grammar (ref #3609) -- mapnik-index - return failure on invalid bounding box (ref #3611) +- CSV.input - fixed `blank` line test ([8a3a380](https://github.com/mapnik/mapnik/commit/8a3a380b3b5c64681f2478b4f0d06f6a907f5eed)) +- GeoJSON - handle empty elements in position grammar (ref [#3609](https://github.com/mapnik/mapnik/issues/3609)) +- mapnik-index - return failure on invalid bounding box (ref [#3611](https://github.com/mapnik/mapnik/issues/3611)) + ## 3.0.12 Released: September 8, 2016 -(Packaged from 1d22d86) +(Packaged from [1d22d86](https://github.com/mapnik/mapnik/commit/1d22d86)) -#### Summary - -- Ensured gdal.input is registered once (refs #3093 #3339 #3340) +- Ensured gdal.input is registered once (refs [#3093](https://github.com/mapnik/mapnik/issues/3093) [#3339](https://github.com/mapnik/mapnik/issues/3339) [#3340](https://github.com/mapnik/mapnik/issues/3340)) - Fixed `mapnik::util::is_clockwise` implementation to use coordinates relative to the origin and avoid numeric precision issues - `mapnik-index` is updated to fail on first error in input (csv) -- Added `guard` to `get_object_severity` method (ref #3322) -- Improved `hash` calculation for `mapnik::value` (ref #3406) -- AGG - made cover `unsigned` to avoid left shift of negative values (ref #3406) +- Added `guard` to `get_object_severity` method (ref [#3322](https://github.com/mapnik/mapnik/issues/3322)) +- Improved `hash` calculation for `mapnik::value` (ref [#3406](https://github.com/mapnik/mapnik/issues/3406)) +- AGG - made cover `unsigned` to avoid left shift of negative values (ref [#3406](https://github.com/mapnik/mapnik/issues/3406)) - Fixed using `scale_factor` in `evaluate_transform(..)` - Fixed line spacing logic by applying `scale factor` -- ~~Fixed `stringify_object/stringify_array` implementations by disabling white space skipping (ref #3419)~~ +- ~~Fixed `stringify_object/stringify_array` implementations by disabling white space skipping (ref [#3419](https://github.com/mapnik/mapnik/issues/3419))~~ - Added geojson unit test for property types/values - JSON - added support for object and array type in `json_value` and update `stringifier` -- GDAL.input - fallback to using `overviews` if present (8e8482803bb435726534c3b686a56037b7d3e8ad) -- TopoJSON.input - improved and simplified grammer/parser implementation (https://github.com/mapnik/mapnik/pull/3429) +- GDAL.input - fallback to using `overviews` if present ([8e84828](https://github.com/mapnik/mapnik/commit/8e8482803bb435726534c3b686a56037b7d3e8ad)) +- TopoJSON.input - improved and simplified grammar/parser implementation ([#3429](https://github.com/mapnik/mapnik/pull/3429)) - GDAL.input - Added support for non-alpha mask band -- TopoJSON.input - fixed order of ellements limitation (ref #3434) -- Fixed stroke-width size not included in markers ellipse bounding box (ref #3445) -- Implemented `char_array_buffer` and removed `boost::iostreams` dependency (2e8c0d36c2237f2815d8004c1b96bad909056eb9) -- JSON.input - `extract_bounding_box_grammar` - make features optional (ref #3463) +- TopoJSON.input - fixed order of ellements limitation (ref [#3434](https://github.com/mapnik/mapnik/issues/3434)) +- Fixed stroke-width size not included in markers ellipse bounding box (ref [#3445](https://github.com/mapnik/mapnik/issues/3445)) +- Implemented `char_array_buffer` and removed `boost::iostreams` dependency ([2e8c0d3](https://github.com/mapnik/mapnik/commit/2e8c0d36c2237f2815d8004c1b96bad909056eb9)) +- JSON.input - `extract_bounding_box_grammar` - make features optional (ref [#3463](https://github.com/mapnik/mapnik/issues/3463)) - Ensure input plugins return `empty_featureset` rather than `nullptr` (feature_ptr()) -- Added support for quantising small (less than 3 pixel) images (ref #3466) -- Added support for natural logarithm function in expressions (ref #3475) +- Added support for quantising small (less than 3 pixel) images (ref [#3466](https://github.com/mapnik/mapnik/issues/3466)) +- Added support for natural logarithm function in expressions (ref [#3475](https://github.com/mapnik/mapnik/issues/3475)) - Improved logic determining if certain compiler features are available e.g `inheriting constructors` (MSVC) -- GeoJSON - corrected quoting in `stringify` objects (ref #3491) -- GeoJSON - ensured consistent ordering of attribute descriptors (ref #3494) -- GeoJSON - exposed `num_features_to_query` as datasource paramer (ref #3495) -- Replaced `boost::mpl::vector` with `std::tuple` (ref #3503) -- BuildingSymbolizer - fixed closing segment of polygon in building symbolizer (ref #3505) +- GeoJSON - corrected quoting in `stringify` objects (ref [#3491](https://github.com/mapnik/mapnik/issues/3491)) +- GeoJSON - ensured consistent ordering of attribute descriptors (ref [#3494](https://github.com/mapnik/mapnik/issues/3494)) +- GeoJSON - exposed `num_features_to_query` as datasource paramer (ref [#3495](https://github.com/mapnik/mapnik/issues/3495)) +- Replaced `boost::mpl::vector` with `std::tuple` (ref [#3503](https://github.com/mapnik/mapnik/issues/3503)) +- BuildingSymbolizer - fixed closing segment of polygon in building symbolizer (ref [#3505](https://github.com/mapnik/mapnik/issues/3505)) - Update dependencies versions - Fixed warnings when compiling with g++5 -- Fixed image swap (ref #3513) -- Stop bundling testdata in source tarball (ref #3335) +- Fixed image swap (ref [#3513](https://github.com/mapnik/mapnik/issues/3513)) +- Stop bundling testdata in source tarball (ref [#3335](https://github.com/mapnik/mapnik/issues/3335)) + ## 3.0.11 Released: April 1, 2016 -(Packaged from 8d9dc27) +(Packaged from [8d9dc27](https://github.com/mapnik/mapnik/commit/8d9dc27)) -#### Summary + - Raster scaling: fixed crash and clipping negative pixel values of floating point rasters ([#3349](https://github.com/mapnik/mapnik/pull/3349)) + - Restored support for unquoted strings in expressions ([#3390](https://github.com/mapnik/mapnik/pull/3390)) + - [TWKB](https://github.com/TWKB/) support via [#3356](https://github.com/mapnik/mapnik/pull/3356) ([#3355](https://github.com/mapnik/mapnik/issues/3355)) + - Visual test runner can render SVG, PDF and Postscript with Cairo renderer ([#3418](https://github.com/mapnik/mapnik/pull/3418)) + - Scale factor is now applied also to `text-line-spacing` and transforms ([#3416](https://github.com/mapnik/mapnik/pull/3416)) - - Raster scaling: fixed crash and clipping negative pixel values of floating point rasters (https://github.com/mapnik/mapnik/pull/3349) - - Restored support for unquoted strings in expressions (https://github.com/mapnik/mapnik/pull/3390) - - [TWKB](https://github.com/TWKB/) support via https://github.com/mapnik/mapnik/pull/3356 (#3355) - - Visual test runner can render SVG, PDF and Postscript with Cairo renderer (https://github.com/mapnik/mapnik/pull/3418) - - Scale factor is now applied also to `text-line-spacing` and transforms (https://github.com/mapnik/mapnik/pull/3416) ## 3.0.10 Released: February 25, 2016 -(Packaged from 5c0d496) - -#### Summary +(Packaged from [5c0d496](https://github.com/mapnik/mapnik/commit/5c0d496)) - The `shapeindex` command now has a `--index-parts` option. When used the index will be bigger but will allow the Shapefile datasource to only parse polygon parts within the query bounds. - WARNING: index files generated with this newer Mapnik are invalid for older versions of Mapnik. - Any `.index` files accompanying a `.shp` must now be regenerated otherwise - it will be skipped. To avoid this problem you can delete the existing `.index` files, or ideally run `shapeindex` to recreate the `.index`. (https://github.com/mapnik/mapnik/pull/3300) - The trigger for this change was an optimization that required a new binary format for the shapefile indexes (https://github.com/mapnik/mapnik/pull/3217). - - Shapeindex - another fix for skipping `null` shapes (#3288) - - Fixed support for filter expressions starting with `not` (https://github.com/mapnik/mapnik/issues/3017) - - Ensure `mapped_memory_cache` acts as singleton across shared objects (#3306) - - Removed miniz support in PNG encoder (#3281) + it will be skipped. To avoid this problem you can delete the existing `.index` files, or ideally run `shapeindex` to recreate the `.index`. ([#3300](https://github.com/mapnik/mapnik/pull/3300)) + The trigger for this change was an optimization that required a new binary format for the shapefile indexes ([#3217](https://github.com/mapnik/mapnik/pull/3217)). + - Shapeindex - another fix for skipping `null` shapes ([#3288](https://github.com/mapnik/mapnik/issues/3288)) + - Fixed support for filter expressions starting with `not` ([#3017](https://github.com/mapnik/mapnik/issues/3017)) + - Ensure `mapped_memory_cache` acts as singleton across shared objects ([#3306](https://github.com/mapnik/mapnik/issues/3306)) + - Removed miniz support in PNG encoder ([#3281](https://github.com/mapnik/mapnik/issues/3281)) - Added `-fvisibility=hidden -fvisibility-inlines-hidden` to default compiler flags - - Fixed parsing of SVG `PathElement` (https://github.com/mapnik/mapnik/issues/3225) + - Fixed parsing of SVG `PathElement` ([#3225](https://github.com/mapnik/mapnik/issues/3225)) - JSON parsing now supports arbitrary (nested) attributes in `geometry` - Support for rendering `dash-array` in SVGs - - SVG parser is now stricter (fails is all input is not parsable) (#3251) + - SVG parser is now stricter (fails is all input is not parsable) ([#3251](https://github.com/mapnik/mapnik/issues/3251)) - SVG parser now correctly handles optional separator `(,)` between multiple command parts - Optimized parsing of `png` format string - The `memory_datasource` now dynamically reports correct datasource type (vector or raster) @@ -198,140 +236,132 @@ Released: February 25, 2016 - Compare: https://github.com/mapnik/mapnik/compare/v3.0.9...v3.0.10 - ## 3.0.9 Released: November 26, 2015 -(Packaged from 03a0926) +(Packaged from [03a0926](https://github.com/mapnik/mapnik/commit/03a0926)) -#### Summary - - - Fixed offsetting of complex paths and sharp angles (https://github.com/mapnik/mapnik/pull/3160) (via @winni159) - - Fixed mapnik.util.variant issue when compiling with gcc-5.x and SSO enabled by default (https://github.com/mapnik/mapnik/issues/3103) (via @nkovacs) - - Fixed issue with complex scripts where some character sequences weren't rendered correctly (https://github.com/mapnik/mapnik/issues/3050) (via @jkroll20) + - Fixed offsetting of complex paths and sharp angles ([#3160](https://github.com/mapnik/mapnik/pull/3160)) (via [@winni159](https://github.com/winni159)) + - Fixed mapnik.util.variant issue when compiling with gcc-5.x and SSO enabled by default ([#3103](https://github.com/mapnik/mapnik/issues/3103)) (via [@nkovacs](https://github.com/nkovacs)) + - Fixed issue with complex scripts where some character sequences weren't rendered correctly ([#3050](https://github.com/mapnik/mapnik/issues/3050)) (via [@jkroll20](https://github.com/jkroll20)) - Revived postgis.input tests - JSON: geometry grammar has been re-factored and optimized to have expectation points - Filled missing specializations for value_bool in `mapnik::value` comparison operators - `mapnik.Image` - fixed copy semantics implementation for internal buffer - JSON parsing: unified error_handler across all grammars - Improved unit test coverage - - Raster scaling: fixed nodata handling, accuracy when working with small floats and clipping floats by \[0; 255\] (https://github.com/mapnik/mapnik/pull/3147) + - Raster scaling: fixed nodata handling, accuracy when working with small floats and clipping floats by \[0; 255\] ([#3147](https://github.com/mapnik/mapnik/pull/3147)) - Added [`code of conduct`](http://contributor-covenant.org) - GeoJSON plug-in is updated to skip feature with empty geometries - - GeoJSON plug-in : ensure original order of features is preserved (fixed) (https://github.com/mapnik/mapnik/issues/3182) + - GeoJSON plug-in : ensure original order of features is preserved (fixed) ([#3182](https://github.com/mapnik/mapnik/issues/3182)) - Shapeindex utility: fixed `empty` shapes handling and ported tests to c++ - - Centroid algorithm: fixed invalid input handling, particularly empty geometries (https://github.com/mapnik/mapnik/pull/3185) + - Centroid algorithm: fixed invalid input handling, particularly empty geometries ([#3185](https://github.com/mapnik/mapnik/pull/3185)) - Updated SCons build system to the latest version 2.4.1 (http://scons.org/) + ## 3.0.8 Released: October 23, 2015 -(Packaged from 2d15567) - -#### Summary +(Packaged from [2d15567](https://github.com/mapnik/mapnik/commit/2d15567)) - Renamed `SHAPE_MEMORY_MAPPED_FILE` define to `MAPNIK_MEMORY_MAPPED_FILE`. Pass `./configure MEMORY_MAPPED_FILE=True|False` to request support for memory mapped files across Mapnik plugins (currently shape, csv, and geojson). - Unified `mapnik-index` utility supporting GeoJSON and CSV formats - Increased unit test coverage for GeoJSON and CSV plugins - - shape.input - re-factor to support *.shx and improve handling various bogus shapefiles + - shape.input - re-factor to support \*.shx and improve handling various bogus shapefiles - geojson.input - make JSON parser stricter + support single Feature/Geometry as well as FeatureCollection - maintain 'FT_LOAD_NO_HINTING' + support >= harfbuzz 1.0.5 - geojson.input - implement on-disk-index support + ## 3.0.7 Released: October 12, 2015 -(Packaged from e161253) - -#### Summary +(Packaged from [e161253](https://github.com/mapnik/mapnik/commit/e161253)) - Removed `MAPNIK_VERSION_IS_RELEASE` define / `mapnik-config --version` not longer reports `-pre` for non-release versions. - Use `mapnik-config --git-revision` instead (https://github.com/mapnik/mapnik/issues/3123) + Use `mapnik-config --git-revision` instead ([#3123](https://github.com/mapnik/mapnik/issues/3123)) - Renamed `nik2img` command to `mapnik-render` - - PostGIS: Fixed handling of all attributes when `key_field_as_attribute=false` (https://github.com/mapnik/mapnik/issues/3120) + - PostGIS: Fixed handling of all attributes when `key_field_as_attribute=false` ([#3120](https://github.com/mapnik/mapnik/issues/3120)) - PostGIS: Fixed parsing of `key_field_as_attribute` as boolean: now `true/false` can be used in addition to `0/1` + ## 3.0.6 Released: October 7, 2015 -(Packaged from 3cebe97) - -#### Summary +(Packaged from [3cebe97](https://github.com/mapnik/mapnik/commit/3cebe97)) - PostGIS plugin: added `key_field_as_attribute` option. Defaults to `True` to preserve current behavior of having the `key_field` added both - as an attribute and as the `feature.id` value. If `key_field_as_attribute=false` is passed then the attribute is discarded (https://github.com/mapnik/mapnik/issues/3115) -- CSV plugin has been further optimized and has gained experimental support for on-disk indexes (https://github.com/mapnik/mapnik/issues/3089) -- SVG parser now fallsback to using `viewbox` if explicit dimensions are lacking (https://github.com/mapnik/mapnik/issues/3081) -- Visual tests: new command line arguments `--agg`, `--cairo`, `--svg`, `--grid` for selecting renderers (https://github.com/mapnik/mapnik/pull/3074) -- Visual tests: new command line argument `--scale-factor` or abbreviated `-s` for setting scale factor (https://github.com/mapnik/mapnik/pull/3074) -- Fixed parsing colors in hexadecimal notation (https://github.com/mapnik/mapnik/pull/3075) -- Removed mapnik::Feature type alias of mapnik::feature_impl (https://github.com/mapnik/mapnik/pull/3099) -- Fixed linking order for plugins to avoid possible linking errors on linux systems (https://github.com/mapnik/mapnik/issues/3105) + as an attribute and as the `feature.id` value. If `key_field_as_attribute=false` is passed then the attribute is discarded ([#3115](https://github.com/mapnik/mapnik/issues/3115)) +- CSV plugin has been further optimized and has gained experimental support for on-disk indexes ([#3089](https://github.com/mapnik/mapnik/issues/3089)) +- SVG parser now fallsback to using `viewbox` if explicit dimensions are lacking ([#3081](https://github.com/mapnik/mapnik/issues/3081)) +- Visual tests: new command line arguments `--agg`, `--cairo`, `--svg`, `--grid` for selecting renderers ([#3074](https://github.com/mapnik/mapnik/pull/3074)) +- Visual tests: new command line argument `--scale-factor` or abbreviated `-s` for setting scale factor ([#3074](https://github.com/mapnik/mapnik/pull/3074)) +- Fixed parsing colors in hexadecimal notation ([#3075](https://github.com/mapnik/mapnik/pull/3075)) +- Removed mapnik::Feature type alias of mapnik::feature_impl ([#3099](https://github.com/mapnik/mapnik/pull/3099)) +- Fixed linking order for plugins to avoid possible linking errors on linux systems ([#3105](https://github.com/mapnik/mapnik/issues/3105)) + ## 3.0.5 Released: September 16, 2015 -(Packaged from 165c704) +(Packaged from [165c704](https://github.com/mapnik/mapnik/commit/165c704)) -#### Summary - -- `scale-hsla` image filter: parameters are no longer limited by interval \[0, 1\] (https://github.com/mapnik/mapnik/pull/3054) +- `scale-hsla` image filter: parameters are no longer limited by interval \[0, 1\] ([#3054](https://github.com/mapnik/mapnik/pull/3054)) - Windows: Fixed SVG file loading from unicode paths -- `colorize-alpha` image filter: fixed normalization of color components (https://github.com/mapnik/mapnik/pull/3058) -- `colorize-alpha` image filter: added support for transparent colors (https://github.com/mapnik/mapnik/pull/3061) -- Enable reading optional `MAPNIK_LOG_FORMAT` environment variable(https://github.com/mapnik/mapnik/commit/6d1ffc8a93008b8c0a89d87d68b59afb2cb3757f) -- CSV.input uses memory mapped file by default on *nix. +- `colorize-alpha` image filter: fixed normalization of color components ([#3058](https://github.com/mapnik/mapnik/pull/3058)) +- `colorize-alpha` image filter: added support for transparent colors ([#3061](https://github.com/mapnik/mapnik/pull/3061)) +- Enable reading optional `MAPNIK_LOG_FORMAT` environment variable([6d1ffc8](https://github.com/mapnik/mapnik/commit/6d1ffc8a93008b8c0a89d87d68b59afb2cb3757f)) +- CSV.input uses memory mapped file by default on \*nix. - Updated bundled fonts to the latest version - Topojson.input - fixed geometry_index logic which was causing missing features -- Fixed SVG file loading from unicode paths (https://github.com/mapnik/node-mapnik/issues/517) -- CSV.input - improved support for LF/CR/CRLF line endings on all platforms (https://github.com/mapnik/mapnik/issues/3065) +- Fixed SVG file loading from unicode paths ([mapnik/node-mapnik#517](https://github.com/mapnik/node-mapnik/issues/517)) +- CSV.input - improved support for LF/CR/CRLF line endings on all platforms ([#3065](https://github.com/mapnik/mapnik/issues/3065)) - Revive `zero allocation image interface` and add unit tests - Benchmark: use return values of test runner. + ## 3.0.4 Released: August 26, 2015 -(Packaged from 17bb81c) - -#### Summary +(Packaged from [17bb81c](https://github.com/mapnik/mapnik/commit/17bb81c)) - CSV.input: plug-in has been re-factored to minimise memory usage and to improve handling of larger input. (NOTE: [large_csv](https://github.com/mapnik/mapnik/tree/large_csv) branch adds experimental trunsduction parser with deferred string initialisation) -- CSV.input: added internal spatial index (boost::geometry::index::tree) for fast `bounding box` queries (https://github.com/mapnik/mapnik/pull/3010) -- Fixed deadlock in recursive datasource registration via @zerebubuth (https://github.com/mapnik/mapnik/pull/3038) -- Introduced new command line argument `--limit` or `-l` to limit number of failed tests via @talaj (https://github.com/mapnik/mapnik/pull/2996) +- CSV.input: added internal spatial index (boost::geometry::index::tree) for fast `bounding box` queries ([#3010](https://github.com/mapnik/mapnik/pull/3010)) +- Fixed deadlock in recursive datasource registration via [@zerebubuth](https://github.com/zerebubuth) ([#3038](https://github.com/mapnik/mapnik/pull/3038)) +- Introduced new command line argument `--limit` or `-l` to limit number of failed tests via [@talaj](https://github.com/talaj) ([#2996](https://github.com/mapnik/mapnik/pull/2996)) + ## 3.0.3 Released: August 12, 2015 -(Packaged from 3d262c7) +(Packaged from [3d262c7](https://github.com/mapnik/mapnik/commit/3d262c7)) -#### Summary - -- Fixed an issue with fields over size of `int32` in `OGR` plugin (https://github.com/mapnik/node-mapnik/issues/499) +- Fixed an issue with fields over size of `int32` in `OGR` plugin ([mapnik/node-mapnik#499](https://github.com/mapnik/node-mapnik/issues/499)) - Added 3 new image-filters to simulate types of colorblindness (`color-blind-protanope`,`color-blind-deuteranope`,`color-blind-tritanope`) -- Fix so that null text boxes have no bounding boxes when attempting placement ( 162f82cba5b0fb984c425586c6a4b354917abc47 ) -- Patch to add legacy method for setting JPEG quality in images ( #3024 ) +- Fix so that null text boxes have no bounding boxes when attempting placement ( [162f82c](https://github.com/mapnik/mapnik/commit/162f82cba5b0fb984c425586c6a4b354917abc47) ) +- Patch to add legacy method for setting JPEG quality in images ( [#3024](https://github.com/mapnik/mapnik/issues/3024) ) - Added `filter_image` method which can modify an image in place or return a new image that is filtered - Added missing typedef's in `mapnik::geometry` to allow experimenting with different containers + ## 3.0.2 Released: July 31, 2015 -(Packaged from 8305e74) +(Packaged from [8305e74](https://github.com/mapnik/mapnik/commit/8305e74)) #### Summary -This release is centered around improvements to the SVG parsing within mapnik. Most work was done in pull request #3003. +This release is centered around improvements to the SVG parsing within mapnik. Most work was done in pull request [#3003](https://github.com/mapnik/mapnik/issues/3003). - Added container to log SVG parsing errors - Reimplemented to use rapidxml for parsing XML (DOM) @@ -343,31 +373,33 @@ This release is centered around improvements to the SVG parsing within mapnik. M - Fixed dimensions parsing - Remove libxml2 dependency + ## 3.0.1 Released: July 27th, 2015 -(Packaged from 28f6f4d) +(Packaged from [28f6f4d](https://github.com/mapnik/mapnik/commit/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 compatible 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) +- Fixed text placement performance after [#2949](https://github.com/mapnik/mapnik/issues/2949) ([#2963](https://github.com/mapnik/mapnik/issues/2963)) +- Fixed rendering behavior for `text-minimum-path-length` which regressed in 3.0.0 ([#2990](https://github.com/mapnik/mapnik/issues/2990)) +- Fixed handling of `xml:id` in SVG parsing ([#2989](https://github.com/mapnik/mapnik/issues/2989)) +- Fixed handling of out of range `rx` and `ry` in SVG `rect` ([#2991](https://github.com/mapnik/mapnik/issues/2991)) +- Fixed reporting of envelope from `mapnik::memory_datasource` when new features are added ([#2985](https://github.com/mapnik/mapnik/issues/2985)) +- Fixed parsing of GeoJSON when unknown properties encountered at `FeatureCollection` level ([#2983](https://github.com/mapnik/mapnik/issues/2983)) +- Fixed parsing of GeoJSON when properties contained `{}` ([#2964](https://github.com/mapnik/mapnik/issues/2964)) +- Fixed potential hang due to invalid use of `line-geometry-transform` ([6d6cb15](https://github.com/mapnik/mapnik/commit/6d6cb15)) +- Moved unmaintained plugins out of core: `osm`, `occi`, and `rasterlite` ([#2980](https://github.com/mapnik/mapnik/issues/2980)) + ## 3.0.0 Released: July 7th, 2015 -(Packaged from e6891a0) +(Packaged from [e6891a0](https://github.com/mapnik/mapnik/commit/e6891a0)) #### Summary @@ -386,7 +418,7 @@ The 3.0 release is a major milestone for Mapnik and includes many performance an - Expressions everywhere: all symbolizer properties can now be data driven expressions (with the exception of `face-name` and `fontset-name` on the `TextSymbolizer`). -- Rewritten geometry storage based on `std::vector` (#2739) +- Rewritten geometry storage based on `std::vector` ([#2739](https://github.com/mapnik/mapnik/issues/2739)) - Separate storage of polygon exterior rings and interior rings to allow for more robust clipping of parts. - Enforces consistent winding order per OGC spec (exterior rings are CCW, interior CW) - Reduced memory consumption for layers with many points @@ -419,7 +451,7 @@ The 3.0 release is a major milestone for Mapnik and includes many performance an - Supports being built with clang++ using `-fvisibility=hidden -flto` for smaller binaries -- Supports being built with Visual Studio 2014 CTP #3 +- Supports being built with Visual Studio 2014 CTP \#3 - Shield icons are now pixel snapped for crisp rendering @@ -436,16 +468,16 @@ geometry. - New GroupSymbolizer for applying multiple symbolizers in a single layout -- AGG renderer: fixed geometry offsetting to work after smoothing to produce more consistent results (#2202) +- AGG renderer: fixed geometry offsetting to work after smoothing to produce more consistent results ([#2202](https://github.com/mapnik/mapnik/issues/2202)) -- AGG renderer: increased `vertex_dist_epsilon` to ensure nearly coincident points are discarded more readily (#2196) +- AGG renderer: increased `vertex_dist_epsilon` to ensure nearly coincident points are discarded more readily ([#2196](https://github.com/mapnik/mapnik/issues/2196)) - GDAL plugin - Now keeps datasets open for the lifetime of the datasource (rather than per featureset) - - Added back support for user driven `nodata` on rgb(a) images (#2023) - - Allowed nodata to override alpha band if set on rgba images (#2023) - - Added `nodata_tolerance` option to set nearby pixels transparent (has similar effect to the `nearblack` program) (#2023) - - At process exit Mapnik core no longer calls `dlclose` on gdal.input (#2716) + - Added back support for user driven `nodata` on rgb(a) images ([#2023](https://github.com/mapnik/mapnik/issues/2023)) + - Allowed nodata to override alpha band if set on rgba images ([#2023](https://github.com/mapnik/mapnik/issues/2023)) + - Added `nodata_tolerance` option to set nearby pixels transparent (has similar effect to the `nearblack` program) ([#2023](https://github.com/mapnik/mapnik/issues/2023)) + - At process exit Mapnik core no longer calls `dlclose` on gdal.input ([#2716](https://github.com/mapnik/mapnik/issues/2716)) - TopoJSON plugin - Now supporting optional `bbox` property on layer @@ -468,73 +500,73 @@ geometry. - PostGIS plugin - Added Async support to - https://github.com/mapnik/mapnik/wiki/PostGIS-Async - - Added support for rendering 3D and 4D geometries (previously silently skipped) (#44) + - Added support for rendering 3D and 4D geometries (previously silently skipped) ([#44](https://github.com/mapnik/mapnik/issues/44)) -- Added support for web fonts: `.woff` format (#2113) +- Added support for web fonts: `.woff` format ([#2113](https://github.com/mapnik/mapnik/issues/2113)) -- Added missing support for `geometry-transform` in `line-pattern` and `polygon-pattern` symbolizers (#2065) +- Added missing support for `geometry-transform` in `line-pattern` and `polygon-pattern` symbolizers ([#2065](https://github.com/mapnik/mapnik/issues/2065)) - Dropped support for Sun compiler - Upgraded unifont to `unifont-6.3.20131020` -- Fixed crash when rendering to cairo context from python (#2031) +- Fixed crash when rendering to cairo context from python ([#2031](https://github.com/mapnik/mapnik/issues/2031)) - Moved `label-position-tolerance` from `unsigned` type to `double` -- Added support for more seamless blurring by rendering to a larger internal image to avoid edge effects (#1478) +- Added support for more seamless blurring by rendering to a larger internal image to avoid edge effects ([#1478](https://github.com/mapnik/mapnik/issues/1478)) - Fixed rendering of large shapes at high zoom levels, which might dissapear due to integer overflow. This bug was previously fixable when geometries were clipped, but would, until now, re-appear if clipping was turned - off for a symbolizer (#2000) + off for a symbolizer ([#2000](https://github.com/mapnik/mapnik/issues/2000)) - Added single color argument support to `colorize-alpha` to allow colorizing alpha with one color. -- Added `color-to-alpha` `image-filter` to allow for applying alpha in proportion to color similiarity (#2023) +- Added `color-to-alpha` `image-filter` to allow for applying alpha in proportion to color similiarity ([#2023](https://github.com/mapnik/mapnik/issues/2023)) -- Fixed alpha handling bug with `comp-op:dst-over` (#1995) +- Fixed alpha handling bug with `comp-op:dst-over` ([#1995](https://github.com/mapnik/mapnik/issues/1995)) -- Fixed alpha handling bug with building-fill-opacity (#2011) +- Fixed alpha handling bug with building-fill-opacity ([#2011](https://github.com/mapnik/mapnik/issues/2011)) - Optimized mapnik.Path.to_wkb -- Python: added `__geo_interface__` to mapnik.Feature and mapnik.Path (#2009) +- Python: added `__geo_interface__` to mapnik.Feature and mapnik.Path ([#2009](https://github.com/mapnik/mapnik/issues/2009)) -- Python: Exposed optimized WKTReader for parsing WKT into geometry paths (6bfbb53) +- Python: Exposed optimized WKTReader for parsing WKT into geometry paths ([6bfbb53](https://github.com/mapnik/mapnik/commit/6bfbb53)) -- Optimized expression evaluation of text by avoiding extra copy (1dd1275) +- Optimized expression evaluation of text by avoiding extra copy ([1dd1275](https://github.com/mapnik/mapnik/commit/1dd1275)) - Added Map level `background-image-comp-op` to control the compositing operation used to blend the `background-image` onto the `background-color`. Has no meaning if `background-color` or `background-image` -are not set. (#1966) +are not set. ([#1966](https://github.com/mapnik/mapnik/issues/1966)) -- Added Map level `background-image-opacity` to dynamically set the opacity of the `background-image` (#1966) +- Added Map level `background-image-opacity` to dynamically set the opacity of the `background-image` ([#1966](https://github.com/mapnik/mapnik/issues/1966)) -- Removed `RENDERING_STATS` compile option since it should be replaced with a better solution (#1956) +- Removed `RENDERING_STATS` compile option since it should be replaced with a better solution ([#1956](https://github.com/mapnik/mapnik/issues/1956)) -- Added support to experimental `svg_renderer` for grouping layers for inkscape and illustrator (#1917) +- Added support to experimental `svg_renderer` for grouping layers for inkscape and illustrator ([#1917](https://github.com/mapnik/mapnik/issues/1917)) - Fixed compile of python bindings against Python 3.x -- Optimized SVG loading by improving color parsing speed (#1918) +- Optimized SVG loading by improving color parsing speed ([#1918](https://github.com/mapnik/mapnik/issues/1918)) -- Fixed startup problem when fonts cannot be read due to lacking permissions (#1919) +- Fixed startup problem when fonts cannot be read due to lacking permissions ([#1919](https://github.com/mapnik/mapnik/issues/1919)) -- Fixed bad behavior when negative image dimensions are requested (#1927) +- Fixed bad behavior when negative image dimensions are requested ([#1927](https://github.com/mapnik/mapnik/issues/1927)) -- Fixed handling of `marker-ignore-placement:true` when `marker-placement:line` (#1931) +- Fixed handling of `marker-ignore-placement:true` when `marker-placement:line` ([#1931](https://github.com/mapnik/mapnik/issues/1931)) -- Fixed handling of svg `opacity` in Cairo renderer (#1943) +- Fixed handling of svg `opacity` in Cairo renderer ([#1943](https://github.com/mapnik/mapnik/issues/1943)) -- Fixed handling of SVG files which contain empty `` (#1944) +- Fixed handling of SVG files which contain empty `` ([#1944](https://github.com/mapnik/mapnik/issues/1944)) - Fixed various 32bit test failures - Fixed compile against icu when by using `U_NAMESPACE_QUALIFIER` -- Fixed missing support for using PathExpression in `marker-file` (#1952) +- Fixed missing support for using PathExpression in `marker-file` ([#1952](https://github.com/mapnik/mapnik/issues/1952)) -- Added support for `line-pattern-offset` (#1991) +- Added support for `line-pattern-offset` ([#1991](https://github.com/mapnik/mapnik/issues/1991)) - Added support for building on Android (tested with `android-ndk-r9`) @@ -548,13 +580,13 @@ are not set. (#1966) - Added to python bindings: `has_tiff`, `has_png`, `has_webp`, `has_proj4`, `has_svg_renderer`, and `has_grid_renderer` -- Made it possible to disable compilation of `grid_renderer` with `./configure GRID_RENDERER=False` (#1962) +- Made it possible to disable compilation of `grid_renderer` with `./configure GRID_RENDERER=False` ([#1962](https://github.com/mapnik/mapnik/issues/1962)) - Added `premultiplied` property on mapnik::image_32 / mapnik.Image to enable knowledge of premultiplied status of image buffer. -- Added `webp` image encoding and decoding support (#1955) +- Added `webp` image encoding and decoding support ([#1955](https://github.com/mapnik/mapnik/issues/1955)) -- Added `scale-hsla` image-filter that allows scaling colors in HSL color space. RGB is converted to HSL (hue-saturation-lightness) and then each value (and the original alpha value) is stretched based on the specified scaling values. An example syntax is `scale-hsla(0,1,0,1,0,1,0,1)` which means no change because the full range will be kept (0 for lowest, 1 for highest). Other examples are: 1) `scale-hsla(0,0,0,1,0,1,0,1)` which would force all colors to be red in hue in the same way `scale-hsla(1,1,0,1,0,1,0,1)` would, 2) `scale-hsla(0,1,1,1,0,1,0,1)` which would cause all colors to become fully saturated, 3) `scale-hsla(0,1,1,1,0,1,.5,1)` which would force no colors to be any more transparent than half, and 4) `scale-hsla(0,1,1,1,0,1,0,.5)` which would force all colors to be at least half transparent. (#1954) +- Added `scale-hsla` image-filter that allows scaling colors in HSL color space. RGB is converted to HSL (hue-saturation-lightness) and then each value (and the original alpha value) is stretched based on the specified scaling values. An example syntax is `scale-hsla(0,1,0,1,0,1,0,1)` which means no change because the full range will be kept (0 for lowest, 1 for highest). Other examples are: 1) `scale-hsla(0,0,0,1,0,1,0,1)` which would force all colors to be red in hue in the same way `scale-hsla(1,1,0,1,0,1,0,1)` would, 2) `scale-hsla(0,1,1,1,0,1,0,1)` which would cause all colors to become fully saturated, 3) `scale-hsla(0,1,1,1,0,1,.5,1)` which would force no colors to be any more transparent than half, and 4) `scale-hsla(0,1,1,1,0,1,0,.5)` which would force all colors to be at least half transparent. ([#1954](https://github.com/mapnik/mapnik/issues/1954)) - The `shapeindex` tool now works correctly with point 3d geometry types @@ -563,17 +595,17 @@ are not set. (#1966) Released June 3rd, 2013 -(Packaged from 9231205) +(Packaged from [9231205](https://github.com/mapnik/mapnik/commit/9231205)) Summary: The 2.2.0 release is primarily a performance and stability release. The code line represents development in the master branch since the release of 2.1.0 in Aug 2012 and therefore includes nearly a year of bug-fixes and optimizations. Nearly 500 new tests have been added bring the total coverage to 925. Shapefile and PostGIS datasources have benefited from numerous stability fixes, 64 bit integer support has been added to support OSM data in the grid renderer and in attribute filtering, and many fixes have landed for higher quality output when using a custom `scale_factor` during rendering. Critical code paths have been optimized include raster rendering, xml map loading, string to number conversion, vector reprojection when using `epsg:4326` and `epsg:3857`, `hextree` encoding, halo rendering, and rendering when using a custom `gamma`. Mapnik 2.2 also compiles faster than previous releases in the 2.x series and drops several unneeded and hard to install dependencies making builds on OS X and Windows easier than any previous release. -- Removed 3 dependencies without loosing any functionality: `ltdl`, `cairomm` and `libsigc++` (#1804,#806,#1681) +- Removed 3 dependencies without loosing any functionality: `ltdl`, `cairomm` and `libsigc++` ([#1804](https://github.com/mapnik/mapnik/issues/1804),[#806](https://github.com/mapnik/mapnik/issues/806),[#1681](https://github.com/mapnik/mapnik/issues/1681)) -- Added 64 bit integer support in expressions, feature ids, and the grid_renderer (#1661,#1662,#1662) +- Added 64 bit integer support in expressions, feature ids, and the grid_renderer ([#1661](https://github.com/mapnik/mapnik/issues/1661),[#1662](https://github.com/mapnik/mapnik/issues/1662),[#1662](https://github.com/mapnik/mapnik/issues/1662)) - Added the ability to disable the need for various dependencies: `proj4`, `libpng`, `libtiff`, `libjpeg` -- Added faster reprojection support between `epsg:3857` and `epsg:4326` (#1705,#1703,#1579) +- Added faster reprojection support between `epsg:3857` and `epsg:4326` ([#1705](https://github.com/mapnik/mapnik/issues/1705),[#1703](https://github.com/mapnik/mapnik/issues/1703),[#1579](https://github.com/mapnik/mapnik/issues/1579)) - Added `colorize-alpha` image filter that applies user provided color gradients based on level of alpha. Accepts one or more colors separated by commas. Each color can be paired with an `offset` value separated @@ -581,246 +613,246 @@ Summary: The 2.2.0 release is primarily a performance and stability release. The on where this design came from see http://www.w3.org/TR/SVG/pservers.html#GradientStops. A simple example of colorizing alpha into a "rainbow" is `colorize-alpha(blue,cyan,lightgreen, yellow, orange, red)`. An example of using offsets and the variety of supported color encodings is to produce a ramp which sharp contrast between `blue` - and `cyan` is `colorize-alpha(blue 30%, cyan, yellow 0.7 , rgb(0%,80%,0%) 90%)` (#1371). + and `cyan` is `colorize-alpha(blue 30%, cyan, yellow 0.7 , rgb(0%,80%,0%) 90%)` ([#1371](https://github.com/mapnik/mapnik/issues/1371)). -- Fixed concurrency problem when using cursors in postgis plugin (#1823,#1588) +- Fixed concurrency problem when using cursors in postgis plugin ([#1823](https://github.com/mapnik/mapnik/issues/1823),[#1588](https://github.com/mapnik/mapnik/issues/1588)) -- Fixed postgres connection pool leaks when using `persist_connection=false` (#1764) +- Fixed postgres connection pool leaks when using `persist_connection=false` ([#1764](https://github.com/mapnik/mapnik/issues/1764)) -- Fixed postgres connection key to respect highest value of `max_size` and `initial_size` for any layer in map (#1599) +- Fixed postgres connection key to respect highest value of `max_size` and `initial_size` for any layer in map ([#1599](https://github.com/mapnik/mapnik/issues/1599)) -- Fixed potential crash in wkb parsing when postgis returns null geometry (#1843) +- Fixed potential crash in wkb parsing when postgis returns null geometry ([#1843](https://github.com/mapnik/mapnik/issues/1843)) -- Fixed blurry rendering of image and SVG icons (#1316) +- Fixed blurry rendering of image and SVG icons ([#1316](https://github.com/mapnik/mapnik/issues/1316)) -- Added detection of invalid srs values when loading xml (#646) +- Added detection of invalid srs values when loading xml ([#646](https://github.com/mapnik/mapnik/issues/646)) - Added support for specifying a base_path as a third, optional argument to load_xml -- Removed muffling of projection errors while rendering (#646) +- Removed muffling of projection errors while rendering ([#646](https://github.com/mapnik/mapnik/issues/646)) - Improved logging system (https://github.com/mapnik/mapnik/wiki/Logging) -- Added support for reading images from in memory streams (#1805) +- Added support for reading images from in memory streams ([#1805](https://github.com/mapnik/mapnik/issues/1805)) -- Optimized halo rendering. When halo radius is < 1 new method will be used automatically (#1781) +- Optimized halo rendering. When halo radius is < 1 new method will be used automatically ([#1781](https://github.com/mapnik/mapnik/issues/1781)) - Added `text-halo-rasterizer` property. Set to `fast` for lower quality but faster - halo rendering (#1298) which matched new default method when radius is < 1. + halo rendering ([#1298](https://github.com/mapnik/mapnik/issues/1298)) which matched new default method when radius is < 1. -- Added support in `shape`, `sqlite`, `geojson`, and `csv` plugin for handling non-latin characters in the paths to file-based resources (#1177) +- Added support in `shape`, `sqlite`, `geojson`, and `csv` plugin for handling non-latin characters in the paths to file-based resources ([#1177](https://github.com/mapnik/mapnik/issues/1177)) -- Fixed rendering of markers when their size is greater than the specified `spacing` value (#1487) +- Fixed rendering of markers when their size is greater than the specified `spacing` value ([#1487](https://github.com/mapnik/mapnik/issues/1487)) -- Fixed handling of alpha premultiplication in image scaling (#1489) +- Fixed handling of alpha premultiplication in image scaling ([#1489](https://github.com/mapnik/mapnik/issues/1489)) -- Optimized rendering when a style with no symbolizers is encountered (#1517) +- Optimized rendering when a style with no symbolizers is encountered ([#1517](https://github.com/mapnik/mapnik/issues/1517)) -- Optimized string handling and type conversion by removing `boost::to_lower`, `boost::trim`, and `boost::lexical_cast` usage (#1687,#1687,#1633) +- Optimized string handling and type conversion by removing `boost::to_lower`, `boost::trim`, and `boost::lexical_cast` usage ([#1687](https://github.com/mapnik/mapnik/issues/1687),[#1687](https://github.com/mapnik/mapnik/issues/1687),[#1633](https://github.com/mapnik/mapnik/issues/1633)) -- Optimized alpha preserving `hextree` method for quantization of png images (#1629) +- Optimized alpha preserving `hextree` method for quantization of png images ([#1629](https://github.com/mapnik/mapnik/issues/1629)) -- Faster rendering of rasters by reducing memory allocation of temporary buffers (#1516) +- Faster rendering of rasters by reducing memory allocation of temporary buffers ([#1516](https://github.com/mapnik/mapnik/issues/1516)) -- Fixed some raster reprojection artifacts (#1501) +- Fixed some raster reprojection artifacts ([#1501](https://github.com/mapnik/mapnik/issues/1501)) -- Fixed raster alignment when width != height and raster is being scaled (#1748,#1622) +- Fixed raster alignment when width != height and raster is being scaled ([#1748](https://github.com/mapnik/mapnik/issues/1748),[#1622](https://github.com/mapnik/mapnik/issues/1622)) -- Added support for caching rasters for re-use during rendering when styling more than once per layer (#1543) +- Added support for caching rasters for re-use during rendering when styling more than once per layer ([#1543](https://github.com/mapnik/mapnik/issues/1543)) -- Improved compile speeds of the code - in some cases by up to 2x and removed need for freetype dependency when building code against mapnik (#1688, #1756) +- Improved compile speeds of the code - in some cases by up to 2x and removed need for freetype dependency when building code against mapnik ([#1688](https://github.com/mapnik/mapnik/issues/1688), [#1756](https://github.com/mapnik/mapnik/issues/1756)) -- Removed internal rule cache on `mapnik::Map` c++ object (#1723) +- Removed internal rule cache on `mapnik::Map` c++ object ([#1723](https://github.com/mapnik/mapnik/issues/1723)) -- Improved the scaled rendering of various map features when using `scale_factor` > 1 (#1280,#1100,#1273,#1792,#1291,#1344,#1279,#1624,#1767,#1766) +- Improved the scaled rendering of various map features when using `scale_factor` > 1 ([#1280](https://github.com/mapnik/mapnik/issues/1280),[#1100](https://github.com/mapnik/mapnik/issues/1100),[#1273](https://github.com/mapnik/mapnik/issues/1273),[#1792](https://github.com/mapnik/mapnik/issues/1792),[#1291](https://github.com/mapnik/mapnik/issues/1291),[#1344](https://github.com/mapnik/mapnik/issues/1344),[#1279](https://github.com/mapnik/mapnik/issues/1279),[#1624](https://github.com/mapnik/mapnik/issues/1624),[#1767](https://github.com/mapnik/mapnik/issues/1767),[#1766](https://github.com/mapnik/mapnik/issues/1766)) -- Added C++ api for overriding scale_denominator to enable rendering at fixed scale (#1582) +- Added C++ api for overriding scale_denominator to enable rendering at fixed scale ([#1582](https://github.com/mapnik/mapnik/issues/1582)) - Added Layer `buffer-size` that can be used to override Map `buffer-size` to avoid over-fetching of data that does not need to be buffered as much as other layers. Map level `buffer-size` will be default if layers do not set the option. Renamed a previously undocumented parameter by the same name that impacted clipping extent and - was not needed (clipping padding should likely be a symbolizer level option) (#1566) + was not needed (clipping padding should likely be a symbolizer level option) ([#1566](https://github.com/mapnik/mapnik/issues/1566)) -- Fixed potential file descriptor leaks in image readers when invalid images were encountered (#1783) +- Fixed potential file descriptor leaks in image readers when invalid images were encountered ([#1783](https://github.com/mapnik/mapnik/issues/1783)) -- Fixed alpha handling in the `blur` and `invert` image filters (#1541) +- Fixed alpha handling in the `blur` and `invert` image filters ([#1541](https://github.com/mapnik/mapnik/issues/1541)) -- Fixed error reporting in the python plugin (#1422) +- Fixed error reporting in the python plugin ([#1422](https://github.com/mapnik/mapnik/issues/1422)) - Added the ability to run tests without installing with `make test-local` -- Reduced library binary size by adding support for `-fvisibility-inlines-hidden` and `-fvisibility=hidden` (#1826,#1832) +- Reduced library binary size by adding support for `-fvisibility-inlines-hidden` and `-fvisibility=hidden` ([#1826](https://github.com/mapnik/mapnik/issues/1826),[#1832](https://github.com/mapnik/mapnik/issues/1832)) -- Added `mapnik::map_request` class, a special object to allow passing mutable map objects to renderer (#1737) +- Added `mapnik::map_request` class, a special object to allow passing mutable map objects to renderer ([#1737](https://github.com/mapnik/mapnik/issues/1737)) -- Added the ability to use `boost::hash` on `mapnik::value` types (#1729) +- Added the ability to use `boost::hash` on `mapnik::value` types ([#1729](https://github.com/mapnik/mapnik/issues/1729)) -- Removed obsolete `geos` plugin (functionality replaced by `csv` plugin) and unmaintained `kismet` plugin (#1809,#1833) +- Removed obsolete `geos` plugin (functionality replaced by `csv` plugin) and unmaintained `kismet` plugin ([#1809](https://github.com/mapnik/mapnik/issues/1809),[#1833](https://github.com/mapnik/mapnik/issues/1833)) -- Added new `mapnik-config` flags: `--all-flags`, `--defines`, `--git-describe`, `--includes`, `--dep-includes`, `--cxxflags`, `--cxx` (#1443) +- Added new `mapnik-config` flags: `--all-flags`, `--defines`, `--git-describe`, `--includes`, `--dep-includes`, `--cxxflags`, `--cxx` ([#1443](https://github.com/mapnik/mapnik/issues/1443)) -- Added support for unicode strings as arguments in python bindings (#163) +- Added support for unicode strings as arguments in python bindings ([#163](https://github.com/mapnik/mapnik/issues/163)) -- Added DebugSymbolizer which is able to render the otherwise invisible collision boxes (#1366) +- Added DebugSymbolizer which is able to render the otherwise invisible collision boxes ([#1366](https://github.com/mapnik/mapnik/issues/1366)) -- Optimized rendering by reducing overhead of using `gamma` property (#1174) +- Optimized rendering by reducing overhead of using `gamma` property ([#1174](https://github.com/mapnik/mapnik/issues/1174)) -- Fixed rendering artifacts when using `polygon-gamma` or `line-gamma` equal to 0 (#761,#1763) +- Fixed rendering artifacts when using `polygon-gamma` or `line-gamma` equal to 0 ([#761](https://github.com/mapnik/mapnik/issues/761),[#1763](https://github.com/mapnik/mapnik/issues/1763)) -- Fixed and optimized the display of excessive precision of some float data in labels (#430,#1697) +- Fixed and optimized the display of excessive precision of some float data in labels ([#430](https://github.com/mapnik/mapnik/issues/430),[#1697](https://github.com/mapnik/mapnik/issues/1697)) -- Removed the `bind` option for datasources (#1654) +- Removed the `bind` option for datasources ([#1654](https://github.com/mapnik/mapnik/issues/1654)) -- Added ability to access style list from map by (name,obj) in python (#1725) +- Added ability to access style list from map by (name,obj) in python ([#1725](https://github.com/mapnik/mapnik/issues/1725)) -- Added `is_solid` method to python mapnik.Image and mapnik.ImageView classes (#1728) +- Added `is_solid` method to python mapnik.Image and mapnik.ImageView classes ([#1728](https://github.com/mapnik/mapnik/issues/1728)) - Changed scale_denominator C++ interface to take scale as first argument rather than map. -- Added support for `background-image` in cairo_renderer (#1724) +- Added support for `background-image` in cairo_renderer ([#1724](https://github.com/mapnik/mapnik/issues/1724)) -- Fixed building symbolizer rendering to be fully sensitive to alpha (8b66128c892 / bc8ea1c5a7a) +- Fixed building symbolizer rendering to be fully sensitive to alpha ([8b66128](https://github.com/mapnik/mapnik/commit/8b66128c892), [bc8ea1c](https://github.com/mapnik/mapnik/commit/bc8ea1c5a7a)) -- `[attr]` now returns false if attr is an empty string (#1665) +- `[attr]` now returns false if attr is an empty string ([#1665](https://github.com/mapnik/mapnik/issues/1665)) -- `[attr]!=null` now returns true if attr is not null (#1642) +- `[attr]!=null` now returns true if attr is not null ([#1642](https://github.com/mapnik/mapnik/issues/1642)) -- Added support for DBF `Logical` type: #1614 +- Added support for DBF `Logical` type: [#1614](https://github.com/mapnik/mapnik/issues/1614) -- Added serialization of `line-offset` to save_map (#1562) +- Added serialization of `line-offset` to save_map ([#1562](https://github.com/mapnik/mapnik/issues/1562)) - Enabled default input plugin directory and fonts path to be set inherited from environment settings in - python bindings to make it easier to run tests locally (#1594). New environment settings are: + python bindings to make it easier to run tests locally ([#1594](https://github.com/mapnik/mapnik/issues/1594)). New environment settings are: - MAPNIK_INPUT_PLUGINS_DIRECTORY - MAPNIK_FONT_DIRECTORY -- Added support for controlling rendering behavior of markers on multi-geometries `marker-multi-policy` (#1555,#1573) +- Added support for controlling rendering behavior of markers on multi-geometries `marker-multi-policy` ([#1555](https://github.com/mapnik/mapnik/issues/1555),[#1573](https://github.com/mapnik/mapnik/issues/1573)) -- Added alternative PNG/ZLIB implementation (`miniz`) that can be enabled with `e=miniz` (#1554) +- Added alternative PNG/ZLIB implementation (`miniz`) that can be enabled with `e=miniz` ([#1554](https://github.com/mapnik/mapnik/issues/1554)) - Added support for setting zlib `Z_FIXED` strategy with format string: `png:z=fixed` -- Fixed handling of transparency level option in `octree` png encoding (#1556) +- Fixed handling of transparency level option in `octree` png encoding ([#1556](https://github.com/mapnik/mapnik/issues/1556)) -- Added ability to pass a pre-created collision detector to the cairo renderer (#1444) +- Added ability to pass a pre-created collision detector to the cairo renderer ([#1444](https://github.com/mapnik/mapnik/issues/1444)) -- Tolerance parameter is now supported for querying datasources at a given point (#503/#1499) +- Tolerance parameter is now supported for querying datasources at a given point ([#503](https://github.com/mapnik/mapnik/issues/503)/[#1499](https://github.com/mapnik/mapnik/issues/1499)) -- Improved detection of newlines in CSV files - now more robust in the face of mixed newline types (#1497) +- Improved detection of newlines in CSV files - now more robust in the face of mixed newline types ([#1497](https://github.com/mapnik/mapnik/issues/1497)) -- Allow style level compositing operations to work outside of featureset extents across tiled requests (#1477) +- Allow style level compositing operations to work outside of featureset extents across tiled requests ([#1477](https://github.com/mapnik/mapnik/issues/1477)) -- Support for encoding `literal` postgres types as strings 69fb17cd3/#1466 +- Support for encoding `literal` postgres types as strings [69fb17c](https://github.com/mapnik/mapnik/commit/69fb17cd3)/[#1466](https://github.com/mapnik/mapnik/issues/1466) - Fixed zoom_all behavior when Map maximum-extent is provided. Previously maximum-extent was used outright but now the combined layer extents will be again respected: they will be clipped to the maximum-extent if possible - and only when back-projecting fails for all layers will the maximum-extent be used as a fallback (#1473) + and only when back-projecting fails for all layers will the maximum-extent be used as a fallback ([#1473](https://github.com/mapnik/mapnik/issues/1473)) -- Compile time flag called `PLUGIN_LINKING` to allow input datasource plugins to be statically linked with the mapnik library (#249) +- Compile time flag called `PLUGIN_LINKING` to allow input datasource plugins to be statically linked with the mapnik library ([#249](https://github.com/mapnik/mapnik/issues/249)) -- Fixed `dasharray` rendering in cairo backend (#1740) +- Fixed `dasharray` rendering in cairo backend ([#1740](https://github.com/mapnik/mapnik/issues/1740)) -- Fixed handling of `opacity` in svg rendering (#1744) +- Fixed handling of `opacity` in svg rendering ([#1744](https://github.com/mapnik/mapnik/issues/1744)) -- Fixed uneven rendering of markers along lines (#1693) +- Fixed uneven rendering of markers along lines ([#1693](https://github.com/mapnik/mapnik/issues/1693)) -- Fixed handling of extra bytes in some shapefile fields (#1605) +- Fixed handling of extra bytes in some shapefile fields ([#1605](https://github.com/mapnik/mapnik/issues/1605)) -- Fixed handling (finally) of null shapes and partially corrupt shapefiles (#1630,#1621) +- Fixed handling (finally) of null shapes and partially corrupt shapefiles ([#1630](https://github.com/mapnik/mapnik/issues/1630),[#1621](https://github.com/mapnik/mapnik/issues/1621)) -- Added ability to re-use `mapnik::image_32` and `mapnik::grid` by exposing a `clear` method (#1571) +- Added ability to re-use `mapnik::image_32` and `mapnik::grid` by exposing a `clear` method ([#1571](https://github.com/mapnik/mapnik/issues/1571)) -- Added support for writing RGB (no A) png images by using the format string of `png:t=0` (#1559) +- Added support for writing RGB (no A) png images by using the format string of `png:t=0` ([#1559](https://github.com/mapnik/mapnik/issues/1559)) -- Added experimental support for geometry simplification at symbolizer level (#1385) +- Added experimental support for geometry simplification at symbolizer level ([#1385](https://github.com/mapnik/mapnik/issues/1385)) ## Mapnik 2.1.0 Released Aug 23, 2012 -(Packaged from a25aac8) +(Packaged from [a25aac8](https://github.com/mapnik/mapnik/commit/a25aac8)) -- Feature-level compositing (comp-op) for all symbolizers (except building) in AGG and Cairo renderers (#1409) +- Feature-level compositing (comp-op) for all symbolizers (except building) in AGG and Cairo renderers ([#1409](https://github.com/mapnik/mapnik/issues/1409)) -- Style-level compositing (comp-op) (#1409) and style-level opacity for AGG renderer (#314) +- Style-level compositing (comp-op) ([#1409](https://github.com/mapnik/mapnik/issues/1409)) and style-level opacity for AGG renderer ([#314](https://github.com/mapnik/mapnik/issues/314)) -- New experimental framework for image manipulation called `image-filters` to allow things to be done across entire layer canvas like burring (#1412) +- New experimental framework for image manipulation called `image-filters` to allow things to be done across entire layer canvas like burring ([#1412](https://github.com/mapnik/mapnik/issues/1412)) -- Support for recoloring stroke, fill, and opacity of SVG files (#1410 / #659) +- Support for recoloring stroke, fill, and opacity of SVG files ([#1410](https://github.com/mapnik/mapnik/issues/1410) / [#659](https://github.com/mapnik/mapnik/issues/659)) -- Support for data-driven transform expressions (#664) +- Support for data-driven transform expressions ([#664](https://github.com/mapnik/mapnik/issues/664)) -- New support for offsetting geometries / parallel lines in line_symbolizer (#927/#1269) +- New support for offsetting geometries / parallel lines in line_symbolizer ([#927](https://github.com/mapnik/mapnik/issues/927)/[#1269](https://github.com/mapnik/mapnik/issues/1269)) -- New support for clipping geometries - now default enabled on all symbolizers (#1116) +- New support for clipping geometries - now default enabled on all symbolizers ([#1116](https://github.com/mapnik/mapnik/issues/1116)) -- Framework for chainable geometry transformations (called `vertex_converters`) so that you can do things like clip, smooth, and offset at the same time (#927) +- Framework for chainable geometry transformations (called `vertex_converters`) so that you can do things like clip, smooth, and offset at the same time ([#927](https://github.com/mapnik/mapnik/issues/927)) -- WKT parsing now is more robust and supports multi-geometries (#745) +- WKT parsing now is more robust and supports multi-geometries ([#745](https://github.com/mapnik/mapnik/issues/745)) -- New support for outputting WKT/WKB/GeoJSON/SVG from mapnik.Geometry objects (#1411) +- New support for outputting WKT/WKB/GeoJSON/SVG from mapnik.Geometry objects ([#1411](https://github.com/mapnik/mapnik/issues/1411)) -- New experimental python datasource plugin (#1337) +- New experimental python datasource plugin ([#1337](https://github.com/mapnik/mapnik/issues/1337)) -- New experimental geojson datasource plugin using in-memory rtree indexing (#1413) +- New experimental geojson datasource plugin using in-memory rtree indexing ([#1413](https://github.com/mapnik/mapnik/issues/1413)) -- Cairo rendering is now much more similiar to AGG rendering as cairo backend now supports `scale_factor` (#1280) and other fixed have landed (#1343, #1233, #1344, #1242, #687, #737, #1006, #1071) +- Cairo rendering is now much more similiar to AGG rendering as cairo backend now supports `scale_factor` ([#1280](https://github.com/mapnik/mapnik/issues/1280)) and other fixed have landed ([#1343](https://github.com/mapnik/mapnik/issues/1343), [#1233](https://github.com/mapnik/mapnik/issues/1233), [#1344](https://github.com/mapnik/mapnik/issues/1344), [#1242](https://github.com/mapnik/mapnik/issues/1242), [#687](https://github.com/mapnik/mapnik/issues/687), [#737](https://github.com/mapnik/mapnik/issues/737), [#1006](https://github.com/mapnik/mapnik/issues/1006), [#1071](https://github.com/mapnik/mapnik/issues/1071)) -- mapnik::Feature objects and datasource plugins now use a `Context` to store attribute schemas to reduce the memory footprint of features (#834) +- mapnik::Feature objects and datasource plugins now use a `Context` to store attribute schemas to reduce the memory footprint of features ([#834](https://github.com/mapnik/mapnik/issues/834)) -- Added Stroke `miterlimit` (#786) +- Added Stroke `miterlimit` ([#786](https://github.com/mapnik/mapnik/issues/786)) - Python: exposed Map `background_image` (and aliased `background` to `background_color`) - Python: exposed BuildingSymbolizer -- Support in the CSV plugin for reading JSON encoded geometries (#1392) +- Support in the CSV plugin for reading JSON encoded geometries ([#1392](https://github.com/mapnik/mapnik/issues/1392)) -- Increased grid encoding performance (#1315) +- Increased grid encoding performance ([#1315](https://github.com/mapnik/mapnik/issues/1315)) - Added support for setting opacity dynamically on images in polygon pattern and markers symbolizers - Added support for filtering on a features geometry type, either `point`, `linestring`, `polygon`, - or `collection` using the expression keyword of `[mapnik::geometry_type]` (#546) + or `collection` using the expression keyword of `[mapnik::geometry_type]` ([#546](https://github.com/mapnik/mapnik/issues/546)) -- MarkersSymbolizer width and height moved to expressions (#1102) +- MarkersSymbolizer width and height moved to expressions ([#1102](https://github.com/mapnik/mapnik/issues/1102)) -- PostGIS: Added `simplify_geometries` option - will trigger ST_Simplify on geometries before returning to Mapnik (#1179) +- PostGIS: Added `simplify_geometries` option - will trigger ST_Simplify on geometries before returning to Mapnik ([#1179](https://github.com/mapnik/mapnik/issues/1179)) - Improved error feedback for invalid values passed to map.query_point -- Fixed rendering of thin svg lines (#1129) +- Fixed rendering of thin svg lines ([#1129](https://github.com/mapnik/mapnik/issues/1129)) -- Improved logging/debugging system with release logs and file redirection (https://github.com/mapnik/mapnik/wiki/Runtime-Logging) (#937 and partially #986, #467) +- Improved logging/debugging system with release logs and file redirection (https://github.com/mapnik/mapnik/wiki/Runtime-Logging) ([#937](https://github.com/mapnik/mapnik/issues/937) and partially [#986](https://github.com/mapnik/mapnik/issues/986), [#467](https://github.com/mapnik/mapnik/issues/467)) -- GDAL: allow setting `nodata` value on the fly (will override value if `nodata` is set in data) (#1161) +- GDAL: allow setting `nodata` value on the fly (will override value if `nodata` is set in data) ([#1161](https://github.com/mapnik/mapnik/issues/1161)) -- GDAL: respect `nodata` for paletted/colormapped images (#1160) +- GDAL: respect `nodata` for paletted/colormapped images ([#1160](https://github.com/mapnik/mapnik/issues/1160)) - PostGIS: Added a new option called `autodetect_key_field` (by default false) that if true will trigger autodetection of the table primary key allowing for feature.id() to represent - globally unique ids. This option has no effect if the user has not manually supplied the `key_field` option. (#804) + globally unique ids. This option has no effect if the user has not manually supplied the `key_field` option. ([#804](https://github.com/mapnik/mapnik/issues/804)) -- Cairo: Add full rendering support for markers to match AGG renderer functionality (#1071) +- Cairo: Add full rendering support for markers to match AGG renderer functionality ([#1071](https://github.com/mapnik/mapnik/issues/1071)) -- Fix Markers rendering so that ellipse height/width units are pixels (previously were unintentionally radii) (#1134) +- Fix Markers rendering so that ellipse height/width units are pixels (previously were unintentionally radii) ([#1134](https://github.com/mapnik/mapnik/issues/1134)) -- Added `ignore-placement` attribute to markers-symbolizer (#1135) +- Added `ignore-placement` attribute to markers-symbolizer ([#1135](https://github.com/mapnik/mapnik/issues/1135)) -- Removed PointDatasource - use more robust MemoryDatasource instead (#1032) +- Removed PointDatasource - use more robust MemoryDatasource instead ([#1032](https://github.com/mapnik/mapnik/issues/1032)) -- SQLite - Added support for !intersects! token in sql subselects (#809) allow custom positioning of rtree spatial filter. +- SQLite - Added support for !intersects! token in sql subselects ([#809](https://github.com/mapnik/mapnik/issues/809)) allow custom positioning of rtree spatial filter. -- New CSV plugin - reads tabular files - autodetecting geo columns, newlines, and delimiters. Uses in-memory featureset for fast rendering and is not designed for large files (#902) +- New CSV plugin - reads tabular files - autodetecting geo columns, newlines, and delimiters. Uses in-memory featureset for fast rendering and is not designed for large files ([#902](https://github.com/mapnik/mapnik/issues/902)) -- Fixed bug in shield line placement when dx/dy are used to shift the label relative to the placement point (Matt Amos) (#908) +- Fixed bug in shield line placement when dx/dy are used to shift the label relative to the placement point (Matt Amos) ([#908](https://github.com/mapnik/mapnik/issues/908)) -- Added parameter in OGR plugin to select a layer by SQL query (besides name or index): see http://www.gdal.org/ogr/ogr_sql.html for specifications (kunitoki) (#472) +- Added parameter in OGR plugin to select a layer by SQL query (besides name or index): see http://www.gdal.org/ogr/ogr_sql.html for specifications (kunitoki) ([#472](https://github.com/mapnik/mapnik/issues/472)) -- Added support for output maps as tiff files (addresses #967 partially) +- Added support for output maps as tiff files (addresses [#967](https://github.com/mapnik/mapnik/issues/967) partially) -- Added support for justify-alignment=auto. This is the new default. (#1125) +- Added support for justify-alignment=auto. This is the new default. ([#1125](https://github.com/mapnik/mapnik/issues/1125)) - Added support for grouped rendering using the `group-by` layer option: https://github.com/mapnik/mapnik/wiki/Grouped-rendering @@ -829,83 +861,83 @@ Released Aug 23, 2012 Released Aug 3, 2012 -(Packaged from adb2ec741) +(Packaged from [adb2ec7](https://github.com/mapnik/mapnik/commit/adb2ec741)) -- Fixed handling of empty WKB geometries (#1334) +- Fixed handling of empty WKB geometries ([#1334](https://github.com/mapnik/mapnik/issues/1334)) -- Fixed naming of `stroke-dashoffset` in save_map (cc3cd5f63f28) +- Fixed naming of `stroke-dashoffset` in save_map ([cc3cd5f](https://github.com/mapnik/mapnik/commit/cc3cd5f63f28)) -- Fixed support for boost 1.50 (8dea5a5fe239233) +- Fixed support for boost 1.50 ([8dea5a5](https://github.com/mapnik/mapnik/commit/8dea5a5fe239233)) -- Fixed TextSymbolizer placement in Cairo backend so it respects avoid-edges and minimum-padding across all renderers (#1242) +- Fixed TextSymbolizer placement in Cairo backend so it respects avoid-edges and minimum-padding across all renderers ([#1242](https://github.com/mapnik/mapnik/issues/1242)) -- Fixed ShieldSymbolizer placement so it respects avoid-edges and minimum-padding across all renderers (#1242) +- Fixed ShieldSymbolizer placement so it respects avoid-edges and minimum-padding across all renderers ([#1242](https://github.com/mapnik/mapnik/issues/1242)) -- Rolled back change made in 2.0.1 to marker width/height meaning that Mapnik > 2.0.2 will stick to assuming width/heigh are radii for back compatibility with 2.0.0. The reverted change is seen below as "Fix Markers rendering so that ellipse height/width units are pixels (previously were unintentionally radii)". Issue tracking this is #1163 +- Rolled back change made in 2.0.1 to marker width/height meaning that Mapnik > 2.0.2 will stick to assuming width/heigh are radii for back compatibility with 2.0.0. The reverted change is seen below as "Fix Markers rendering so that ellipse height/width units are pixels (previously were unintentionally radii)". Issue tracking this is [#1163](https://github.com/mapnik/mapnik/issues/1163) - XML: Fixed to avoid throwing if a `` element is encountered (which is supported in >= 2.1.x) -- Support for PostGIS 2.0 in the pgsql2sqlite command (e69c44e/47e5b3c) +- Support for PostGIS 2.0 in the pgsql2sqlite command ([e69c44e](https://github.com/mapnik/mapnik/commit/e69c44e), [47e5b3c](https://github.com/mapnik/mapnik/commit/47e5b3c)) -- Fixed reference counting of Py_None when returning null attributes from Postgres during UTFGrid encoding, which could cause a Fatal Python error: deallocating None (#1221) +- Fixed reference counting of Py_None when returning null attributes from Postgres during UTFGrid encoding, which could cause a Fatal Python error: deallocating None ([#1221](https://github.com/mapnik/mapnik/issues/1221)) -- Fixed possible breakage registering plugins via python if a custom PREFIX or DESTDIR was used (e.g. macports/homebrew) (#1171) +- Fixed possible breakage registering plugins via python if a custom PREFIX or DESTDIR was used (e.g. macports/homebrew) ([#1171](https://github.com/mapnik/mapnik/issues/1171)) -- Fixed memory leak in the case of proj >= 4.8 and a projection initialization error (#1173) +- Fixed memory leak in the case of proj >= 4.8 and a projection initialization error ([#1173](https://github.com/mapnik/mapnik/issues/1173)) ## Mapnik 2.0.1 Released April 10, 2012 -(Packaged from 57347e9106) +(Packaged from [57347e9](https://github.com/mapnik/mapnik/commit/57347e9106)) -- Support for PostGIS 2.0 (#956,#1083) +- Support for PostGIS 2.0 ([#956](https://github.com/mapnik/mapnik/issues/956),[#1083](https://github.com/mapnik/mapnik/issues/1083)) -- Switched back to "libmapnik" and "import mapnik" rather than "mapnik2" (mapnik2 will still work from python) (#941) +- Switched back to "libmapnik" and "import mapnik" rather than "mapnik2" (mapnik2 will still work from python) ([#941](https://github.com/mapnik/mapnik/issues/941)) -- Restored Python 2.5 compatibility (#904) +- Restored Python 2.5 compatibility ([#904](https://github.com/mapnik/mapnik/issues/904)) -- Fixed `mapnik-config --version` (#903) +- Fixed `mapnik-config --version` ([#903](https://github.com/mapnik/mapnik/issues/903)) -- Cairo: Add full rendering support for markers to match AGG renderer functionality (#1071) +- Cairo: Add full rendering support for markers to match AGG renderer functionality ([#1071](https://github.com/mapnik/mapnik/issues/1071)) -- Fix Markers rendering so that ellipse height/width units are pixels (previously were unintentially radii) (#1134) +- Fix Markers rendering so that ellipse height/width units are pixels (previously were unintentially radii) ([#1134](https://github.com/mapnik/mapnik/issues/1134)) -- Added `ignore-placement` attribute to markers-symbolizer (#1135) +- Added `ignore-placement` attribute to markers-symbolizer ([#1135](https://github.com/mapnik/mapnik/issues/1135)) - Removed svn_revision info from mapnik-config and python bindings as git is now used -- Removed OGCServer from core - now at https://github.com/mapnik/OGCServer (e7f6267) +- Removed OGCServer from core - now at https://github.com/mapnik/OGCServer ([e7f6267](https://github.com/mapnik/mapnik/commit/e7f6267)) -- Fixed SQLite open stability across platforms/versions (#854) +- Fixed SQLite open stability across platforms/versions ([#854](https://github.com/mapnik/mapnik/issues/854)) -- Workaround for boost interprocess compile error with recent gcc versions (#950,#1001,#1082) +- Workaround for boost interprocess compile error with recent gcc versions ([#950](https://github.com/mapnik/mapnik/issues/950),[#1001](https://github.com/mapnik/mapnik/issues/1001),[#1082](https://github.com/mapnik/mapnik/issues/1082)) -- Fix possible memory corruption when using `hextree` mode for png color reduction (#1087) +- Fix possible memory corruption when using `hextree` mode for png color reduction ([#1087](https://github.com/mapnik/mapnik/issues/1087)) -- Fixed bug in shield line placement when dx/dy are used to shift the label relative to the placement point (Matt Amos) (#908) +- Fixed bug in shield line placement when dx/dy are used to shift the label relative to the placement point (Matt Amos) ([#908](https://github.com/mapnik/mapnik/issues/908)) -- Fix to avoid modifying a feature if an attribute is requested that does not exist (0f5ab18ed) +- Fix to avoid modifying a feature if an attribute is requested that does not exist ([0f5ab18](https://github.com/mapnik/mapnik/commit/0f5ab18ed)) -- Fixed ability to save to jpeg format from python (7387afd9) (#896) +- Fixed ability to save to jpeg format from python ([7387afd](https://github.com/mapnik/mapnik/commit/7387afd96)) ([#896](https://github.com/mapnik/mapnik/issues/896)) ## Mapnik 2.0.0 Released September 26, 2011 -(Packaged from 5b4c20eab3) +(Packaged from [5b4c20e](https://github.com/mapnik/mapnik/commit/5b4c20eab3)) -- Add minimum-path-length property to text_symbolizer to allow labels to be placed only on lines of a certain length (#865) +- Add minimum-path-length property to text_symbolizer to allow labels to be placed only on lines of a certain length ([#865](https://github.com/mapnik/mapnik/issues/865)) -- Add support for png quantization using fixed palettes (#843) +- Add support for png quantization using fixed palettes ([#843](https://github.com/mapnik/mapnik/issues/843)) - Add AlsoFilter functionality - https://github.com/mapnik/mapnik/wiki/AlsoFilter -- SQLite Plugin: optimize i/o using shared cache and no mutexes (#797) +- SQLite Plugin: optimize i/o using shared cache and no mutexes ([#797](https://github.com/mapnik/mapnik/issues/797)) -- Directly link input plugins to libmapnik to avoid having to set dlopen flags from binding languages (#790) +- Directly link input plugins to libmapnik to avoid having to set dlopen flags from binding languages ([#790](https://github.com/mapnik/mapnik/issues/790)) - Throw an error during registration for fonts which Freetype2 does not report a family or style name (r2985). @@ -933,62 +965,62 @@ Released September 26, 2011 cannot possibly be projected into the map srs or the user wishes to control map bounds without modifying the extents of each layer. -- Support for `nodata` values with grey and rgb images in GDAL plugin (#727) +- Support for `nodata` values with grey and rgb images in GDAL plugin ([#727](https://github.com/mapnik/mapnik/issues/727)) -- Print warning if invalid XML property names are used (#110) +- Print warning if invalid XML property names are used ([#110](https://github.com/mapnik/mapnik/issues/110)) -- Made XML property names use consistent dashes, never underscores (#644) +- Made XML property names use consistent dashes, never underscores ([#644](https://github.com/mapnik/mapnik/issues/644)) -- Added support for drawing only first matching rule using filter-mode="first" in Style (#706) +- Added support for drawing only first matching rule using filter-mode="first" in Style ([#706](https://github.com/mapnik/mapnik/issues/706)) -- Added support to PointSymbolizer (`ignore_placement`) for skipping adding placed points to collision detector (#564) +- Added support to PointSymbolizer (`ignore_placement`) for skipping adding placed points to collision detector ([#564](https://github.com/mapnik/mapnik/issues/564)) -- Added ability to register fonts within XML using Map level `font-directory` parameter (#168) +- Added ability to register fonts within XML using Map level `font-directory` parameter ([#168](https://github.com/mapnik/mapnik/issues/168)) - TextSymbolizer: Change text_convert to text_transform to better match css naming (r2211) -- Shapefile Plugin: Throw error if attribute name is requested that does not exist (#604) +- Shapefile Plugin: Throw error if attribute name is requested that does not exist ([#604](https://github.com/mapnik/mapnik/issues/604)) -- Upgraded to the latest proj4 string literal for EPSG:4326 (WGS84) as global default projection (#333) +- Upgraded to the latest proj4 string literal for EPSG:4326 (WGS84) as global default projection ([#333](https://github.com/mapnik/mapnik/issues/333)) - Added `mapnik_version_from_string()` function in python bindings to easily convert string representation of version number to the integer format used in `mapnik/version.hpp`. e.g. `0.7.1` --> `701`. -- Added xinclude (http://www.w3.org/TR/xinclude/) support to libxml2-based xml parser (oldtopos) (#567) +- Added xinclude (http://www.w3.org/TR/xinclude/) support to libxml2-based xml parser (oldtopos) ([#567](https://github.com/mapnik/mapnik/issues/567)) - Optimized rendering speeds by avoiding locking in the projection code (r2063) (r2713) -- Added support for setting global alignment of polygon pattern fills (#203) +- Added support for setting global alignment of polygon pattern fills ([#203](https://github.com/mapnik/mapnik/issues/203)) - Added support for choosing OGR layer by index number using `layer_by_index` parameter (r1904) -- Added support for fractional halo widths (using FT Stroker) (#93) +- Added support for fractional halo widths (using FT Stroker) ([#93](https://github.com/mapnik/mapnik/issues/93)) -- Added support for reading jpeg images (in addition to png/tiff) for image symbolizers (#518) +- Added support for reading jpeg images (in addition to png/tiff) for image symbolizers ([#518](https://github.com/mapnik/mapnik/issues/518)) -- Made libjpeg dependency optional at compile time and added mapnik2.has_jpeg() method to check for support in python (#545). +- Made libjpeg dependency optional at compile time and added mapnik2.has_jpeg() method to check for support in python ([#545](https://github.com/mapnik/mapnik/issues/545)). -- Fixed reading of PostGIS data on Big Endian systems (#515) +- Fixed reading of PostGIS data on Big Endian systems ([#515](https://github.com/mapnik/mapnik/issues/515)) -- PostGIS: Added better support for alternative schemas (#500) +- PostGIS: Added better support for alternative schemas ([#500](https://github.com/mapnik/mapnik/issues/500)) - AGG Renderer - Enforced default gamma function on all symbolizers to ensure proper antialiasing - even when gamma is modified on the PolygonSymbolizer. (#512) + even when gamma is modified on the PolygonSymbolizer. ([#512](https://github.com/mapnik/mapnik/issues/512)) -- Added ability to read pre 2.0.0 stylesheets, but prints a warning for deprecated syntax (r1592, #501) +- Added ability to read pre 2.0.0 stylesheets, but prints a warning for deprecated syntax (r1592, [#501](https://github.com/mapnik/mapnik/issues/501)) -- Rasterlite Plugin: Experimental support for Rasterlite, to practically use sqlite database with wavelet compressed rasters (#469) +- Rasterlite Plugin: Experimental support for Rasterlite, to practically use sqlite database with wavelet compressed rasters ([#469](https://github.com/mapnik/mapnik/issues/469)) -- PNG: fixed png256 for large images and some improvements to reduce color corruptions (#522) +- PNG: fixed png256 for large images and some improvements to reduce color corruptions ([#522](https://github.com/mapnik/mapnik/issues/522)) -- Implement MarkersSymbolizer in Cairo render and improve the markers placement finder. (#553) +- Implement MarkersSymbolizer in Cairo render and improve the markers placement finder. ([#553](https://github.com/mapnik/mapnik/issues/553)) # Mapnik 0.7.2 Released Oct 18, 2011 -(Packaged from bc5cabeb6a) +(Packaged from [bc5cabe](https://github.com/mapnik/mapnik/commit/bc5cabeb6a)) - Added forward compatibility for Mapnik 2.0 XML syntax (https://github.com/mapnik/mapnik/wiki/Mapnik2/Changes) @@ -1000,29 +1032,29 @@ Released Oct 18, 2011 - Fixes to the postgres pool -- Fix for correct transparency levels in png256/png8 output (#540) +- Fix for correct transparency levels in png256/png8 output ([#540](https://github.com/mapnik/mapnik/issues/540)) - Various build system fixes, especially for gcc compiler on open solaris. -- When plugins are not found, report the searched directories (#568) +- When plugins are not found, report the searched directories ([#568](https://github.com/mapnik/mapnik/issues/568)) -- Improved font loading support (#559) +- Improved font loading support ([#559](https://github.com/mapnik/mapnik/issues/559)) - Fix to shapeindex for allowing indexing of directory of shapefiles like `shapeindex dir/*shp` -- Fixed handling of null and multipatch shapes in shapefile driver - avoiding inf loop (#573) +- Fixed handling of null and multipatch shapes in shapefile driver - avoiding inf loop ([#573](https://github.com/mapnik/mapnik/issues/573)) -- Fixed raster alpha blending (#589,#674) +- Fixed raster alpha blending ([#589](https://github.com/mapnik/mapnik/issues/589),[#674](https://github.com/mapnik/mapnik/issues/674)) -- Enhanced support for faster reprojection if proj >= 4.8 is used (#575) +- Enhanced support for faster reprojection if proj >= 4.8 is used ([#575](https://github.com/mapnik/mapnik/issues/575)) -- Allow for late-binding of datasources (#622) +- Allow for late-binding of datasources ([#622](https://github.com/mapnik/mapnik/issues/622)) -- Fix to OSM plugin to avoid over-caching of data (#542) +- Fix to OSM plugin to avoid over-caching of data ([#542](https://github.com/mapnik/mapnik/issues/542)) - Various fixes to sqlite, ogr, and occi driver backported from trunk. -- Ensured that `\n` triggers linebreaks in text rendering (#584) +- Ensured that `\n` triggers linebreaks in text rendering ([#584](https://github.com/mapnik/mapnik/issues/584)) - Support for boost filesystem v3 @@ -1035,7 +1067,7 @@ Released Oct 18, 2011 Released March 23, 2010 -(Packaged from r1745/db89f1ca75) +(Packaged from [db89f1c](https://github.com/mapnik/mapnik/commit/db89f1ca75) / r1745) - Rasters: Various fixes and improvements to 8bit png output ([#522](https://github.com/mapnik/mapnik/issues/522),[#475](https://github.com/mapnik/mapnik/issues/475)) @@ -1047,7 +1079,7 @@ Released March 23, 2010 system. LINK_PRIORITY defaults to prioritizing internal sources of the mapnik source folder, then local/user installed libraries over system libraries, but the option can be customized. Sorting not only ensures that compiling and linking will more likely match the desired libraries but also gives more likelyhood to avoid - the scenario where libraries are linked that don`t match the includes libmapnik compiled against. + the scenario where libraries are linked that don't match the includes libmapnik compiled against. - XML: Fixed behavior of PolygonPatternSymbolizer and LinePatternSymbolizer whereby width, height, and type of images is actually allowed to be optionally ommitted ([#508](https://github.com/mapnik/mapnik/issues/508)). This was added in r1543 but @@ -1077,13 +1109,13 @@ Released March 23, 2010 Released January, 19 2010 -(Packaged from r1574/a0da946be9) +(Packaged from [a0da946](https://github.com/mapnik/mapnik/commit/a0da946be9) / r1574) - Core: Fixed linking to external libagg (r1297,r1299) - Core: Completed full support for PPC (Big endian) architectures (r1352 -> r1357) -- Gdal Plugin: Added support for Gdal overviews, enabling fast loading of > 1GB rasters (#54) +- Gdal Plugin: Added support for Gdal overviews, enabling fast loading of > 1GB rasters ([#54](https://github.com/mapnik/mapnik/issues/54)) * Use the gdaladdo utility to add overviews to existing GDAL datasets @@ -1093,63 +1125,64 @@ Released January, 19 2010 table to query based on parsing the `table` parameter, which may fail for complex queries with more than one `from` keyword. Using this parameter should allow for existing metadata and table indexes to be used while opening the door to much more complicated subqueries being passed to the `table` parameter without - failing (#260, #426). + failing ([#260](https://github.com/mapnik/mapnik/issues/260), [#426](https://github.com/mapnik/mapnik/issues/426)). - PostGIS Plugin: Added optional `geometry_field` and `srid` parameters. If specified these will allow Mapnik to skip several queries to try to determine these values dynamically, and can be helpful to avoid - possible query failures during metadata lookup with complex subqueries as discussed in #260 and #436, but - also solvable by specifying the `geometry_table` parameter. (r1300,#376) + possible query failures during metadata lookup with complex subqueries as discussed in [#260](https://github.com/mapnik/mapnik/issues/260) and [#436](https://github.com/mapnik/mapnik/issues/436), but + also solvable by specifying the `geometry_table` parameter. (r1300,[#376](https://github.com/mapnik/mapnik/issues/376)) - PostGIS: Added an optional `extent_from_subquery` parameter that when true (while the `extent` parameter is not provided and `estimate_extent` is false) will direct Mapnik to calculate the extent upon the exact table or sql provided in the `table` parameter. If a sub-select is used for the table parameter then this will, in cases where the subquery limits results, provide a faster and more accurate layer extent. It will have - no effect if the `table` parameter is simply an existing table. This parameter is false by default. (#456) + no effect if the `table` parameter is simply an existing table. This parameter is false by default. ([#456](https://github.com/mapnik/mapnik/issues/456)) - PostGIS Plugin: Added `!bbox!` token substitution ability in sql query string. This opens the door for various complex queries that may aggregate geometries to be kept fast by allowing proper placement of the bbox - query to be used by indexes. (#415) + query to be used by indexes. ([#415](https://github.com/mapnik/mapnik/issues/415)) * Pass the bbox token inside a subquery like: !bbox! * Valid Usages include: - + ```sql (Select ST_Union(geom) as geom from table where ST_Intersects(geometry,!bbox!)) as map - (Select * from table where geom && !bbox!) as map + (Select * from table where geom && !bbox!) as map + ``` -- PostGIS Plugin: Added `scale_denominator` substitution ability in sql query string (#415/#465) +- PostGIS Plugin: Added `scale_denominator` substitution ability in sql query string ([#415](https://github.com/mapnik/mapnik/issues/415)/[#465](https://github.com/mapnik/mapnik/issues/465)) * Pass the scale_denominator token inside a subquery like: !scale_denominator! * e.g. (Select * from table where field_value > !scale_denominator!) as map -- PostGIS Plugin: Added support for quoted table names (r1454) (#393) +- PostGIS Plugin: Added support for quoted table names (r1454) ([#393](https://github.com/mapnik/mapnik/issues/393)) - PostGIS: Add a `persist_connection` option (default true), that when false will release - the idle psql connection after datasource goes out of scope (r1337) (#433,#434) + the idle psql connection after datasource goes out of scope (r1337) ([#433](https://github.com/mapnik/mapnik/issues/433),[#434](https://github.com/mapnik/mapnik/issues/434)) - PostGIS: Added support for BigInt (int8) postgres type (384) -- PostGIS Plugin: Throw and report errors if SQL execution fails (r1291) (#363, #242) +- PostGIS Plugin: Throw and report errors if SQL execution fails (r1291) ([#363](https://github.com/mapnik/mapnik/issues/363), [#242](https://github.com/mapnik/mapnik/issues/242)) - PostGIS Plugin: Fixed problem in conversion of long numbers to strings (r1302,1303) -- PostGIS Plugin: Added missing support for BigInt(int8) postgres datatypes (r1250) (#384) +- PostGIS Plugin: Added missing support for BigInt(int8) postgres datatypes (r1250) ([#384](https://github.com/mapnik/mapnik/issues/384)) -- OGR Plugin: Added support for reading multipoint features (#458) +- OGR Plugin: Added support for reading multipoint features ([#458](https://github.com/mapnik/mapnik/issues/458)) -- Shape Plugin: Fixed bug in file extension stripping (#413) +- Shape Plugin: Fixed bug in file extension stripping ([#413](https://github.com/mapnik/mapnik/issues/413)) -- Shape Plugin: Fixed missing compiler flags that causes crashing on newer g++ versions (#436) +- Shape Plugin: Fixed missing compiler flags that causes crashing on newer g++ versions ([#436](https://github.com/mapnik/mapnik/issues/436)) -- PNG: Fixed problem with garbled/striped png256 output along sharp edges(#416,#445,#447,#202) +- PNG: Fixed problem with garbled/striped png256 output along sharp edges([#416](https://github.com/mapnik/mapnik/issues/416),[#445](https://github.com/mapnik/mapnik/issues/445),[#447](https://github.com/mapnik/mapnik/issues/447),[#202](https://github.com/mapnik/mapnik/issues/202)) -- PNG: Added support for semi-transparency in png256 output (#477,#202) +- PNG: Added support for semi-transparency in png256 output ([#477](https://github.com/mapnik/mapnik/issues/477),[#202](https://github.com/mapnik/mapnik/issues/202)) - PolygonSymbolizer: Added `gamma` attribute to allow for dilation of polygon edges - a solution to gap artifacts or "ghost lines" between adjacent polygons and allows for slight sharpening of @@ -1169,15 +1202,15 @@ Released January, 19 2010 - XML: Added support for using CDATA with libxml2 parser (r1364) -- XML: Fixed memory leak in libxml2 implementation (#473) +- XML: Fixed memory leak in libxml2 implementation ([#473](https://github.com/mapnik/mapnik/issues/473)) -- XML: Added function to serialize map to string, called `mapnik.save_map_to_string()` (#396) +- XML: Added function to serialize map to string, called `mapnik.save_map_to_string()` ([#396](https://github.com/mapnik/mapnik/issues/396)) - XML: Added parameter to called `minimum_version` to allow for enforcing the minimum Mapnik version needed for XML features used in the mapfiles. Uses Major.Minor.Point syntax, for example would throw an error if the user is running Mapnik less than 0.6.1. -- XML: Added support for relative paths when using entities and `mapnik.load_map_from_string()` (#440) +- XML: Added support for relative paths when using entities and `mapnik.load_map_from_string()` ([#440](https://github.com/mapnik/mapnik/issues/440)) - XML: Made width and height optional for symbolizers using images (r1543) @@ -1185,21 +1218,21 @@ Released January, 19 2010 - XML: Added missing serialization of PointSymbolizer `opacity` and `allow_overlap` attributes (r1358) -- XML: Default text vertical_alignment now dependent on dy (#485, r1527) +- XML: Default text vertical_alignment now dependent on dy ([#485](https://github.com/mapnik/mapnik/issues/485), r1527) -- Python: Exposed ability to write to Cairo formats using `mapnik.render_to_file()` and without pycairo (#381) +- Python: Exposed ability to write to Cairo formats using `mapnik.render_to_file()` and without pycairo ([#381](https://github.com/mapnik/mapnik/issues/381)) -- Python: Fixed potential crash if pycairo support is enabled but python-cairo module is missing (#392) +- Python: Fixed potential crash if pycairo support is enabled but python-cairo module is missing ([#392](https://github.com/mapnik/mapnik/issues/392)) -- Python: Added `mapnik.has_pycairo()` function to test for pycairo support (r1278) (#284) +- Python: Added `mapnik.has_pycairo()` function to test for pycairo support (r1278) ([#284](https://github.com/mapnik/mapnik/issues/284)) - Python: Added `mapnik.register_plugins()` and `mapnik.register_fonts()` functions (r1256) -- Python: Pickling support for point_symbolizer (r1295) (#345) +- Python: Pickling support for point_symbolizer (r1295) ([#345](https://github.com/mapnik/mapnik/issues/345)) -- Python: Ensured mapnik::config_errors now throw RuntimeError exception instead of UserWarning exception (#442) +- Python: Ensured mapnik::config_errors now throw RuntimeError exception instead of UserWarning exception ([#442](https://github.com/mapnik/mapnik/issues/442)) -- Filters: Added support for `!=` as an alias to `<>` for not-equals filters (avoids <>) (r1326) (#427) +- Filters: Added support for `!=` as an alias to `<>` for not-equals filters (avoids <>) (r1326) ([#427](https://github.com/mapnik/mapnik/issues/427)) - SCons: Improved boost auto-detection (r1255,r1279) @@ -1210,7 +1243,7 @@ Released January, 19 2010 - SCons: Added ability to link to custom icu library name using ICU_LIB_NAME (r1414) -- SCons: Improved reliability of python linking on OSX (#380) +- SCons: Improved reliability of python linking on OSX ([#380](https://github.com/mapnik/mapnik/issues/380)) - Fonts: Added unifont to auto-installed fonts, which is used by the OSM styles as a fallback font (r1328) @@ -1219,96 +1252,96 @@ Released January, 19 2010 Released July 14, 2009 -(Packaged from r1247/353ff576c7) +(Packaged from [353ff57](https://github.com/mapnik/mapnik/commit/353ff576c7) / r1247) - Plugins: expose list of registered plugins as a `plugin_names()` method of DatasourceCache (r1180) -- XML: Fixed serialization and parsing bugs related to handling of integers and Enums (#328,#353) +- XML: Fixed serialization and parsing bugs related to handling of integers and Enums ([#328](https://github.com/mapnik/mapnik/issues/328),[#353](https://github.com/mapnik/mapnik/issues/353)) -- SCons: Added the ability to set the PKG_CONFIG_PATH env setting (#217) +- SCons: Added the ability to set the PKG_CONFIG_PATH env setting ([#217](https://github.com/mapnik/mapnik/issues/217)) -- SCons: Improved linking to only required libraries for libmapnik (#371) +- SCons: Improved linking to only required libraries for libmapnik ([#371](https://github.com/mapnik/mapnik/issues/371)) -- Shape Plugin: Added compile time flag to allow disabling the use of memory mapped files (r1213) (#342) +- Shape Plugin: Added compile time flag to allow disabling the use of memory mapped files (r1213) ([#342](https://github.com/mapnik/mapnik/issues/342)) - Core: Improved support for PPC (Big endian) architectures (r1198 -> r1213) -- Scons: Improved auto-detection of boost libs/headers (r1200) (#297) +- Scons: Improved auto-detection of boost libs/headers (r1200) ([#297](https://github.com/mapnik/mapnik/issues/297)) -- Plugins: Exposed list of available/registered plugins (r1180) (#246) +- Plugins: Exposed list of available/registered plugins (r1180) ([#246](https://github.com/mapnik/mapnik/issues/246)) - SCons: Improve build support for SunCC (patches from River Tarnell) (r1168, r1169) -- Python: Pickling support for text_symbolizer (r1164) (#345) +- Python: Pickling support for text_symbolizer (r1164) ([#345](https://github.com/mapnik/mapnik/issues/345)) -- Python: Pickling support for proj_transform and view/coord_transform (r1163) (#345) +- Python: Pickling support for proj_transform and view/coord_transform (r1163) ([#345](https://github.com/mapnik/mapnik/issues/345)) -- Python: Pickling support for parameters (r1162) (#345) +- Python: Pickling support for parameters (r1162) ([#345](https://github.com/mapnik/mapnik/issues/345)) -- Python: Pickling support for stroke objects (r1161) (#345) +- Python: Pickling support for stroke objects (r1161) ([#345](https://github.com/mapnik/mapnik/issues/345)) -- Python: Pickling support for line_symbolizer (r1160) (#345) +- Python: Pickling support for line_symbolizer (r1160) ([#345](https://github.com/mapnik/mapnik/issues/345)) -- Python: Pickling support for projection objects (r1159) (#345) +- Python: Pickling support for projection objects (r1159) ([#345](https://github.com/mapnik/mapnik/issues/345)) -- Python: Pickling support for shield_symbolizer (r1158) (#345) +- Python: Pickling support for shield_symbolizer (r1158) ([#345](https://github.com/mapnik/mapnik/issues/345)) -- Python: Pickling support for polygon_symbolizer (r1157) (#345) +- Python: Pickling support for polygon_symbolizer (r1157) ([#345](https://github.com/mapnik/mapnik/issues/345)) -- Python: Pickling support for query objects (r1156) (#345) +- Python: Pickling support for query objects (r1156) ([#345](https://github.com/mapnik/mapnik/issues/345)) -- Python: Pickling support for pattern symbolizers (r1155) (#345) +- Python: Pickling support for pattern symbolizers (r1155) ([#345](https://github.com/mapnik/mapnik/issues/345)) -- Python: Pickling support for raster_symbolizer (r1154) (#345) +- Python: Pickling support for raster_symbolizer (r1154) ([#345](https://github.com/mapnik/mapnik/issues/345)) -- Python: Added `mapnik.has_cairo()` function to test for cairo support (r1152) (#284) +- Python: Added `mapnik.has_cairo()` function to test for cairo support (r1152) ([#284](https://github.com/mapnik/mapnik/issues/284)) -- Python: Exposed dash_array get method (r1151) (#317) +- Python: Exposed dash_array get method (r1151) ([#317](https://github.com/mapnik/mapnik/issues/317)) -- Python: Pickling support for Coord objects (#345) +- Python: Pickling support for Coord objects ([#345](https://github.com/mapnik/mapnik/issues/345)) - GDAL Plugin: Added an experimental option to open files in `shared mode` (r1143) - Python: Exposed RasterSymbolizer options in Python (r1139) -- Plugins: Fixed support for non-file based sources in GDAL and OGR plugins (#336,#337) +- Plugins: Fixed support for non-file based sources in GDAL and OGR plugins ([#336](https://github.com/mapnik/mapnik/issues/336),[#337](https://github.com/mapnik/mapnik/issues/337)) -- Plugins: Formal inclusion of new plugin for Kismet server (r1127) (#293) +- Plugins: Formal inclusion of new plugin for Kismet server (r1127) ([#293](https://github.com/mapnik/mapnik/issues/293)) -- Python: Made access to features and featuresets more Pythonic (r1121) (#171,#280,#283) +- Python: Made access to features and featuresets more Pythonic (r1121) ([#171](https://github.com/mapnik/mapnik/issues/171),[#280](https://github.com/mapnik/mapnik/issues/280),[#283](https://github.com/mapnik/mapnik/issues/283)) -- XML: Ensured relative paths in XML are interpreted relative to XML file location (r1124) (#326) +- XML: Ensured relative paths in XML are interpreted relative to XML file location (r1124) ([#326](https://github.com/mapnik/mapnik/issues/326)) -- XML: Added ability to serialize all default symbolizer values by passing third argument to save_map(m,`file.xml`,True)(r1117) (#327) +- XML: Added ability to serialize all default symbolizer values by passing third argument to save_map(m,`file.xml`,True)(r1117) ([#327](https://github.com/mapnik/mapnik/issues/327)) -- Core: Added support for alpha transparency when writing to png256 (patch from Marcin Rudowski) (#202) +- Core: Added support for alpha transparency when writing to png256 (patch from Marcin Rudowski) ([#202](https://github.com/mapnik/mapnik/issues/202)) -- SCons: Ensured ABI compatibility information is embedded in libmapnik.dylib on Mac OS X (#322) +- SCons: Ensured ABI compatibility information is embedded in libmapnik.dylib on Mac OS X ([#322](https://github.com/mapnik/mapnik/issues/322)) -- SCons: Ensured that the full `install_name` path would be added to libmapnik.dylib on Mac OS X (#374) +- SCons: Ensured that the full `install_name` path would be added to libmapnik.dylib on Mac OS X ([#374](https://github.com/mapnik/mapnik/issues/374)) - Tests: Added testing framework in Python using nose (r1101-r1105) -- Raster Plugin: Added a tile/bbox-based read policy for large (rasters width * height > 1024*1024 will be loaded in chunks) (r1089) +- Raster Plugin: Added a tile/bbox-based read policy for large (rasters width * height > 1024 * 1024 will be loaded in chunks) (r1089) -- OGCServer: Made lxml dependency optional (r1085) (#303) +- OGCServer: Made lxml dependency optional (r1085) ([#303](https://github.com/mapnik/mapnik/issues/303)) -- Rasters: Handle rounding to allow better alignment of raster layers (r1079) (#295) +- Rasters: Handle rounding to allow better alignment of raster layers (r1079) ([#295](https://github.com/mapnik/mapnik/issues/295)) -- AGG Renderer: Added option to control output JPEG quality (r1078) (#198) +- AGG Renderer: Added option to control output JPEG quality (r1078) ([#198](https://github.com/mapnik/mapnik/issues/198)) -- Plugins: Fixed segfault in OGR Plugin with empty geometries (r1074) (#292) +- Plugins: Fixed segfault in OGR Plugin with empty geometries (r1074) ([#292](https://github.com/mapnik/mapnik/issues/292)) # Mapnik 0.6.0 Released April 1, 2009 -(Packaged from r1066/c88e03436f) +(Packaged from [c88e034](https://github.com/mapnik/mapnik/commit/c88e03436f) / r1066) - Python: Added support for aspect_fix_mode (r1013) -- OGCServer Fixed axis-ordering for WMS 1.3.0 request (r1051) (#241) +- OGCServer Fixed axis-ordering for WMS 1.3.0 request (r1051) ([#241](https://github.com/mapnik/mapnik/issues/241)) - Plugins: Added option to all plugins to support using a `base` path argument (r1042) @@ -1333,7 +1366,7 @@ Released April 1, 2009 - Filter parsing: Allow numbers in the filter field name. This allows for shapefiles with columns like `1970`. -- Plugins: Added OGR driver for reading all OGR supported formats (kunitoki) (r836) (#170) +- Plugins: Added OGR driver for reading all OGR supported formats (kunitoki) (r836) ([#170](https://github.com/mapnik/mapnik/issues/170)) - XML: Added serialization of Fontsets (r807) @@ -1345,7 +1378,7 @@ Released April 1, 2009 - Python: Added ability to resize map and clear all layers and styles from python (r793) -- Python: Exposed Proj to/from transformation for projected coordinate systems (r792,r822) (#117) +- Python: Exposed Proj to/from transformation for projected coordinate systems (r792,r822) ([#117](https://github.com/mapnik/mapnik/issues/117)) - Memory Datasource: Added support for dynamically adding Points to map using Point Datasource (r790) @@ -1393,28 +1426,28 @@ Released April 1, 2009 - Plugins: Use memory mapped files for reading shape file (r628) -- Core: Use streams to write images (i/o re-factor) (r628) (#15) +- Core: Use streams to write images (i/o re-factor) (r628) ([#15](https://github.com/mapnik/mapnik/issues/15)) # Mapnik 0.5.1 Released April 15, 2008 -(Packaged from c29cb7386d) +(Packaged from [c29cb73](https://github.com/mapnik/mapnik/commit/c29cb7386d)) # Mapnik 0.5.0 Released April 15, 2008 -(Packaged from 0464a3563c) +(Packaged from [0464a35](https://github.com/mapnik/mapnik/commit/0464a3563c)) # Mapnik 0.4.0 Released February 26, 2007 -(Packaged from 8d73e3a8dc) +(Packaged from [8d73e3a](https://github.com/mapnik/mapnik/commit/8d73e3a8dc)) # Mapnik 0.3.0 Released May 22, 2006 -(Packaged from 3ae046ebe2) +(Packaged from [3ae046e](https://github.com/mapnik/mapnik/commit/3ae046ebe2)) diff --git a/INSTALL.md b/INSTALL.md index 8992144b1..b701a7dc9 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -6,6 +6,7 @@ First clone mapnik from github and initialize submodules ```bash git clone https://github.com/mapnik/mapnik.git +cd mapnik git submodule update --init ``` @@ -191,6 +192,6 @@ Mapnik is great for building your own mapping applications. Visit https://github.com/mapnik/mapnik/wiki/LearningMapnik for basic tutorials on how to programmatically use Mapnik. -### Contributers +### Contributors -Read docs/contributing.md for resources for getting involved with Mapnik development. +Read [docs/contributing.md](docs/contributing.md) for resources for getting involved with Mapnik development. diff --git a/SConstruct b/SConstruct index 35a9afa1d..635b38deb 100644 --- a/SConstruct +++ b/SConstruct @@ -34,6 +34,20 @@ try: except: HAS_DISTUTILS = False +try: + # Python 3.3+ + from shlex import quote as shquote +except: + # Python 2.7 + from pipes import quote as shquote + +try: + # Python 3.3+ + from subprocess import DEVNULL +except: + # Python 2.7 + DEVNULL = open(os.devnull, 'w') + LIBDIR_SCHEMA_DEFAULT='lib' severities = ['debug', 'warn', 'error', 'none'] @@ -157,12 +171,66 @@ def regular_print(color,text,newline=True): else: print (text) -def call(cmd, silent=False): - stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() - if not stderr: - return stdin.strip() - elif not silent: - color_print(1,'Problem encounted with SCons scripts, please post bug report to: https://github.com/mapnik/mapnik/issues \nError was: %s' % stderr) +def shell_command(cmd, *args, **kwargs): + """ Run command through shell. + + `cmd` should be a valid, properly shell-quoted command. + + Additional positional arguments, if provided, will each + be individually quoted as necessary and appended to `cmd`, + separated by spaces. + + `logstream` optional keyword argument should be either: + - a file-like object, into which the command-line + and the command's STDERR output will be written; or + - None, in which case STDERR will go to DEVNULL. + + Additional keyword arguments will be passed to `Popen`. + + Returns a tuple `(result, output)` where: + `result` = True if the command completed successfully, + False otherwise + `output` = captured STDOUT with trailing whitespace removed + """ + # `cmd` itself is intentionally not wrapped in `shquote` here + # in order to support passing user-provided commands that may + # include arguments. For example: + # + # ret, out = shell_command(env['CXX'], '--version') + # + # needs to work even if `env['CXX'] == 'ccache c++'` + # + if args: + cmdstr = ' '.join([cmd] + [shquote(a) for a in args]) + else: + cmdstr = cmd + # redirect STDERR to `logstream` if provided + try: + logstream = kwargs.pop('logstream') + except KeyError: + logstream = None + else: + if logstream is not None: + logstream.write(cmdstr + '\n') + kwargs['stderr'] = logstream + else: + kwargs['stderr'] = DEVNULL + # execute command and capture output + proc = Popen(cmdstr, shell=True, stdout=PIPE, **kwargs) + out, err = proc.communicate() + try: + outtext = out.decode(sys.stdout.encoding or 'UTF-8').rstrip() + except UnicodeDecodeError: + outtext = out.decode('UTF-8', errors='replace').rstrip() + if logstream is not None and outtext: + logstream.write('->\t' + outtext.replace('\n', '\n->\t') + '\n') + return proc.returncode == 0, outtext + +def silent_command(cmd, *args): + return shell_command(cmd, *args, stderr=DEVNULL) + +def config_command(cmd, *args): + return shell_command(cmd, *args, logstream=conf.logstream) def strip_first(string,find,replace=''): if string.startswith(find): @@ -188,13 +256,6 @@ def create_uninstall_target(env, path, is_glob=False): ]) env.Alias("uninstall", "uninstall-"+path) -def shortest_name(libs): - name = '-'*200 - for lib in libs: - if len(name) > len(lib): - name = lib - return name - def rm_path(item,set,_env): for i in _env[set]: if i.startswith(item): @@ -491,6 +552,12 @@ for opt in opts.options: if opt.key not in pickle_store: pickle_store.append(opt.key) +def rollback_option(env, variable): + global opts + for item in opts.options: + if item.key == variable: + env[variable] = item.default + # Method of adding configure behavior to Scons adapted from: # http://freeorion.svn.sourceforge.net/svnroot/freeorion/trunk/FreeOrion/SConstruct preconfigured = False @@ -578,19 +645,22 @@ def prioritize_paths(context, silent=True): def CheckPKGConfig(context, version): context.Message( 'Checking for pkg-config... ' ) - ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0] + context.sconf.cached = False + ret, _ = config_command('pkg-config --atleast-pkgconfig-version', version) context.Result( ret ) return ret def CheckPKG(context, name): context.Message( 'Checking for %s... ' % name ) - ret = context.TryAction('pkg-config --exists \'%s\'' % name)[0] + context.sconf.cached = False + ret, _ = config_command('pkg-config --exists', name) context.Result( ret ) return ret def CheckPKGVersion(context, name, version): context.Message( 'Checking for at least version %s for %s... ' % (version,name) ) - ret = context.TryAction('pkg-config --atleast-version=%s \'%s\'' % (version,name))[0] + context.sconf.cached = False + ret, _ = config_command('pkg-config --atleast-version', version, name) context.Result( ret ) return ret @@ -601,8 +671,9 @@ def parse_config(context, config, checks='--libs --cflags'): if config in ('GDAL_CONFIG'): toolname += ' %s' % checks context.Message( 'Checking for %s... ' % toolname) - cmd = '%s %s' % (env[config],checks) - ret = context.TryAction(cmd)[0] + context.sconf.cached = False + cmd = '%s %s' % (env[config], checks) + ret, value = config_command(cmd) parsed = False if ret: try: @@ -613,7 +684,6 @@ def parse_config(context, config, checks='--libs --cflags'): # and thus breaks knowledge below that gdal worked # TODO - upgrade our scons logic to support Framework linking if env['PLATFORM'] == 'Darwin': - value = call(cmd,silent=True) if value and '-framework GDAL' in value: env['LIBS'].append('gdal') if os.path.exists('/Library/Frameworks/GDAL.framework/unix/lib'): @@ -631,7 +701,7 @@ def parse_config(context, config, checks='--libs --cflags'): # optional deps... if tool not in env['SKIPPED_DEPS']: env['SKIPPED_DEPS'].append(tool) - conf.rollback_option(config) + rollback_option(env, config) else: # freetype and libxml2, not optional if tool not in env['MISSING_DEPS']: env['MISSING_DEPS'].append(tool) @@ -643,12 +713,11 @@ def get_pkg_lib(context, config, lib): libname = None env = context.env context.Message( 'Checking for name of %s library... ' % lib) - cmd = '%s --libs' % env[config] - ret = context.TryAction(cmd)[0] + context.sconf.cached = False + ret, value = config_command(env[config], '--libs') parsed = False if ret: try: - value = call(cmd, silent=True).decode("utf8") if ' ' in value: parts = value.split(' ') if len(parts) > 1: @@ -671,37 +740,33 @@ def parse_pg_config(context, config): env = context.env tool = config.lower() context.Message( 'Checking for %s... ' % tool) - ret = context.TryAction(env[config])[0] + context.sconf.cached = False + ret, lib_path = config_command(env[config], '--libdir') + ret, inc_path = config_command(env[config], '--includedir') if ret: - lib_path = call('%s --libdir' % env[config]).decode("utf8") - inc_path = call('%s --includedir' % env[config]).decode("utf8") env.AppendUnique(CPPPATH = fix_path(inc_path)) env.AppendUnique(LIBPATH = fix_path(lib_path)) lpq = env['PLUGINS']['postgis']['lib'] env.Append(LIBS = lpq) else: env['SKIPPED_DEPS'].append(tool) - conf.rollback_option(config) + rollback_option(env, config) context.Result( ret ) return ret def ogr_enabled(context): env = context.env context.Message( 'Checking if gdal is ogr enabled... ') - ret = context.TryAction('%s --ogr-enabled' % env['GDAL_CONFIG'])[0] + context.sconf.cached = False + ret, out = config_command(env['GDAL_CONFIG'], '--ogr-enabled') + if ret and out: + ret = (out == 'yes') if not ret: if 'ogr' not in env['SKIPPED_DEPS']: env['SKIPPED_DEPS'].append('ogr') context.Result( ret ) return ret -def rollback_option(context,variable): - global opts - env = context.env - for item in opts.options: - if item.key == variable: - env[variable] = item.default - def FindBoost(context, prefixes, thread_flag): """Routine to auto-find boost header dir, lib dir, and library naming structure. @@ -727,7 +792,7 @@ def FindBoost(context, prefixes, thread_flag): if len(libItems) >= 1 and len(incItems) >= 1: BOOST_LIB_DIR = os.path.dirname(libItems[0]) BOOST_INCLUDE_DIR = incItems[0].rstrip('boost/') - shortest_lib_name = shortest_name(libItems) + shortest_lib_name = min(libItems, key=len) match = re.search(r'%s(.*)\..*' % search_lib, shortest_lib_name) if hasattr(match,'groups'): BOOST_APPEND = match.groups()[0] @@ -812,7 +877,7 @@ def CheckIcuData(context, silent=False): if not silent: context.Message('Checking for ICU data directory...') - ret = context.TryRun(""" + ret, out = context.TryRun(""" #include #include @@ -829,14 +894,15 @@ int main() { """, '.cpp') if silent: context.did_show_result=1 - if ret[0]: - context.Result('u_getDataDirectory returned %s' % ret[1]) - return ret[1].strip() + if ret: + value = out.strip() + context.Result('u_getDataDirectory returned %s' % value) + return value else: - ret = call("icu-config --icudatadir", silent=True) + ret, value = config_command('icu-config --icudatadir') if ret: - context.Result('icu-config returned %s' % ret.decode("utf8")) - return ret.decode('utf8') + context.Result('icu-config returned %s' % value) + return value else: context.Result('Failed to detect (mapnik-config will have null value)') return '' @@ -845,8 +911,8 @@ int main() { def CheckGdalData(context, silent=False): if not silent: - context.Message('Checking for GDAL data directory...') - ret = context.TryRun(""" + context.Message('Checking for GDAL data directory... ') + ret, out = context.TryRun(""" #include "cpl_config.h" #include @@ -857,19 +923,20 @@ int main() { } """, '.cpp') + value = out.strip() if silent: context.did_show_result=1 - if ret[0]: - context.Result('GDAL_PREFIX returned %s' % ret[1]) + if ret: + context.Result('GDAL_PREFIX returned %s' % value) else: context.Result('Failed to detect (mapnik-config will have null value)') - return ret[1].strip() + return value def CheckProjData(context, silent=False): if not silent: context.Message('Checking for PROJ_LIB directory...') - ret = context.TryRun(""" + ret, out = context.TryRun(""" // This is narly, could eventually be replaced using https://github.com/OSGeo/proj.4/pull/551] #include @@ -919,20 +986,21 @@ int main() { } """, '.cpp') + value = out.strip() if silent: context.did_show_result=1 - if ret[0]: - context.Result('pj_open_lib returned %s' % ret[1]) + if ret: + context.Result('pj_open_lib returned %s' % value) else: context.Result('Failed to detect (mapnik-config will have null value)') - return ret[1].strip() + return value def CheckCairoHasFreetype(context, silent=False): if not silent: context.Message('Checking for cairo freetype font support ... ') context.env.AppendUnique(CPPPATH=copy(env['CAIRO_CPPPATHS'])) - ret = context.TryRun(""" + ret, out = context.TryRun(""" #include @@ -945,7 +1013,7 @@ int main() #endif } -""", '.cpp')[0] +""", '.cpp') if silent: context.did_show_result=1 context.Result(ret) @@ -972,7 +1040,7 @@ int main() return ret def GetBoostLibVersion(context): - ret = context.TryRun(""" + ret, out = context.TryRun(""" #include #include @@ -987,8 +1055,8 @@ return 0; """, '.cpp') # hack to avoid printed output context.did_show_result=1 - context.Result(ret[0]) - return ret[1].strip() + context.Result(ret) + return out.strip() def CheckBoostScopedEnum(context, silent=False): if not silent: @@ -1008,8 +1076,9 @@ int main() context.Result(ret) return ret -def icu_at_least_four_two(context): - ret = context.TryRun(""" +def icu_at_least(context, min_version_str): + context.Message('Checking for ICU version >= %s... ' % min_version_str) + ret, out = context.TryRun(""" #include #include @@ -1021,28 +1090,32 @@ int main() } """, '.cpp') - # hack to avoid printed output - context.Message('Checking for ICU version >= 4.2... ') - context.did_show_result=1 - result = ret[1].strip() - if not result: - context.Result('error, could not get major and minor version from unicode/uversion.h') + try: + found_version_str = out.strip() + found_version = tuple(map(int, found_version_str.split('.'))) + min_version = tuple(map(int, min_version_str.split('.'))) + except: + context.Result('error (could not get version from unicode/uversion.h)') return False - major, minor = map(int,result.split('.')) - if major >= 4 and minor >= 0: - color_print(4,'found: icu %s' % result) + if found_version >= min_version: + context.Result('yes (found ICU %s)' % found_version_str) return True - color_print(1,'\nFound insufficient icu version... %s' % result) + context.Result('no (found ICU %s)' % found_version_str) return False def harfbuzz_version(context): - ret = context.TryRun(""" + context.Message('Checking for HarfBuzz version >= %s... ' % HARFBUZZ_MIN_VERSION_STRING) + ret, out = context.TryRun(""" #include "harfbuzz/hb.h" #include +#ifndef HB_VERSION_ATLEAST +#define HB_VERSION_ATLEAST(...) 0 +#endif + int main() { std::cout << HB_VERSION_ATLEAST(%s, %s, %s) << ";" << HB_VERSION_STRING; @@ -1050,24 +1123,20 @@ int main() } """ % HARFBUZZ_MIN_VERSION, '.cpp') - # hack to avoid printed output - context.Message('Checking for HarfBuzz version >= %s... ' % HARFBUZZ_MIN_VERSION_STRING) - context.did_show_result=1 - result = ret[1].strip() - if not result: - context.Result('error, could not get version from hb.h') - return False - - items = result.split(';') - if items[0] == '1': - color_print(4,'found: HarfBuzz %s' % items[1]) - return True - - color_print(1,'\nHarfbuzz >= %s required but found ... %s' % (HARFBUZZ_MIN_VERSION_STRING,items[1])) - return False + if not ret: + context.Result('error (could not get version from hb.h)') + else: + ok_str, found_version_str = out.strip().split(';', 1) + ret = int(ok_str) + if ret: + context.Result('yes (found HarfBuzz %s)' % found_version_str) + else: + context.Result('no (found HarfBuzz %s)' % found_version_str) + return ret def harfbuzz_with_freetype_support(context): - ret = context.TryRun(""" + context.Message('Checking for HarfBuzz with freetype support... ') + ret, out = context.TryRun(""" #include "harfbuzz/hb-ft.h" #include @@ -1078,11 +1147,8 @@ int main() } """, '.cpp') - context.Message('Checking for HarfBuzz with freetype support\n') - context.Result(ret[0]) - if ret[0]: - return True - return False + context.Result(ret) + return ret def boost_regex_has_icu(context): if env['RUNTIME_LINK'] == 'static': @@ -1091,7 +1157,8 @@ def boost_regex_has_icu(context): if lib_name in context.env['LIBS']: context.env['LIBS'].remove(lib_name) context.env.Append(LIBS=lib_name) - ret = context.TryRun(""" + context.Message('Checking if boost_regex was built with ICU unicode support... ') + ret, out = context.TryRun(""" #include #include @@ -1111,11 +1178,8 @@ int main() } """, '.cpp') - context.Message('Checking if boost_regex was built with ICU unicode support... ') - context.Result(ret[0]) - if ret[0]: - return True - return False + context.Result(ret) + return ret def sqlite_has_rtree(context, silent=False): """ check an sqlite3 install has rtree support. @@ -1124,7 +1188,9 @@ def sqlite_has_rtree(context, silent=False): http://www.sqlite.org/c3ref/compileoption_get.html """ - ret = context.TryRun(""" + if not silent: + context.Message('Checking if SQLite supports RTREE... ') + ret, out = context.TryRun(""" #include #include @@ -1156,17 +1222,15 @@ int main() } """, '.c') - if not silent: - context.Message('Checking if SQLite supports RTREE... ') if silent: context.did_show_result=1 - context.Result(ret[0]) - if ret[0]: - return True - return False + context.Result(ret) + return ret def supports_cxx14(context,silent=False): - ret = context.TryRun(""" + if not silent: + context.Message('Checking if compiler (%s) supports -std=c++14 flag... ' % context.env.get('CXX','CXX')) + ret, out = context.TryRun(""" int main() { @@ -1178,14 +1242,10 @@ int main() } """, '.cpp') - if not silent: - context.Message('Checking if compiler (%s) supports -std=c++14 flag... ' % context.env.get('CXX','CXX')) if silent: context.did_show_result=1 - context.Result(ret[0]) - if ret[0]: - return True - return False + context.Result(ret) + return ret @@ -1205,8 +1265,7 @@ conf_tests = { 'prioritize_paths' : prioritize_paths, 'parse_pg_config' : parse_pg_config, 'ogr_enabled' : ogr_enabled, 'get_pkg_lib' : get_pkg_lib, - 'rollback_option' : rollback_option, - 'icu_at_least_four_two' : icu_at_least_four_two, + 'icu_at_least' : icu_at_least, 'harfbuzz_version' : harfbuzz_version, 'harfbuzz_with_freetype_support': harfbuzz_with_freetype_support, 'boost_regex_has_icu' : boost_regex_has_icu, @@ -1274,11 +1333,11 @@ if not preconfigured: env['PLATFORM'] = platform.uname()[0] color_print(4,"Configuring on %s in *%s*..." % (env['PLATFORM'],mode)) - cxx_version = call("%s --version" % env["CXX"] ,silent=True) - if cxx_version: - color_print(5, "CXX %s" % cxx_version.decode("utf8")) + ret, cxx_version = config_command(env['CXX'], '--version') + if ret: + color_print(5, "C++ compiler: %s" % cxx_version) else: - color_print(5, "Could not detect CXX compiler") + color_print(5, "Could not detect C++ compiler") env['MISSING_DEPS'] = [] env['SKIPPED_DEPS'] = [] @@ -1528,7 +1587,7 @@ if not preconfigured: else: if libname == env['ICU_LIB_NAME']: if env['ICU_LIB_NAME'] not in env['MISSING_DEPS']: - if not conf.icu_at_least_four_two(): + if not conf.icu_at_least("4.0"): # expression_string.cpp and map.cpp use fromUTF* function only available in >= ICU 4.2 env['MISSING_DEPS'].append(env['ICU_LIB_NAME']) elif libname == 'harfbuzz': @@ -1597,8 +1656,8 @@ if not preconfigured: # around. See https://svn.boost.org/trac/boost/ticket/6779 for more # details. if not env['HOST']: - boost_version = [int(x) for x in env.get('BOOST_LIB_VERSION_FROM_HEADER').split('_')] if not conf.CheckBoostScopedEnum(): + boost_version = [int(x) for x in env.get('BOOST_LIB_VERSION_FROM_HEADER').split('_') if x] if boost_version < [1, 51]: env.Append(CXXFLAGS = '-DBOOST_NO_SCOPED_ENUMS') elif boost_version < [1, 57]: diff --git a/benchmark/build.py b/benchmark/build.py index 37ba86707..b08724d8d 100644 --- a/benchmark/build.py +++ b/benchmark/build.py @@ -18,40 +18,19 @@ test_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES']) if test_env['HAS_CAIRO']: test_env.PrependUnique(CPPPATH=test_env['CAIRO_CPPPATHS']) test_env.Append(CPPDEFINES = '-DHAVE_CAIRO') +test_env.PrependUnique(CPPPATH='include', delete_existing=True) test_env['LINKFLAGS'] = copy(test_env['LIBMAPNIK_LINKFLAGS']) if env['PLATFORM'] == 'Darwin': test_env.Append(LINKFLAGS='-F/ -framework CoreFoundation') test_env_local = test_env.Clone() -#benchmarks = glob.glob('test*cpp') -benchmarks = [ - #"test_array_allocation.cpp", - #"test_png_encoding1.cpp", - #"test_png_encoding2.cpp", - #"test_to_string1.cpp", - #"test_to_string2.cpp", - #"test_to_bool.cpp", - #"test_to_double.cpp", - #"test_to_int.cpp", - #"test_utf_encoding.cpp" - "test_polygon_clipping.cpp", - #"test_polygon_clipping_rendering.cpp", - "test_proj_transform1.cpp", - "test_expression_parse.cpp", - "test_face_ptr_creation.cpp", - "test_font_registration.cpp", - "test_rendering.cpp", - "test_rendering_shared_map.cpp", - "test_offset_converter.cpp", - "test_marker_cache.cpp", - "test_quad_tree.cpp", - "test_noop_rendering.cpp", - "test_getline.cpp", -# "test_numeric_cast_vs_static_cast.cpp", -] -for cpp_test in benchmarks: - test_program = test_env_local.Program('out/'+cpp_test.replace('.cpp',''), source=[cpp_test]) +benchmarks = glob.glob("src/*.cpp") + +for src in benchmarks: + name, ext = os.path.splitext(os.path.basename(src)) + out = os.path.join("out", name) + test_program = test_env_local.Program(out, source=[src]) if 'install' in COMMAND_LINE_TARGETS: env.Alias('install',test_program) #Depends(test_program, env.subst('../src/%s' % env['MAPNIK_LIB_NAME'])) diff --git a/benchmark/bench_framework.hpp b/benchmark/include/bench_framework.hpp similarity index 94% rename from benchmark/bench_framework.hpp rename to benchmark/include/bench_framework.hpp index 32639ed85..df2a9e57b 100644 --- a/benchmark/bench_framework.hpp +++ b/benchmark/include/bench_framework.hpp @@ -12,6 +12,7 @@ #include #include // log10, round #include // snprintf +#include #include #include #include @@ -239,14 +240,19 @@ int run(T const& test_runner, std::string const& name) big_number_fmt itersf(4, total_iters); big_number_fmt ips(5, total_iters / seconds(elapsed_nonzero).count()); + std::clog << std::left << std::setw(43) << name; + std::clog << std::resetiosflags(std::ios::adjustfield); + if (num_threads > 0) { + std::clog << ' ' << std::setw(3) << num_threads + << " worker" << (num_threads > 1 ? "s" : " "); + } + else { + std::clog << " main thread"; + } std::snprintf(msg, sizeof(msg), - "%-43s %3zu thread(s) %*.0f%s iters %6.0f milliseconds %*.0f%s i/s\n", - name.c_str(), - num_threads, - itersf.w, itersf.v, itersf.u, - dur_total, - ips.w, ips.v, ips.u - ); + " %*.0f%s iters %6.0f milliseconds %*.0f%s i/t/s\n", + itersf.w, itersf.v, itersf.u, dur_total, + ips.w, ips.v, ips.u); std::clog << msg; return 0; } diff --git a/benchmark/compare_images.hpp b/benchmark/include/compare_images.hpp similarity index 100% rename from benchmark/compare_images.hpp rename to benchmark/include/compare_images.hpp diff --git a/benchmark/run b/benchmark/run index b296fc8ce..a750471e3 100755 --- a/benchmark/run +++ b/benchmark/run @@ -10,7 +10,7 @@ function run { local threads="$2" local iters="$3" shift 3 - $runner --threads 1 --iterations $iters "$@" + $runner --threads 0 --iterations $iters "$@" if test $threads -gt 0; then $runner --threads $threads --iterations $((iters/threads)) "$@" fi @@ -28,6 +28,7 @@ run test_expression_parse 10 10000 run test_face_ptr_creation 10 1000 run test_font_registration 10 100 run test_offset_converter 10 1000 +#run normalize_angle 0 1000000 --min-duration=0.2 # commented since this is really slow on travis : ' diff --git a/benchmark/src/normalize_angle.cpp b/benchmark/src/normalize_angle.cpp new file mode 100644 index 000000000..bc137a95f --- /dev/null +++ b/benchmark/src/normalize_angle.cpp @@ -0,0 +1,69 @@ +#include "bench_framework.hpp" + +#include + +template +struct bench_func : benchmark::test_case +{ + T (* const func_)(T); + T const value_; + + bench_func(mapnik::parameters const& params, T (*func)(T), T value) + : test_case(params), func_(func), value_(value) {} + + bool validate() const { return true; } + + bool operator() () const + { + for (auto i = this->iterations_; i-- > 0; ) + { + func_(value_); + } + return true; + } +}; + +#define BENCH_FUNC1(func, value) \ + run>(#func "(" #value ")", func, value) + +int main(int argc, char** argv) +{ + return benchmark::sequencer(argc, argv) + .BENCH_FUNC1(mapnik::util::normalize_angle, +3) + .BENCH_FUNC1(mapnik::util::normalize_angle, +6) + .BENCH_FUNC1(mapnik::util::normalize_angle, +9) + .BENCH_FUNC1(mapnik::util::normalize_angle, +12) + .BENCH_FUNC1(mapnik::util::normalize_angle, +15) + .BENCH_FUNC1(mapnik::util::normalize_angle, +20) + .BENCH_FUNC1(mapnik::util::normalize_angle, +30) + .BENCH_FUNC1(mapnik::util::normalize_angle, +40) + .BENCH_FUNC1(mapnik::util::normalize_angle, +50) + .BENCH_FUNC1(mapnik::util::normalize_angle, +70) + .BENCH_FUNC1(mapnik::util::normalize_angle, +90) + .BENCH_FUNC1(mapnik::util::normalize_angle, +110) + .BENCH_FUNC1(mapnik::util::normalize_angle, +130) + .BENCH_FUNC1(mapnik::util::normalize_angle, +157) + .BENCH_FUNC1(mapnik::util::normalize_angle, +209) + .BENCH_FUNC1(mapnik::util::normalize_angle, +314) + .BENCH_FUNC1(mapnik::util::normalize_angle, +628) + .BENCH_FUNC1(mapnik::util::normalize_angle, +942) + .BENCH_FUNC1(mapnik::util::normalize_angle, -3) + .BENCH_FUNC1(mapnik::util::normalize_angle, -6) + .BENCH_FUNC1(mapnik::util::normalize_angle, -9) + .BENCH_FUNC1(mapnik::util::normalize_angle, -12) + .BENCH_FUNC1(mapnik::util::normalize_angle, -15) + .BENCH_FUNC1(mapnik::util::normalize_angle, -20) + .BENCH_FUNC1(mapnik::util::normalize_angle, -30) + .BENCH_FUNC1(mapnik::util::normalize_angle, -40) + .BENCH_FUNC1(mapnik::util::normalize_angle, -50) + .BENCH_FUNC1(mapnik::util::normalize_angle, -70) + .BENCH_FUNC1(mapnik::util::normalize_angle, -90) + .BENCH_FUNC1(mapnik::util::normalize_angle, -110) + .BENCH_FUNC1(mapnik::util::normalize_angle, -130) + .BENCH_FUNC1(mapnik::util::normalize_angle, -157) + .BENCH_FUNC1(mapnik::util::normalize_angle, -209) + .BENCH_FUNC1(mapnik::util::normalize_angle, -314) + .BENCH_FUNC1(mapnik::util::normalize_angle, -628) + .BENCH_FUNC1(mapnik::util::normalize_angle, -942) + .done(); +} diff --git a/benchmark/test_array_allocation.cpp b/benchmark/src/test_array_allocation.cpp similarity index 100% rename from benchmark/test_array_allocation.cpp rename to benchmark/src/test_array_allocation.cpp diff --git a/benchmark/test_expression_parse.cpp b/benchmark/src/test_expression_parse.cpp similarity index 100% rename from benchmark/test_expression_parse.cpp rename to benchmark/src/test_expression_parse.cpp diff --git a/benchmark/test_face_ptr_creation.cpp b/benchmark/src/test_face_ptr_creation.cpp similarity index 100% rename from benchmark/test_face_ptr_creation.cpp rename to benchmark/src/test_face_ptr_creation.cpp diff --git a/benchmark/test_font_registration.cpp b/benchmark/src/test_font_registration.cpp similarity index 100% rename from benchmark/test_font_registration.cpp rename to benchmark/src/test_font_registration.cpp diff --git a/benchmark/test_getline.cpp b/benchmark/src/test_getline.cpp similarity index 100% rename from benchmark/test_getline.cpp rename to benchmark/src/test_getline.cpp diff --git a/benchmark/test_marker_cache.cpp b/benchmark/src/test_marker_cache.cpp similarity index 100% rename from benchmark/test_marker_cache.cpp rename to benchmark/src/test_marker_cache.cpp diff --git a/benchmark/test_noop_rendering.cpp b/benchmark/src/test_noop_rendering.cpp similarity index 100% rename from benchmark/test_noop_rendering.cpp rename to benchmark/src/test_noop_rendering.cpp diff --git a/benchmark/test_numeric_cast_vs_static_cast.cpp b/benchmark/src/test_numeric_cast_vs_static_cast.cpp similarity index 100% rename from benchmark/test_numeric_cast_vs_static_cast.cpp rename to benchmark/src/test_numeric_cast_vs_static_cast.cpp diff --git a/benchmark/test_offset_converter.cpp b/benchmark/src/test_offset_converter.cpp similarity index 100% rename from benchmark/test_offset_converter.cpp rename to benchmark/src/test_offset_converter.cpp diff --git a/benchmark/test_png_encoding1.cpp b/benchmark/src/test_png_encoding1.cpp similarity index 100% rename from benchmark/test_png_encoding1.cpp rename to benchmark/src/test_png_encoding1.cpp diff --git a/benchmark/test_png_encoding2.cpp b/benchmark/src/test_png_encoding2.cpp similarity index 100% rename from benchmark/test_png_encoding2.cpp rename to benchmark/src/test_png_encoding2.cpp diff --git a/benchmark/test_polygon_clipping.cpp b/benchmark/src/test_polygon_clipping.cpp similarity index 100% rename from benchmark/test_polygon_clipping.cpp rename to benchmark/src/test_polygon_clipping.cpp diff --git a/benchmark/test_polygon_clipping_rendering.cpp b/benchmark/src/test_polygon_clipping_rendering.cpp similarity index 100% rename from benchmark/test_polygon_clipping_rendering.cpp rename to benchmark/src/test_polygon_clipping_rendering.cpp diff --git a/benchmark/test_proj_transform1.cpp b/benchmark/src/test_proj_transform1.cpp similarity index 100% rename from benchmark/test_proj_transform1.cpp rename to benchmark/src/test_proj_transform1.cpp diff --git a/benchmark/test_quad_tree.cpp b/benchmark/src/test_quad_tree.cpp similarity index 100% rename from benchmark/test_quad_tree.cpp rename to benchmark/src/test_quad_tree.cpp diff --git a/benchmark/test_rendering.cpp b/benchmark/src/test_rendering.cpp similarity index 100% rename from benchmark/test_rendering.cpp rename to benchmark/src/test_rendering.cpp diff --git a/benchmark/test_rendering_shared_map.cpp b/benchmark/src/test_rendering_shared_map.cpp similarity index 100% rename from benchmark/test_rendering_shared_map.cpp rename to benchmark/src/test_rendering_shared_map.cpp diff --git a/benchmark/test_to_bool.cpp b/benchmark/src/test_to_bool.cpp similarity index 100% rename from benchmark/test_to_bool.cpp rename to benchmark/src/test_to_bool.cpp diff --git a/benchmark/test_to_double.cpp b/benchmark/src/test_to_double.cpp similarity index 100% rename from benchmark/test_to_double.cpp rename to benchmark/src/test_to_double.cpp diff --git a/benchmark/test_to_int.cpp b/benchmark/src/test_to_int.cpp similarity index 100% rename from benchmark/test_to_int.cpp rename to benchmark/src/test_to_int.cpp diff --git a/benchmark/test_to_string1.cpp b/benchmark/src/test_to_string1.cpp similarity index 100% rename from benchmark/test_to_string1.cpp rename to benchmark/src/test_to_string1.cpp diff --git a/benchmark/test_to_string2.cpp b/benchmark/src/test_to_string2.cpp similarity index 100% rename from benchmark/test_to_string2.cpp rename to benchmark/src/test_to_string2.cpp diff --git a/benchmark/test_utf_encoding.cpp b/benchmark/src/test_utf_encoding.cpp similarity index 100% rename from benchmark/test_utf_encoding.cpp rename to benchmark/src/test_utf_encoding.cpp diff --git a/deps/mapbox/geometry b/deps/mapbox/geometry index b0e41cc56..cfcb983f3 160000 --- a/deps/mapbox/geometry +++ b/deps/mapbox/geometry @@ -1 +1 @@ -Subproject commit b0e41cc5635ff8d50e7e1edb73cadf1d2a7ddc83 +Subproject commit cfcb983f3571269653467f0a679bd956366c101e diff --git a/deps/mapbox/protozero b/deps/mapbox/protozero index f5154595f..a44efc34e 160000 --- a/deps/mapbox/protozero +++ b/deps/mapbox/protozero @@ -1 +1 @@ -Subproject commit f5154595f8488dd3016a17d434202e46f2feef25 +Subproject commit a44efc34e5a86e93c06390aa19c89f8e115971f6 diff --git a/deps/mapbox/variant b/deps/mapbox/variant index 859a8c933..256ddd555 160000 --- a/deps/mapbox/variant +++ b/deps/mapbox/variant @@ -1 +1 @@ -Subproject commit 859a8c933a0c2ab18941acb9dcf834799c0de46c +Subproject commit 256ddd55582bb7c06c342315dbacc6a42fee4b34 diff --git a/include/mapnik/expression_grammar_x3_def.hpp b/include/mapnik/expression_grammar_x3_def.hpp index 5f234c1f6..649c1d70b 100644 --- a/include/mapnik/expression_grammar_x3_def.hpp +++ b/include/mapnik/expression_grammar_x3_def.hpp @@ -315,14 +315,14 @@ namespace mapnik { namespace grammar { auto const single_quoted_string = x3::rule {} = lit('\'') >> no_skip[*(unesc_char[append] | - //(lit('\\') > escaped_unicode[append]) // FIXME (!) - //| + (lit('\\') >> escaped_unicode[append]) + | (~char_('\''))[append])] > lit('\''); auto const double_quoted_string = x3::rule {} = lit('"') >> no_skip[*(unesc_char[append] | - (lit('\\') > escaped_unicode[append]) + (lit('\\') >> escaped_unicode[append]) | (~char_('"'))[append])] > lit('"'); diff --git a/include/mapnik/image_view_impl.hpp b/include/mapnik/image_view_impl.hpp index a12c60a0e..e4ed2a57c 100644 --- a/include/mapnik/image_view_impl.hpp +++ b/include/mapnik/image_view_impl.hpp @@ -37,7 +37,7 @@ image_view::image_view(std::size_t x, std::size_t y, std::size_t width, std:: data_(data) { if (x_ >= data_.width() && data_.width() > 0) x_ = data_.width() - 1; - if (y_ >= data_.height() && data.height() > 0) y_ = data_.height() - 1; + if (y_ >= data_.height() && data_.height() > 0) y_ = data_.height() - 1; if (x_ + width_ > data_.width()) width_ = data_.width() - x_; if (y_ + height_ > data_.height()) height_ = data_.height() - y_; } diff --git a/include/mapnik/offset_converter.hpp b/include/mapnik/offset_converter.hpp index a39e209a8..d45ffa788 100644 --- a/include/mapnik/offset_converter.hpp +++ b/include/mapnik/offset_converter.hpp @@ -40,6 +40,8 @@ namespace mapnik { +static constexpr double offset_converter_default_threshold = 5.0; + template struct offset_converter { @@ -48,7 +50,7 @@ struct offset_converter offset_converter(Geometry & geom) : geom_(geom) , offset_(0.0) - , threshold_(5.0) + , threshold_(offset_converter_default_threshold) , half_turn_segments_(16) , status_(initial) , pre_first_(vertex2d::no_init) diff --git a/include/mapnik/util/math.hpp b/include/mapnik/util/math.hpp index a5cbf623d..fd86238a9 100644 --- a/include/mapnik/util/math.hpp +++ b/include/mapnik/util/math.hpp @@ -27,9 +27,11 @@ namespace mapnik { namespace util { +constexpr double pi = 3.1415926535897932384626433832795; +constexpr double tau = 6.283185307179586476925286766559; + MAPNIK_DECL double normalize_angle(double angle); }} #endif - diff --git a/include/mapnik/version.hpp b/include/mapnik/version.hpp index bfeb18e2a..63a297b7e 100644 --- a/include/mapnik/version.hpp +++ b/include/mapnik/version.hpp @@ -29,10 +29,18 @@ #define MAPNIK_MINOR_VERSION 1 #define MAPNIK_PATCH_VERSION 0 -#define MAPNIK_VERSION (MAPNIK_MAJOR_VERSION*100000) + (MAPNIK_MINOR_VERSION*100) + (MAPNIK_PATCH_VERSION) +#define MAPNIK_VERSION MAPNIK_MAKE_VERSION(MAPNIK_MAJOR_VERSION, \ + MAPNIK_MINOR_VERSION, \ + MAPNIK_PATCH_VERSION) #define MAPNIK_VERSION_STRING MAPNIK_STRINGIFY(MAPNIK_MAJOR_VERSION) "." \ MAPNIK_STRINGIFY(MAPNIK_MINOR_VERSION) "." \ MAPNIK_STRINGIFY(MAPNIK_PATCH_VERSION) +#define MAPNIK_VERSION_AT_LEAST(major, minor, patch) \ + (MAPNIK_VERSION >= MAPNIK_MAKE_VERSION(major, minor, patch)) + +#define MAPNIK_MAKE_VERSION(major, minor, patch) \ + ((major) * 100000 + (minor) * 100 + (patch)) + #endif // MAPNIK_VERSION_HPP diff --git a/plugins/input/gdal/gdal_featureset.cpp b/plugins/input/gdal/gdal_featureset.cpp index 7ec336f55..ef14f4bd7 100644 --- a/plugins/input/gdal/gdal_featureset.cpp +++ b/plugins/input/gdal/gdal_featureset.cpp @@ -124,6 +124,33 @@ feature_ptr gdal_featureset::next() return feature_ptr(); } +void gdal_featureset::find_best_overview(int bandNumber, + int ideal_width, + int ideal_height, + int & current_width, + int & current_height) const +{ + GDALRasterBand * band = dataset_.GetRasterBand(bandNumber); + int band_overviews = band->GetOverviewCount(); + if (band_overviews > 0) + { + for (int b = 0; b < band_overviews; b++) + { + GDALRasterBand * overview = band->GetOverview(b); + int overview_width = overview->GetXSize(); + int overview_height = overview->GetYSize(); + if ((overview_width < current_width || + overview_height < current_height) && + ideal_width <= overview_width && + ideal_height <= overview_height) + { + current_width = overview_width; + current_height = overview_height; + } + } + } +} + feature_ptr gdal_featureset::get_feature(mapnik::query const& q) { feature_ptr feature = feature_factory::create(ctx_,1); @@ -206,77 +233,55 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) int im_width = width; double im_offset_x = x_off; double im_offset_y = y_off; - int current_width = (int)raster_width_; - int current_height = (int)raster_height_; + int current_width = static_cast(raster_width_); + int current_height = static_cast(raster_height_); + + // loop through overviews -- snap up in resolution to closest overview + // if necessary we find an image size that most resembles + // the resolution of our output image. + const double width_res = std::get<0>(q.resolution()); + const double height_res = std::get<1>(q.resolution()); + const int ideal_raster_width = static_cast( + std::floor(raster_extent_.width() * + width_res * filter_factor) + .5); + const int ideal_raster_height = static_cast( + std::floor(raster_extent_.height() * + height_res * filter_factor) + .5); - // loop through overviews -- snap up in resolution to closest overview if necessary - // we find an image size that most resembles the resolution of our output image. - double width_res = std::get<0>(q.resolution()); - double height_res = std::get<1>(q.resolution()); - int res_adjusted_raster_width = static_cast(std::floor(((double)raster_width_ * width_res) + .5)); - int res_adjusted_raster_height = static_cast(std::floor(((double)raster_height_ * height_res) + .5)); if (band_ > 0 && band_ < nbands_) { - GDALRasterBand * band = dataset_.GetRasterBand(band_); - int band_overviews = band->GetOverviewCount(); - if (band_overviews > 0) - { - for (int b = 0; b < band_overviews; b++) - { - GDALRasterBand * overview = band->GetOverview(b); - int overview_width = overview->GetXSize(); - int overview_height = overview->GetYSize(); - if ((overview_width < current_width || overview_height < current_height) && - res_adjusted_raster_width <= overview_width && - res_adjusted_raster_height <= overview_height) - { - current_width = overview_width; - current_height = overview_height; - } - } - } + find_best_overview(band_, + ideal_raster_width, + ideal_raster_height, + current_width, + current_height); } else { for (int i = 0; i < nbands_; ++i) { - GDALRasterBand * band = dataset_.GetRasterBand(i + 1); - int band_overviews = band->GetOverviewCount(); - if (band_overviews > 0) - { - for (int b = 0; b < band_overviews; b++) - { - GDALRasterBand * overview = band->GetOverview(b); - int overview_width = overview->GetXSize(); - int overview_height = overview->GetYSize(); - if ((overview_width < current_width || overview_height < current_height) && - res_adjusted_raster_width <= overview_width && - res_adjusted_raster_height <= overview_height) - { - current_width = overview_width; - current_height = overview_height; - } - } - } + find_best_overview(i + 1, + ideal_raster_width, + ideal_raster_height, + current_width, + current_height); } } - if (current_width != (int)raster_width_ || current_height != (int)raster_height_) + + if (current_width != (int)raster_width_ || + current_height != (int)raster_height_) { if (current_width != (int)raster_width_) { double ratio = (double)current_width / (double)raster_width_; - int adjusted_width = static_cast(std::floor((ratio * im_width) + 0.5)); - double adjusted_ratio = (double)adjusted_width / (double)im_width; - im_offset_x = adjusted_ratio * im_offset_x; - im_width = adjusted_width; + im_offset_x = std::floor(ratio * im_offset_x); + im_width = static_cast(std::ceil(ratio * im_width)); } if (current_height != (int)raster_height_) { double ratio = (double)current_height / (double)raster_height_; - int adjusted_height = static_cast(std::floor((ratio * im_height) + 0.5)); - double adjusted_ratio = (double)adjusted_height / (double)im_height; - im_offset_y = adjusted_ratio * im_offset_y; - im_height = adjusted_height; + im_offset_y = std::floor(ratio * im_offset_y); + im_height = static_cast(std::ceil(ratio * im_height)); } } diff --git a/plugins/input/gdal/gdal_featureset.hpp b/plugins/input/gdal/gdal_featureset.hpp index 325c6a999..8ca1bae56 100644 --- a/plugins/input/gdal/gdal_featureset.hpp +++ b/plugins/input/gdal/gdal_featureset.hpp @@ -72,6 +72,12 @@ public: mapnik::feature_ptr next(); private: + void find_best_overview(int bandNumber, + int ideal_width, + int ideal_height, + int & current_width, + int & current_height) const; + mapnik::feature_ptr get_feature(mapnik::query const& q); mapnik::feature_ptr get_feature_at_point(mapnik::coord2d const& p); GDALDataset & dataset_; diff --git a/plugins/input/pgraster/pgraster_datasource.cpp b/plugins/input/pgraster/pgraster_datasource.cpp index d6c9a5e3b..f3191e8e4 100644 --- a/plugins/input/pgraster/pgraster_datasource.cpp +++ b/plugins/input/pgraster/pgraster_datasource.cpp @@ -172,7 +172,7 @@ pgraster_datasource::pgraster_datasource(parameters const& params) (raster_table_, parsed_schema_, parsed_table_); } - // If we do not know either the geometry_field or the srid or we + // If we do not know either the raster_field or the srid or we // want to use overviews but do not know about schema, or // no extent was specified, then attempt to fetch the missing // information from a raster_columns entry. @@ -180,7 +180,7 @@ pgraster_datasource::pgraster_datasource(parameters const& params) // This will return no records if we are querying a bogus table returned // from the simplistic table parsing in table_from_sql() or if // the table parameter references a table, view, or subselect not - // registered in the geometry columns. + // registered in the raster_columns. // geometryColumn_ = mapnik::sql_utils::unquote_copy('"', raster_field_); if (!parsed_table_.empty() && ( @@ -265,7 +265,7 @@ pgraster_datasource::pgraster_datasource(parameters const& params) // If we still do not know the srid then we can try to fetch // it from the 'table_' parameter, which should work even if it is - // a subselect as long as we know the geometry_field to query + // a subselect as long as we know the raster_field to query if (! geometryColumn_.empty() && srid_ <= 0) { s.str(""); @@ -443,7 +443,7 @@ pgraster_datasource::pgraster_datasource(parameters const& params) MAPNIK_LOG_DEBUG(pgraster) << "pgraster_datasource: Table " << table_ << " is using SRID=" << srid_; } - // At this point the geometry_field may still not be known + // At this point the raster_field may still not be known // but we'll catch that where more useful... MAPNIK_LOG_DEBUG(pgraster) << "pgraster_datasource: Using SRID=" << srid_; MAPNIK_LOG_DEBUG(pgraster) << "pgraster_datasource: Using geometry_column=" << geometryColumn_; @@ -835,7 +835,7 @@ featureset_ptr pgraster_datasource::features_with_context(query const& q,process s_error << parsed_schema_ << "."; } s_error << parsed_table_ - << "'. Please manually provide the 'geometry_field' parameter or add an entry " + << "'. Please manually provide the 'raster_field' parameter or add an entry " << "in the geometry_columns for '"; if (!parsed_schema_.empty()) @@ -998,7 +998,7 @@ featureset_ptr pgraster_datasource::features_at_point(coord2d const& pt, double s_error << parsed_schema_ << "."; } s_error << parsed_table_ - << "'. Please manually provide the 'geometry_field' parameter or add an entry " + << "'. Please manually provide the 'raster_field' parameter or add an entry " << "in the geometry_columns for '"; if (!parsed_schema_.empty()) diff --git a/scripts/markdown-hyperlinks.pl b/scripts/markdown-hyperlinks.pl new file mode 100755 index 000000000..9e6e1361f --- /dev/null +++ b/scripts/markdown-hyperlinks.pl @@ -0,0 +1,56 @@ +#! /usr/bin/env perl +# +# Re-generate hyperlinks in place: +# +# perl -i scripts/markdown-hyperlinks.pl CHANGELOG.md +# +# Generate to another file: +# +# scripts/markdown-hyperlinks.pl CHANGELOG.md > CHANGELOG-autolink.md + +use strict; +use warnings; + +my $user = qr/ [a-zA-Z] [a-zA-Z0-9]* /x; +my $repo = qr/ [a-zA-Z] [a-zA-Z0-9.-]* /x; + +while (<>) { + + # make links from @username references + # (except when escaped like \@foobar or in code like `where !@barman! = 'Moe'`) + s"(?: (`++) .*? \g{-1} (*SKIP) (*FAIL) )? # skip over code spans + (? clip_box = clipping_extent(common_); if (clip) { - double padding = (double)(common_.query_extent_.width() / common_.width_); - if (half_stroke > 1) - padding *= half_stroke; - if (std::fabs(offset) > 0) - padding *= std::fabs(offset) * 1.2; - padding *= common_.scale_factor_; + double pad_per_pixel = static_cast(common_.query_extent_.width()/common_.width_); + double pixels = std::ceil(std::max(width / 2.0 + std::fabs(offset), + (std::fabs(offset) * offset_converter_default_threshold))); + double padding = pad_per_pixel * pixels * common_.scale_factor_; + clip_box.pad(padding); } using vertex_converter_type = vertex_converter::process(line_symbolizer const& sym, line_rasterizer_enum rasterizer_e = get(sym, feature, common_.vars_); if (clip) { - double padding = static_cast(common_.query_extent_.width() / common_.width_); - double half_stroke = 0.5 * width; - if (half_stroke > 1) - { - padding *= half_stroke; - } - if (std::fabs(offset) > 0) - { - padding *= std::fabs(offset) * 1.2; - } + double pad_per_pixel = static_cast(common_.query_extent_.width()/common_.width_); + double pixels = std::ceil(std::max(width / 2.0 + std::fabs(offset), + (std::fabs(offset) * offset_converter_default_threshold))); + double padding = pad_per_pixel * pixels * common_.scale_factor_; - padding *= common_.scale_factor_; clip_box.pad(padding); - // debugging - //box2d inverse = query_extent_; - //inverse.pad(-padding); - //draw_geo_extent(inverse,mapnik::color("red")); } if (rasterizer_e == RASTERIZER_FAST) diff --git a/src/cairo/process_line_pattern_symbolizer.cpp b/src/cairo/process_line_pattern_symbolizer.cpp index 3a05d7c82..a55e22c19 100644 --- a/src/cairo/process_line_pattern_symbolizer.cpp +++ b/src/cairo/process_line_pattern_symbolizer.cpp @@ -133,13 +133,11 @@ void cairo_renderer::process(line_pattern_symbolizer const& sym, box2d clipping_extent = common_.query_extent_; if (clip) { - double padding = (double)(common_.query_extent_.width()/common_.width_); - double half_stroke = width/2.0; - if (half_stroke > 1) - padding *= half_stroke; - if (std::fabs(offset) > 0) - padding *= std::fabs(offset) * 1.2; - padding *= common_.scale_factor_; + double pad_per_pixel = static_cast(common_.query_extent_.width()/common_.width_); + double pixels = std::ceil(std::max(width / 2.0 + std::fabs(offset), + (std::fabs(offset) * offset_converter_default_threshold))); + double padding = pad_per_pixel * pixels * common_.scale_factor_; + clipping_extent.pad(padding); } diff --git a/src/cairo/process_line_symbolizer.cpp b/src/cairo/process_line_symbolizer.cpp index 5d715c3d7..141d33ae4 100644 --- a/src/cairo/process_line_symbolizer.cpp +++ b/src/cairo/process_line_symbolizer.cpp @@ -73,13 +73,11 @@ void cairo_renderer::process(line_symbolizer const& sym, box2d clipping_extent = common_.query_extent_; if (clip) { - double padding = (double)(common_.query_extent_.width()/common_.width_); - double half_stroke = width/2.0; - if (half_stroke > 1) - padding *= half_stroke; - if (std::fabs(offset) > 0) - padding *= std::fabs(offset) * 1.2; - padding *= common_.scale_factor_; + double pad_per_pixel = static_cast(common_.query_extent_.width()/common_.width_); + double pixels = std::ceil(std::max(width / 2.0 + std::fabs(offset), + (std::fabs(offset) * offset_converter_default_threshold))); + double padding = pad_per_pixel * pixels * common_.scale_factor_; + clipping_extent.pad(padding); } using vertex_converter_type = vertex_converter::process(line_pattern_symbolizer const& sym, box2d clipping_extent = common_.query_extent_; if (clip) { - double padding = (double)(common_.query_extent_.width()/pixmap_.width()); - double half_stroke = stroke_width/2.0; - if (half_stroke > 1) - padding *= half_stroke; - if (std::fabs(offset) > 0) - padding *= std::fabs(offset) * 1.2; - padding *= common_.scale_factor_; + double pad_per_pixel = static_cast(common_.query_extent_.width()/common_.width_); + double pixels = std::ceil(std::max(stroke_width / 2.0 + std::fabs(offset), + (std::fabs(offset) * offset_converter_default_threshold))); + double padding = pad_per_pixel * pixels * common_.scale_factor_; + clipping_extent.pad(padding); } diff --git a/src/grid/process_line_symbolizer.cpp b/src/grid/process_line_symbolizer.cpp index b45b70c92..ccfb15bd3 100644 --- a/src/grid/process_line_symbolizer.cpp +++ b/src/grid/process_line_symbolizer.cpp @@ -84,13 +84,11 @@ void grid_renderer::process(line_symbolizer const& sym, if (clip) { - double padding = (double)(common_.query_extent_.width()/pixmap_.width()); - double half_stroke = width/2.0; - if (half_stroke > 1) - padding *= half_stroke; - if (std::fabs(offset) > 0) - padding *= std::fabs(offset) * 1.2; - padding *= common_.scale_factor_; + double pad_per_pixel = static_cast(common_.query_extent_.width()/common_.width_); + double pixels = std::ceil(std::max(width / 2.0 + std::fabs(offset), + (std::fabs(offset) * offset_converter_default_threshold))); + double padding = pad_per_pixel * pixels * common_.scale_factor_; + clipping_extent.pad(padding); } using vertex_converter_type = vertex_converter MAPNIK_VERSION) + if (!MAPNIK_VERSION_AT_LEAST(n[0], n[1], n[2])) { throw config_error(std::string("This map uses features only present in Mapnik version ") + *min_version_string + " and newer"); } - } - } } catch (config_error const& ex) @@ -545,11 +542,25 @@ void map_parser::parse_style(Map & map, xml_node const& node) if (!map.insert_style(name, std::move(style))) { - if (map.find_style(name)) + boost::optional dupe = map.find_style(name); + if (strict_) { - throw config_error("duplicate style name"); + if (dupe) + { + throw config_error("duplicate style name"); + } + throw config_error("failed to insert style to the map"); + } + else + { + std::string s_err("failed to insert style '"); + s_err += name + "' to the map"; + if (dupe) + { + s_err += " since it was already added"; + } + MAPNIK_LOG_ERROR(load_map) << "map_parser: " << s_err; } - throw config_error("failed to insert style to the map"); } } catch (config_error const& ex) diff --git a/src/math.cpp b/src/math.cpp index 681b5fe00..cbf090ae3 100644 --- a/src/math.cpp +++ b/src/math.cpp @@ -22,7 +22,6 @@ // mapnik #include -#include // stl #include @@ -33,13 +32,26 @@ namespace util { double normalize_angle(double angle) { - while (angle >= M_PI) + if (angle > pi) { - angle -= 2.0 * M_PI; + if (angle > 16 * tau) + { + // the angle is too large; better compute the remainder + // directly to avoid subtracting circles ad infinitum + return std::remainder(angle, tau); + } + // std::remainder would take longer than a few subtractions + while ((angle -= tau) > pi) + ; } - while (angle < -M_PI) + else if (angle < -pi) { - angle += 2.0 * M_PI; + if (angle < -16 * tau) + { + return std::remainder(angle, tau); + } + while ((angle += tau) < -pi) + ; } return angle; } diff --git a/src/proj_transform.cpp b/src/proj_transform.cpp index 30087a4b0..8e7719127 100644 --- a/src/proj_transform.cpp +++ b/src/proj_transform.cpp @@ -21,13 +21,17 @@ *****************************************************************************/ // mapnik -#include +#include #include +#include #include #include #include #include +// boost +#include + #ifdef MAPNIK_USE_PROJ4 // proj4 #include @@ -39,6 +43,56 @@ namespace mapnik { +namespace { // (local) + +// Returns points in clockwise order. This allows us to do anti-meridian checks. +template +auto envelope_points(box2d const& env, std::size_t num_points) + -> geometry::multi_point +{ + auto width = env.width(); + auto height = env.height(); + + geometry::multi_point coords; + coords.reserve(num_points); + + // top side: left >>> right + // gets extra point if (num_points % 4 >= 1) + for (std::size_t i = 0, n = (num_points + 3) / 4; i < n; ++i) + { + auto x = env.minx() + (i * width) / n; + coords.emplace_back(x, env.maxy()); + } + + // right side: top >>> bottom + // gets extra point if (num_points % 4 >= 3) + for (std::size_t i = 0, n = (num_points + 1) / 4; i < n; ++i) + { + auto y = env.maxy() - (i * height) / n; + coords.emplace_back(env.maxx(), y); + } + + // bottom side: right >>> left + // gets extra point if (num_points % 4 >= 2) + for (std::size_t i = 0, n = (num_points + 2) / 4; i < n; ++i) + { + auto x = env.maxx() - (i * width) / n; + coords.emplace_back(x, env.miny()); + } + + // left side: bottom >>> top + // never gets extra point + for (std::size_t i = 0, n = (num_points + 0) / 4; i < n; ++i) + { + auto y = env.miny() + (i * height) / n; + coords.emplace_back(env.minx(), y); + } + + return coords; +} + +} // namespace mapnik::(local) + proj_transform::proj_transform(projection const& source, projection const& dest) : source_(source), @@ -334,49 +388,6 @@ bool proj_transform::backward (box2d & box) const return true; } -// Returns points in clockwise order. This allows us to do anti-meridian checks. -void envelope_points(std::vector< coord > & coords, box2d& env, int points) -{ - double width = env.width(); - double height = env.height(); - - int steps; - - if (points <= 4) { - steps = 0; - } else { - steps = static_cast(std::ceil((points - 4) / 4.0)); - } - - steps += 1; - double xstep = width / steps; - double ystep = height / steps; - - coords.resize(points); - for (int i=0; iright - coords[i] = coord(env.minx() + i * xstep, env.maxy()); - // right: top>bottom - coords[i + steps] = coord(env.maxx(), env.maxy() - i * ystep); - // bottom: right>left - coords[i + steps * 2] = coord(env.maxx() - i * xstep, env.miny()); - // left: bottom>top - coords[i + steps * 3] = coord(env.minx(), env.miny() + i * ystep); - } -} - -box2d calculate_bbox(std::vector > & points) { - std::vector >::iterator it = points.begin(); - std::vector >::iterator it_end = points.end(); - - box2d env(*it, *(++it)); - for (; it!=it_end; ++it) { - env.expand_to_include(*it); - } - return env; -} - - // More robust, but expensive, bbox transform // in the face of proj4 out of bounds conditions. // Can result in 20 -> 10 r/s performance hit. @@ -393,18 +404,18 @@ bool proj_transform::backward(box2d& env, int points) const return backward(env); } - std::vector > coords; - envelope_points(coords, env, points); // this is always clockwise + auto coords = envelope_points(env, points); // this is always clockwise - double z; - for (std::vector >::iterator it = coords.begin(); it!=coords.end(); ++it) { - z = 0; - if (!backward(it->x, it->y, z)) { + for (auto & p : coords) + { + double z = 0; + if (!backward(p.x, p.y, z)) return false; - } } - box2d result = calculate_bbox(coords); + box2d result; + boost::geometry::envelope(coords, result); + if (is_source_longlat_ && !util::is_clockwise(coords)) { // we've gone to a geographic CS, and our clockwise envelope has @@ -432,18 +443,17 @@ bool proj_transform::forward(box2d& env, int points) const return forward(env); } - std::vector > coords; - envelope_points(coords, env, points); // this is always clockwise + auto coords = envelope_points(env, points); // this is always clockwise - double z; - for (std::vector >::iterator it = coords.begin(); it!=coords.end(); ++it) { - z = 0; - if (!forward(it->x, it->y, z)) { + for (auto & p : coords) + { + double z = 0; + if (!forward(p.x, p.y, z)) return false; - } } - box2d result = calculate_bbox(coords); + box2d result; + boost::geometry::envelope(coords, result); if (is_dest_longlat_ && !util::is_clockwise(coords)) { diff --git a/test/data-visual b/test/data-visual index c113ce132..23034ae27 160000 --- a/test/data-visual +++ b/test/data-visual @@ -1 +1 @@ -Subproject commit c113ce13267124332cc2ecd049d7d2d7397f9a51 +Subproject commit 23034ae27fb0b00d202688865268a80d05065fcc diff --git a/test/standalone/map_xml_test.cpp b/test/standalone/map_xml_test.cpp index d6bc6aac1..b33a3f718 100644 --- a/test/standalone/map_xml_test.cpp +++ b/test/standalone/map_xml_test.cpp @@ -156,6 +156,17 @@ TEST_CASE("map xml I/O") { } } // END SECTION + SECTION("duplicate styles only throw in strict mode") { + std::string duplicate_stylename("test/data/broken_maps/duplicate_stylename.xml"); + CAPTURE(duplicate_stylename); + mapnik::Map m(256, 256); + REQUIRE(m.register_fonts("fonts", true)); + REQUIRE_NOTHROW(mapnik::load_map(m, duplicate_stylename, false)); + mapnik::Map m2(256, 256); + REQUIRE(m2.register_fonts("fonts", true)); + REQUIRE_THROWS(mapnik::load_map(m2, duplicate_stylename, true)); + } // END SECTION + SECTION("broken maps") { std::vector broken_maps; add_xml_files("test/data/broken_maps", broken_maps); diff --git a/test/unit/core/expressions_test.cpp b/test/unit/core/expressions_test.cpp index a01c5bdea..2f9e3823f 100644 --- a/test/unit/core/expressions_test.cpp +++ b/test/unit/core/expressions_test.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include namespace { @@ -57,7 +57,7 @@ std::string parse_and_dump(std::string const& str) TEST_CASE("expressions") { using namespace std::placeholders; - using properties_type = std::vector > ; + using properties_type = std::map; mapnik::transcoder tr("utf8"); properties_type prop = {{ "foo" , tr.transcode("bar") }, @@ -65,6 +65,7 @@ TEST_CASE("expressions") { "grass" , tr.transcode("grow")}, { "wind" , tr.transcode("blow")}, { "sky" , tr.transcode("is blue")}, + { "τ" , mapnik::value_double(6.2831853)}, { "double", mapnik::value_double(1.23456)}, { "int" , mapnik::value_integer(123)}, { "bool" , mapnik::value_bool(true)}, @@ -74,8 +75,6 @@ TEST_CASE("expressions") auto eval = std::bind(evaluate_string, feature, _1); auto approx = Approx::custom().epsilon(1e-6); - TRY_CHECK(eval(" [foo]='bar' ") == true); - // primary expressions // null TRY_CHECK(parse_and_dump("null") == "null"); @@ -98,6 +97,17 @@ TEST_CASE("expressions") TRY_CHECK(parse_and_dump("deg_to_rad") == "0.0174533"); TRY_CHECK(parse_and_dump("rad_to_deg") == "57.2958"); + // ascii attribute name + TRY_CHECK(eval(" [foo]='bar' ") == true); + + // unicode attribute name + TRY_CHECK(eval("[τ]") == prop.at("τ")); + TRY_CHECK(eval("[τ]") == eval(u8"[\u03C4]")); + + // change to TRY_CHECK once \u1234 escape sequence in attribute name + // is implemented in expression grammar + CHECK_NOFAIL(eval("[τ]") == eval("[\\u03C3]")); + // unary functions // sin / cos TRY_CHECK(eval(" sin(0.25 * pi) / cos(0.25 * pi) ").to_double() == approx(1.0)); @@ -174,7 +184,8 @@ TEST_CASE("expressions") // regex // replace - TRY_CHECK(eval(" [foo].replace('(\\B)|( )','$1 ') ") == tr.transcode("b a r")); + TRY_CHECK(eval(" [foo].replace('(\\B)|( )','$1 ') ") == tr.transcode("b a r")); // single quotes + TRY_CHECK(eval(" [foo].replace(\"(\\B)|( )\",\"$1 \") ") == tr.transcode("b a r")); // double quotes // https://en.wikipedia.org/wiki/Chess_symbols_in_Unicode //'\u265C\u265E\u265D\u265B\u265A\u265D\u265E\u265C' - black chess figures @@ -185,14 +196,26 @@ TEST_CASE("expressions") TRY_CHECK(val0.to_string() == val1.to_string()); // UTF-8 TRY_CHECK(val0.to_unicode() == val1.to_unicode()); // Unicode // \u+NNNN \U+NNNNNNNN \xNN\xNN - auto val3 = eval(u8"'\u262f\xF0\x9F\x8D\xB7'"); - auto val4 = eval(u8"'\U0000262f\U0001F377'"); + // single quotes + auto val3 = eval("'\\u262f\\xF0\\x9F\\x8D\\xB7'"); + auto val4 = eval("'\\U0000262f\\U0001F377'"); + // double quotes + auto val5 = eval("\"\\u262f\\xF0\\x9F\\x8D\\xB7\""); + auto val6 = eval("\"\\U0000262f\\U0001F377\""); // UTF16 surrogate pairs work also ;) - // \ud83d\udd7a\ud83c\udffc => \U0001F57A\U0001F3FC works also - // TODO: find a way to enter UTF16 pairs + auto val7 = eval("'\\ud83d\\udd7a\\ud83c\\udffc'"); + auto val8 = eval("'\\U0001F57A\\U0001F3FC'"); + TRY_CHECK(val3 == val4); + TRY_CHECK(val5 == val6); TRY_CHECK(val3.to_string() == val4.to_string()); // UTF-8 TRY_CHECK(val3.to_unicode() == val4.to_unicode()); // Unicode + TRY_CHECK(val5.to_string() == val6.to_string()); // UTF-8 + TRY_CHECK(val5.to_unicode() == val6.to_unicode()); // Unicode + TRY_CHECK(val7 == val8); + TRY_CHECK(val7.to_string() == val8.to_string()); // UTF-8 + TRY_CHECK(val7.to_unicode() == val8.to_unicode()); // Unicode + // following test will fail if boost_regex is built without ICU support (unpaired surrogates in output) TRY_CHECK(eval("[name].replace('(\\B)|( )',' ') ") == tr.transcode("Q u é b e c")); diff --git a/test/unit/datasource/csv.cpp b/test/unit/datasource/csv.cpp index 84f23655a..7f8f581ce 100644 --- a/test/unit/datasource/csv.cpp +++ b/test/unit/datasource/csv.cpp @@ -241,7 +241,7 @@ TEST_CASE("csv") { auto features = ds->features(query); auto feature = features->next(); - require_attributes(feature, { + REQUIRE_ATTRIBUTES(feature, { attr { lon_name, mapnik::value_integer(0) }, attr { "lat", mapnik::value_integer(0) } }); @@ -295,11 +295,11 @@ TEST_CASE("csv") { , attr { "Phone", mapnik::value_unicode_string("(212) 334-0711") } , attr { "Address", mapnik::value_unicode_string("19 Elizabeth Street") } , attr { "Precinct", mapnik::value_unicode_string("5th Precinct") } - , attr { "geo_longitude", mapnik::value_integer(-70) } - , attr { "geo_latitude", mapnik::value_integer(40) } + , attr { "geo_longitude", mapnik::value_double(-70.0) } + , attr { "geo_latitude", mapnik::value_double(40.0) } }; - require_attributes(feature, expected_attr); - require_attributes(feature2, expected_attr); + REQUIRE_ATTRIBUTES(feature, expected_attr); + REQUIRE_ATTRIBUTES(feature2, expected_attr); if (mapnik::util::exists(filepath + ".index")) { mapnik::util::remove(filepath + ".index"); @@ -367,7 +367,7 @@ TEST_CASE("csv") { auto featureset = all_features(ds); auto feature = featureset->next(); - require_attributes(feature, { + REQUIRE_ATTRIBUTES(feature, { attr { "x", mapnik::value_integer(0) } , attr { "empty_column", mapnik::value_unicode_string("") } , attr { "text", mapnik::value_unicode_string("a b") } @@ -416,15 +416,15 @@ TEST_CASE("csv") { require_field_types(fields, {mapnik::Integer, mapnik::Integer, mapnik::String}); auto featureset = all_features(ds); - require_attributes(featureset->next(), { + REQUIRE_ATTRIBUTES(featureset->next(), { attr{"x", 0} , attr{"y", 0} , attr{"name", mapnik::value_unicode_string("a/a") } }); - require_attributes(featureset->next(), { + REQUIRE_ATTRIBUTES(featureset->next(), { attr{"x", 1} , attr{"y", 4} , attr{"name", mapnik::value_unicode_string("b/b") } }); - require_attributes(featureset->next(), { + REQUIRE_ATTRIBUTES(featureset->next(), { attr{"x", 10} , attr{"y", 2.5} , attr{"name", mapnik::value_unicode_string("c/c") } }); @@ -531,7 +531,7 @@ TEST_CASE("csv") { auto fields = ds->get_descriptor().get_descriptors(); require_field_names(fields, {"x", "y", "1990", "1991", "1992"}); auto feature = all_features(ds)->next(); - require_attributes(feature, { + REQUIRE_ATTRIBUTES(feature, { attr{"x", 0} , attr{"y", 0} , attr{"1990", 1} @@ -575,15 +575,15 @@ TEST_CASE("csv") { require_field_names(fields, {"x", "y", "label"}); auto featureset = all_features(ds); - require_attributes(featureset->next(), { + REQUIRE_ATTRIBUTES(featureset->next(), { attr{"x", 0}, attr{"y", 0}, attr{"label", ustring("0,0") } }); - require_attributes(featureset->next(), { + REQUIRE_ATTRIBUTES(featureset->next(), { attr{"x", 5}, attr{"y", 5}, attr{"label", ustring("5,5") } }); - require_attributes(featureset->next(), { + REQUIRE_ATTRIBUTES(featureset->next(), { attr{"x", 0}, attr{"y", 5}, attr{"label", ustring("0,5") } }); - require_attributes(featureset->next(), { + REQUIRE_ATTRIBUTES(featureset->next(), { attr{"x", 5}, attr{"y", 0}, attr{"label", ustring("5,0") } }); - require_attributes(featureset->next(), { + REQUIRE_ATTRIBUTES(featureset->next(), { attr{"x", 2.5}, attr{"y", 2.5}, attr{"label", ustring("2.5,2.5") } }); if (mapnik::util::exists(filename + ".index")) { @@ -615,7 +615,7 @@ TEST_CASE("csv") { auto ds = get_csv_ds(filename); auto fields = ds->get_descriptor().get_descriptors(); require_field_names(fields, {"x", "y", "z"}); - require_attributes(all_features(ds)->next(), { + REQUIRE_ATTRIBUTES(all_features(ds)->next(), { attr{"x", 1}, attr{"y", 10}, attr{"z", 9999.9999} }); if (mapnik::util::exists(filename + ".index")) { @@ -653,7 +653,7 @@ TEST_CASE("csv") { auto ds = get_csv_ds(filename); auto fields = ds->get_descriptor().get_descriptors(); require_field_names(fields, {"x", "y", "line"}); - require_attributes(all_features(ds)->next(), { + REQUIRE_ATTRIBUTES(all_features(ds)->next(), { attr{"x", 0}, attr{"y", 0} , attr{"line", ustring("many\n lines\n of text\n with unix newlines")} }); if (mapnik::util::exists(filename + ".index")) @@ -684,7 +684,7 @@ TEST_CASE("csv") { auto ds = get_csv_ds(filename); auto fields = ds->get_descriptor().get_descriptors(); require_field_names(fields, {"x", "y", "z"}); - require_attributes(all_features(ds)->next(), { + REQUIRE_ATTRIBUTES(all_features(ds)->next(), { attr{"x", -122}, attr{"y", 48}, attr{"z", 0} }); if (mapnik::util::exists(filename + ".index")) { @@ -719,7 +719,7 @@ TEST_CASE("csv") { auto ds = get_csv_ds(filename); auto fields = ds->get_descriptor().get_descriptors(); require_field_names(fields, {"x", "y", "z"}); - require_attributes(all_features(ds)->next(), { + REQUIRE_ATTRIBUTES(all_features(ds)->next(), { attr{"x", 0}, attr{"y", 0}, attr{"z", ustring("hello")} }); if (mapnik::util::exists(filename + ".index")) { @@ -754,9 +754,9 @@ TEST_CASE("csv") { require_field_types(fields, {mapnik::Integer, mapnik::Integer, mapnik::String, mapnik::Boolean}); auto featureset = all_features(ds); - require_attributes(featureset->next(), { + REQUIRE_ATTRIBUTES(featureset->next(), { attr{"x", 0}, attr{"y", 0}, attr{"null", ustring("null")}, attr{"boolean", true}}); - require_attributes(featureset->next(), { + REQUIRE_ATTRIBUTES(featureset->next(), { attr{"x", 0}, attr{"y", 0}, attr{"null", ustring("")}, attr{"boolean", false}}); if (mapnik::util::exists(filename + ".index")) @@ -829,11 +829,11 @@ TEST_CASE("csv") { require_field_types(fields, {mapnik::Integer, mapnik::Integer, mapnik::String}); auto featureset = all_features(ds); - require_attributes(featureset->next(), { + REQUIRE_ATTRIBUTES(featureset->next(), { attr{"x", 0}, attr{"y", 0}, attr{"fips", ustring("001")}}); - require_attributes(featureset->next(), { + REQUIRE_ATTRIBUTES(featureset->next(), { attr{"x", 0}, attr{"y", 0}, attr{"fips", ustring("003")}}); - require_attributes(featureset->next(), { + REQUIRE_ATTRIBUTES(featureset->next(), { attr{"x", 0}, attr{"y", 0}, attr{"fips", ustring("005")}}); if (mapnik::util::exists(filename + ".index")) { @@ -990,7 +990,7 @@ TEST_CASE("csv") { auto fields = ds->get_descriptor().get_descriptors(); require_field_names(fields, {"x", "y", "name"}); require_field_types(fields, {mapnik::Integer, mapnik::Integer, mapnik::String}); - require_attributes(all_features(ds)->next(), { + REQUIRE_ATTRIBUTES(all_features(ds)->next(), { attr{"x", 0}, attr{"y", 0}, attr{"name", ustring("data_name")} }); REQUIRE(count_features(all_features(ds)) == r.second); CHECK(ds->get_geometry_type() == mapnik::datasource_geometry_t::Point); @@ -1007,13 +1007,13 @@ TEST_CASE("csv") { auto fs = all_features(ds); auto feature = fs->next(); - require_attributes(feature, { + REQUIRE_ATTRIBUTES(feature, { attr{"x", 0}, attr{"y", 0}, attr{"bigint", 2147483648} }); feature = fs->next(); - require_attributes(feature, { + REQUIRE_ATTRIBUTES(feature, { attr{"x", 0}, attr{"y", 0}, attr{"bigint", 9223372036854775807ll} }); - require_attributes(feature, { + REQUIRE_ATTRIBUTES(feature, { attr{"x", 0}, attr{"y", 0}, attr{"bigint", 0x7FFFFFFFFFFFFFFFll} }); } // END SECTION #pragma GCC diagnostic pop diff --git a/test/unit/datasource/ds_test_util.hpp b/test/unit/datasource/ds_test_util.hpp index 381d70c6e..6ab3968f6 100644 --- a/test/unit/datasource/ds_test_util.hpp +++ b/test/unit/datasource/ds_test_util.hpp @@ -107,18 +107,20 @@ inline std::size_t count_features(mapnik::featureset_ptr features) { using attr = std::tuple; -#define REQUIRE_ATTRIBUTES(feature, attrs) \ - REQUIRE(bool(feature)); \ - for (auto const &kv : attrs) { \ - REQUIRE(feature->has_key(std::get<0>(kv))); \ - CHECK(feature->get(std::get<0>(kv)) == std::get<1>(kv)); \ - } \ - - -inline void require_attributes(mapnik::feature_ptr feature, - std::initializer_list const &attrs) { - REQUIRE_ATTRIBUTES(feature, attrs); -} +#define REQUIRE_ATTRIBUTES(feature, ...) \ + do { \ + auto const& _feat = (feature); /* evaluate feature only once */ \ + REQUIRE(_feat != nullptr); \ + for (auto const& kv : __VA_ARGS__) { \ + auto& key = std::get<0>(kv); \ + auto& val = std::get<1>(kv); \ + CAPTURE(key); \ + CHECKED_IF(_feat->has_key(key)) { \ + CHECK(_feat->get(key) == val); \ + CHECK(_feat->get(key).which() == val.which()); \ + } \ + } \ + } while (0) namespace detail { diff --git a/test/unit/datasource/geojson.cpp b/test/unit/datasource/geojson.cpp index 2ed99d9e2..2b09f1443 100644 --- a/test/unit/datasource/geojson.cpp +++ b/test/unit/datasource/geojson.cpp @@ -824,7 +824,7 @@ TEST_CASE("geojson") { std::initializer_list attrs = { attr{"name", tr.transcode("Test")}, attr{"NOM_FR", tr.transcode("Québec")}, - attr{"boolean", mapnik::value_bool("true")}, + attr{"boolean", mapnik::value_bool(true)}, attr{"description", tr.transcode("Test: \u005C")}, attr{"double", mapnik::value_double(1.1)}, attr{"int", mapnik::value_integer(1)}, diff --git a/test/unit/datasource/topojson.cpp b/test/unit/datasource/topojson.cpp index a7d793338..372cd187f 100644 --- a/test/unit/datasource/topojson.cpp +++ b/test/unit/datasource/topojson.cpp @@ -100,7 +100,7 @@ TEST_CASE("topojson") std::initializer_list attrs = { attr{"name", tr.transcode("Test")}, attr{"NOM_FR", tr.transcode("Québec")}, - attr{"boolean", mapnik::value_bool("true")}, + attr{"boolean", mapnik::value_bool(true)}, attr{"description", tr.transcode("Test: \u005C")}, attr{"double", mapnik::value_double(1.1)}, attr{"int", mapnik::value_integer(1)}, diff --git a/test/unit/projection/proj_transform.cpp b/test/unit/projection/proj_transform.cpp index bb56b888c..31fc2f1ea 100644 --- a/test/unit/projection/proj_transform.cpp +++ b/test/unit/projection/proj_transform.cpp @@ -119,4 +119,80 @@ SECTION("test pj_transform failure behavior") #endif +// Github Issue https://github.com/mapnik/mapnik/issues/2648 +SECTION("Test proj antimeridian bbox") +{ + mapnik::projection prj_geog("+init=epsg:4326"); + mapnik::projection prj_proj("+init=epsg:2193"); + + mapnik::proj_transform prj_trans_fwd(prj_proj, prj_geog); + mapnik::proj_transform prj_trans_rev(prj_geog, prj_proj); + + // reference values taken from proj4 command line tool: + // (non-corner points assume PROJ_ENVELOPE_POINTS == 20) + // + // cs2cs -Ef %.10f +init=epsg:2193 +to +init=epsg:4326 < better(-180.0, -62.3337481525, + 180.0, -24.5845974912); + + { + mapnik::box2d ext(274000, 3087000, 3327000, 7173000); + prj_trans_fwd.forward(ext, PROJ_ENVELOPE_POINTS); + CHECK(ext.minx() == Approx(better.minx())); + CHECK(ext.miny() == Approx(better.miny())); + CHECK(ext.maxx() == Approx(better.maxx())); + CHECK(ext.maxy() == Approx(better.maxy())); + } + + { + // check the same logic works for .backward() + mapnik::box2d ext(274000, 3087000, 3327000, 7173000); + prj_trans_rev.backward(ext, PROJ_ENVELOPE_POINTS); + CHECK(ext.minx() == Approx(better.minx())); + CHECK(ext.miny() == Approx(better.miny())); + CHECK(ext.maxx() == Approx(better.maxx())); + CHECK(ext.maxy() == Approx(better.maxy())); + } + + // reference values taken from proj4 command line tool: + // + // cs2cs -Ef %.10f +init=epsg:2193 +to +init=epsg:4326 < normal(148.7667597489, -60.1222810241, + 159.9548489296, -24.9771195155); + + { + // checks for not being snapped (ie. not antimeridian) + mapnik::box2d ext(274000, 3087000, 276000, 7173000); + prj_trans_fwd.forward(ext, PROJ_ENVELOPE_POINTS); + CHECK(ext.minx() == Approx(normal.minx())); + CHECK(ext.miny() == Approx(normal.miny())); + CHECK(ext.maxx() == Approx(normal.maxx())); + CHECK(ext.maxy() == Approx(normal.maxy())); + } + + { + // check the same logic works for .backward() + mapnik::box2d ext(274000, 3087000, 276000, 7173000); + prj_trans_rev.backward(ext, PROJ_ENVELOPE_POINTS); + CHECK(ext.minx() == Approx(normal.minx())); + CHECK(ext.miny() == Approx(normal.miny())); + CHECK(ext.maxx() == Approx(normal.maxx())); + CHECK(ext.maxy() == Approx(normal.maxy())); + } +} + }