Compare commits

...

2404 commits

Author SHA1 Message Date
Artem Pavlenko
bb3106d04f
Merge pull request #4480 from mapnik/configure-unbound-variable
Check for if VARS is set (ref #4478)
2024-11-04 18:21:55 +00:00
Artem Pavlenko
8ebd792258 Check for if VARS is set (ref #4478) 2024-11-04 16:39:09 +00:00
Artem Pavlenko
e7a2bacb5d update CHANGELOG for mapnik v4.0.3 release [skip ci] 2024-10-30 08:45:55 +00:00
Artem Pavlenko
05389e3c73 setting up for mapnik v4.0.3 release [skip ci] 2024-10-30 08:44:01 +00:00
Artem Pavlenko
abeace5167
Merge pull request #4479 from mapnik/empty_featureset
Empty featureset
2024-10-29 11:04:26 +00:00
Artem Pavlenko
92b1ea9ceb Commit staged changes 2024-10-29 10:19:22 +00:00
Artem Pavlenko
cd082c5872 Update version to 4.0.3 2024-10-29 09:56:03 +00:00
Artem Pavlenko
c1117a4d33 Empty featureset instead of invalid + bool is_empty(featureset_ptr) 2024-10-29 09:52:35 +00:00
Artem Pavlenko
20b154ae49 Remove 'final' specifier as it was breaking dynamic_cast<invalid_featureset*> in 'is_valid' test when building on macOS arm64
```
Apple clang version 16.0.0 (clang-1600.0.26.3)
Target: arm64-apple-darwin24.0.0
```
Also remove empty dtor as not required
2024-10-28 11:02:08 +00:00
Artem Pavlenko
379261434b Upgrade to SCons v4.8.1 2024-09-09 10:56:17 +01:00
Artem Pavlenko
3d172b94f7 Unit tests - fix #endif statement (via @bgardner-noggin) 2024-09-04 09:39:11 +01:00
Artem Pavlenko
5f327ff3c8 update CHANGELOG for mapnik v4.0.2 release [skip ci] 2024-08-21 14:00:44 +01:00
Artem Pavlenko
dc97085b31 Upgrade SCons to v4.8.0 [skip ci] 2024-08-21 13:57:11 +01:00
Artem Pavlenko
7a1663f0a2 Update version to 4.0.2 2024-08-15 11:07:05 +01:00
Artem Pavlenko
924123e9c7
Merge pull request #4470 from mapnik/cmake-soversion
CMake - set `SOVERSION` to `${MAPNIK_MAJOR_VERSION}.${MAPNIK_MINOR_VERSION}`
2024-07-31 15:34:43 +01:00
Artem Pavlenko
75756b33f3 CMake - set SOVERSION to ${MAPNIK_MAJOR_VERSION}.${MAPNIK_MINOR_VERSION} 2024-07-31 10:30:50 +01:00
Artem Pavlenko
f1a3d6d7da Update CHANGELOG [skip ci] 2024-07-30 11:12:51 +01:00
Artem Pavlenko
3348f97c76
Merge pull request #4468 from mapnik/bounding-box-split
Split bounding box along (0, 0) before reprojecting  [WIP] [skip ci]
2024-07-30 10:27:47 +01:00
Artem Pavlenko
a982e69525 clang-format 2024-07-29 12:35:31 +01:00
Artem Pavlenko
4f6a7a2571 Add basic forward/backward test for reprojection bounding box for epsg:3995 (WGS 84 / Arctic Polar Stereographic) 2024-07-29 11:23:39 +01:00
Artem Pavlenko
7358a66c2f mapnik::projection - add area_of_use method returning std::optional<mapnik::box2d<double>> (WGS84) [WIP] [skip ci] 2024-07-29 11:21:54 +01:00
Artem Pavlenko
727e3a1ca7 Split bounding box along (0, 0) before reprojecting [WIP] [skip ci]
(improves handling stereographic projections e.g epsg:3995)
2024-07-26 14:28:41 +01:00
Artem Pavlenko
fc029ae5a5 Update Coopyright year 2024-07-22 10:20:47 +01:00
Artem Pavlenko
4df58036aa Update version to 4.0.1 2024-07-22 09:53:04 +01:00
Artem Pavlenko
5e7b478627
Merge pull request #4456 from hummeltech/GCC14
Fix building with GCC 14
2024-07-15 15:54:03 +01:00
David Hummel
0526c603d4 Workaround for Windows builds with GCC 14 patches 2024-06-26 08:44:30 -07:00
David Hummel
2ef5003283 Fix building with GCC 14
Co-authored-by: Tom Hughes <tom@compton.nu>
2024-06-26 08:44:30 -07:00
Artem Pavlenko
eb99057a47
Merge pull request #4466 from hummeltech/GitHubActionsVCPkgCache
Speed up the GitHub Actions CI jobs
2024-06-26 10:29:52 +01:00
David Hummel
d9a6494858 Minor change to demonstrate cache usage 2024-06-25 13:23:11 -07:00
David Hummel
7f743210a0 Speed up the GitHub Actions jobs 2024-06-25 11:33:45 -07:00
Artem Pavlenko
53900d359c use MAPNIK_LIB_DIR via @hummeltech 2024-06-20 16:41:45 +01:00
Artem Pavlenko
507a834264 Merge branch 'tomhughes-libdir' 2024-06-20 16:40:52 +01:00
Tom Hughes
0e0aed3bde Use CMAKE_INSTALL_LIBDIR for libdir in pkg-config files 2024-06-19 19:44:01 +01:00
Artem Pavlenko
e7d0b85dbc
Merge pull request #4462 from hummeltech/InstallDoc
Update `INSTALL.md`
2024-06-17 09:06:20 +01:00
David Hummel
1a878af2f7 Update INSTALL.md 2024-06-16 13:01:46 -07:00
Artem Pavlenko
85801bd402 Mapnik 4.0.0 release. 2024-06-16 14:56:13 +01:00
Artem Pavlenko
02049bb811 Update publish_release.sh script [skip ci] 2024-06-16 14:53:46 +01:00
Artem Pavlenko
52bde246d2 Fix escape char (python >= v3.12) 2024-06-14 14:36:25 +01:00
Artem Pavlenko
ffcf059556
Merge pull request #4461 from hummeltech/MapnikTestsTempDir
Use `temp_directory_path` rather than hard-coded `/tmp` for `image io` tests
2024-06-14 12:45:19 +01:00
Artem Pavlenko
054c2a18a9 Downgrade to ubuntu-22.04 2024-06-14 09:41:49 +01:00
Artem Pavlenko
f91f522e71 runners - use explicit versioning + remove macos-13 2024-06-14 09:30:55 +01:00
David Hummel
9a0d7445be Use temp_directory_path rather than hard-coded /tmp for tests 2024-06-13 08:31:12 -07:00
Artem Pavlenko
63d7e51b84 Update data-visual (cairo) 2024-06-13 10:05:59 +01:00
Artem Pavlenko
3da7a3b1a1 Fix year :) 2024-06-12 16:06:42 +01:00
Artem Pavlenko
cde255852d Attempting to address #4460 by swithing to windows-19 runner 2024-06-12 16:04:48 +01:00
Artem Pavlenko
8c3048bf99 Use python3 by default 2024-06-10 15:39:10 +01:00
Artem Pavlenko
9610c4e2ad SConstruct - use pkg-config proj --variable=datadir ro determine PROJ_LIB directory 2024-06-10 15:35:30 +01:00
Artem Pavlenko
b8166f81a6 Update vcpkg-sha to ad25766aefb5313b6bc4e2a4b78a2946f84fbf66 2024-06-10 09:34:09 +01:00
Artem Pavlenko
84cd5864e7 demo/viewer - use std::optional 2024-06-07 14:12:24 +01:00
Artem Pavlenko
61cb187dbb Check if text_symbolizer has 'placement finder'(keys::text_placements) before any text processing 2024-06-04 12:15:10 +01:00
Artem Pavlenko
d7a8f1d04a clang-format 2024-06-04 12:13:02 +01:00
Artem Pavlenko
f5acdb3efd Update comment. 2024-06-04 12:11:28 +01:00
Artem Pavlenko
c87b245f71 Remove unused 'simplify_prefilter_' parameter (ref #4459) 2024-06-04 12:09:24 +01:00
Artem Pavlenko
4798be914c Set default font-size -> 16px/1em 2024-06-03 12:47:34 +01:00
Artem Pavlenko
653d8b7310 grid_view - delete assignment op 2024-05-30 09:17:14 +01:00
Artem Pavlenko
d7a490ffc2
Merge pull request #4445 from mapnik/feature/drop_boost_cpp17
replace majority of boost->std optional and boost->std string_view
2024-05-22 14:10:17 +01:00
Artem Pavlenko
2c9e55b770
Merge pull request #4458 from mapnik/delete_unused
Delete unused files
2024-05-22 11:11:21 +01:00
Mathis Logemann
9510cd68a3 delete appveyor.yml 2024-05-21 21:17:49 +02:00
Mathis Logemann
0a10de3827 delete bootstrap.sh 2024-05-21 21:17:32 +02:00
Mathis Logemann
b3dd7a0e7d delete .travis.yml 2024-05-21 21:17:16 +02:00
Artem Pavlenko
34bb44e490 clang-format 2024-05-21 09:41:19 +01:00
Artem Pavlenko
658a8bb080 symbolizer_property_value_string - handle value_bool, value_integer, value_double + dash_array 2024-05-21 09:15:50 +01:00
Mathis Logemann
21276ab2a0 use explicit type for std::array 2024-05-18 10:47:51 +02:00
Mathis Logemann
9292899240 remove boost-fileystem from vcpkg, since c++17 is min req. 2024-05-18 10:22:29 +02:00
Mathis Logemann
ab626ac052 update pre-commit and format sources 2024-05-18 10:22:29 +02:00
Mathis Logemann
7ef431ece2 use std::optional instead of boost::optional 2024-05-18 10:22:29 +02:00
Mathis Logemann
e1feef5a79 Use std::string_view instead of boost::string_view 2024-05-18 10:22:29 +02:00
Artem Pavlenko
4114824e6b pre-commit run --show-diff-on-failure --color=always --all-files 2024-05-15 10:29:13 +01:00
Artem Pavlenko
99aa246b73 Remove comment - duplicate names are OK 2024-05-15 10:25:47 +01:00
Artem Pavlenko
3a461630f7 remove extra space character for ouput (tidy) 2024-05-15 10:25:14 +01:00
Artem Pavlenko
1283ca5b77 Revive Symbolizer to json functionality 2024-05-15 10:24:27 +01:00
Artem Pavlenko
454837070d Fix typo 2024-05-14 09:10:51 +01:00
Artem Pavlenko
f89f221445
Merge pull request #4449 from hummeltech/macOSCI
`macos-latest` was migrated from `macOS 12` on `amd64` to `macOS 14` on `arm64`
2024-05-06 11:14:29 +01:00
David Hummel
09067f55fa Account for difference of PROJ_LIB 2024-05-05 13:04:14 -07:00
Artem Pavlenko
f84c30f20c
Merge pull request #4450 from mapnik/svg-refactor
Svg refactor
2024-04-30 10:07:21 +01:00
Artem Pavlenko
3176749613 clang-format
(pre-commit run --show-diff-on-failure --color=always --all-files)
2024-04-30 10:04:57 +01:00
Artem Pavlenko
e412e12599 svg_parser - cleanup + consistent push/pop attributes 2024-04-30 10:01:02 +01:00
Artem Pavlenko
77cd733258 svg_group - check parent is not nullptr 2024-04-30 09:59:35 +01:00
David Hummel
bbeac846d7 Address issues after recent upgrade to LCOV v2.1 2024-04-26 14:01:39 -07:00
David Hummel
e18643ed08 Install missing libtool package on macos-14 2024-04-26 13:16:47 -07:00
David Hummel
8afed63683 macos-latest changed from macOS 12 on amd64 to arm64
This seems to have happened around 2024.04.23

https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/
2024-04-26 12:03:16 -07:00
Artem Pavlenko
6e81004cfb add const qualifier to comparison operator 2024-04-25 10:55:04 +01:00
Artem Pavlenko
0d0c471eb5
Merge pull request #4446 from hummeltech/GitHubActionsNodeJS16
Resolve `Node.js 16 actions are deprecated` GitHub Actions warnings
2024-04-23 14:16:38 +01:00
Artem Pavlenko
751c96ec4a tidy [skip ci] 2024-04-22 15:33:11 +01:00
Artem Pavlenko
7350d0a653
Merge pull request #4447 from hummeltech/MapnikTestVisual
No need to install `mapnik-test-visual`
2024-04-22 15:29:51 +01:00
Artem Pavlenko
e1d7d3deb5 Fix dasharray grammar 2024-04-22 15:22:19 +01:00
Artem Pavlenko
6e44fb052c Expose parse_dasharray method (+MAPNIK_DECL), needed by python-bindings 2024-04-22 15:05:05 +01:00
David Hummel
7c45369e88 No need to install mapnik-test-visual 2024-04-21 16:54:28 -07:00
David Hummel
754b12b008 Resolve Node.js 16 actions are deprecated warnings 2024-04-19 16:27:48 -07:00
Mathis Logemann
a85bc95135
Merge pull request #4444 from mapnik/feature/increase_min_cxx_standard
Increase min cxx standard to 17
2024-04-19 20:04:58 +02:00
Mathis Logemann
15abda8b3e [workflow] Remove unused matrix options 2024-04-19 18:20:33 +02:00
Mathis Logemann
dc5ad24ef8 Increase min cxx standard to 17 2024-04-19 18:17:01 +02:00
Artem Pavlenko
e3b0044f8e github actions - build shared libs 2024-04-19 14:17:12 +01:00
Artem Pavlenko
a8d1797bcf
Merge pull request #4442 from hummeltech/macOSLCOV
Address `lcov`/`geninfo` errors on macOS CI builds
2024-04-19 08:57:01 +01:00
Artem Pavlenko
283e2762d4
Merge pull request #4443 from hummeltech/png_io.hppMissingString
Add missing `#include <string>` to `include/mapnik/png_io.hpp`
2024-04-18 09:09:50 +01:00
David Hummel
3ef2e8e3da Address lcov/geninfo error on macOS 2024-04-17 18:12:40 -07:00
David Hummel
0ffd196010 Add missing #include <string> to include/mapnik/png_io.hpp 2024-04-17 13:43:02 -07:00
Artem Pavlenko
15f6745223
Merge pull request #4441 from mapnik/bugfix/dont_pollute_global_install
don't pollute global include dir when installing agg
2024-04-17 09:13:45 +01:00
Mathis Logemann
6c58ae3ae1 don't pollute global include dir when installing agg 2024-04-16 20:05:38 +02:00
Artem Pavlenko
0897271a8e upgrade vcpkg-sha : b4a3d89125e45bc8f80fb94bef9761d4f4e14fb9 + reduce number of runners for now. 2024-04-16 09:24:55 +01:00
Artem Pavlenko
d6fc3b1ddc Upgrade SCons to latest production release (v4.7.0) [skip ci] 2024-04-15 14:35:35 +01:00
Artem Pavlenko
5cc57566cc Fix typo in CSS color unit test 2024-04-15 14:28:22 +01:00
Artem Pavlenko
658d5e69a4
Merge pull request #4438 from mapnik/css_color_fractional_percent
css color fractional percentage values
2024-04-15 14:17:10 +01:00
Artem Pavlenko
7afaa7e6cc clang-format 2024-04-15 14:13:14 +01:00
Artem Pavlenko
5ac45af78e Allow percentage values with a fractional component (implements https://github.com/mapnik/mapnik/issues/4437)
(https://www.w3.org/TR/css-color-4/#funcdef-rgba)
2024-04-15 14:09:04 +01:00
Artem Pavlenko
93ab8b4690 Fix compiler warning - definition of implicit copy constructor for 'enumeration<mapnik::colorizer_mode_enum, &mapnik::colorizer_mode_to_string, &mapnik::colorizer_mode_from_string, &mapnik::colorizer_mode_lookup>' is deprecated because it has a user-provided copy assignment operator [-Wdeprecated-copy-with-user-provided-copy] void operator=(const enumeration& other) { value_ = other.value_; } 2024-04-12 14:20:23 +01:00
Artem Pavlenko
7864289291 Update data-visual 2024-04-04 17:37:02 +01:00
Artem Pavlenko
0708ee8724 Use pkg-config to determine static linking dependencies, default to original behaviour. 2024-04-04 11:01:17 +01:00
Artem Pavlenko
c2c6d2ed60 gdal-config - use both --libs and --dep-libs when RUNTIME_LINK
+ `ogr.input` needs `pkg-config libpq --libs --static`
2024-04-03 18:18:13 +01:00
Artem Pavlenko
83f833f1ce clang-format 2024-03-28 16:49:57 +00:00
Artem Pavlenko
7aceade7c5 Update visual-data [skip ci] 2024-03-28 16:17:05 +00:00
Artem Pavlenko
a9e0bf5bee Link to sharpyuv when 'RUNTIME_LINK'=='static' (webp) 2024-03-28 15:57:14 +00:00
Artem Pavlenko
1e4c17256a WEBP - add fallback pkg-config check if WEBP_INCLUDES and/or WEBP_LIBS aren't set. 2024-03-28 15:55:30 +00:00
Artem Pavlenko
6479059c7e Add specialisation for nodata->rgba8 conversion for mapnik::image_gray8
( fixes gdal-overview-gray8 visual test)
2024-03-28 15:33:41 +00:00
Artem Pavlenko
e394db6c8f add boost-format 2024-03-13 09:10:17 +00:00
Artem Pavlenko
fb61b3fb12 Upgrade to actions/setup-python@v5 (node 20) 2024-03-12 14:29:59 +00:00
Artem Pavlenko
493c7fd5a1 Attempting to fix deb package path 2024-03-12 13:55:23 +00:00
Artem Pavlenko
ba2125b095 Fix -> pre-commit/action@v3.0.1 2024-03-12 13:28:14 +00:00
Artem Pavlenko
6d420b0911 Upgrade to node20 actions e.g @v4 2024-03-12 13:24:34 +00:00
Artem Pavlenko
f9b9261d53 Update vcpkg-sha : e105a86c97b8ab13d4dbe3f7bd9ebc17ece31634 2024-03-12 10:58:56 +00:00
Artem Pavlenko
61b5ff26f2 tidy - remoce PROJ.4 references [skip ci] 2024-03-12 10:58:36 +00:00
Artem Pavlenko
2b932be0ca Update test data (GDAL/OGR 3.5.3) 2024-03-07 09:23:03 +00:00
Artem Pavlenko
02e3b1577c Use __APPLE__ to check OS platform 2024-03-07 09:09:56 +00:00
Artem Pavlenko
8d2388870a
Merge pull request #4364 from mapnik/svg-group-render
Svg group renderer [WIP]
2024-03-01 09:13:49 +00:00
Artem Pavlenko
62c449e6d1 Use the same flags when calling FT_Load_Glyph
+ `revive missing check_object_status_and_throw_exceptiona` in `set_font_face`
2024-03-01 09:05:05 +00:00
Artem Pavlenko
d4173b022d Merge branch 'master' into svg-group-render [skip ci] 2024-02-27 09:05:50 +00:00
Artem Pavlenko
34c95df267
Merge pull request #4432 from mapnik/geojson-empty-geometries
Geojson - empty positions arrays handling
2024-02-27 09:04:24 +00:00
Artem Pavlenko
5b08c21eb0 Actually enable 'is_empty' test + cleanup 2024-02-26 16:25:40 +00:00
Artem Pavlenko
38193817de pre-commit run --show-diff-on-failure --color=always --all-files [skip ci] 2024-02-26 14:48:49 +00:00
Artem Pavlenko
c067399041 GeoJSON unit tests - require expected geometries are "empty". 2024-02-26 14:45:59 +00:00
Artem Pavlenko
0e9f8b06a3 Fix is_empty unit test e.g if multi geometry consists of empty geometries it is "empty". 2024-02-26 14:44:19 +00:00
Artem Pavlenko
b911464472 correct 'is_empty' implementation for multi geometries 2024-02-26 14:40:36 +00:00
Artem Pavlenko
127f9ba143 add missing copy 2024-02-26 14:39:41 +00:00
Artem Pavlenko
995d3044a4 GeoJSON - allow empty arrays in "coordinates" element for Multi* geometries (ref #4431) 2024-02-26 14:01:09 +00:00
Artem Pavlenko
1da533b5e5 Fix building on Ubuntu 23.10 (add <cstdint>) [skip ci] 2024-02-23 14:11:04 +00:00
Artem Pavlenko
6350e1b259 Update test data (+visual) 2024-02-21 16:06:53 +00:00
Artem Pavlenko
dcfb2d692c SVG - improve handling of gradientUnits and gradientTransform attributes (radial gradient) + correct default values [skip ci] 2024-02-15 11:47:57 +00:00
Artem Pavlenko
1c6d14eb85 viewer.app - Increase max scale factor to 10 2024-02-09 09:19:26 +00:00
Artem Pavlenko
cc1c990a2a clang-format : pre-commit run --show-diff-on-failure --color=always --all-files
xsx
2024-02-06 09:37:48 +00:00
Artem Pavlenko
45f954c578 Merge branch 'master' into svg-group-render 2024-02-05 09:41:31 +00:00
Artem Pavlenko
4f6ab6a4a2 Fix spurious ',' in operator== 2024-02-05 09:36:56 +00:00
Artem Pavlenko
2e1b32512b
Merge pull request #4421 from hummeltech/ogr-open-options-CMake
Fix CMake build issues after OGR open_options support addition
2023-11-28 08:54:08 +00:00
Artem Pavlenko
9d5c458405
Merge pull request #4426 from geofabrik/configure-fix
Fix bugs in configure script
2023-11-24 14:05:45 +00:00
Michael Reichert
ee76817d14 Fix bugs in configure script
The script expected that the shell supports arrays but only Z shell and
Bash do so. Other shells return syntax errors.

In addition, the script expected the mapnik-settings.env file to exist
and crashed otherwise.
2023-11-24 13:46:29 +01:00
Artem Pavlenko
88652012a9
Merge pull request #4424 from geofabrik/configure
Fix configure script for variables read from mapnik-settings.env
2023-11-24 08:50:04 +00:00
Michael Reichert
a5a96aacad Fix configure script for variables read from mapnik-settings.env
Custom build variables (e.g. CXX_STD or CXX) read from
mapnik-settings.env have to be provided as command line arguments
because SCons does not respect the environment variables.
2023-11-23 22:04:58 +01:00
David Hummel
c8fd548133 Fix build issues after addition of OGR open_options support 2023-11-22 09:45:23 -07:00
Artem Pavlenko
437feebaf1
Merge pull request #4423 from hummeltech/LibXML2_2.12.0_Support
Fix broken builds with libxml2 >= v2.12.0
2023-11-21 09:16:08 +00:00
David Hummel
8cdca5f5be Fix broken builds with libxml2 >= v2.12.0
**I.E.**
```
src/libxml2_loader.cpp:91:50: error: invalid conversion from ‘const xmlError*’ {aka ‘const _xmlError*’} to ‘xmlError*’ {aka ‘_xmlError*’} [-fpermissive]
src/libxml2_loader.cpp:131:50: error: invalid conversion from ‘const xmlError*’ {aka ‘const _xmlError*’} to ‘xmlError*’ {aka ‘_xmlError*’} [-fpermissive]
```
2023-11-20 10:21:12 -07:00
Artem Pavlenko
d745e43eb1 pre-commit run --show-diff-on-failure --color=always --all-files 2023-11-17 16:33:01 +00:00
Artem Pavlenko
7d2029165e Merge branch 'geofabrik-ogr-open-options-pr' 2023-11-17 16:31:13 +00:00
Michael Reichert
2d20d5a3c5 Add support for open options in OGR input plugin 2023-11-17 11:06:18 +01:00
Artem Pavlenko
738a7f19b7 Merge branch 'master' into svg-group-render 2023-11-17 09:43:02 +00:00
Artem Pavlenko
279acf4c36
Merge pull request #4419 from geofabrik/drop-old-gdal-pr
Drop support for old versions of GDAL/OGR (older than 2.0)
2023-11-17 09:10:49 +00:00
Michael Reichert
bff4fdde77 Drop support for old versions of GDAL/OGR (older than 2.0)
Fixes #4403.

GDAL 2.0.0 was released in March 2018 (more than five years ago).
Almost all Linux distributions (apart from few long-term support versions)
should come with at least GDAL >= 2.0.
2023-11-16 20:16:05 +01:00
Artem Pavlenko
f391178af0 Upgrade to SCons 4.5.2 2023-09-22 14:38:30 +01:00
Artem Pavlenko
50f1b05f86 boost/algorithm/string/trim.hpp is needed for `trim_if' (boost 1.83) 2023-09-22 14:37:34 +01:00
Artem Pavlenko
47f7f6bd4d Merge branch 'master' into svg-group-render 2023-09-15 14:48:44 +01:00
Artem Pavlenko
d69a0902d4 Forward declaration of 'mapnik::rule' is not sufficient when building on macOS :
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
2023-09-15 14:46:29 +01:00
Artem Pavlenko
cb352ac609 Remove unused local variable 2023-09-15 14:45:18 +01:00
Artem Pavlenko
388d3fd8da Add missing scons-local-4.5.1 2023-09-15 12:34:31 +01:00
Artem Pavlenko
b7332b07a1
Merge pull request #4404 from hummeltech/include_mapnik_geometry_cstdint_header
Add cstdint header include to `include/mapnik/geometry/boost_spirit_karma_adapter.hpp`
2023-09-15 09:12:49 +01:00
David Hummel
b1282fe32c Add cstdint header include to include/mapnik/geometry/boost_spirit_karma_adapter.hpp 2023-09-14 17:38:27 -07:00
Artem Pavlenko
ee8c403779 Merge branch 'master' into svg-group-render 2023-06-12 08:29:49 +01:00
Artem Pavlenko
123232ffde
Merge pull request #4390 from mapnik/feature/updateVcpkg
Update vcpkg commit ref in the ci
2023-06-12 08:29:12 +01:00
Mathis Logemann
2445dbe063 remove boost foreach include 2023-06-11 20:10:50 +02:00
Artem Pavlenko
ed0f8dcb48 Add missing scons-local-4.5.1 2023-06-11 11:31:23 +01:00
Artem Pavlenko
f226d4fd93 Conditionally apply BOOST_SPIRIT_X3_HIDE_CXX17_WARNING if cxx_std < 17 2023-06-11 11:22:49 +01:00
Artem Pavlenko
708e2a4009 Include rule.hpp as fwd decl no longer sufficient with clang++-14
(Apple clang version 14.0.3 (clang-1403.0.22.14.1)
2023-06-11 11:20:16 +01:00
Artem Pavlenko
92426bfc8e Merge branch 'master' into svg-group-render 2023-06-11 09:49:37 +01:00
Artem Pavlenko
20acc0e656
Merge pull request #4389 from MoeSzyslak98/gcc-13-fix
add cstdint header for gcc13 compilation.
2023-06-11 09:44:02 +01:00
Mathis Logemann
6003293e25
Update build_and_test.yml 2023-06-11 08:30:42 +02:00
kian
76c5fd047d add cstdint header for gcc13 compilation. 2023-06-09 15:32:59 +03:30
Artem Pavlenko
3b81effb3e remove unused local variable 2023-04-25 14:23:08 +01:00
Artem Pavlenko
35d901072b mapnik-render: use mapnik/filesystem.hpp 2023-03-27 09:34:03 +01:00
Artem Pavlenko
e847bb738b Set USE_BOOST_FILESYSTEM=True if CXX_STD < 17 + fix typo 2023-03-26 11:36:14 +01:00
Artem Pavlenko
cd4069f91e Merge branch 'master' into svg-group-render 2023-03-20 09:03:18 +00:00
Artem Pavlenko
c4aa24496a
Merge pull request #4385 from hummeltech/C++17Build
Add build & test for `CXX_STANDARD=17` to GitHub Actions
2023-03-20 09:01:13 +00:00
Hummeltech
63f33eed4b
List advanced cached variables in CI [skip ci] 2023-03-19 14:05:58 -07:00
Hummeltech
bc09efb8f5
Fixed typo USE_BOOST_FILESYSYTEM 2023-03-19 14:01:14 -07:00
Hummeltech
bb280a2815
Fixing issues with USE_BOOST_FILESYSTEM definition 2023-03-19 13:39:20 -07:00
Hummeltech
93e488a6cf
Only test for !defined(USE_BOOST_FILESYSTEM) in filesystem.hpp 2023-03-19 09:39:13 -07:00
Hummeltech
9f88d4c3a4
Revert CMAKE_CXX_FLAGS msvc-cl change 2023-03-19 09:38:27 -07:00
David Hummel
f6cd056552 Attempting to fix Windows build with C++17 2023-03-18 09:06:34 -07:00
David Hummel
0e9996dde0 Add build & test for CXX_STANDARD=17 to GitHub Actions 2023-03-18 08:03:58 -07:00
Artem Pavlenko
fc2d27d349
Merge pull request #4384 from hummeltech/cplusplus17
Fixed check for `__cpp_lib_filesystem` in `filesystem.hpp`
2023-03-18 14:35:07 +00:00
David Hummel
e4557c016f Oops, it looks like <version> does not exist until C++20 2023-03-17 10:31:30 -07:00
David Hummel
edec46e8c3 Fixed check for '__cpp_lib_filesystem' always false until after '#include <filesystem>' 2023-03-17 10:20:24 -07:00
Artem Pavlenko
b7fdeeeb02 Move rotation struct definition into pixel_position.hpp 2023-03-15 10:29:30 +00:00
Artem Pavlenko
ecfccdd36c Merge branch 'master' into svg-group-render 2023-03-15 08:37:06 +00:00
Artem Pavlenko
338942b490
Merge pull request #4383 from mapnik/std-filesystem 2023-03-15 07:47:55 +00:00
Artem Pavlenko
00199754a2
Update test/visual/CMakeLists.txt
Co-authored-by: Mathis Logemann <mathisloge@gmail.com>
2023-03-14 16:54:04 +00:00
Artem Pavlenko
49912a423e
Update CMakeLists.txt
Co-authored-by: Mathis Logemann <mathisloge@gmail.com>
2023-03-14 16:53:37 +00:00
Artem Pavlenko
5504aea704 clang-format 2023-03-14 14:53:44 +00:00
Artem Pavlenko
779c04af06 demo/viewer - fix currentIndexChanged signal signature 2023-03-14 14:44:45 +00:00
Artem Pavlenko
a244effa91 Add mapnik/filesystem.hpp ref:https://github.com/mapnik/mapnik/pull/4383#discussion_r1131405532 2023-03-13 14:27:02 +00:00
Artem Pavlenko
45b48721fa replace std::tmpnam (deprecated) with make_unique 2023-03-13 09:34:58 +00:00
Artem Pavlenko
106a46bbf6
Update CMakeLists.txt
Co-authored-by: Mathis Logemann <mathisloge@gmail.com>
2023-03-09 21:14:54 +00:00
Artem Pavlenko
96a6fcd941
Update CMakeLists.txt
Co-authored-by: Mathis Logemann <mathisloge@gmail.com>
2023-03-09 21:14:45 +00:00
Artem Pavlenko
d680d1d7f5
Update CMakeLists.txt
Co-authored-by: Mathis Logemann <mathisloge@gmail.com>
2023-03-09 21:14:28 +00:00
Artem Pavlenko
be0b537f52 Use std::filesystem when CXX_STD >= 17 and not USE_BOOST_FILESYSTEM 2023-03-09 13:17:28 +00:00
Artem Pavlenko
a3f65197dd Merge branch 'master' into svg-group-render 2023-03-08 12:02:34 +00:00
Artem Pavlenko
c646d245b4 Upgrade SCons to v4.5.1 2023-03-08 12:01:16 +00:00
Artem Pavlenko
f36ac22f82 MAPNIK_DECL only on __GNUC__ builds
ref: error C2491: 'mapnik::feature_style_processor<Processor>::prepare_layers': definition of dllimport function not allowed
2023-03-07 11:25:52 +00:00
Artem Pavlenko
87ac079bb6 Add -fvisibility=hidden -fvisibility-inlines-hidden to mapnik target (CMake) 2023-03-07 10:02:50 +00:00
Artem Pavlenko
accb28eb80 external linking (MAPNIK_DECL) requires for -fvisibility=hidden -fvisibility-inlines-hidden to work for GCC/g++ builds 2023-03-07 10:00:18 +00:00
Artem Pavlenko
7035b3e399 small typo 2023-03-07 09:57:36 +00:00
Artem Pavlenko
692c2faa0e
Merge pull request #4382 from hummeltech/master
Add `fonts_dir` & `plugins_dir` variables to `libmapnik.pc`
2023-03-02 15:48:40 +00:00
David Hummel
db9c4bc340 Add fonts & input_plugins variables to libmapnik.pc 2023-03-01 14:48:30 -07:00
Artem Pavlenko
52b5cab584 Update data-visual 2023-02-28 10:37:15 +00:00
Artem Pavlenko
41bb612e5d Merge branch 'master' into svg-group-render 2023-02-27 11:18:48 +00:00
Artem Pavlenko
3dbeb1ee4f Use explicit boost::filesystem::path::value_type to std::string conversion (win) 2023-02-27 09:22:17 +00:00
Artem Pavlenko
21d31bf62e Fix deprecated headers warning 2023-02-27 09:17:55 +00:00
Artem Pavlenko
02445f43ed mini cleanup 2023-02-27 09:17:37 +00:00
Artem Pavlenko
1351d90d51 Use boost::filesystem when __cplusplus < 201703L 2023-02-26 14:40:00 +00:00
Artem Pavlenko
8839f5774a pre-commit run --all-files 2023-02-24 18:07:09 +00:00
Artem Pavlenko
a499989b1d add missing header 2023-02-24 18:05:01 +00:00
Artem Pavlenko
d1f16479d1 pre-commit run --all-files 2023-02-24 17:51:40 +00:00
Artem Pavlenko
5e980ec853 mapnik-render
New options :
 * --bbox -- bounding box to zoom in (expected in Map's SRS unless "--geographic" is used)
 * --geographic,-g  -- bounding box is in WGS 84 lon/lat
 * --plugins-dir -- directory contaning input plugins (default:./plugins/input)
 * --fonts-dir -- directory containing fonts (default: relative to plugins-dir or ./fonts if no plugins-dir specified)
2023-02-24 11:23:26 +00:00
Artem Pavlenko
8efaa959f0 projection - rename 'expanded' to 'definition' (PJ_PROJ_INFO) + add 'description' method 2023-02-24 09:23:52 +00:00
Artem Pavlenko
e0da4468d2
Merge pull request #4379 from mapnik/update/vcpkg-sha
Update vcpkg-sha
2023-02-03 13:54:16 +00:00
Mathis Logemann
b4f1bc09f8
Update vcpkg-sha 2023-02-03 12:38:51 +01:00
Artem Pavlenko
ce073c64c7 Merge branch 'master' into svg-group-render 2023-01-24 14:30:28 +00:00
Artem Pavlenko
b9175100bd
Merge pull request #4378 from tomhughes/stdint
Include cstdint for uint16_t
2023-01-24 14:22:21 +00:00
Artem Pavlenko
fb97fb10f7
Merge pull request #4377 from mathisloge/fix/python-mapnik-findings
move datasource_plugin into mapnik target
2023-01-24 14:21:17 +00:00
Tom Hughes
c62e03344f Include cstdint for uint16_t 2023-01-23 22:37:16 +00:00
Mathis Logemann
ccbf27400c move datasource_plugin into mapnik target 2023-01-23 16:13:32 +01:00
Artem Pavlenko
00e2027d86 Merge branch 'master' into svg-group-render 2023-01-18 09:52:43 +00:00
Artem Pavlenko
43a7d7e455 Fix compiler warning (consistent class or struct declarations) 2023-01-18 09:50:26 +00:00
Artem Pavlenko
edddd08d73 Merge branch 'master' into svg-group-render 2023-01-18 09:48:29 +00:00
Artem Pavlenko
4e064b8b8e
Merge pull request #4291 from mathisloge/feature/cmake-static
Feature/cmake static plugins
2023-01-17 11:27:42 +00:00
Mathis Logemann
7cce5ce346 Merge branch 'master' of https://github.com/mapnik/mapnik into feature/cmake-static 2023-01-16 19:55:02 +01:00
Artem Pavlenko
e811958745
Merge pull request #4372 from mathisloge/refactor/enumarations
Refactor/enumerations
2022-12-19 12:37:32 +00:00
Mathis Logemann
64a031a19b changelog 2022-12-16 15:36:22 +01:00
Artem Pavlenko
51b5c9604a including <memory> - "src/test_png_encoding2.cpp:6:10: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type" 2022-12-12 14:23:39 +00:00
Artem Pavlenko
6afcb73135 Merge branch 'master' into svg-group-render 2022-12-12 12:10:43 +00:00
Artem Pavlenko
e27bc63887 SVG parser - update test data 2022-12-12 11:48:45 +00:00
Artem Pavlenko
f4eec2e24f pre-commit run --all-files 2022-12-12 10:46:41 +00:00
Artem Pavlenko
d29aeb2ddb SVG parser unit test - add attribute comparison framework + test data 2022-12-11 10:24:14 +00:00
Mathis Logemann
dd38dd18f9 rework enumeration<...> 2022-12-10 16:55:24 +01:00
Mathis Logemann
bc38652079 Finalize static plugins 2022-12-09 14:48:52 +01:00
Mathis Logemann
be46202511 Merge branch 'master' of https://github.com/mapnik/mapnik into feature/cmake-static 2022-11-28 08:29:20 +01:00
Artem Pavlenko
d417b8933a
Merge pull request #4366 from mathisloge/feature/refactor_actions
[CI] refactor github actions
2022-11-26 17:27:17 +00:00
Mathis Logemann
2ff1f4228d [CI] fail-fast: false 2022-11-26 16:40:16 +01:00
Mathis Logemann
d949acb925 [CI] only build if the check source code step is succesfull 2022-11-26 16:10:16 +01:00
Mathis Logemann
cbb80aa0db refactor actions 2022-11-26 16:07:44 +01:00
Artem Pavlenko
0b62415225 Export comp_op_rgba_xxx to fix linking on Windows via @mathisloge 2022-11-26 15:01:39 +00:00
Artem Pavlenko
d436c94c25 SVG cairo - push/pop group 2022-11-26 12:50:57 +00:00
Artem Pavlenko
0e5e77121c SVG - implement Cairo group renderer [WIP] [skip ci] 2022-11-26 11:13:37 +00:00
Mathis Logemann
0071eb1163 fix vcpkg for static 2022-11-26 08:36:42 +01:00
Mathis Logemann
df1ff425b7 Merge branch 'master' of https://github.com/mapnik/mapnik into feature/cmake-static 2022-11-26 08:32:20 +01:00
Artem Pavlenko
7c24ff09ee clang-format 2022-11-25 13:54:41 +00:00
Artem Pavlenko
e790aa6c06 Merge branch 'master' into svg-group-render 2022-11-25 13:48:36 +00:00
Artem Pavlenko
b7953fa68b
Merge pull request #4368 from mathisloge/fix/win-error
Fix windows build error
2022-11-25 10:57:01 +00:00
Mathis Logemann
9c873d0e95
Update ubuntu.yml 2022-11-24 22:36:17 +01:00
Artem Pavlenko
0968e12b5e
Merge pull request #4367 from mapnik/ci/vcpkg-json 2022-11-24 19:26:24 +00:00
Mathis Logemann
ae5e283df9 update proj db ref 2022-11-24 20:16:35 +01:00
Mathis Logemann
2770657ba1 fix windows build error 2022-11-24 19:41:21 +01:00
Mathis Logemann
b26d0757b7 add .cache to gitignore 2022-11-24 19:41:15 +01:00
Artem Pavlenko
8bc1aad37f SVG - convert USER_SPACE_ON_USE radial gradient values to % (fix) [WIP] [skip ci] 2022-11-24 10:35:19 +00:00
Artem Pavlenko
c3aec439a7 svg2png - check for valid opacity range 0..1 [WIP] [skip ci] 2022-11-24 10:25:09 +00:00
Artem Pavlenko
b3ed2280b6 Merge branch 'master' into svg-group-render 2022-11-24 09:55:44 +00:00
Artem Pavlenko
bfdab8879c svg2png - add top level "opacity" option e.g similar to <svg opacity="<val>"/> [WIP] [skip ci] 2022-11-23 16:18:18 +00:00
Artem Pavlenko
5f4711a019 SVG - refactor and minimise internal group usage [WIP] [skip ci] 2022-11-23 15:53:08 +00:00
Mathis Logemann
7d267b47fe Merge branch 'master' of https://github.com/mapnik/mapnik into feature/cmake-static 2022-11-22 20:14:33 +01:00
Mathis Logemann
56312c68ad
Update vcpkg.json 2022-11-22 20:08:32 +01:00
Mathis Logemann
4fc828cf29
Merge pull request #4365 from mathisloge/ci/update_vcpkg
[CI] update vcpkg
2022-11-22 12:24:50 +01:00
Artem Pavlenko
8c04fb1262 Use feature_id in render_id [WIP] [skip ci] 2022-11-22 10:57:05 +00:00
Mathis Logemann
07789ad3cc
Update .pre-commit-config.yaml 2022-11-22 11:45:23 +01:00
Mathis Logemann
817f644c6d update pre-commit versions 2022-11-21 22:40:46 +01:00
Mathis Logemann
6183005baf [CI] update gh action runners 2022-11-21 22:28:44 +01:00
Mathis Logemann
7d414450c1 update vcpkg hash 2022-11-21 22:09:04 +01:00
Artem Pavlenko
4ef05da536 Revive 'push_explicit_style' logic. [WIP] [skip ci] 2022-11-21 19:10:12 +00:00
Artem Pavlenko
5347a1d939 format identation 2022-11-21 19:08:05 +00:00
Artem Pavlenko
0da7efdbac Fix - blend using correct 'opacity' 2022-11-21 19:06:53 +00:00
Artem Pavlenko
d4ae5ac653 SVG group renderer implementation (WIP) [skip ci] 2022-11-18 15:17:58 +00:00
Artem Pavlenko
a65d65a5ab Update .clang-format to BraceWrapping: BeforeCatch : true
run `pre-commit`
2022-11-10 15:57:38 +00:00
Artem Pavlenko
1d75721a46 Fix compiler warning -
```
include/mapnik/markers_placements/vertex_last.hpp:49:18: warning: variable 'cmd1' set but not used [-Wunused-but-set-variable]
        unsigned cmd1 = SEG_END;
                 ^
1 warning generated.
```
2022-11-04 14:39:54 +00:00
Artem Pavlenko
2a71903c75 Remove redundant BOOST_VERSION #if/endif 2022-11-04 14:07:28 +00:00
Artem Pavlenko
7e5655eef4 Use snprintf instead of sprintf (ref #4361) 2022-11-04 13:46:10 +00:00
Artem Pavlenko
5522cdd201 pre-commit run --all-files 2022-11-04 09:46:00 +00:00
Artem Pavlenko
bd018ef5ab git-clang-format 2022-11-03 11:29:50 +00:00
Artem Pavlenko
b438edd8da SVG path parser unit tests - update expected arc paths ref:98e5e64d80d921a02bc57f05c55c2e0e2426ab4d 2022-11-03 11:13:09 +00:00
Artem Pavlenko
05661e5439 Merge branch 'kkaefer-fix-svg-smooth-curve-after-arc' 2022-10-18 14:14:57 +01:00
Artem Pavlenko
02af1f606c Apply fix from #4357 to agg_path_storage 2022-10-18 14:13:35 +01:00
Artem Pavlenko
618ddef663 Merge branch 'fix-svg-smooth-curve-after-arc' of github.com:kkaefer/mapnik into kkaefer-fix-svg-smooth-curve-after-arc 2022-10-18 14:11:22 +01:00
Artem Pavlenko
fa9ee1fc61 Issue warning not an error when font face not found (ref #4354) 2022-10-18 13:56:05 +01:00
Konstantin Käfer
98e5e64d80 SVG: Fix reflection points for smooth curves after arcs
Internally, Agg/Mapnik converts arcs to curves. This means that the detection logic in the “smooth curve” command, which looks at the previous points for calculating the reflection point, mistakenly assumes that the previous commands were curve commands, even though they were in reality arc commands. To fix this, we add an explicit lineto command after every arc.
2022-10-18 12:17:05 +02:00
Artem Pavlenko
53a8e2ec2c Remove docbook directory from local SCons distribution and avoid referencing jQuery
(ref: Cross-site scripting (XSS) vulnerability in jQuery before 1.6.3)
2022-09-23 10:03:14 +01:00
Artem Pavlenko
9cf40a6144 Fix radial-distance simplification algorithm to always oupput last vertex (ref #4347) 2022-09-23 09:41:11 +01:00
Artem Pavlenko
9e8e178160 Re-enable simplify_converter tests + add radial-distance tests (#4348) 2022-09-23 09:32:06 +01:00
Artem Pavlenko
81103491b4 Fix building with boost_1_80 (#4340) 2022-08-30 10:40:25 +01:00
Mathis Logemann
ce8bd250dd better export [wip] 2022-08-25 19:59:29 +02:00
Mathis Logemann
4cd4985e75 resolve double defined symbol 2022-08-23 21:37:06 +02:00
Mathis Logemann
b9379f9024 Merge branch 'master' of https://github.com/mapnik/mapnik into feature/cmake-static 2022-08-18 20:38:47 +02:00
Mathis Logemann
e6553ef652 simplify cmake 2022-08-18 20:38:21 +02:00
Artem Pavlenko
019af0ad1d
Merge pull request #4338 from mathisloge/fix/ci-run
[CI] only run on master pushes and all PRs
2022-08-18 11:08:37 +01:00
Mathis Logemann
13c4719912 [CI] only run on master pushes and all PRs 2022-08-17 18:26:19 +02:00
Mathis Logemann
cf78c2a129 Merge branch 'master' of https://github.com/mapnik/mapnik into feature/cmake-static 2022-08-17 18:23:19 +02:00
Artem Pavlenko
a1596e4dad
Merge pull request #4333 from mapnik/cmake-install-fonts
Fix font installation logic
2022-08-17 17:19:34 +01:00
Artem Pavlenko
c8cff17fb6 Merge remote-tracking branch 'origin/cmake-install-fonts' into cmake-install-fonts 2022-08-17 17:05:19 +01:00
Artem Pavlenko
7d8be299f3 Fix font installation logic 2022-08-17 17:00:24 +01:00
Mathis Logemann
3ab8e80f2a depend on formatting 2022-08-17 17:37:43 +02:00
Mathis Logemann
eb3823aa4a precommit 2022-08-17 17:35:25 +02:00
Mathis Logemann
213be3777c Merge branch 'master' of https://github.com/mapnik/mapnik into feature/cmake-static 2022-08-17 17:34:52 +02:00
Mathis Logemann
2b7456f54b Revert "precommit"
This reverts commit f48589738f.
2022-08-17 17:22:07 +02:00
Mathis Logemann
f48589738f precommit 2022-08-17 17:19:59 +02:00
Mathis Logemann
f6bcdac258 default crt = 0N 2022-08-17 17:16:32 +02:00
Artem Pavlenko
14a5cc7e1a
Merge pull request #4334 from mathisloge/cmake-linting
adding auto formatting
2022-08-17 14:15:13 +01:00
Mathis Logemann
54b0381f4d wip 2022-08-16 21:03:56 +02:00
Mathis Logemann
e3d8e55a79 pre-commit run -a 2022-08-16 19:00:16 +02:00
Mathis Logemann
df141876d0 disable clang-format for external deps 2022-08-16 19:00:15 +02:00
Artem Pavlenko
8abad1843a
Merge pull request #4336 from mathisloge/fix/viewer-ini
[CMake] fix generated viewer ini file
2022-08-16 14:08:20 +01:00
Mathis Logemann
13c96ab7d0 [CMake] fix generated viewer ini file 2022-08-15 21:14:16 +02:00
Mathis Logemann
69d682ef02 [clang-format] more compact extern c 2022-08-14 22:26:32 +02:00
Mathis Logemann
eb16e7a647 fix all files
format files
2022-08-14 22:26:31 +02:00
Mathis Logemann
88052447b9 pre-commit
add more hooks

add workflow
2022-08-11 22:53:03 +02:00
Artem Pavlenko
b6161dd439 Merge branch 'master' into cmake-install-fonts 2022-08-04 14:40:38 +01:00
Artem Pavlenko
9627432723 Fix -Wdeprecated-enum-enum-conversion warnings (AGG) 2022-08-04 11:25:35 +01:00
Artem Pavlenko
a9c98dff5d Fix deprecation warning (libtiff)
/usr/include/x86_64-linux-gnu/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
2022-08-04 11:01:56 +01:00
Artem Pavlenko
322f6cd805 Fix font installation logic 2022-08-03 16:19:07 +01:00
Mathis Logemann
34df24f4e2 [CMake] use pkgconfig for webp; make some statements more clearly 2022-04-22 21:10:42 +02:00
Mathis Logemann
c85f8462fd [CMake] fixes for windows (WIP) 2022-04-22 15:10:49 +02:00
Mathis Logemann
59d2f21369 [CMake] remove FindCairo and use pkgconfig 2022-04-22 15:10:02 +02:00
Mathis Logemann
25012517aa [CI] add static builds 2022-04-16 11:26:34 +02:00
Mathis Logemann
503fe35817 Merge branch 'master' of https://github.com/mapnik/mapnik into feature/cmake-static 2022-04-16 11:21:05 +02:00
Artem Pavlenko
1ba1278b42
Merge pull request #4307 from josch/proj-debug
src/proj_transform.cpp: only use proj_context_errno_string for proj >= 8.0.0
2022-04-14 14:14:48 +01:00
Johannes Schauer Marin Rodrigues
01e018eb0a
src/proj_transform.cpp: only use proj_context_errno_string for proj >= 8.0.0 2022-04-14 11:52:25 +02:00
Artem Pavlenko
5c06098caf
Merge pull request #4300 from mathisloge/ci/vcpkg_2022-03-18
[CI] update vcpkg to latest hash
2022-04-13 10:00:08 +01:00
Mathis Logemann
a963ae5ea6 [CI] trigger 2022-04-12 20:51:52 +02:00
Mathis Logemann
ca269f425c Revert "[CI] update vcpkg deps"
This reverts commit 75ad499fb5.
2022-04-12 14:42:19 +02:00
Mathis Logemann
75ad499fb5 [CI] update vcpkg deps 2022-04-12 14:21:45 +02:00
Mathis Logemann
8c9e61373e Merge branch 'master' of https://github.com/mapnik/mapnik into ci/vcpkg_2022-03-18 2022-04-11 15:24:45 +02:00
Artem Pavlenko
1ce18f6698
Merge pull request #4305 from josch/proj-debug 2022-04-11 14:20:14 +01:00
Artem Pavlenko
85997107af
Merge pull request #4304 from mathisloge/fix/cairo-1.17.6 2022-04-11 14:19:20 +01:00
Mathis Logemann
2259f8da6f use unnamed workflows, move vcpkg into preset update vcpkg 2022-04-11 15:04:30 +02:00
Johannes Schauer Marin Rodrigues
4f72043bcd
src/proj_transform.cpp: improve error handling of proj_transform()
- set proj log level to PJ_LOG_ERROR
 - let error message indicate whether proj_create_crs_to_crs or
   proj_normalize_for_visualization failed
 - output proj_context_errno_string when an error is thrown
2022-04-10 11:55:04 +02:00
Mathis Logemann
6afdc89894 fix test for newer cairo 2022-04-05 10:31:26 +02:00
Mathis Logemann
1bba69b108 [CI] update vcpkg to latest hash
notable changes: * proj => v9
[CI] fix sqlite dep

[vcpkg] update hash

update vcpkg cache
2022-04-02 18:05:03 +02:00
Mathis Logemann
e00847e711 [CI] fix sqlite dep 2022-03-19 10:27:34 +01:00
Mathis Logemann
2b8eec969b PluginInfo: remove static init and exit methods
those aren't used.
2022-03-15 21:12:43 +01:00
Mathis Logemann
5ee7571761 add dlerror for plugin loading 2022-03-15 21:12:43 +01:00
Mathis Logemann
4493a06878 call mapnik::setup automatically 2022-03-15 21:12:43 +01:00
Mathis Logemann
515a7e8279 changelog 2022-03-15 21:12:43 +01:00
Mathis Logemann
bb1bc2f07b [CMake] enable msvc static crt 2022-02-18 18:48:27 +01:00
Artem Pavlenko
2d03db8ef1 Fix scons build 2022-02-15 15:40:16 +00:00
Mathis Logemann
45568e8895 [datasource] call after_load for static plugins 2022-02-14 17:34:20 +01:00
Mathis Logemann
ee63a6f055 [tests] also test when using static 2022-02-14 10:15:09 +01:00
Mathis Logemann
0f0e06c6b8 [datasource] add plugin_registered function 2022-02-14 10:14:59 +01:00
Mathis Logemann
6fcdccaf83 [CMake] fix rename MAPNIK_STATIC_PLUGINS => BUILD_SHARED_PLUGINS 2022-02-09 15:57:03 +01:00
Mathis Logemann
c0d52ced18 [Changelog] describe breaking changes 2022-02-08 16:55:42 +01:00
Mathis Logemann
f9e69b4090 Merge branch 'master' of https://github.com/mapnik/mapnik into feature/cmake-static 2022-02-08 16:49:51 +01:00
Artem Pavlenko
f3da900c35
Merge pull request #4295 from mathisloge/ci/disable-debug-mode
[CI] disable vcpkg debug mode
2022-02-08 14:09:55 +00:00
Mathis Logemann
0769303075 [CI] ubuntu: run with mono 2022-02-08 14:59:43 +01:00
Mathis Logemann
01f414de59 [CI] disable vcpkg debug mode 2022-02-08 14:54:40 +01:00
Mathis Logemann
65dde2cce3 Merge branch 'master' of https://github.com/mapnik/mapnik into feature/cmake-static 2022-02-07 15:35:45 +01:00
Mathis Logemann
49ef468e84 [CMake] add msvc EHsc option 2022-02-07 15:35:09 +01:00
Mathis Logemann
42f465f842 refactor datasource plugins
fix merge

remove old DATASOURCE_PLUGIN call

fix memory_datasource

wip

wip

fix temp return

fix install

wip before_unload

linux

remove docker

remove docker

comments

add windows error message if libmapnik=static and plugins=dynamic

fix false plugin macro

plugin default de/constructor to remove UB

simplyfy plugin targets - add fpic

fix makro

simplyfy

use unique_ptr for plugin handle

rename option static plugins

replace local init with fnc call

call setup everywhere

init datasource_static
2022-02-07 15:35:09 +01:00
Artem Pavlenko
713104c2dc
Merge pull request #4290 from mathisloge/fix/gha-upload
[GHA] use current user if PR or local repo (readonly) and vcpkg debug…
2022-02-07 14:06:05 +00:00
Artem Pavlenko
843eb3eae5
Merge pull request #4289 from mathisloge/fix/format
fix formatting of warning.hpp
2022-02-07 14:05:40 +00:00
Mathis Logemann
e75725ef37 [GHA] use current user if PR or local repo (readonly) and vcpkg debug mode
use github.actor

test readonly access?

test

test

test

readonly user

use correct toolcahin for windows
2022-02-02 20:56:01 +01:00
Mathis Logemann
d148121dad fix formatting of warning.hpp 2022-02-02 17:31:43 +01:00
Mathis Logemann
8a1f2579e9 Merge branch 'master' of https://github.com/mapnik/mapnik into feature/cmake-static 2022-02-02 17:15:55 +01:00
Mathis Logemann
2d846dd5f3 static plugins
wip static plugins

add remaining datasources

wip

formatting
2022-02-02 16:35:49 +01:00
Artem Pavlenko
0c8352fc3e
Merge pull request #4288 from mathisloge/fix/github-actions 2022-02-02 14:32:53 +00:00
Mathis Logemann
32ca0104a7 fix gha secret name 2022-02-02 15:31:24 +01:00
Artem Pavlenko
f9b310a8ca
Merge pull request #4286 from mathisloge/feature/github-actions
add github actions
2022-02-02 14:28:23 +00:00
Mathis Logemann
cda203a83f use correct cache 2022-02-02 10:14:55 +01:00
Mathis Logemann
bff4dbd957 add github actions
use mapnik as user

drop codecov token (not needed)
2022-01-28 11:14:04 +01:00
Artem Pavlenko
d7b83c0f7d
Merge pull request #4282 from mathisloge/feature/clang-format
Feature clang format
2022-01-28 09:57:58 +00:00
Mathis Logemann
9bf8fcc823 fix color.cpp formatting 2022-01-28 10:37:38 +01:00
Mathis Logemann
779787f980 Merge branch 'master' of https://github.com/mapnik/mapnik into feature/clang-format 2022-01-28 10:31:55 +01:00
Artem Pavlenko
7df7e16c56
Merge pull request #4284 from mathisloge/fix/windows-utf8
CMake stuff, missing includes and enables tiff test on windows
2022-01-28 09:20:52 +00:00
Artem Pavlenko
dafdbb01ea
Merge pull request #4276 from mathisloge/remove_cxx11_support
remove cxx11_support.hpp
2022-01-28 09:18:53 +00:00
Mathis Logemann
7bccb2a280 Merge branch 'fix/windows-utf8' of https://github.com/mathisloge/mapnik 2022-01-27 19:18:11 +01:00
Mathis Logemann
ef062ac314 [unit-tests] mark text/nested script runs as unicode 16 2022-01-27 18:42:40 +01:00
Mathis Logemann
3b1d09702c [unit-test] enable tiff test 2022-01-27 18:40:22 +01:00
Mathis Logemann
3012ea43ee [visual-test] enable utf-8 console output for windows 2022-01-27 18:37:19 +01:00
Mathis Logemann
aee8519bac [CMake] visual test in own dir 2022-01-27 18:37:03 +01:00
Mathis Logemann
ba27149232 add missing includes 2022-01-27 18:32:21 +01:00
Mathis Logemann
08dcab617e [CMake] add benchmark run script 2022-01-27 18:31:33 +01:00
Mathis Logemann
ccd44da4a2 [CMake] fix installation 2022-01-27 18:30:13 +01:00
Mathis Logemann
c5d4bfe680 [CMake] add msvc utf-8 flag 2022-01-27 18:28:44 +01:00
Mathis Logemann
4fbaa032f0 format dir demo 2022-01-27 00:12:13 +01:00
Mathis Logemann
65035706fb format dir benchmark 2022-01-27 00:12:13 +01:00
Mathis Logemann
6dcf754077 format dir test
format dir test

fix
2022-01-27 00:12:12 +01:00
Mathis Logemann
d5a873e81c format utils 2022-01-27 00:12:12 +01:00
Mathis Logemann
e7c3d04309 format dir include and src
format all files

Revert "format all files"

This reverts commit 95d5812e49e7f916b68e786596f5a8eb5bcac414.

Revert "format some files"

This reverts commit ed3c8762d4d828b2b28e7b18809fc33f4f8ccaf5.

format all files

fix formatting in dir include

fix formatting of debug macro
2022-01-27 00:12:08 +01:00
Mathis Logemann
6fe46f61e2 add clang-format
fix clang-format

fix clang-format

adjust pointer and reference aligment

add cmake script to format all files run with: cmake -P cmake/clang-format.cmake

fix sort includes

change format cmake script
2022-01-26 23:36:12 +01:00
Mathis Logemann
61dd5dccab Merge branch 'master' of https://github.com/mapnik/mapnik 2022-01-26 00:13:21 +01:00
Artem Pavlenko
1d6350b1e5
Merge pull request #4281 from mathisloge/fix/unique_shared_ptr
use shared::ptr<T>::use_count instead of unique()
2022-01-25 12:09:52 +00:00
Mathis Logemann
9ac35a0a9c use use_count instead of unique()
This should be safe to use, since there aren't any weak_ptr's using the shared_ptr. Furthermore any async operations should be finished or guarded for multithreaded execution.
2022-01-25 10:21:27 +01:00
Artem Pavlenko
9e3bafcd4c
Merge pull request #4279 from mathisloge/fix/issue-4268
fix #4268 by adding mapped_memory_file
2022-01-25 08:54:50 +00:00
Mathis Logemann
a3ccf2967f [scons] add mapped_memory_file to source list 2022-01-24 21:21:45 +01:00
Artem Pavlenko
611fd93308
Merge pull request #4280 from mathisloge/feature/vcpkg
add vpkg.json manifest file
2022-01-24 17:04:17 +00:00
Mathis Logemann
c16aa1e5c4 add vpkg.json 2022-01-24 10:49:07 +01:00
Mathis Logemann
fe887a2c83 fix #4268 by adding mapped_memory_file 2022-01-24 10:45:32 +01:00
Mathis Logemann
26052486ee remove cxx11_support.hpp 2022-01-20 23:07:17 +01:00
Artem Pavlenko
fb06428250
Merge pull request #4275 from mathisloge/remove_make_unique_cpp11 2022-01-19 13:52:39 +00:00
Mathis Logemann
4f95463c75 remove make_unique 2022-01-19 12:42:52 +01:00
Artem Pavlenko
cf5541d180
Merge pull request #4272 from mathisloge/cite
add CITATION.cff
2021-12-14 11:44:10 +00:00
Mathis Logemann
3c2aff82bc add CITATION.cff 2021-12-14 10:49:22 +01:00
Artem Pavlenko
79901e494b
Merge pull request #4271 from mathisloge/fix/cmake_install
[CMake] do not install FindHarfbuzz.cmake
2021-12-03 14:02:53 +00:00
Mathis Logemann
7a1b441cf0 [CMake] do not install FindHarfbuzz.cmake 2021-12-03 14:48:13 +01:00
Artem Pavlenko
6d47d3b70f
Merge pull request #4270 from mathisloge/fix/cmake-proj
fix proj version detection / harfbuzz pkg-config for cmake
2021-12-03 10:54:29 +00:00
Mathis Logemann
d546cda6d5 [CMake] drop harfbuzz and use pkg-config as a backup 2021-11-20 12:53:58 +01:00
Mathis Logemann
eb4390b5a6 fix proj version detection for cmake 2021-11-19 20:04:22 +01:00
Mathis Logemann
92b1dbaf32 delete all data 2021-11-15 16:41:37 +01:00
Mathis Logemann
c5d3d9c188 wip 2021-11-15 16:39:10 +01:00
Mathis Logemann
c6619d042c check out correctly 2021-11-15 16:09:46 +01:00
Mathis Logemann
7195448334 all branches 2021-11-15 16:08:48 +01:00
Mathis Logemann
500728e51f test workflow 2021-11-15 16:08:27 +01:00
Mathis Logemann
4b66137654 initial docker 2021-11-15 15:32:58 +01:00
Artem Pavlenko
14f913d6ab
Merge pull request #4266 from mathisloge/cmake_improvments
[CMake] improve build structure
2021-11-15 14:21:13 +00:00
Mathis Logemann
a911e33d7b [CMake] add more build presets
[CMake] rename windows presets

Revert "[CMake] rename windows presets"

This reverts commit 381dcd606c0c8f4281a482ede0c8c4a9a6d912fa.

[CMake] rename windows presets
2021-11-15 11:30:59 +01:00
Mathis Logemann
fbb0ae1489 [CMake] fix building with zero plugins
[Cmake] fix null plugins

fix null
2021-11-15 00:55:58 +01:00
Mathis Logemann
7a7a8125a9 [CMake] remove obsolete statements/improve docs
[CMake] remove obsolete variables and improve docs

[CMake] remove proj env var
2021-11-15 00:40:48 +01:00
Mathis Logemann
f0940c2075 [CMake] move all build artifacts into same dir to remove the need of copy_dlls (except for plugins)
[CMake] improve BUILD_TESTING and use pkgconf for cairo on linux

[CMake] add Threads dependency to -Config
2021-11-15 00:40:47 +01:00
Artem Pavlenko
dc5f497495 catch.hpp - upgrade to v2.13.7 (to unlock c++20 support) 2021-11-02 14:16:07 +00:00
Artem Pavlenko
4eb38c1051
Merge pull request #4260 from mathisloge/windows_define
replace _WINDOWS with _WIN32
2021-10-25 10:25:50 +01:00
Mathis Logemann
e626ba2688 replace _WINDOWS with _WIN32 2021-10-21 18:22:53 +02:00
Artem Pavlenko
f2ab25cf98
Merge pull request #4257 from mathisloge/cmake-pkgconf-improv
[CMake] improve pkg-config export
2021-10-20 16:08:47 +01:00
Mathis Logemann
aa903c675f [CMake] improve pkg-config export
add needed libs

pkg-conf: move libmapnikjson and libmapnikjson to m_requires

make pkg multi config aware

update proj min ver

correct prefix

use the correct output name

add import prefixes, just in case
2021-10-20 16:23:04 +02:00
Artem Pavlenko
4695c42b51
Merge pull request #4253 from GimpMaster/master
Compile for vcpkg using VS2017
2021-10-18 15:18:48 +01:00
Artem Pavlenko
28378b81e8
Merge pull request #4254 from mathisloge/cmake_option_fix
[CMake] fix mapnik_option
2021-10-18 10:40:01 +01:00
Mathis Logemann
c551ed3a62 [CMake] fix mapnik_option 2021-10-16 08:31:19 +02:00
Mathis Logemann
aef71dbae5 [CMake] fix mapnik_option 2021-10-16 08:27:09 +02:00
Joshua Hintze
cab3ba345c -Removed unneeded macro escapes 2021-10-15 19:33:50 -06:00
Joshua Hintze
15798e6ebb -Fixed issue with VS2017 compiling 2021-10-15 19:31:45 -06:00
Artem Pavlenko
0edb018465
Merge pull request #4252 from mathisloge/cmake_mapnik_config
[CMake] Fix issues with tests, boost-regex and webp. Fix viewer qt6
2021-10-13 17:02:16 +01:00
Mathis Logemann
a89447686c remove mapnik-config 2021-10-13 17:47:38 +02:00
Mathis Logemann
5ef2e27e8e [CMake] add boost regex icu check 2021-10-13 10:16:39 +02:00
Mathis Logemann
01dccee231 Merge branch 'cmake_mapnik_config' of https://github.com/mathisloge/mapnik into cmake_mapnik_config 2021-10-13 09:04:31 +02:00
Mathis Logemann
83b4989bd4 [CMake] restore compability with 3.15 2021-10-13 09:04:26 +02:00
Mathis Logemann
561a79720e [CMake] unit-test add utilities to path 2021-10-12 23:00:48 +02:00
Mathis Logemann
6dee79f442 [CMake] mapnik::mapnik restructure. should give a better overview 2021-10-11 19:08:25 +02:00
Mathis Logemann
dea63374f4 [CMake] better logging of feature options. Output log files for better help management. ; get started with mapnik-config 2021-10-10 21:34:15 +02:00
Mathis Logemann
59f7a61661 [CMake] unit-test copy more data 2021-10-09 14:11:58 +02:00
Mathis Logemann
ba8a972254 [unit-test] fix formatting 2021-10-09 13:55:32 +02:00
Mathis Logemann
05c2278893 [CMake] add the search paths for the build executables automatically for ctest.; depend completly on the external catch2 2021-10-09 13:48:11 +02:00
Mathis Logemann
a73d2f7d94 [unit-tests] fix windows 11 path search 2021-10-09 13:46:55 +02:00
Mathis Logemann
bf6081b207 [unit-test] add std includes for external catch2 2021-10-09 13:46:24 +02:00
Mathis Logemann
ac95449ff5 [CMake] fix critical webp init 2021-10-09 09:40:44 +02:00
Mathis Logemann
56e8de6b16 [CMake] proj remove global 2021-10-09 08:44:03 +02:00
Mathis Logemann
1a5aea5653 [CMake] use pkgconf imported target for proj; see https://github.com/mapnik/mapnik/issues/4249#issuecomment-937214705 2021-10-08 20:21:18 +02:00
Mathis Logemann
a0525ddd26 [CMake] nativ harfbuzz don't publish a version. Therefore we can't depend on it. 4645c3b47c/CMakeLists.txt (L686) and following 2021-10-07 20:16:45 +02:00
Mathis Logemann
8714432a67 [viewer] fix qt6 2021-10-07 20:05:11 +02:00
Artem Pavlenko
d96b6843b3
Merge pull request #4251 from mathisloge/cmake_hotfix
[CMake] fix `mapnik_find_plugin_dir`
2021-10-06 16:10:11 +01:00
Mathis Logemann
95e210521c [CMake] fix mapnik_find_plugin_dir 2021-10-06 16:43:55 +02:00
Artem Pavlenko
6f01d7a34a
Merge pull request #4250 from mathisloge/boost_bump_1_73
bump boost version to 1.73 and fix docs
2021-10-06 14:23:05 +01:00
Mathis Logemann
feca084ed6 bump boost version to 1.73 and fix docs 2021-10-06 15:15:32 +02:00
Artem Pavlenko
a1a3a712dd
Merge pull request #4248 from mathisloge/cmake-fix
[CMake] Simplify install, add min versions and PkgConfig
2021-10-06 10:28:21 +01:00
Mathis Logemann
333e745d7b [CMake] pkg-config: generate correct library link file names 2021-10-01 20:42:57 +02:00
Mathis Logemann
8c83e15404 [CMake] fix export plugin file naming 2021-09-23 19:28:40 +02:00
Mathis Logemann
fa2fec338b [CMake] add import prefix for libmapnik
so that the resulting archive is also named libmapnik
2021-09-23 19:11:29 +02:00
Mathis Logemann
fcc7016124 add basic pkg-config exports 2021-09-23 18:46:48 +02:00
Mathis Logemann
a2d3364ec7 [CMake] add version and soversion to base libraries 2021-09-23 10:41:25 +02:00
Mathis Logemann
1c51a8e529 [CMake] add configuration dependend exports for plugin install dir.
add function to get the current plugin install dir
2021-09-23 10:33:32 +02:00
Mathis Logemann
5287c234d6 [CMake] fix resulting config when no plugins are build 2021-09-22 21:39:04 +02:00
Mathis Logemann
f1ed49edec install utilities 2021-09-22 20:49:44 +02:00
Mathis Logemann
35ea6f2a56 [CMake] refactor mapnik_install 2021-09-22 19:52:39 +02:00
Mathis Logemann
d57f0ac93a [Cmake] Fix cache description 2021-09-22 15:44:34 +02:00
Mathis Logemann
755e8d322e add minimum versions; proj include dir only as a build interface 2021-09-22 15:25:55 +02:00
Mathis Logemann
25774ac82a [CMake] unify and simplify install commands.; Add Components to targets 2021-09-22 14:41:50 +02:00
Mathis Logemann
9d4d7fd273 [CMake] do not print install targets 2021-09-22 13:19:43 +02:00
Artem Pavlenko
1ccbbf95b5
Merge pull request #4244 from mathisloge/cmake-pub-dep
[CMake] make mapnik::core a public dependency of mapnik::mapnik
2021-09-15 16:38:23 +01:00
Mathis Logemann
8bd463d4fc make mapnik::core a public dependency of mapnik::mapnik 2021-09-14 20:46:43 +02:00
Artem Pavlenko
737e7a69c2 Add includes required for building with boost_1_77 (46e3d9231c (diff-2eb9871858184271f07935b31093c2d9f70f7a219979bec85adc03db6721a182)) 2021-09-01 10:11:13 +01:00
Artem Pavlenko
69911ad9ea
Merge pull request #4191 from mathisloge/cmake-support
CMake build support
2021-08-30 09:44:14 +01:00
Mathis Logemann
f40822980e update to latest catch2 2021-08-25 17:25:23 +02:00
Mathis Logemann
02180115bf some last minor improvements 2021-08-25 16:41:57 +02:00
Artem Pavlenko
262f769ece Update test/data 2021-08-17 13:27:08 +01:00
Mathis Logemann
0198cad883 Merge branch 'master' of https://github.com/mapnik/mapnik into cmake-support 2021-08-13 20:44:55 +02:00
Mathis Logemann
4b4cfca706 copy all plugins to the viewer build dir 2021-08-13 20:41:30 +02:00
Mathis Logemann
83e77559c4 update cmake docs 2021-08-13 17:21:46 +02:00
Artem Pavlenko
29eea37b38 Update test/data 2021-08-12 10:30:44 +01:00
Mathis Logemann
8500b3cd69 remove not needed include of <warning.hpp> 2021-07-24 00:58:28 +02:00
Mathis Logemann
a8d6bdcac1 [FindWebP] FOUND_VAR is deprecated 2021-07-23 18:41:30 +02:00
Mathis Logemann
fcda7021b6 Revert "found var was deprecated."
This reverts commit 6b5e4dcec2.
2021-07-23 18:41:07 +02:00
Mathis Logemann
6b5e4dcec2 found var was deprecated. 2021-07-23 18:40:57 +02:00
Mathis Logemann
001718cf73 some fixes for FindWebP 2021-07-23 18:39:42 +02:00
Mathis Logemann
872f1139db Merge branch 'cmake-support' of https://github.com/mathisloge/mapnik into cmake-support 2021-07-23 18:14:40 +02:00
Mathis Logemann
02fed92074 link with correct lib (clang) 2021-07-23 19:34:17 +02:00
Mathis Logemann
f80a7724bf delete clang toolchain(replaced by CMakePresets) 2021-07-23 18:14:37 +02:00
Mathis Logemann
ac6842656e enable qt6 or qt5 for mapnik-viewer. android could be dropped 2021-07-23 17:06:24 +02:00
Mathis Logemann
f90c684471 add missing generator to CMakePresets 2021-07-23 16:41:28 +02:00
Mathis Logemann
08791f496d add MAPNIK_STATS 2021-07-23 16:10:35 +02:00
Mathis Logemann
6739c30941 fixed some var refs 2021-07-23 16:04:25 +02:00
Mathis Logemann
42fec31784 add version again to FindWebP 2021-07-23 15:54:51 +02:00
Mathis Logemann
e2524f80df rewrite webp to add debug libraries 2021-07-23 15:48:17 +02:00
Mathis Logemann
72600b996e added missing options 2021-07-23 13:34:49 +02:00
Mathis Logemann
54e63dd9fe some docs 2021-07-22 23:05:48 +02:00
Mathis Logemann
01516c9603 fix 2021-07-22 22:56:00 +02:00
Mathis Logemann
1f6a794b43 add MAPNIK_DEBUG when using the mapnik debug configuration 2021-07-22 22:54:22 +02:00
Mathis Logemann
28d286ecb8 i really need to upgrade proj... 2021-07-22 22:46:23 +02:00
Mathis Logemann
d737569574 add presets 2021-07-22 22:45:39 +02:00
Mathis Logemann
4d3affb95d fix gdal include dir 2021-07-22 22:06:01 +02:00
Mathis Logemann
14944cd235 added some docs 2021-07-22 21:55:01 +02:00
Mathis Logemann
bbcf1c2009 add multithreaded 2021-07-22 21:45:25 +02:00
Mathis Logemann
b925abf403 fix library name 2021-07-22 21:35:12 +02:00
Mathis Logemann
03b1f18c89 make pkg-config optionally. But fail later when we actually need pkg-config as a fallback 2021-07-22 21:04:45 +02:00
Mathis Logemann
7b0aa9d3bf remove openjpeg again. was just a test 2021-07-22 20:45:16 +02:00
Mathis Logemann
3001e0c78a Revert "remove openjpeg again. was just a test."
This reverts commit bcc66a739c.
2021-07-22 20:44:36 +02:00
Mathis Logemann
bcc66a739c remove openjpeg again. was just a test. 2021-07-22 20:44:29 +02:00
Mathis Logemann
81397f84bc add debug postfix to wkt, json and mapnik.
Mapnik can be installed with multi configuration enviroment
2021-07-22 20:34:08 +02:00
Mathis Logemann
9998ca7dd9 fix gdal library variable 2021-07-22 20:17:03 +02:00
Mathis Logemann
3a2996e5b0 install mapbox headers when using NOT USE_EXTERNAL* 2021-07-21 20:20:44 +02:00
Mathis Logemann
199fd8218b this fixes a bug when including a package via pkg-config:
We will append the call to the config file to find the package
via find_package. However this does not work when the package was included
with pkg-config
2021-07-21 20:08:22 +02:00
Mathis Logemann
282986c503 fix config file naming scheme.
Only happens when using older cmake versions. But this was definitly an issue.
Target name should be the same on the file (case sensitive)
2021-07-21 20:03:42 +02:00
Mathis Logemann
e5cf5dda39 default to jpeg. 2021-07-21 18:24:40 +02:00
Mathis Logemann
c5ced60c38 fix some bugs when using ubuntu to build 2021-07-21 18:16:48 +02:00
Mathis Logemann
01159d0721 still forget proj everytime... 2021-07-07 21:11:28 +02:00
Mathis Logemann
59f9974baa TEMP: use openjpeg 2021-07-07 21:06:59 +02:00
Mathis Logemann
3397fff8ea add harfbuzz fallback 2021-07-06 22:46:07 +02:00
Mathis Logemann
cdb598e67b add harfbuzz minimum version and HarfBuzz::ICU target. probably fixes osx 2021-07-06 22:19:28 +02:00
Mathis Logemann
c5f0565654 remove subsequent boost require version calls. 2021-07-06 22:07:29 +02:00
Mathis Logemann
eb1236d5dd use proj *gr* 2021-07-06 21:32:58 +02:00
Mathis Logemann
e408bf9a22 add find harfbuzz.cmake 2021-07-06 21:32:36 +02:00
Mathis Logemann
6a19824c12 hate proj4... 2021-07-05 21:58:53 +02:00
Mathis Logemann
7a13a940df build plugins as modules. 2021-07-05 17:13:45 +02:00
Mathis Logemann
7231d06a46 ups. this shouldn't be commited 2021-07-02 22:43:01 +02:00
Mathis Logemann
7f2511632f add packaging 2021-07-02 22:26:36 +02:00
Mathis Logemann
d610671327 try install json and wkt again 2021-07-02 16:02:30 +02:00
Mathis Logemann
cdf41a3144 install sparsehash 2021-07-02 13:55:55 +02:00
Mickey Rose
51b118ef2f prevent files under scons/ from skewing repository language statistics 2021-07-02 11:00:28 +02:00
Mathis Logemann
d17abeddb7 [cmake] add folders for visual studio 2021-06-30 10:33:20 +02:00
Mathis Logemann
a7ec89a8a1 Merge branch 'master' of https://github.com/mapnik/mapnik into cmake-support 2021-05-29 22:43:59 +02:00
Artem Pavlenko
0a8e353e83
Merge pull request #4230 from mapnik/c++20
C++20
2021-05-17 16:15:07 +01:00
Artem Pavlenko
0efdcafe56 make from_u8string inline 2021-05-17 16:11:53 +01:00
Artem Pavlenko
6fa2666747 Add convertion functions from_u8string to support c++20 + update tests 2021-05-17 16:11:44 +01:00
Artem Pavlenko
fb2e45c579 Upgrade to ICU 58.1 2021-04-28 17:05:24 +01:00
Mathis Logemann
4879efce58 Merge branch 'master' of https://github.com/mapnik/mapnik into cmake-support 2021-04-22 19:41:35 +02:00
Mathis Logemann
5a109a99fb install dependencies only on windows and install plugins into correct dir 2021-04-22 19:41:21 +02:00
Artem Pavlenko
88a15daf93 Fix parse_svg_value 2021-04-22 11:36:10 +01:00
Artem Pavlenko
a1cb756fa0 SVG parse_svg_value: update is_percent only if parsing successful 2021-04-19 18:02:24 +01:00
Artem Pavlenko
3031b7cf6a SVG parse_svg_value/parse_font_size: re-initialise default val on parser failure 2021-04-19 08:55:39 +01:00
Artem Pavlenko
4ff25eb2a8 remove token 2021-04-16 17:26:44 +01:00
Artem Pavlenko
21fd41b9a9
Merge pull request #4225 from mapnik/svg-rendering-improvements
SVG rendering improvements
2021-04-16 09:51:25 +01:00
Artem Pavlenko
7c5f4539e1 Fix error message + update SVG parser unit test 2021-04-15 16:29:05 +01:00
Artem Pavlenko
fd204874ec svg2png - avoid writing to an empty image 2021-04-15 15:53:04 +01:00
Artem Pavlenko
654a3c1f9f SVG : refactor and simplify width/height+viewBox logic (https://www.w3.org/TR/SVG11/struct.html#SVGElement) + check font_sizes_ size before accesing last element 2021-04-15 15:38:59 +01:00
Artem Pavlenko
0feabeb7e8 SVG circle: ignore when r = 0 2021-04-13 13:48:05 +01:00
Artem Pavlenko
55370c3453 Update visual data 2021-04-13 10:26:39 +01:00
Artem Pavlenko
f293371a9d SVG rendering improvements:
* process `font-size` attributes and use them to scale `em` units
* fix default `color-stop` value
* store `viewBox` and use it to calculate `%` values correctly
* add more absolute/relative values
* default `DPI`:96
* default `font-size`: 10
* process style attributes on `<svg>` element
* use viewBox `width`, `height` and `normalized_diagonal` for relevant length values
* apply scale factor to gradient transforms
2021-04-13 09:19:33 +01:00
Artem Pavlenko
9c2132f895 Fix gradient transform calc (apply scale factor) 2021-04-13 09:17:48 +01:00
Artem Pavlenko
ff8c411749 Use DPI=96 + add absolute and relative sizes + add missing value units 2021-04-12 14:16:39 +01:00
Artem Pavlenko
4f783f61ed Init by value 2021-04-12 14:16:09 +01:00
Mathis Logemann
e1fa32f21f install dependencies. Required for windows (and ?macos?). Needs testing on linux. 2021-04-10 14:36:22 +02:00
Mathis Logemann
1929fbc0ba add an option to disable plugin and font copying 2021-04-09 15:53:21 +02:00
Mathis Logemann
02f78e4ce5 fixed Dll copying on windows; copy plugins and fonts into appropiate directories when building. 2021-04-09 15:50:50 +02:00
Mathis Logemann
b6d8f54779 Merge branch 'master' of https://github.com/mapnik/mapnik into cmake-support 2021-04-06 18:38:51 +02:00
Artem Pavlenko
6bab4e56fd Move MAPNIK_DECL to the front (ref https://github.com/mapnik/mapnik/pull/4220#issuecomment-814259514) 2021-04-06 17:36:46 +01:00
Mathis Logemann
9049a7e58d Merge branch 'master' of https://github.com/mapnik/mapnik into cmake-support 2021-04-06 17:27:28 +02:00
Artem Pavlenko
8c3b9758eb
Merge pull request #4220 from mapnik/proj6
Simplify proj_transform_cache implementation
2021-04-06 11:58:44 +01:00
Artem Pavlenko
b974a4a683 Simplify proj_transform_cache implementation (ref https://github.com/mapnik/mapnik/pull/4191#issuecomment-813377082) 2021-04-06 10:30:12 +01:00
Mathis Logemann
5963c64960 Merge branch 'master' of https://github.com/mapnik/mapnik into cmake-support 2021-04-01 18:17:39 +02:00
Artem Pavlenko
bb18a5ba0a
Merge pull request #4219 from mathisloge/proj_transform_fix
fixes proj_transform_cache incomplete type
2021-04-01 17:16:48 +01:00
Mathis Logemann
bed3ffb3dc fix typo grid renderer -> svg renderer 2021-04-01 18:01:43 +02:00
Mathis Logemann
ee90425de1 fixes proj_transform_cache incomplete type for gcc 2021-04-01 17:57:20 +02:00
Mathis Logemann
f57d39378d add BIGINT and MAPNIK_MEMORY_MAPPED_FILE; require cxx standard, disable compiler specific flags (CXX_EXTENSIONS) 2021-04-01 16:15:32 +02:00
Mathis Logemann
b1e1ea66f5 try fix linux take II 2021-04-01 16:03:58 +02:00
Mathis Logemann
7121bd6fbf Revert "hopefully fix unstatisfied proj_transform_cache"
This reverts commit d2066da339.
2021-04-01 15:55:57 +02:00
Mathis Logemann
d2066da339 hopefully fix unstatisfied proj_transform_cache 2021-03-31 20:25:46 +02:00
Mathis Logemann
8cd78b6945 Merge branch 'master' of https://github.com/mapnik/mapnik into cmake-support 2021-03-26 20:04:30 +01:00
Artem Pavlenko
53669bc42e
Merge pull request #4202 from mapnik/proj6
Upgrade to new Proj APIs
2021-03-26 16:55:10 +00:00
Mathis Logemann
7897bb5c83 add threads to mapnik::core 2021-03-26 15:45:15 +01:00
Mathis Logemann
1367e7007f print version strings if available 2021-03-25 21:28:41 +01:00
Mathis Logemann
2b977f14c9 changed proj; add mapnik_proj_version; use boost regex icu workaround 2021-03-25 18:46:18 +01:00
Mathis Logemann
eb943d11d0 add postgis to unit tests 2021-03-25 18:42:17 +01:00
Artem Pavlenko
3489bdbe36 rename PROJ_VERSION to MAPNIK_PROJ_VERSION to avoid clashes with libproj 2021-03-25 16:38:21 +00:00
Mathis Logemann
0ab47e1fc6 Merge branch 'proj6' of https://github.com/mapnik/mapnik into cmake-support 2021-03-25 17:28:06 +01:00
Mathis Logemann
b2116fd9e9 added benchmarks; needed mutex header 2021-03-25 17:26:29 +01:00
Artem Pavlenko
f093d0cf6e Fix potential iterator out of range condition by using appropriate function (ref #4218) via @mathisloge
```
template< class InputIt1, class InputIt2, class BinaryPredicate >

bool equal( InputIt1 first1, InputIt1 last1,
            InputIt2 first2, InputIt2 last2,
            BinaryPredicate p );
```
2021-03-25 16:07:48 +00:00
Artem Pavlenko
5dfd1a24fc Fix potential iterator out of range condition by using appropriate function (ref #4218) via @mathisloge
```
template< class InputIt1, class InputIt2, class BinaryPredicate >

bool equal( InputIt1 first1, InputIt1 last1,
            InputIt2 first2, InputIt2 last2,
            BinaryPredicate p );
```
2021-03-25 16:03:15 +00:00
Mathis Logemann
c29c84327a add proj_transform_cache to source list 2021-03-25 13:34:25 +01:00
Mathis Logemann
f8b159f8ff Merge branch 'proj6' of https://github.com/mapnik/mapnik into cmake-support 2021-03-25 13:26:30 +01:00
Artem Pavlenko
503b9c5bbf Move proj_transform_cache declarations and implementaion into separate translation unit (ref VC++ C2492) 2021-03-25 12:16:15 +00:00
Mathis Logemann
0a3bb4e8bd update test data deps. somehow got messed up in last commit 2021-03-25 08:52:09 +01:00
Mathis Logemann
31c0b08548 renamed MAPNIK_USE_PROJ4 to MAPNIK_USE_PROJ and removed ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 2021-03-24 23:55:12 +01:00
Mathis Logemann
59b97a57fc test data changes 2021-03-24 23:31:11 +01:00
Mathis Logemann
4eed15f87a Merge branch 'proj6' of https://github.com/mapnik/mapnik into cmake-support 2021-03-24 23:30:50 +01:00
Mathis Logemann
772e50ba79 copy basic dlls for mapnik-demo 2021-03-24 23:28:36 +01:00
Mathis Logemann
e963af53a5 find proj without config 2021-03-24 15:21:39 +01:00
Mathis Logemann
61a1248262 fix false default cmake install dir 2021-03-24 15:17:08 +01:00
Mathis Logemann
db6d1a1293 fix typo in text 2021-03-24 15:16:12 +01:00
Mathis Logemann
9835f07179 find and link icu first 2021-03-24 14:57:27 +01:00
Artem Pavlenko
c76f65a49a Add missing header (linux) 2021-03-24 11:44:56 +00:00
Artem Pavlenko
d756b534e3 Fix names and add welsh reference for good measure 2021-03-24 11:42:18 +00:00
Artem Pavlenko
2bb5bdb9fe Fix existing and add more transformation test + test for is_geographic (ref 3a302667a1) 2021-03-24 11:23:27 +00:00
Artem Pavlenko
f82ed08d6a Replace remaining MAPNIK_USE_PROJ4 -> MAPNIK_USE_PROJ 2021-03-24 11:22:32 +00:00
Artem Pavlenko
b24fc9a8da Remove proj4 related stuff 2021-03-24 11:21:50 +00:00
Artem Pavlenko
3a302667a1 Fix return value (MAPNIK_WEBMERCATOR_PROJ is not geographic SRS) 2021-03-24 09:42:52 +00:00
Artem Pavlenko
59aa5087fc upgrade libpq to 9.6.5 2021-03-22 16:03:08 +00:00
Artem Pavlenko
602948f783 Upgrade mason pkgs:
* libgdal 2.2.3
* libpng 1.6.32
* jpeg_turbo 1.5.2
* libtiff 4.0.8
2021-03-22 15:45:36 +00:00
Mathis Logemann
167461ccc4 rename internal name mapnik-core to core since the exported name would be mapnik::mapnik-core instead of mapnik::core. This fixes the issue 2021-03-19 22:51:50 +01:00
Artem Pavlenko
5afe22030f Fix proj_version on macOS 2021-03-19 16:37:21 +00:00
Artem Pavlenko
9df7afd0a3 Add 'proj_version' check + define PROJ_MIN_VERSION as 7.2.0 2021-03-19 13:24:14 +00:00
Artem Pavlenko
6af16764aa proj - add version check based on major*10000+minor*100+patch format 2021-03-19 13:22:16 +00:00
Artem Pavlenko
6b9b42f314 Declare proj_cache_ thread_local static to allow mapnik::Map to be thread-safe under certain conditions + refactor
(benchmark/src/test_rendering_shared_map.cpp)
2021-03-18 16:05:58 +00:00
Artem Pavlenko
ebbd544d75 Add text to indicate if proj_transform is internal or external (libproj) 2021-03-18 16:05:09 +00:00
Artem Pavlenko
9c7e21fa47 Re-use proj_transform as creating a new one is extremely expensive on libproj >= 6 (NOTE: epsg:4326 and epsg:3857 are special cases which use internal implementations and are not expensive to create on stack). 2021-03-18 15:32:13 +00:00
Mathis Logemann
36be4fe594 renamed target mapnik::headers to mapnik::core 2021-03-18 15:35:55 +01:00
Mathis Logemann
4604aee202 3.15 is the minium supported target. tested. 2021-03-17 23:06:49 +01:00
Mathis Logemann
4e898b2a52 added some basic READMEs 2021-03-17 22:37:46 +01:00
Mathis Logemann
ae43a49b71 add dependencies to cmake config. Provieded a new macro for better maintance 2021-03-17 22:18:21 +01:00
Mathis Logemann
a0d60f233b fixes cairo renderer debug configuration. Copied FindCairo had a lot of issues with the multiconfiguration settings. Rewrite of the whole file 2021-03-17 21:29:00 +01:00
Artem Pavlenko
199e609a79 Fix compiler warning - use non-reference type 'boost::tuples::cons<...>' 2021-03-16 11:49:53 +00:00
Artem Pavlenko
fbc6bec12a Update visual data references 2021-03-15 18:18:24 +00:00
Artem Pavlenko
56d63073b4 Update test 2021-03-15 18:10:09 +00:00
Artem Pavlenko
387d54fe9d Defer projection init 2021-03-15 18:09:21 +00:00
Artem Pavlenko
6099804559 Use POSIX definition of pi constant (M_PI) + define tau in terms of pi + better namings + remove deprecated proj4 style definitions 2021-03-15 18:06:26 +00:00
Mathis Logemann
c1d9bde886 fix find cairo 2021-03-15 10:03:26 +01:00
Mathis Logemann
f9d65edf20 oops. do not push github workflow 2021-03-15 08:57:50 +01:00
Mathis Logemann
79d369db1f Merge branch 'master' of https://github.com/mapnik/mapnik into cmake-support 2021-03-15 08:52:15 +01:00
Mathis Logemann
b3fb65edaa Merge branch 'master' of https://github.com/mathisloge/mapnik into cmake-support 2021-03-15 08:49:27 +01:00
Artem Pavlenko
baad6b3819 Update data and data-visual to use epsg:XXXX syntax to define SRS (old proj4 syntax is not recommended in proj >=6) 2021-03-12 16:24:11 +00:00
Artem Pavlenko
c71bcdc92d update visual tests affected by switching to well_known_srs 2021-03-12 14:39:14 +00:00
Artem Pavlenko
f432204180 Update test/data-visual 2021-03-12 13:14:31 +00:00
Artem Pavlenko
68efb709ed Fix mason version 2021-03-11 15:16:31 +00:00
Artem Pavlenko
ec880947e0 fix merge artifacts 2021-03-11 15:04:53 +00:00
Artem Pavlenko
342bf2947b Merge branch 'master' into proj6 2021-03-11 14:51:01 +00:00
Artem Pavlenko
74c79eb17c
Merge pull request #4217 from mapnik/scons-4.1.0
Scons 4.1.0
2021-03-11 14:45:32 +00:00
Artem Pavlenko
689aa4cdef Remove Proj.4 reference in preference to Proj 2021-03-11 14:11:44 +00:00
Artem Pavlenko
d9b7055cbe travis-ci - brew link postgresql postgis 2021-03-11 13:58:53 +00:00
Artem Pavlenko
b70e5adad0 remove extract token 2021-03-11 13:57:12 +00:00
Artem Pavlenko
a6ced1622c .travis.yml - use 'brew list --formula + brew link git` 2021-03-11 13:41:35 +00:00
Artem Pavlenko
13a6b0c03a .travis.yml - fix syntax typo 2021-03-11 12:40:15 +00:00
Artem Pavlenko
5f78b90572 travis-ci - revive postgis.input tests (call unlink brew pkga in script section) 2021-03-11 12:32:58 +00:00
Artem Pavlenko
466ff8c319 travis-ci - unlink all brew pkgs 2021-03-11 11:15:33 +00:00
Artem Pavlenko
e91d1ec0a5 travis-ci - brew list 2021-03-11 10:56:47 +00:00
Artem Pavlenko
93f239f5cb travis-ci print brew info proj/boost 2021-03-11 10:13:44 +00:00
Artem Pavlenko
256ee86104 unit tests - don't run projection transformations tests which require libproj when MAPNIK_USE_PROJ4 is not set 2021-03-11 09:58:24 +00:00
Artem Pavlenko
692907761a Add more diagnostic stderr 2021-03-10 16:36:13 +00:00
Artem Pavlenko
5d5cc3a5db Try building without postgis.input 2021-03-10 12:22:14 +00:00
Artem Pavlenko
f5d911968f Force remove system boost_1_74 2021-03-10 11:46:52 +00:00
Artem Pavlenko
abf05e8bc8 Remove (attempting) system boost 2021-03-10 11:37:37 +00:00
Artem Pavlenko
5d88fa4a2c Let's see if upgrading xcode to 12.2 solves the boost issue 2021-03-10 11:11:45 +00:00
Artem Pavlenko
8271bbde06 Merge branch 'master' into scons-4.1.0 2021-03-10 09:34:57 +00:00
Artem Pavlenko
0714e61545 Refactor "Query map point" unit test 2021-03-09 16:29:23 +00:00
Artem Pavlenko
ebc3dabd6d Add basic Map::query_map_point test 2021-03-09 16:14:26 +00:00
Artem Pavlenko
0e0d222ede Print mapnik::Map (useful gathering query_map_point data) 2021-03-09 16:13:20 +00:00
Artem Pavlenko
f8877e2263 Add missing &copy 2021-03-09 16:12:54 +00:00
Artem Pavlenko
eb49b5776a Fix BBOX in geographic WGS84 (epsg:4326) calc logic 2021-03-09 15:02:11 +00:00
Artem Pavlenko
977c65e9de Fix proj_transform order in Map::query_point 2021-03-09 11:33:21 +00:00
Artem Pavlenko
7cbbd7305b Map::mapnik - restore non-const access to layers + create proj_transform and cache in get_proj_transform + declare proj_cache_ mutable 2021-03-09 10:48:32 +00:00
Artem Pavlenko
8f126a1000 Fix updateData signal signature so it actually works + cleanups 2021-03-08 13:21:01 +00:00
Artem Pavlenko
fb325f527b Fix updateData signal signature so it actually works + cleanups 2021-03-08 13:19:11 +00:00
Artem Pavlenko
f1fc3c4948 Update mason version 2021-03-05 15:42:32 +00:00
Artem Pavlenko
1259b1d333 try boost 1.75.0 2021-03-05 15:37:23 +00:00
Artem Pavlenko
2cd0c91215 Attempting to fix travis-ci :D 2021-03-05 15:32:21 +00:00
Artem Pavlenko
e8c2ba7eeb travis-ci - revert back to language:generic 2021-03-05 14:22:20 +00:00
Artem Pavlenko
61a73d21e6 bootstrap.sh - boost 1.74 + remove libexpat dep 2021-03-05 14:18:03 +00:00
Artem Pavlenko
459ea9f486 travis-ci - upgrade to xcode11 2021-03-05 12:42:13 +00:00
Artem Pavlenko
3c475ab7da travis-ci - set PYTHON=python3 globally 2021-03-05 11:08:20 +00:00
Artem Pavlenko
6124b1fae8 set PYTHON env var to python3 2021-03-05 11:04:07 +00:00
Artem Pavlenko
1bc84b837a attempting to force python3 2021-03-05 10:52:33 +00:00
Artem Pavlenko
65273e7a07 .travis.yml - set language to c++ 2021-03-05 10:45:35 +00:00
Artem Pavlenko
489154b342 remove python2 stuff 2021-03-05 10:35:20 +00:00
Artem Pavlenko
84a05a6597 Upgrade to Scons 4.1.0 2021-03-05 10:18:26 +00:00
Artem Pavlenko
b532beccde mapnik::Map ctor/operator= - initialise proj transforms 2021-03-04 10:19:44 +00:00
Artem Pavlenko
554556e4d5 Add support for libproj >=8 2021-03-04 10:18:42 +00:00
Artem Pavlenko
b75737fd6a Implement proj_transform caching using boost::unordered_map which allows calling find method with compatible key type.
In this case `std::pair<boost::string_view, boost::string_view>` avoiding potentially expensive temp string keys.
(TODO: In the future use c++20 `std::unordered_map::find` transparent keys facility)
2021-03-03 15:01:58 +00:00
Artem Pavlenko
6fedae386d add c++20 2021-03-03 11:13:42 +00:00
Artem Pavlenko
11ff758c38 Add proj_transform::definition() method 2021-03-02 17:07:13 +00:00
Artem Pavlenko
a149ebed16 use std::size_t consistently (proj API) 2021-03-02 16:39:32 +00:00
Artem Pavlenko
cb75f00780 Move proj_transform initialisation to add_layer method 2021-02-25 11:05:11 +00:00
Mathis Logemann
3a6362f1a9 added clang toolchain file 2021-02-05 19:35:35 +01:00
Artem Pavlenko
c3eda40e01
Update to travis.com 2021-02-04 13:34:03 +00:00
Mathis Logemann
2009598cdc cmake do not test cmp0110 on versions less 3.19 2021-02-03 22:53:02 +01:00
Mathis Logemann
74b325e71a fix comment 2021-02-03 22:48:25 +01:00
Mathis Logemann
54a61f7553 add dlcfn on non windows systems 2021-02-03 22:47:15 +01:00
Mathis Logemann
5f02b197dd get mapnik version from mapnik/version.hpp 2021-02-03 19:43:28 +01:00
Mathis Logemann
1f73d1c771 rename boost::boost to boost::headers, added missing icu components 2021-02-03 19:29:43 +01:00
Mathis Logemann
dec9056511 remove unnecessary cmake_minimum_required from sub projects 2021-02-03 19:14:08 +01:00
Artem Pavlenko
e5c182591a use unordered_map for proj_transform caching 2021-02-01 10:57:52 +00:00
Artem Pavlenko
5c086b0cd5 Add proj_transform caching to minimise expensive initialisations calls in libproj >= 6 [WIP] 2021-01-27 09:40:28 +00:00
Mathis Logemann
0b76278adc its getting too late.. 2021-01-27 01:22:41 +01:00
Mathis Logemann
4bc99d8047 should use the ADDITIONAL_LIBARIES_PATHS var... 2021-01-27 01:20:32 +01:00
Mathis Logemann
e60d4368ed add option to disable shared lib fixup 2021-01-27 01:17:00 +01:00
Mathis Logemann
d159bec46a FindCairo: find debug release library 2021-01-27 00:42:19 +01:00
Mathis Logemann
a7c9f5b941 windows: copy all dlls. optional library dir if some dlls are not found. 2021-01-27 00:41:54 +01:00
Mathis Logemann
247ceff7a7 temporarily remove find dll. only windows specific. needs better impl 2021-01-24 19:36:01 +01:00
Mathis Logemann
953796645f enable position independent code for wkt and json 2021-01-24 19:35:21 +01:00
Mathis Logemann
14f4362bb5 better support for proj 2021-01-24 19:34:51 +01:00
Artem Pavlenko
db9829d702 Fix missing proj context and cleanup/simplify proj_transform 2021-01-22 15:23:11 +00:00
Artem Pavlenko
6cc353f8a2 Use 'proj_backward_strategy' and avoid creating an extra proj_transform 2021-01-22 15:22:18 +00:00
Artem Pavlenko
ff14ad3425 Link to libsqlite3 when required 2021-01-21 12:47:41 +00:00
Artem Pavlenko
19511463ab Include <cmath> for HUGE_VAL 2021-01-21 12:46:57 +00:00
Artem Pavlenko
d35f0596d1 Update data-visual 2021-01-21 11:01:20 +00:00
Artem Pavlenko
b1982cc68a Upgrade to latest mason + proj-v7.2.1 + sqlite-v3.34.0 2021-01-21 10:59:54 +00:00
Artem Pavlenko
88241b32ee Initial implementation of new proj7 APIs support 2021-01-15 15:21:09 +00:00
Artem Pavlenko
bec509d5b8 Merge branch 'master' into proj6 2021-01-12 15:09:10 +00:00
Artem Pavlenko
bd961c4da2 update copyright year [skip ci] 2021-01-05 14:39:07 +00:00
Artem Pavlenko
c8b8b5c1d0
Merge pull request #4194 from mathisloge/warning-fix
fix warning for unknown compiler
2020-12-17 15:49:46 +00:00
Mathis Logemann
002c6e2a5e remove vcpkg folder 2020-12-17 10:21:25 +01:00
Mathis Logemann
6a286c7ac2 Merge branch 'master' of https://github.com/mapnik/mapnik into warning-fix 2020-12-17 10:16:52 +01:00
Mathis Logemann
bf51fc8650 Merge branch 'master' of https://github.com/mapnik/mapnik into cmake-support 2020-12-17 10:14:40 +01:00
Artem Pavlenko
cb4f1ff63a
Merge pull request #4199 from mapnik/travis
upgrade dist+toolchain
2020-12-16 14:25:13 +00:00
Artem Pavlenko
176b4bf8f7 travis ci - remove glibcxx workaround check as we're building on xenial 2020-12-16 13:48:53 +00:00
Artem Pavlenko
dca32e5cf3 travis ci - downgrade to isu 57.1 and boost 1.73.0 2020-12-16 11:13:11 +00:00
Artem Pavlenko
fb6334287a re-enable glibc workaround 2020-12-11 13:02:25 +00:00
Artem Pavlenko
9127d6334e travis-ci - update to postgis-2.4 2020-12-11 12:36:37 +00:00
Artem Pavlenko
17a1c72f41 fix .travis 2020-12-11 11:47:04 +00:00
Artem Pavlenko
6f36340888 upgrade dist+toolchain 2020-12-11 11:29:51 +00:00
Artem Pavlenko
7520e16340 travis-ci - disable Linux/gcc build 2020-12-10 13:00:48 +00:00
Artem Pavlenko
9c76fdc3bb Merge remote-tracking branch 'origin/master' 2020-12-10 11:18:25 +00:00
Artem Pavlenko
006c66e488 Remove sudo : false per https://docs.travis-ci.com/user/reference/trusty#container-based-infrastructure 2020-12-03 09:14:24 +00:00
Artem Pavlenko
834c1eac44
Merge pull request #4197 from Nonemoticoner/patch-1
Fix dead link to tutorials in INSTALL.md
2020-12-02 15:44:01 +00:00
Nonemoticoner
34a42a8fa1
Fix dead link to tutorials in INSTALL.md 2020-12-01 23:10:43 +01:00
Artem Pavlenko
8e1ff0785a Merge branch 'master' into proj6 2020-11-30 15:10:13 +00:00
Mathis Logemann
cbd19b6052 use status message 2020-11-25 15:42:33 +01:00
Mathis Logemann
410393fefa do not use absolute paths for fonts/plugins 2020-11-25 13:20:07 +01:00
Mathis Logemann
b3a34de3ce some line endings 2020-11-25 12:17:31 +01:00
Mathis Logemann
f432018bdb added cache variable for lib/bin/archive output 2020-11-25 12:16:06 +01:00
Mathis Logemann
9ede58f2b7
create boilerplate code 2020-11-25 10:56:49 +01:00
Mathis Logemann
37dd7c17df update catch dep 2020-11-25 10:45:20 +01:00
Mathis Logemann
8096bd869f fix warning for unknown compiler 2020-11-25 08:47:51 +01:00
Mathis Logemann
f027667daa added correct plugin default paths 2020-11-25 08:23:41 +01:00
Artem Pavlenko
765e1ad0c6 Upgrade to ICU 58.1 + mason 2020-11-23 16:04:01 +00:00
Mathis Logemann
983087b5c5 cache var for cxx standard 2020-11-22 22:11:27 +01:00
Mathis Logemann
f6acf4c027 do not use the install interface for mapbox deps 2020-11-22 22:06:15 +01:00
Mathis Logemann
85736c4c95 name fonts correctly 2020-11-22 22:02:17 +01:00
Mathis Logemann
68528ffb28 cmake improvements 2020-11-22 22:01:33 +01:00
Mathis Logemann
29cd904c5f fix one forgotton native() 2020-11-21 19:16:47 +01:00
Mathis Logemann
f68f7e88de fixed map_xml_test 2020-11-21 19:03:55 +01:00
Mathis Logemann
45fd654898 added MAPNIK_DECL to interior and polylabel explicit template 2020-11-21 18:19:58 +01:00
Mathis Logemann
b11ef9d44b removed MAPNIK_DECL from feature_style_processor; conflicts with the feature_style_processor_impl.h 2020-11-21 18:18:21 +01:00
Mathis Logemann
691d385687 comment not workable test out 2020-11-21 18:17:32 +01:00
Mathis Logemann
99d8c3e503 fix cmake typo 2020-11-21 18:04:24 +01:00
Mathis Logemann
695ad02cb2 fix svg renderer 2020-11-21 18:01:48 +01:00
Mathis Logemann
96a8327d06 add libraries to test 2020-11-21 17:45:44 +01:00
Mathis Logemann
0eb0408cc3 add options for grid/svg renderer 2020-11-21 17:03:30 +01:00
Mathis Logemann
3eb00b9794 use feature test for <execution> 2020-11-21 15:41:03 +01:00
Mathis Logemann
096befe69e try with c++14 2020-11-21 15:34:13 +01:00
Mathis Logemann
0084628d61 use only c++17 with extensions.. 2020-11-21 15:18:31 +01:00
Mathis Logemann
07546fe098 enable c++17 and do not use c++ extensions 2020-11-21 15:10:20 +01:00
Mathis Logemann
744aa2a76a do not compile features.... 2020-11-21 15:02:07 +01:00
Mathis Logemann
9213f76d49 do not compile features if they are not set 2020-11-21 14:54:26 +01:00
Mathis Logemann
f447cad781 add initial test support 2020-11-21 13:20:04 +01:00
Mathis Logemann
9a132080b5 add proj required define 2020-11-21 12:50:11 +01:00
Mathis Logemann
8de67bc262 add support for proj4 2020-11-21 12:38:29 +01:00
Mathis Logemann
3990fbe1dd add options to enable/disable utilitys 2020-11-21 12:30:34 +01:00
Mathis Logemann
e3789e219a build utilities correctly 2020-11-21 12:24:34 +01:00
Mathis Logemann
f390a830ae remove plugins from generated targets; install includes 2020-11-21 11:40:55 +01:00
Mathis Logemann
6254f7c09e more cmake 2020-11-21 11:34:45 +01:00
Mathis Logemann
7d46eda60d more options 2020-11-21 10:09:29 +01:00
Mathis Logemann
895d89a125 optional libraries 2020-11-21 09:46:54 +01:00
Mathis Logemann
d86a90a10a more cmake 2020-11-20 21:15:27 +01:00
Mathis Logemann
e6f6d0f133 more cmake 2020-11-20 20:20:28 +01:00
Mathis Logemann
5420ccd6af now fix msvc compiler error. Why does msvc complain? 2020-11-20 20:16:27 +01:00
Mathis Logemann
621ab99961 Revert "fix mscv compiler errors"
This reverts commit fe3160ca99.
2020-11-20 20:11:42 +01:00
Mathis Logemann
fe3160ca99 fix mscv compiler errors 2020-11-20 20:02:40 +01:00
Mathis Logemann
f6b7bc0867 add string to box2d which is required by msvc 2020-11-20 19:04:30 +01:00
Mathis Logemann
945e57286b initial cmake scripts 2020-11-20 18:20:43 +01:00
Artem Pavlenko
c945dd7195 Merge branch 'mathisloge-master' 2020-11-20 10:09:30 +00:00
Mathis Logemann
16b98fe3e7 more msvc warnings 2020-11-19 17:53:44 +01:00
Mathis Logemann
a2df8b7ad2 use absolute include 2020-11-19 17:45:40 +01:00
Mathis Logemann
a06e4efcb1 Merge branch 'master' of https://github.com/mathisloge/mapnik 2020-11-19 17:25:26 +01:00
Mathis Logemann
64054fade4 compiler independent warning ignore
Signed-off-by: Mathis Logemann <mathisloge@gmail.com>
2020-11-19 17:25:10 +01:00
Mathis Logemann
75643e6f68 compiler independent warning ignore 2020-11-19 15:30:30 +01:00
Artem Pavlenko
4227fd5d69 c++ style casts 2020-11-18 16:15:59 +00:00
Artem Pavlenko
3ae38bbab1 Fix typo pos.second -> pos.size (via @mathisloge) ref #4187 2020-11-18 15:58:00 +00:00
Artem Pavlenko
309c7b3422 Update sqlite to v3.21.0 2020-10-22 16:25:53 +01:00
Artem Pavlenko
12cdc1af69 Update test values (epsg:2193) 2020-10-22 16:13:57 +01:00
Artem Pavlenko
f9b18c3614 fix proj version typo 2020-10-22 16:13:33 +01:00
Artem Pavlenko
8cba41b2d8 Upgrade to latest mason ed144f5b 2020-10-22 16:03:26 +01:00
Artem Pavlenko
5abb40e3be Update proj to 6.1.0 (travis) 2020-10-22 15:58:51 +01:00
Artem Pavlenko
c6fc956a77 Upgrade to boost 1.74 and latest mason 2020-10-19 12:27:41 +01:00
Artem Pavlenko
3a58dd89b5 Use mapnik::value_integer for id type in feature generator 2020-10-19 12:09:42 +01:00
Artem Pavlenko
a9d9f7ed99 add unit test #4177 2020-10-09 10:03:00 +01:00
Artem Pavlenko
4fbf8a054f
Merge pull request #4178 from mapnik/issue-4177
`null` properties in `Feature` object
2020-10-09 09:37:24 +01:00
Artem Pavlenko
7ecff4b693
Merge pull request #4173 from mapnik/c++17
Support for C++17 builds
2020-10-09 09:34:41 +01:00
Artem Pavlenko
7d1a559ae2 GeoJSON - allow 'null' properties in Feature objects [#4177] 2020-10-08 10:53:12 +01:00
Artem Pavlenko
fba418d20b <execution> is available starting from c++17 2020-09-10 18:00:12 +01:00
Artem Pavlenko
277de45dbc Add support to setup c++ stanfard via CXX_STD (defalt to 14) 2020-09-10 17:50:21 +01:00
Artem Pavlenko
adced85761 Implement is_solid using stdlib <algorithm> `find_if 2020-09-10 15:57:19 +01:00
Artem Pavlenko
5629a6fb6f Require c++17 support 2020-09-10 15:56:38 +01:00
Artem Pavlenko
d6d69df498 Update catch.hpp to v2.13.1 + fix tests 2020-09-10 15:34:52 +01:00
Artem Pavlenko
ea7003628f variant - update to v1.2.0 2020-08-03 15:58:37 +01:00
Artem Pavlenko
9cb1b7e37f perfect forwarding in apply_visitor alias 2020-07-13 10:26:59 +01:00
Artem Pavlenko
8913b673c3 remove unused function 2020-07-09 12:57:37 +01:00
Artem Pavlenko
6e40d4bcf7 Update to boost 1.73.0 and latest mason 2020-06-15 14:39:18 +01:00
Artem Pavlenko
4bd05cec22 Add missing include (bootstrap build) 2020-06-15 14:38:23 +01:00
Artem Pavlenko
8901fd0fa5 Dropping boost version to 1.67.0 (as 1.72.0 is missing program_options) 2020-05-12 18:54:35 +01:00
Artem Pavlenko
e45b7571a8 Update mason version to 250ac4b 2020-05-12 13:19:05 +01:00
Artem Pavlenko
1079264aea Update boost version to 1.72.0 2020-05-12 12:49:53 +01:00
Artem Pavlenko
ed1696db4a
Merge pull request #4144 from mapnik/boost_1_73
boost_1_73 support
2020-05-12 12:46:05 +01:00
Artem Pavlenko
cc78a5de78 Fix for boost < 1.70.0 (ref #4143) 2020-05-12 12:14:18 +01:00
Artem Pavlenko
a14d27f090 Attempting to fix boost_1_65_1 compile (WIP) 2020-05-12 12:00:25 +01:00
Artem Pavlenko
8f3dded093 Re-implement feature_json_generator by adapting feature_impl into boost::fusion container and removing use semantic actions (simpler code + boost_1_73 support) (ref #4143) 2020-05-11 22:18:55 +01:00
Artem Pavlenko
d0b40f62dc Relax bounding box extracting grammar (ref #4140) + unit test 2020-05-07 11:35:53 +01:00
Artem Pavlenko
9bfe888cef Add missing unit test for color::operator= and color::operator== (ref #4137) 2020-04-23 18:20:32 +01:00
Artem Pavlenko
52ae365c66 fix operator== (ref #4137) 2020-04-23 18:20:32 +01:00
Artem Pavlenko
cb638eaabf color::swap - add missing premultiplied_ (ref #4137) 2020-04-23 18:20:32 +01:00
Artem Pavlenko
3e178a2153
Merge pull request #4132 from zdila/master
add support for spacing-offset
2020-04-02 10:00:37 +01:00
Artem Pavlenko
11cbc189f3
Merge pull request #4128 from dirkvdb/master
Update SConstruct to fix osx build
2020-04-02 09:56:26 +01:00
Martin Ždila
657442947b add support for spacing-offset 2020-03-23 23:07:49 +01:00
Dirk Vanden Boer
ddd2ceae63
Update SConstruct
Fixed framework presence check to avoid TypeError:
TypeError: a bytes-like object is required, not 'str':
2020-02-27 21:03:43 +01:00
Artem Pavlenko
e3f4e76c47
Merge pull request #4124 from cpaulik/gdal-int32-support
Add Int32 support for gdal driver
2020-02-11 12:15:32 +00:00
Christoph Paulik
5a73efbb07 Add Int32 support for gdal driver 2020-02-11 12:30:03 +01:00
Artem Pavlenko
1784c4f03e
Merge pull request #4123 from mapnik/svg-css
SVG: basic CSS support
2020-02-07 14:26:10 +00:00
Artem Pavlenko
d26fc722d5 Add SVG renderer unit test - both inline and css styled octocat result in identical image (ref PR #4123) 2020-02-07 13:53:06 +00:00
Artem Pavlenko
8d73767949 css-parser-grammar: parse values into iterator_range via boost::spirit::x3::raw directive (no conversions) + cleanup 2020-02-06 11:23:02 +00:00
Artem Pavlenko
0d693b151d svg2png: use svgBBOX() to calculate output PNG dimensions when no valif width or height (or viewBox) is specified. 2020-02-05 15:06:11 +00:00
Artem Pavlenko
c69e467ad0 SVG: basic CSS styles processor (TODO: fix inefficient and redundant value=>string=>value transformations) 2020-02-05 15:03:14 +00:00
Artem Pavlenko
2ddbff46d5 add bool css_style_ member variable to control CSS style processing. 2020-02-04 17:30:58 +00:00
Artem Pavlenko
cc9e8e3db3 add missing headers 2020-02-04 15:15:32 +00:00
Artem Pavlenko
27bf941211 SVG CSS: refactor unit value symbols table into separate header + add css_data member to svg_parser 2020-02-04 15:02:41 +00:00
Artem Pavlenko
b6e567d87c SVG CSS: add basic parsing of <style> [C]DATA 2020-02-04 11:41:22 +00:00
Artem Pavlenko
4d54e81889 Use char const* as iterator type for CSS grammar 2020-02-04 11:40:52 +00:00
Artem Pavlenko
8a90551b63 SVG CSS - add <style> element handler 2020-02-04 11:25:35 +00:00
Artem Pavlenko
00b888c1ef Add CSS parser grammar + move into separate include/css and src/css dirs. 2020-02-04 10:38:34 +00:00
Artem Pavlenko
3be9ce8fa0
Merge pull request #4122 from lightmare/prevent-duplicate-flags
scons: prevent duplication of linker flags
2020-01-30 20:02:12 +00:00
Mickey Rose
be017f1945 scons: prevent duplication of linker flags 2020-01-30 18:38:20 +01:00
Mickey Rose
6f4c15d077 scons: improve parsing CUSTOM_LDFLAGS
With the help of SCons.Environment.ParseFlags, split user-supplied
CUSTOM_LDFLAGS into appropriate option lists: LIBPATH, LIBS, etc.
Known non-linker options (like -Dx -I.) will be reported and ignored,
unrecognized options will be appended to LINKFLAGS.
2020-01-30 16:32:23 +00:00
Artem Pavlenko
3dee9b634f Merge branch 'lightmare-fix-write_config' 2020-01-30 16:31:51 +00:00
Artem Pavlenko
82533b2f7a Merge branch 'fix-write_config' of https://github.com/lightmare/mapnik into lightmare-fix-write_config 2020-01-30 16:31:21 +00:00
Artem Pavlenko
0636734f8f Revert "move sparsehash out of mapnik dir"
This reverts commit 720fbc74a1.
2020-01-30 15:14:37 +00:00
Mickey Rose
39202f5ac0 mapnik-config: fix substitution of environment variables
Simply calling str(val) doesn't work, because if the value happens to
be a SCons.Util.CLVar, it may contain not just plain strings, but also
tuples appended by SCons.Environment.ParseFlags.

For example "-isysroot /foo" becomes CLVar: [("-isysroot", "/foo")]

CLVar.__str__ supports only string elements, nothing else.
2020-01-30 15:15:14 +01:00
Artem Pavlenko
26d3084ead Revert "scons: improve parsing CUSTOM_LDFLAGS" -- this change introduced env.ParseFlags which broke mason/travis integration
This reverts commit a25f53e667.

Revert "SCons.Util.CLVar:  fix __str__ method to flatten tuples + revert "add print to debug travis (temp)""

This reverts commit 2e78959435.

Revert "add print to debug travis (temp)"

This reverts commit 65dce899cb.

ref #4120
2020-01-30 09:45:13 +00:00
Artem Pavlenko
2e78959435 SCons.Util.CLVar: fix __str__ method to flatten tuples + revert "add print to debug travis (temp)" 2020-01-29 22:11:11 +00:00
Artem Pavlenko
65dce899cb add print to debug travis (temp) 2020-01-29 17:15:22 +00:00
Artem Pavlenko
b22d5d2fac update and pin deps/mapbox to latest tags: protozero 1.6.8, variant 1.1.6, polylabel 1.0.3 2020-01-29 14:35:31 +00:00
Artem Pavlenko
720fbc74a1 move sparsehash out of mapnik dir 2020-01-29 14:16:47 +00:00
Artem Pavlenko
c7d29b826f Add "darkslategray" and "rebeccapurple" named colors (ref: https://drafts.csswg.org/css-color/#typedef-color) 2020-01-24 15:26:10 +00:00
Artem Pavlenko
7e604ed8b0
Merge pull request #4113 from mapnik/svg-fixes
Svg fixes
2020-01-24 10:19:40 +00:00
Artem Pavlenko
ba4ad23af8 Update visual tests data 2020-01-23 16:12:55 +00:00
Artem Pavlenko
ed194a3c09 use std::round (ref:https://en.cppreference.com/w/cpp/numeric/math/round) 2020-01-23 15:48:16 +00:00
Artem Pavlenko
53f8c49620 SVG path parser : add Quadratic and Cubic Bezier curves tests. 2020-01-22 14:01:53 +00:00
Artem Pavlenko
d87cf7db48 re-use code [skip ci] 2020-01-22 13:40:33 +00:00
Artem Pavlenko
b6e9711add Mark output image as premultiplied alpha 2020-01-22 10:49:10 +00:00
Artem Pavlenko
97e33ec8ca Move 0.5 up/down rounding into rounding expression (via @lightmare 7f54e94748 (r369294323)) (ref #4116) 2020-01-22 10:45:15 +00:00
Artem Pavlenko
cab05f1f2c Only use reflection of the second control point on the previous command relative to the current point as first control point when both last and prev( NOTE: before last command in AGG logic!) are curve commands. This fixes long outstanding SVG rendering bug aka Octocat bug (ref #4115) 2020-01-21 15:49:00 +00:00
Artem Pavlenko
c30adf39c8 format 2020-01-21 15:48:32 +00:00
Artem Pavlenko
4276f01404 Init output image with transparent color and 255 alpha. 2020-01-21 15:12:18 +00:00
Artem Pavlenko
fe893134a5
Merge pull request #4114 from sebastic/libxml2
Use pkg-config for libxml2.
2020-01-21 15:09:08 +00:00
Bas Couwenberg
c4fda867c0 Use pkg-config for libxml2. 2020-01-21 15:13:09 +01:00
Artem Pavlenko
1a0b1a1e77 SVG parser: fix typo (stroke gradient was applied instead if fill gradient) 2020-01-21 11:01:36 +00:00
Artem Pavlenko
7f54e94748 Add support for scale-factor parameter - useful for debugging SVG issues (ref #4112) 2020-01-21 10:33:04 +00:00
Artem Pavlenko
4e26d2a7d6 Don't attempt to rasterize ARCs with very small sweep_angles, just resort to LINETO (#4112) 2020-01-21 10:30:29 +00:00
Artem Pavlenko
0420b13055 Fix typo in agg_bezier_arc initialisation. 2020-01-21 09:09:41 +00:00
Artem Pavlenko
60a33a9b8f use numeric parser for arc flags 2020-01-16 10:38:10 +00:00
Artem Pavlenko
44982cddc5 Update "Arcs 3" test for #222835e73a21fec3965b21685993b86a63f626b8 2020-01-14 21:05:41 +00:00
Artem Pavlenko
b4b5f393e3 Revert "no need to throw std::runtime_error as ellipsis catch (...) {} catches them all."
This reverts commit c5f3e6c654.
2020-01-14 15:20:25 +00:00
Artem Pavlenko
222835e73a Fix SVG path grammar - parse arc and sweep flags using special single digit parser, numeric int_ parser was over greedy and didn't handle compact notation produced by svgo (https://github.com/svg/svgo). 2020-01-14 14:38:10 +00:00
Artem Pavlenko
c5f3e6c654 no need to throw std::runtime_error as ellipsis catch (...) {} catches them all.
(TODO: consider having finer grained catches e.g expectation_failure)
2020-01-14 14:34:39 +00:00
Mickey Rose
0bddff6977 bootstrap: simplify export_variables
Nameref attribute (local -n) is a Bash 4.3 feature, thus not available
on OSX with Bash 3.2.

And because we know the argument looks like a valid assignment, we can
pass it whole to export.
2020-01-03 15:38:48 +01:00
Mickey Rose
d38d16ade9 better tests for logical expressions
Two of the original checks were not testing what they were supposed to
test, because the result of eval didn't depend on correct parsing:

    eval("not true or not true")
    correct parse:      ((not true) or (not true)) == false
    incorrect parse:    (not (true or (not true))) == false

    eval("not false and not false")
    correct parse:      ((not false) and (not false)) == true
    incorrect parse:    (not (false and (not false))) == true
2020-01-02 17:30:24 +01:00
Mickey Rose
f19bd188c2 2to3 last remnants of Python 2 syntax 2019-12-31 12:39:57 +01:00
Artem Pavlenko
538eb20264
Merge pull request #4103 from mapnik/boost_1_72
Boost 1_72 support
2019-12-13 17:07:41 +00:00
Artem Pavlenko
59e5f50e26 Use boost::spirit::x3::standard::char_ parser 2019-12-13 17:04:54 +00:00
Artem Pavlenko
7f2c8b756a Use official colospace HSL/HSV converters from boost source tree (BOOST_VERSION > 1_69) 2019-12-13 17:02:31 +00:00
Artem Pavlenko
44198d1ac2 more const-ness 2019-11-27 16:16:09 +00:00
Artem Pavlenko
cfa5809cd2 Make x3::rules declarations const 2019-11-25 10:36:34 +00:00
Artem Pavlenko
94dd756669 Fix compiler warning 2019-11-20 09:43:31 +00:00
Artem Pavlenko
5482d8c7e2 Conditionally include <mapnik/image_filter_types.hpp> for BOOST_VERSION < 107000 2019-11-20 09:41:23 +00:00
Artem Pavlenko
29069560a9 remove .circleci/config.yml (ref #4100) 2019-11-19 09:33:51 +00:00
Artem Pavlenko
6f6a0ed1ef
remove CircleCI badge
ref #4100
2019-11-19 09:25:15 +00:00
Artem Pavlenko
fc25053e8b Set initial STACK_SIZE to 16 (plenty), make it private static member var (ref #4096) 2019-11-18 09:59:26 +00:00
Artem Pavlenko
9dac8dcc34 Only push new elements to parenStack when needed (via @lightmare) (ref #4096) 2019-11-18 08:45:03 +00:00
Artem Pavlenko
a5a24f0260 Revert "CircleCI fix" [skip ci]
This reverts commit 838c88b318.
2019-11-15 15:29:23 +00:00
Artem Pavlenko
838c88b318 CircleCI fix 2019-11-15 14:49:31 +00:00
Artem Pavlenko
77483e4266 Fix boost_regex compiled with ICU support check for BOOST_VERSION >= 1_70 2019-11-15 13:55:09 +00:00
Artem Pavlenko
e82c6e65fb
Merge pull request #4096 from mapnik/fix-out-of-bounds-array-access
avoid potential out-of-bounds array access (undefined behaviour)
2019-11-06 16:27:40 +00:00
Artem Pavlenko
bf6ce8dd8d attempting to fix circleci 2019-11-06 15:21:47 +00:00
Artem Pavlenko
9e82006314 make ScriptRun class visible 2019-11-06 15:08:30 +00:00
Artem Pavlenko
f33e318ac5 more compact test string initialisation via @talaj (#4096) 2019-11-05 10:55:16 +00:00
Artem Pavlenko
b84c414f2e Add unit test for 7003255c0e (#4096) 2019-11-05 09:53:41 +00:00
Artem Pavlenko
7003255c0e avoid negative indicies access to parenStack - thanks @talaj! (ref #4096) 2019-11-05 09:50:51 +00:00
Artem Pavlenko
33fac6d47d use std::vector to avoid limiting number of paired characters. 2019-11-04 13:59:23 +00:00
Artem Pavlenko
370f38a2c3 remove sanitize=bounds 2019-11-04 11:41:49 +00:00
Artem Pavlenko
f2732ed517 remove sanitize=bounds 2019-11-04 11:35:47 +00:00
Artem Pavlenko
e72803935a add ICU include 2019-11-04 11:22:41 +00:00
Artem Pavlenko
05d488f98d add script runs unit test 2019-11-04 10:47:35 +00:00
Artem Pavlenko
8aae32ec4c better syntax 2019-11-01 17:09:12 +00:00
Artem Pavlenko
1edd3b7a93 use & mask for array bounds clipping (provided array size is 2^n) 2019-11-01 16:16:57 +00:00
Artem Pavlenko
dec6bc0950 avoid potential out-of-bounds array access (undefined behaviour) + add c++ C-array size implementation 2019-11-01 13:06:21 +00:00
Artem Pavlenko
0842d0af6f
Merge pull request #4094 from mapnik/boost_1_71
Boost-1.71
2019-10-22 09:47:07 +01:00
Artem Pavlenko
c9da5cbd8e support for boost < 1.69 2019-10-21 18:21:51 +01:00
Artem Pavlenko
b60de49388 make sure boost 1_69 works too 2019-10-21 17:18:25 +01:00
Artem Pavlenko
0b4f3dc497 fix support for BOOST 1_71 2019-10-21 16:42:58 +01:00
Mickey Rose
fdf60044c3 fix agg::pod_array and pod_vector move constructors
These were added with #4031, and probably not used in the end, as Mapnik
compiles and all tests pass without them. However, they might be useful,
so I'm only removing bad calls to deallocate with uninitialized values,
and doing proper member initialization.
2019-09-22 23:29:13 +02:00
Artem Pavlenko
162ac80675
Merge pull request #4086 from lightmare/install-mapnik-deps-subdir
install mapbox includes into subdir mapnik/deps/
2019-09-22 18:13:00 +01:00
Mickey Rose
d1697efe6d install mapbox includes into subdir mapnik/deps/ 2019-09-20 20:15:53 +02:00
Artem Pavlenko
cea7821722
Merge pull request #4085 from lightmare/revamp-mapnik-config-template
Revamp mapnik-config generation
2019-09-20 12:21:24 +01:00
Mickey Rose
2dcb31cd01 mapnik-config: minor cleanup 2019-09-16 23:30:01 +02:00
Mickey Rose
a3086c06a5 mapnik-config: improve mapnik-config.template.sh
- move template text from build.py into mapnik-config.template.sh,
  so that the resulting script is simply that template file after
  substitutions, instead of concatenation of two parts

- substitute using re.sub matching particular variables, instead of
  format % dict; this allows putting default values in the template
2019-09-16 23:17:09 +02:00
Mickey Rose
c61d0d541d Revert "Forgot to add prefix change to mapnik config to cairo as well"
This reverts commit a9712ed081.
2019-09-15 12:30:37 +02:00
Mickey Rose
297126906d Revert "Added an update to mapnik config so that it can provide relative path to libraries better in node mapnik."
This reverts commit a4aee2eb59.
2019-09-15 12:30:28 +02:00
Mickey Rose
d5a7c9e214 scons: minor cleanup
(cherry picked from commit 745e393fd6)
2019-09-01 11:57:24 +02:00
Mickey Rose
f6fda91717 scons: define OPTIONAL_LIBSHEADERS before use
Refs #4075

(cherry picked from commit 0d68464194)
2019-09-01 10:37:44 +02:00
Mickey Rose
b541c3595f rename MAPNIK_MAKE_VERSION to MAPNIK_VERSION_ENCODE
Both forms can be seen in various other libraries. However, I think that
macro names with common prefix serving as substitute for namespace are
the better convention. MAPNIK_MAKE_VERSION hasn't appeared in any Mapnik
release yet, so this shouldn't break anything.

I'm not renaming other MAPNIK_*_VERSION defines that don't have the same
prefix simply because they've been there for ages, so renaming those now
might break stuff outside of Mapnik.
2019-08-30 16:30:28 +02:00
Mickey Rose
65d2d9d188 scons: use gdal-config to obtain GDAL data path 2019-08-19 17:35:45 +02:00
Mickey Rose
a25f53e667 scons: improve parsing CUSTOM_LDFLAGS
With the help of SCons.Environment.ParseFlags, split user-supplied
CUSTOM_LDFLAGS into appropriate option lists: LIBPATH, LIBS, etc.
Known non-linker options (like -Dx -I.) will be reported and ignored,
unrecognized options will be appended to LINKFLAGS.
2019-08-18 23:01:11 +02:00
Mickey Rose
08ccaf109b scons: facilitate passing linker options with '$ORIGIN'
Passing CUSTOM_LDFLAGS='-Wl,-rpath=$ORIGIN' to ./configure is
unnecessarily difficult and error-prone. The option needs to be
protected from SCons variable substitution by doubling the '$',
and also from shell parameter expansion with a backslash.
Such fortified value then cannot be used directly in contexts
where either expansion does not happen.

This commit makes that protection optional by injecting variable
named ORIGIN, that resolves to '$ORIGIN', into both the SCons
construction Environment and the process environment, so whenever
'$ORIGIN' undergoes variable substitution, it is replaced by the
original string.
2019-08-18 22:48:18 +02:00
Mickey Rose
e80dd063ba Revert "Disable "Linux clang-3.9 + coverage" builds which are failing with "The job exceeded the maximum log length, and has been terminated.""
This reverts commit ac19076f0b.
2019-08-14 16:02:54 +02:00
Mickey Rose
699b3c11d9 travis: silence gcov output and errors flooding build log
Also added ignore paths from `codecov.yml` to the command, because
codecov-bash doesn't pull those from there. Currently its `parse_yaml`
function simply ignores arrays, so they don't even check for "ignore".
4678d212cc/codecov (L834)

(cherry picked from commit d09fdd78a9)
2019-08-14 16:01:39 +02:00
Mickey Rose
931dc8921c update changelog [skip ci] 2019-08-12 17:19:29 +02:00
lightmare
a0ea7db1a7
Merge pull request #3984 from lightmare/pg-app-name
accept explicit parameter "application_name" in postgis and pgraster datasources
2019-08-12 12:52:34 +02:00
Artem Pavlenko
b504a86696
Merge pull request #3319 from mapnik/ST_MakeEnvelope
use `ST_MakeEnvelope` (ref #3317)
2019-08-12 08:27:50 +01:00
lightmare
8c4313f1b5
Merge branch 'master' into ST_MakeEnvelope 2019-08-11 12:06:20 +02:00
lightmare
8a44f7ffbb
Merge pull request #3942 from lightmare/postgis-float-tokens
postgis: always put decimal point in substituted tokens in SQL
2019-08-11 11:57:44 +02:00
Artem Pavlenko
05546b2053 add 'pattern' to unsupported elements + call handle_unsupported on end_element to catch them all + update unit tests 2019-08-08 11:50:31 +01:00
Artem Pavlenko
f68a147ff4 don't log identical error messages 2019-08-08 11:42:45 +01:00
Artem Pavlenko
7d1bfaeb4b
Merge pull request #3999 from mapnik/test-placement-type
Tests of text_placements_simple and text_placements_list
2019-07-02 11:56:39 +01:00
Artem Pavlenko
ef2adc855c Merge branch 'timmg-master' 2019-07-02 11:52:36 +01:00
Artem Pavlenko
b617197aba Merge branch 'master' of https://github.com/timmg/mapnik into timmg-master 2019-07-02 11:51:45 +01:00
Artem Pavlenko
3dfac03633 Merge branch 'tarvip-libxml2-parse-huge' 2019-07-02 11:03:29 +01:00
Artem Pavlenko
fa714f2a01 Merge branch 'libxml2-parse-huge' of https://github.com/tarvip/mapnik into tarvip-libxml2-parse-huge 2019-07-02 11:02:59 +01:00
Artem Pavlenko
f104edbefb Merge branch 'Kojoley-spirit-rule-placeholders' 2019-07-02 10:56:15 +01:00
Nikita Kniazev
c191e196c0 Replace MAPNIK_INIT_PRIORITY workaround
Spirit rules are just placeholders. They are cheap to construct and by doing
this static initialization order fiasco problem is effectively avoided.

Also had to fix name clash between geojson and generic json parsers.
2019-07-02 01:04:31 +03:00
Artem Pavlenko
01a4057317
Merge pull request #4066 from mapnik/issue-4045
Ensure 'scaling' and `comp-op` stored as enumeration_wrappers + fix image `scaling` property
2019-06-12 11:18:35 +01:00
Artem Pavlenko
e90a4fca7d add missing image scaling property meta type + replace to integer conversion with comparison operator in enumeration_wrapper + change order in value_base_type (ref #4045) 2019-06-12 09:40:10 +01:00
Artem Pavlenko
563bb00de5
Merge pull request #4064 from treenewbee/master
Update main.cpp
2019-06-04 17:42:30 +01:00
Eric
45168024a9
Update main.cpp
Qt::AA_EnableHighDpiScaling was added in Qt 5.6.
2019-06-04 10:47:31 -04:00
Artem Pavlenko
b890dc2775
Merge pull request #4058 from mapycz/colorizer-linear-combined
New raster colorizer mode for Terrain-RGB
2019-05-20 10:38:33 +01:00
Jiri Drbalek
6f83cdf572 Update visual tests 2019-05-17 22:55:42 +02:00
Jiri Drbalek
a74543a145 New raster colorizer modes linear-rgba and linear-bgra 2019-05-17 21:54:24 +02:00
Artem Pavlenko
ac19076f0b Disable "Linux clang-3.9 + coverage" builds which are failing with "The job exceeded the maximum log length, and has been terminated." 2019-05-14 12:45:39 +01:00
Artem Pavlenko
f04ab0cbae Update svg unit tests post 831e353c5d 2019-05-14 10:50:10 +01:00
Artem Pavlenko
201268334d Don't prefix MAPNIK_LOG_ERROR with redundant "SVG PARSING ERROR" 2019-05-14 10:48:21 +01:00
Artem Pavlenko
831e353c5d SVG parser: better stderr - don't assume fill/stroke ref is a <gradient>, can be a <pattern> also. 2019-05-14 10:30:26 +01:00
Artem Pavlenko
dc15e70f79 Skip parsing (currently unsupported) <pattern> elements 2019-05-14 10:20:14 +01:00
Artem Pavlenko
88f3b29a92 fix includes 2019-05-07 11:19:37 +01:00
Tim Gleason
cdcc97ac4b Add command line options for map size to mapnik-render. 2019-05-05 12:02:47 -04:00
Tarvi Pillessaar
ddf0f337c2 libxml2: add support for huge XMLs 2019-04-14 16:42:57 +03:00
Artem Pavlenko
783437f16b Merge branch 'mdholloway-rint' 2019-03-25 09:56:35 +00:00
Michael Holloway
918e1a3a90 Ditch rint
Removes all usages of rint from the codebase, in favor of the standard
rounding and casting formula used throughout the codebase:

  static_cast<int>(std::floor(<val> + .5))

Fixes #2392
2019-03-22 14:23:32 -04:00
Artem Pavlenko
46478d4b5a Reduce verbosity of 'coverage' builds vi 'QUIET=true' - go travis-ci! 2019-03-07 19:05:13 +00:00
Artem Pavlenko
0db5d6231f Add 'QUIET` boolean configuration option to reduce build verbosity (default: no)
To enable =>  `./scons/scons.py configure QUIET=y`
2019-03-07 19:01:24 +00:00
Artem Pavlenko
1377ec9752 remove bogus quote from ST_EstimatedExtent SQL {#4032) via @urzhumskov 2019-03-07 11:05:33 +00:00
Artem Pavlenko
ab03726659 comment out cat config.log to reduce log size (travis-ci) 2019-02-13 15:39:44 +00:00
Artem Pavlenko
b1185fc099
Merge pull request #4031 from mapycz/adaptive-smooth
[WIP] Adaptive smooth
2019-02-13 14:00:00 +00:00
Artem Pavlenko
653bd92ce9
Merge pull request #4029 from mapycz/svg-1.2
Cairo: set version of SVG to 1.2
2019-02-13 10:24:10 +00:00
Jiri Drbalek
2dde0eb257 Adaptive smooth 2019-02-09 15:24:12 +00:00
Jiri Drbalek
c2b1103cb6 Cairo: set version of SVG to 1.2 2019-02-08 12:32:01 +00:00
Artem Pavlenko
23492d6742 CSS color: add hue range tests for hsl(a) color strings (#4020) 2019-01-16 10:31:53 +00:00
Artem Pavlenko
16ae1c0472 CSS parser - use appropriate storage type for hue value (0..320) (#4020) 2019-01-14 16:21:53 +00:00
talaj
19a979955e
More info, small fixes 2019-01-05 14:09:37 +01:00
Jiri Drbalek
27a4d60026 Documentation of development process 2019-01-05 10:51:07 +00:00
Artem Pavlenko
d2ba5e5eec dummy commit to pacify travis 2018-12-13 17:16:51 +00:00
Artem Pavlenko
bcb1e67507 fix Boost.GIL includes for BOOST_VERSION >= 1.69 (ref #4000) 2018-12-13 15:46:57 +00:00
Gaetano Checinski
e583063ab5 fix: makes serveral header definitions static to support static library builds 2018-12-03 09:58:18 +00:00
Dane Springmeyer
bcb4f2020e
Merge pull request #3866 from mapnik/remove-sanitize-shorthands
Remove sanitizer flags to configure step
2018-12-02 18:10:32 -08:00
Artem Pavlenko
abcd96be0e
Merge pull request #4009 from mapycz/cairo-polygon-pattern-vectorial
Vector patterns with Cairo
2018-11-21 14:24:18 +00:00
Jiri Drbalek
91b868d7ad Update visual tests 2018-11-21 12:21:54 +00:00
Jiri Drbalek
2344fe3ac2 Vector patterns with Cairo 2018-11-21 12:20:31 +00:00
Artem Pavlenko
940f0dc39d bump version to 4.0.0 2018-11-21 11:03:00 +00:00
Artem Pavlenko
def1994856 update dependencies 2018-11-20 14:36:59 +00:00
Artem Pavlenko
9406eb4c44 use c++-stype casts + compare the same types 2018-11-20 14:35:36 +00:00
Artem Pavlenko
65e98c1940 fix compiler warning (warning: field 'expected_query_bbox_' will be initialized after base 'mapnik::memory_datasource' [-Wreorder]) 2018-11-20 14:16:44 +00:00
Artem Pavlenko
c08b639902 fix compiler warnings e.g warning: class 'xxx' was previously declared as a struct [-Wmismatched-tags] 2018-11-20 14:13:25 +00:00
Artem Pavlenko
c6cd132c31 explicit cast to native enum type in switch statements to address error: case value is not a constant expression
(clang version 8.0.0 (trunk 347189))
2018-11-20 13:47:44 +00:00
talaj
7dcf5ee082
Merge pull request #3989 from mapycz/fix-pattern-alignment
True global pattern alignment, fixed local alignment
2018-11-02 14:31:31 +01:00
Jiri Drbalek
46de0f661b New test of text_placements_list 2018-10-20 21:09:08 +00:00
Jiri Drbalek
3b188b4c26 Remove method declaration that is not implemented 2018-10-20 20:59:20 +00:00
Jiri Drbalek
90a1b65081 New test of text_placements_simple 2018-10-20 20:59:20 +00:00
Artem Pavlenko
da69fdf66b add "clipPath" to unsupported elements 2018-10-10 09:30:05 +01:00
Artem Pavlenko
982f156995 enable unsupported attributes handling + ignore/skip any elements inside <symbol> 2018-10-02 09:34:07 +01:00
talaj
85aad2ec32
Merge pull request #3993 from tdubrownik/boost-1.68
Compatibility patch for Boost GIL v1.68
2018-09-29 14:57:22 +02:00
Tomek Dubrownik
c067eb7eec Compatibility patch for Boost GIL v1.68
A number of basic typedef were removed in the Boost GIL 1.68 release,
notably `bits32` and `bits32f`. Additionally the
`GIL_DEFINE_ALL_TYPEDEFS` macro signature changed.

This commit introduces compatibility type aliases and conditionally
calls the new macro if `BOOST_VERSION` is high enough.
2018-09-29 13:43:44 +08:00
Jiri Drbalek
493eaa4d18 Update visual tests 2018-09-20 08:14:43 +00:00
Jiri Drbalek
776fa0d2f8 True global pattern alignment, fixed local alignment 2018-09-19 13:21:59 +00:00
Jiri Drbalek
692fc7f107 render_pattern() needs its own rasterizer 2018-09-19 08:33:24 +00:00
Artem Pavlenko
fcec445a2e
Merge pull request #3980 from mapycz/simple-line-pattern
Polygon pattern on line geometries
2018-09-18 15:55:16 +01:00
Jiri Drbalek
d42d2740f3 Update visual tests 2018-09-18 12:12:53 +00:00
Jiri Drbalek
384158fa7c Polygon pattern on line geometries for Grid backend 2018-09-18 12:12:21 +00:00
Jiri Drbalek
d823378260 Polygon pattern on line geometries for Cairo backend 2018-09-18 12:12:21 +00:00
Jiri Drbalek
18c1a99604 Polygon pattern on line geometries for AGG backend 2018-09-18 12:12:21 +00:00
Mickey Rose
86e70a726d postgres: add connect param "application_name" 2018-09-07 11:07:33 +02:00
talaj
2ceac9b496
Merge pull request #3979 from rbray89/master
sqlite: Add !pixel_width! and !pixel_height!
2018-09-05 14:24:09 +02:00
Ryan Bray
17de0f89ed sqlite: Add !pixel_width! and !pixel_height! 2018-09-01 11:21:29 -06:00
Mickey Rose
2929c4ae6d travis: move variables not relevant to cache contents out of env
(so that changing these later doesn't invalidate the cache)
2018-08-26 22:25:48 +02:00
Mickey Rose
a6057af11f travis: remove downstream trigger (refs #3366) 2018-08-26 21:41:05 +02:00
Mickey Rose
f432f5f1cc travis: install clang from apt 2018-08-25 22:56:31 +02:00
Mickey Rose
eff8890b4f travis: postgresql service doesn't seem necessary 2018-08-25 15:07:00 +02:00
Mickey Rose
5d51bdde7a travis: shortcut 2018-08-25 14:53:25 +02:00
Mickey Rose
d0f7b405a6 bootstrap: name=val regex must be anchored 2018-08-24 17:13:41 +02:00
lightmare
b4bce33b34
Merge pull request #3945 from lightmare/travis-trusty
travis: switch to dist: trusty
2018-08-16 00:49:53 +02:00
Mickey Rose
a33e984dbd travis: switch to dist: trusty 2018-08-15 23:16:37 +02:00
lightmare
6a7317d354
Merge pull request #3967 from mapycz/fix-warp-transparent-raster
Fix seams of mesh faces when warping transparent raster
2018-08-15 23:07:29 +02:00
Jiri Drbalek
b50498cb53 Update test data 2018-08-15 07:44:27 +00:00
lightmare
a6e0b6b857
Merge pull request #3958 from mapycz/fix-buffer-size-with-scale-factor
Fix buffer-size with scale-factor
2018-08-14 17:11:31 +02:00
lightmare
9275ca9373
Merge pull request #3971 from lightmare/fix-topojson-empty
Accept TopoJSON with no objects
2018-08-14 15:10:07 +02:00
Mickey Rose
8a1fdb3900 dodge operator precedence warning 2018-08-13 19:11:58 +02:00
Mickey Rose
2b8226316f topojson: fix parsing empty topology 2018-08-13 19:08:38 +02:00
Mickey Rose
6a3452da96 fix read beyond buffer in topojson test 2018-08-13 19:08:30 +02:00
Mickey Rose
ee28954786 topojson: add test with empty "objects" and "arcs" 2018-08-13 18:41:56 +02:00
Mickey Rose
74b2886036 update changelog [skip ci] 2018-08-08 00:08:19 +02:00
lightmare
99b25c72d9
Merge pull request #3965 from mapycz/icu-namespace-master
Force full qualification of ICU types
2018-08-08 00:06:28 +02:00
Artem Pavlenko
c2251faa91 second time lucky 2018-08-07 14:58:21 +01:00
Artem Pavlenko
242c9eba3c Revert "opps, adding lost change (re: boost>=1.67)"
This reverts commit 22f913d892.
2018-08-07 14:26:34 +01:00
Artem Pavlenko
22f913d892 opps, adding lost change (re: boost>=1.67) 2018-08-07 14:09:30 +01:00
Jiri Drbalek
8b27aba0c4 Fix seams of mesh faces when warping transparent raster 2018-08-07 11:57:38 +00:00
talaj
1a87e920da
Merge pull request #3962 from lightmare/bootstrap-manners
bootstrap.sh improvements
2018-08-07 09:28:33 +02:00
Jiri Drbalek
cfbc044fd2 Force full qualification of ICU types
https://github.com/mapnik/mapnik/issues/3961
2018-08-03 16:02:20 +00:00
Mickey Rose
f400f17c75 travis: some tweaks
- remove unused MASON_PUBLISH variables
- defer downloading test-data until after successful compilation;
  they are big and don't update frequently, so I added depth limit;
  if that doesn't work well, feel free to increase or remove it
2018-08-01 17:59:09 +02:00
Mickey Rose
7f0daee8b3 configure: posix shell can handle this
It's such a trivial script, no need to bash.
2018-08-01 17:37:15 +02:00
Mickey Rose
33a42303d1 bootstrap: behave when sourced, minor improvements
- don't exit sourcing shell on error
- don't git pull mason, checkout --detach instead
- only git fetch mason when the desired version is unknown
- use arguments of the form NAME=VALUE as variables to export;
  this is to unify syntax with ./configure, for example:

    ./bootstrap.sh CC='cc' CXX='ccache c++'
2018-08-01 15:24:34 +02:00
Jiri Drbalek
8a0dca38a3 Fix buffer-size with scale-factor 2018-08-01 08:06:37 +00:00
Artem Pavlenko
3683c30557 Merge branch 'lightmare-pi-is-wrong' 2018-07-30 10:41:13 +01:00
Artem Pavlenko
af842a8bf9 Merge branch 'pi-is-wrong' of https://github.com/lightmare/mapnik into lightmare-pi-is-wrong 2018-07-30 10:40:51 +01:00
lightmare
686355cbbe
Merge pull request #3506 from mapycz/fix-building-symbolizer-transform
Building symbolizer improvements
2018-07-27 12:55:53 +02:00
Jiri Drbalek
acbf80677a update visual tests data 2018-07-27 10:23:34 +00:00
Jiri Drbalek
4a93209423 render building symbolizer rewrite
- make projection and view transforms first
- removed dependency on segment_t
- no need for sorting faces
2018-07-27 10:23:33 +00:00
Mickey Rose
6e71bad70c Revert "update test data"
This reverts commit 81183d6fe6.
It removed recent tests, didn't update.
2018-07-27 10:58:31 +02:00
Artem Pavlenko
b796cc9912
[skip ci] 2018-07-25 17:04:37 +01:00
Artem Pavlenko
ace2baafbd
Update README.md 2018-07-25 16:01:41 +01:00
Artem Pavlenko
50caf755c3
Update README.md 2018-07-25 15:55:18 +01:00
Artem Pavlenko
7cf93eb70f
Update README.md 2018-07-25 15:45:40 +01:00
Artem Pavlenko
f930bea045
Update README.md 2018-07-25 15:45:09 +01:00
Artem Pavlenko
174c82662d
Merge pull request #3952 from mapnik/circleci-20-test
Circleci 20 test
2018-07-25 15:26:28 +01:00
Artem Pavlenko
fed8effb67 remove circleci v1.0 config 2018-07-25 14:17:46 +01:00
Artem Pavlenko
64462b8dca cleanup 2018-07-25 14:16:04 +01:00
Artem Pavlenko
39b6dca059 Adding auto-generated CircleCI 2.0 config file 2018-07-25 13:53:56 +01:00
Artem Pavlenko
70fbdd21c7
Merge pull request #3948 from mapnik/boost_1_67
Boost 1 67
2018-07-23 14:05:52 +01:00
Artem Pavlenko
5eca7731e9 rely on implicit std::reference_wrapper<T> -> T conversions (thanks @lightmare) 2018-07-23 13:26:22 +01:00
Artem Pavlenko
93d0eea8af Merge branch 'master' into boost_1_67 2018-07-23 11:35:14 +01:00
Artem Pavlenko
65080e2a95 add support for BOOST_VERSION < 106700 2018-07-23 10:58:27 +01:00
talaj
c819a03bb3
Merge pull request #3944 from EmilGedda/gedda-patch-1
remove old render_box function declaration from cairo_renderer.hpp
2018-07-20 14:43:48 +02:00
Emil Gedda
93c566638f
remove old render_box function declaration from cairo_renderer.hpp 2018-07-20 14:02:51 +02:00
Artem Pavlenko
5fe0dda890 Merge branch 'master' into boost_1_67 2018-07-20 11:53:47 +01:00
Mickey Rose
1ddd3afc51 postgis+pgraster: substitute numbers always with decimal point 2018-07-19 22:52:55 +02:00
Mickey Rose
774a618d13 postgis: add test for pg_typeof substituted tokens 2018-07-19 22:51:01 +02:00
Artem Pavlenko
bdf7876652 const-ness 2018-07-19 15:36:00 +01:00
Artem Pavlenko
67dbb96580 use uint8_t to parse hex2 values to avoid overflowing (boost >= 1.67) 2018-07-19 15:34:40 +01:00
Mickey Rose
f1d07d6718 proj_transform test: also check that transform succeeded 2018-07-18 19:31:12 +02:00
Artem Pavlenko
a98d1b8071 use std::uint8_t as an attribute for hex2 parser 2018-07-18 10:40:41 +01:00
Artem Pavlenko
4c31bd16d2 Merge branch 'master' into boost_1_67 2018-07-18 09:27:56 +01:00
Sandro Santilli
69c317cd1f Fix some comments and error messages referencing raster parameters 2018-07-16 19:27:12 +02:00
Mickey Rose
68a7f5f63c proj_transform: fix strided coordinate array transform 2018-07-16 14:18:49 +02:00
Mickey Rose
1e6feecb91 proj_transform: add test for strided coordinate array 2018-07-16 14:18:49 +02:00
Mickey Rose
f84191204e eradicate M_PI 2018-07-16 14:18:49 +02:00
Mickey Rose
32e7202223 well_known_srs: move implementation to .cpp
- add lonlat2merc, merc2lonlat overloads for single point
- add stride argument to overloads for coordinate arrays
- make all functions exported
- change static string constants to exported
- change static numeric constants to constexpr
- remove superfluous numeric constants
2018-07-16 14:18:32 +02:00
Mickey Rose
e11f3a660a offset_converter: minor refactoring
DRY: extract method for `joint_angle` calculation.
2018-07-14 12:46:53 +02:00
Mickey Rose
a0a2c78950 util/math: clamp, degrees, radians
Use common functions for degrees <-> radians conversions, except when
dealing with agg, where it makes sense to use available deg2rad/rad2deg
functions instead of including another header.
2018-07-13 12:34:25 +02:00
lightmare
187c1df332
Merge pull request #3337 from lightmare/normalize-angle
speed up util::normalize_angle for large values
2018-07-12 19:30:37 +02:00
Mickey Rose
0a6e82e555 move src/math.cpp under src/util/ 2018-07-11 23:55:21 +02:00
Mickey Rose
7c4ccf0209 make util::normalize_angle reasonably fast on large values
Because it simply calculates the remainder after division by full turn,
it shouldn't take time proportional to the magnitude of its operand.
2018-07-11 23:14:23 +02:00
Mickey Rose
354be41811 benchmarks: clarify output
Make it clear in benchmark output which mode it ran in:
- "main thread" only
- "1 worker" thread
- "N workers"
2018-07-11 23:14:04 +02:00
Mickey Rose
65f3bb75dd Revert "benchmark - slightly better stderr"
This partially reverts commit 5ab6db2607.

The change of argument --threads N doesn't just change output, it
changes the mode of operation.
With --threads 0, the benchmark runs wholly in the main thread.
With --threads 1, it starts 1 worker thread, which does the work, and
the main thread measures how long it takes to complete.
2018-07-11 23:14:03 +02:00
Mickey Rose
d70c2d978c add benchmark for mapnik::util::normalize_angle 2018-07-11 23:13:59 +02:00
Mickey Rose
5091a4ba9d benchmarks: move sources under benchmarks/src/ 2018-07-11 15:57:04 +02:00
Mickey Rose
fa55e3dfa9 benchmarks: move headers under benchmarks/include/ 2018-07-11 13:32:32 +02:00
Mickey Rose
25f0ef09a5 use MAPNIK_VERSION_AT_LEAST for minimum-version check 2018-07-11 10:43:06 +02:00
Mickey Rose
c2c00570b3 define MAPNIK_MAKE_VERSION, MAPNIK_VERSION_AT_LEAST 2018-07-11 10:38:32 +02:00
Mickey Rose
b20e42ba3f changelog: more missing unreleased changes [skip ci] 2018-07-10 22:49:50 +02:00
Mickey Rose
fb8e75afec changelog: copy changes from v3.0.x branch [skip ci] 2018-07-10 22:49:50 +02:00
Mickey Rose
558dcdb7d0 changelog: unindent [skip ci] 2018-07-10 22:49:50 +02:00
Mickey Rose
249c4b6c6c changelog: minor formatting [skip ci] 2018-07-10 22:49:50 +02:00
talaj
ae3a9404b7
Merge pull request #3935 from lightmare/fix-bbox-reprojection
Fix bbox reprojection
2018-07-10 21:45:47 +02:00
Mickey Rose
62912d25af Revert "allow visual test failures with g++"
This reverts commit 05936826b3.
2018-07-10 18:51:34 +02:00
Mickey Rose
d4f113e302 update changelog [skip ci] 2018-07-10 12:06:32 +02:00
Mickey Rose
947e424f56 proj_transform: fix bbox reprojection
- remove buggy calculate_bbox, use boost::geometry::envelope instead
- move helper envelope_points to anonymous namespace and make it always
  produce exactly the requested number of points, even if it's not
  evenly divisible by 4
2018-07-10 11:31:06 +02:00
Mickey Rose
2a98fe0155 proj_transform test: use reference values from cs2cs tool 2018-07-10 11:31:06 +02:00
Jiri Drbalek
9a30fda852 Backport Python test of bbox reprojection
Originaly in Python from https://github.com/mapnik/mapnik/pull/2657
2018-07-10 11:31:06 +02:00
Mickey Rose
abbe44db6d changelog: add notice about c++14 and spirit x3
[skip ci]
2018-07-09 14:32:00 +02:00
Mickey Rose
c389cdc562 changelog: add missing unreleased changes
[skip ci]
2018-07-09 14:32:00 +02:00
Mickey Rose
70a511165b scripts/markdown-hyperlinks: prevent unwanted replacements
- don't replace @var in code spans with link to github user
- don't replace 1234567... in links with link to commit
- replace hexadecimal numbers looking like commit hashes only
  after replacing raw URIs - this together with the previous point
  prevents inadvertent replacement of long numbers in links

[skip ci]
2018-07-09 14:32:00 +02:00
Mickey Rose
e9befd9057 changelog: fix markdown
[skip ci]
2018-07-09 13:45:07 +02:00
lightmare
15f953672d
Merge pull request #3924 from lightmare/changelog-autolink
Changelog autolinks
2018-07-08 23:11:48 +02:00
Artem Pavlenko
2c2669d655 fixes typo (#3930) 2018-07-05 09:37:49 +02:00
Artem Pavlenko
735acb297a add (uncomment) surrogate pairs test + small typo fix 2018-07-02 21:55:27 +02:00
Artem Pavlenko
df0ba4a777 add more single/double quotes tests 2018-07-02 16:42:35 +02:00
Artem Pavlenko
81183d6fe6 update test data 2018-07-02 15:11:47 +02:00
Artem Pavlenko
2977688a8a test for single and double quoted escaped strings (regex) (ref 3433397c30 (commitcomment-29512684)) 2018-07-02 15:10:28 +02:00
Artem Pavlenko
9d44a73ad0 fix - add single quoted string escaped chars support + allow backtracking when escaped characters are not part of /u, /U. /x encodings (ref 3433397c30 (commitcomment-29512684)) 2018-07-02 15:07:41 +02:00
Artem Pavlenko
7db6b0c9f0
Merge pull request #3925 from lightmare/test-ds-attr-types
Also check types of values in datasource tests
2018-07-02 09:53:53 +02:00
Artem Pavlenko
c81a40d9eb
Merge pull request #3923 from lightmare/sconf-fixup-messages
scons configure cleanup
2018-07-02 09:53:25 +02:00
Artem Pavlenko
ba0e13c812
Merge pull request #3922 from lightmare/sconf-try-action
Sconf TryAction replacement
2018-07-02 09:53:02 +02:00
Artem Pavlenko
51065985df
Merge pull request #3921 from lightmare/unicode-attr-name
add test for parsing expression with non-ascii characters in attribute name
2018-07-02 09:51:45 +02:00
Artem Pavlenko
9e3014494c
Merge pull request #3912 from mapycz/fix-overviews
GDAL: Fixes of overviews
2018-07-02 09:49:46 +02:00
Mickey Rose
178edb9da6 update CHANGELOG with links to issues, commits, users
[skip ci]
2018-07-01 11:58:18 +02:00
Mickey Rose
bdaf7813af minor CHANGELOG amendments in preparation for generating hyperlinks
[skip ci]
2018-07-01 11:55:45 +02:00
Mickey Rose
2e82c17d92 datasource tests: typos 2018-06-30 15:26:17 +02:00
Mickey Rose
58592ed597 datasource tests: fix failing csv test
- it was indeed the test that was wrong; the coordinates in nypd.csv are
  specified with a decimal point, thus should be `value_double`
2018-06-30 15:21:55 +02:00
Mickey Rose
04e1f82734 datasource tests: use macro REQUIRE_ATTRIBUTES instead of function
- failing checks report location inside the function, not where it's
  called from; using macro reports proper location
2018-06-30 15:20:22 +02:00
Mickey Rose
d62e215ff9 datasource tests: also check value types in REQUIRE_ATTRIBUTES 2018-06-30 15:20:19 +02:00
Mickey Rose
e31578045e add script for auto-generating links in CHANGELOG
[skip ci]
2018-06-30 12:01:57 +02:00
Mickey Rose
b417ddf32d SConstruct: shortest_name is a one-liner 2018-06-29 16:43:33 +02:00
Mickey Rose
89d0c6da19 SConstruct: change rollback_option to free function
It shouldn't be a conftest. First, it doesn't act like one. Second,
calling it as conf.rollback_option from within another conftest before
calling context.Result confuses scons, it doesn't expect conftests to be
nested and reports "error: no result" for the outer one as soon as the
inner is called.
2018-06-29 16:24:04 +02:00
Mickey Rose
16eb870303 SConstruct: fixup config.log message order
- always call .Message before .TryRun
- always unpack .TryRun result tuple
2018-06-29 16:07:47 +02:00
Mickey Rose
a17de02ce4 SConstruct: fixup ICU min version check
- "Say what you mean." The check is for version >= 4.0, not 4.2
- call .Message before .TryRun
- don't silence .Result
2018-06-29 16:00:23 +02:00
Mickey Rose
a2af3a53fa SConstruct: fixup HarfBuzz configure checks
- call .Message before .TryRun
- don't silence .Result
- report found version even if it's really old and doesn't even define
  HB_VERSION_ATLEAST macro
2018-06-29 15:48:51 +02:00
Mickey Rose
4531393367 SConstruct: fix configure check ogr_enabled
gdal-config --ogr-enabled writes yes/no to stdout,
but always returns 0 (unless an invalid argument is given)
2018-06-28 15:02:27 +02:00
Mickey Rose
e63003a6e0 SConstruct: log configure commands to config.log
Forgot that with `TryAction`, configure commands and their outputs were
being logged in `config.log`, and the previous commit failed to retain
this ability.

New function `config_command` mimics the logging, with the modification
that output lines are prefixed with `->` so they stand out a bit more.
2018-06-28 15:02:27 +02:00
Mickey Rose
9baa10d135 SConstruct: avoid incorrect usage of sconf.TryAction
Closes #3918

Replace all previous uses of `call` and `TryAction` with a new function
`silent_command`, which invokes `subprocess.Popen` and returns both exit
status and command output.
2018-06-27 21:03:30 +02:00
Mickey Rose
5544c4c74f expressions_test: add test for unicode attribute name
Refs #1153

That issue doesn't affect current master, maybe it was valid at the time
of posting.  I just couldn't find a test that'd confirm unicode in
attribute names actually works, so here it is.
2018-06-27 11:58:56 +02:00
Mickey Rose
6befc23101 expressions_test: change properties_type to std::map 2018-06-27 11:56:36 +02:00
Dane Springmeyer
42d3f2d0d3
Merge pull request #3917 from mapnik/only-throw-on-dupe-style-in-strict-mode
Only throw on duplicate styles in strict mode
2018-06-26 18:20:35 -07:00
Dane Springmeyer
d60be13ed8 remove unused code 2018-06-26 15:57:21 -07:00
Blake Thompson
a914047770
Merge pull request #3920 from manaswinidas/improve
Improves INSTALL.md
2018-06-26 11:24:38 -07:00
Dane Springmeyer
c458cf0c57 test duplicate style throw behavior exactly 2018-06-26 09:53:12 -07:00
Manaswini Das
1d7fc9c070
Improves INSTALL.md 2018-06-26 21:16:03 +05:30
Dane Springmeyer
434511ca3b fix to only throw in strict mode 2018-06-24 19:08:38 -07:00
Dane Springmeyer
7673bbe827 only throw on duplicate styles in strict mode 2018-06-24 10:19:33 -07:00
Dane Springmeyer
e9ebc938e0 [build] ensure we don't fail abruptly in BOOST_LIB_VERSION_FROM_HEADER is unknown 2018-06-19 17:21:50 -07:00
Jiri Drbalek
712cce8213 Update test data 2018-06-11 14:40:58 +02:00
Jiri Drbalek
4753aeb73a gdal: Refactoring 2018-06-11 12:00:43 +00:00
Jiri Drbalek
25f1b8cb18 gdal: Do not shrink query extent 2018-06-09 16:34:17 +00:00
Jiri Drbalek
10aaf85f54 gdal: Count in filter_factor 2018-06-09 16:34:17 +00:00
Jiri Drbalek
4f570413ba gdal: Fix finding closest overview 2018-06-09 16:34:17 +00:00
Artem Pavlenko
9cd40947d8 update deps 2018-06-07 09:51:29 +01:00
Artem Pavlenko
7c8215dfda Merge branch 'Algunenano-blessed_offset_clip' 2018-06-07 09:45:43 +01:00
Artem Pavlenko
977c86af6c update visual test data 2018-06-07 09:45:14 +01:00
Raul Marin
8e11ef3fd7 Improve padding calculation 2018-06-06 18:39:15 +02:00
Artem Pavlenko
a396282189
Merge pull request #3905 from ISNIT0/patch-1
Update INSTALL.md
2018-05-30 15:32:31 +01:00
Joe Reeve
e84fbf1523
Update INSTALL.md
Added a `cd` to allow for simpler execution (copy-paste)
2018-05-30 10:51:46 +01:00
Artem Pavlenko
95d5fabad0 Merge branch 'master' into boost_1_67 2018-05-21 15:58:24 +01:00
Artem Pavlenko
16501f8641
Merge pull request #3899 from Algunenano/master_line_middle
Marker symbolizer: Fix bug with lines with 0 length
2018-05-21 15:53:59 +01:00
Artem Pavlenko
102fc3eaf9
Merge pull request #3892 from Algunenano/master_freetype29
Use pkg-config to find FreeType2 if available
2018-05-21 15:52:14 +01:00
Raul Marin
0becc1c5e9 Markers point placement: Add some basic tests 2018-05-11 15:39:55 +02:00
Raul Marin
0195047d7a Marker symbolizer: Fix bug with lines with 0 length (division by zero) 2018-05-11 12:24:01 +02:00
Artem Pavlenko
b7e486d3c3
Merge pull request #3897 from mapycz/refactor-scale-denom
Scale denominator: a bit of refactoring
2018-05-09 08:46:09 +01:00
Jiri Drbalek
846e961b05 Replace magic number with described constant 2018-05-08 16:54:46 +00:00
Artem Pavlenko
d75a73a727
Merge pull request #3896 from mapycz/rm-ellipsoid
Remove useless ellipsoid.hpp
2018-05-08 17:47:02 +01:00
Artem Pavlenko
c2fe73ecbe
Merge pull request #3895 from mapycz/postgis-connection-creator-id
postgis: Exclude password from ConnectionCreator::id()
2018-05-08 17:46:26 +01:00
Artem Pavlenko
051f2fa906
Merge pull request #3894 from mapycz/postgis-connection-manager-thread-safe
postgis: Thread safe ConnectionManager
2018-05-08 17:44:45 +01:00
Jiri Drbalek
3deb55cc5f Use existing constant 2018-05-08 16:44:41 +00:00
Jiri Drbalek
89b5cb4f22 Remove useless ellipsoid.hpp 2018-05-08 15:39:13 +00:00
Jiri Drbalek
ab05de48df postgis: Exclude password from ConnectionCreator::id()
- Password is not necessary for connection identification
- When password is not required by the database,
  user can accidentally use multiple different passwords
  without noticing.
  This leads to allocating more connection pools
  and increase of connection consumption.
2018-05-07 13:49:57 +00:00
Jiri Drbalek
497055d80d postgis: Thread safe ConnectionManager 2018-05-04 20:18:04 +00:00
Raul Marin
23755a527a Use pkg-config to find FreeType2 if available 2018-05-03 17:07:37 +02:00
Artem Pavlenko
b1a19bc13c Merge branch 'master' into boost_1_67 2018-05-01 10:01:59 +02:00
Artem Pavlenko
d8dbe11fd0 Merge branch 'Algunenano-master_overlap' 2018-04-30 09:52:04 +02:00
Artem Pavlenko
871991dced Merge branch 'master_overlap' of https://github.com/Algunenano/mapnik into Algunenano-master_overlap 2018-04-30 09:51:15 +02:00
Artem Pavlenko
4691315e5a
Merge pull request #3891 from mapnik/compiler-detect
don't error oddly if compiler is not found
2018-04-30 09:15:34 +02:00
Dane Blakely Springmeyer
8af9bfe8e0 don't error oddly if compiler is not found 2018-04-29 21:08:36 -07:00
Raul Marin
3171b89fea Generalize overlap_optimization to use points and text too 2018-04-27 17:15:03 +02:00
Raul Marin
0a2be27ba9 Use overlap optimization in load_map_string too 2018-04-27 17:14:57 +02:00
Artem Pavlenko
b7bdd08837 define BOOST_SPIRIT_INSTANTIATE_UNUSED once and re-use [skip-ci] 2018-04-18 14:18:40 +02:00
Artem Pavlenko
664d3508de remove reference_wrapper usage when injecting attributes into grammar ( >= boost_1_67) [skip-ci] 2018-04-18 12:53:17 +02:00
Artem Pavlenko
c946620fec remove unused instantiation 2018-04-18 10:31:33 +02:00
Artem Pavlenko
9e79e1edf1 update const-ness in x3::context definitions to support boost 1_67 [skip-ci] 2018-04-17 15:41:17 +02:00
Artem Pavlenko
def0fd1f31 prepare for breaking change in spirit::x3 (from boost 1.67.0) - remove with_context usage
(ref https://github.com/boostorg/spirit/pull/239)
2018-04-16 15:25:39 +02:00
Artem Pavlenko
b392b8214e add explicit instantiation declarations to DEFINE_ENUM macro to fix -Wundefined-var-template warnings. 2018-04-16 11:12:05 +02:00
Artem Pavlenko
fe5c4bb978 supress unused variable warning in boost state_machine 2018-04-16 11:08:08 +02:00
Artem Pavlenko
82fb67441f
Merge pull request #3880 from Algunenano/master_icu61
Qualify ICU types explicitly
2018-04-10 10:32:30 +02:00
Artem Pavlenko
f04248e57d Merge branch 'mapycz-save-map-denominator' 2018-04-10 10:27:40 +02:00
Artem Pavlenko
d2d587cb1b mapycz-save-map-denominator 2018-04-10 10:25:23 +02:00
Raul Marin
1ddfe6c315 Qualify ICU types explicitly
ICU 61 has dropped the global `using namespace icu;`
http://site.icu-project.org/download/61#TOC-Migration-Issues
2018-04-03 13:18:43 +02:00
Blake Thompson
f7098a8a7e
Merge pull request #3873 from mapnik/gdal_overview_fix
GDAL Driver Overview Fix and Memory Reduction - Master
2018-03-30 16:45:58 -05:00
Blake Thompson
a217b38fd5 Updated to use max_image_area as a datasource parameter for GDAL plugin 2018-03-30 15:40:30 -05:00
Blake Thompson
25e4bb3f6c A fix for two distinct issues associated with gdal featuresets, the first is overviews were not properly being utilized based on the resolution of the final image requested. The second is that allocation of far too much memory could be possible in GDAL to attempt to do resampling internally in mapnik. This now has a hard cap so that we allocate less memory in these situations but are still able to resample internally in mapnik. 2018-03-30 15:10:29 -05:00
Dane Springmeyer
65b4afdfc1
Merge pull request #3876 from Algunenano/blessed_master_threadsafe_disabled
Fix build issue with MAPNIK_THREADSAFE disabled
2018-03-26 12:15:34 -04:00
Raul Marin
caa2a88177 Fix build issue with MAPNIK_THREADSAFE disabled 2018-03-26 18:08:44 +02:00
Blake Thompson
ae6c9c7e37
Merge pull request #3875 from mapycz/raster-colorizer-image-size
Raster colorizer: check image bounds
2018-03-23 13:50:16 -04:00
Jiri Drbalek
ac50139c54 Raster colorizer: check image bounds 2018-03-23 11:55:40 +00:00
Artem Pavlenko
a8d7fc1cfb Revert "avoid symbols duplication"
This reverts commit c737f4d56f.
2018-03-15 15:58:23 +01:00
Artem Pavlenko
c737f4d56f avoid symbols duplication 2018-03-09 09:57:49 +01:00
Artem Pavlenko
030b0de105 update CHANGELOG 2018-03-06 15:42:48 +01:00
Artem Pavlenko
934124d30c follow up on 5b8b75e680 2018-03-01 12:11:03 +01:00
Artem Pavlenko
eb1a32eb79 fix dereferencing out-of-range iterator (caught by -fsanitize=undefined,integer) (#3867) 2018-03-01 11:54:41 +01:00
Artem Pavlenko
5b8b75e680 fix compiler warning
```include/mapnik/text/symbolizer_helpers.hpp:164:45: warning: template template parameter using 'typename' is a C++17 extension
      [-Wc++17-extensions]
    template <template <typename, typename> typename GridAdapter>
                                            ^~~~~~~~
                                            class
```
2018-03-01 10:56:55 +01:00
Artem Pavlenko
abce91a180 decode ret into str for consistency. 2018-02-28 15:42:25 +01:00
Artem Pavlenko
3ad43a33ae check language variable to avoid SIGILL in '-fsanitize-trap=integer,undefined' builds. 2018-02-28 15:20:13 +01:00
Dane Springmeyer
fb8cbb6848 remove shorthands for sanitizers, best to pass flags manually 2018-02-27 10:28:53 -08:00
Artem Pavlenko
60c505d08b Merge branch 'mapycz-offset-converter-topology' 2018-02-26 16:06:56 +01:00
Artem Pavlenko
37b7f05180 Merge branch 'offset-converter-topology' of https://github.com/mapycz/mapnik into mapycz-offset-converter-topology 2018-02-26 16:06:19 +01:00
Artem Pavlenko
3ebbf2075f
Merge pull request #3865 from Algunenano/master_icu_data
ICU DATA: Default to icu-config if u_getDataDirectory fails
2018-02-26 15:13:08 +01:00
Artem Pavlenko
c12f11fe42
Merge pull request #3837 from mat007/fix-unicode-file-path-on-windows
Handle unicode file path on windows in command line tools
2018-02-26 12:23:11 +01:00
Raul Marin
765406f9a7 ICU DATA: Default to icu-config if u_getDataDirectory fails 2018-02-23 15:33:10 +01:00
Artem Pavlenko
8876d13356 improve errors reporting in mapnik-index 2018-02-21 16:02:12 +01:00
Artem Pavlenko
ff56c86446
Merge pull request #3862 from mapnik/apply_color_blind_filter-fix
Fix apply_color_blind_filter to use correct color-space and avoid NAN…
2018-02-20 16:48:31 +01:00
Artem Pavlenko
cec5e0e391
Merge pull request #3863 from Algunenano/master_proj_lib
PROJ_LIB: Fix detection code
2018-02-20 16:04:50 +01:00
Raul Marin
b77ad659d8 PROJ_LIB: Fix detection code
.sconf_temp/conftest_24.cpp:30:42: error: use of undeclared identifier 'strlen'
2018-02-20 14:24:06 +01:00
Artem Pavlenko
2a090aa799 update visual tests data 2018-02-20 12:42:40 +01:00
Artem Pavlenko
c5e91a5c1e update color-blind filters tests post bac24cd844 2018-02-20 12:05:49 +01:00
Artem Pavlenko
cdb301b357 enable high dpi scaling 2018-02-20 11:43:55 +01:00
Artem Pavlenko
bac24cd844 Fix apply_color_blind_filter to use correct color-space and avoid NAN which results in SIGILL when compiled with DEBUG_UNDEFINED=yes (#3861) 2018-02-20 11:19:53 +01:00
Artem Pavlenko
d43c4c1812 fix typo #3856 2018-02-19 13:15:48 +01:00
Artem Pavlenko
429d79c81d check nodata returned by 'GetNoDataValue' has valid representation (!std::isnan) (#3856) 2018-02-19 12:09:56 +01:00
Artem Pavlenko
a2f596951e update visual tests data 2018-02-15 10:04:43 +01:00
Artem Pavlenko
b8e6a0accc
Merge pull request #3859 from mapycz/fix-dgal-default-nodata
Respect raster_has_nodata
2018-02-14 16:51:57 +01:00
Artem Pavlenko
6815ac2869 use multiplication instead of << to avoid undefined behavour when LHS is a negative int (-fsanitize=undefined) 2018-02-14 16:49:31 +01:00
Artem Pavlenko
17a98767b4 use safe_cast for narrowing double->typename span_gen_type::value_type cast (#3856) (thanks @talaj!) 2018-02-14 16:47:47 +01:00
Jiri Drbalek
4c444d0082 Respect raster_has_nodata 2018-02-14 13:56:04 +00:00
Artem Pavlenko
533c6d6e5b check m_width_abs > 0 to avoid division by zero (-fsanitize=undefined) 2018-02-13 17:06:55 +01:00
Artem Pavlenko
2a594d4f0e
Merge pull request #3855 from mapycz/grid_vertex_converter-fix-empty-polygon
grid_vertex_converter: Fix handling of empty polygon
2018-02-13 16:49:10 +01:00
Jiri Drbalek
b6c451d7e3 grid_vertex_converter: Fix handling of empty polygon 2018-02-13 15:00:25 +00:00
Jiri Drbalek
e08786b5fb AGG: Fix invalid memory access if input buffer size is zero 2018-02-13 15:00:25 +00:00
Artem Pavlenko
3976014dcd fix left shift of negative value (-fsanitize=undefined) 2018-02-13 15:14:17 +01:00
Artem Pavlenko
15f16ce6ec cast header to unsiged char const* (-fsanitize=address) 2018-02-13 13:34:42 +01:00
Artem Pavlenko
f117546f73
Merge pull request #3848 from mapnik/update_changelog
Updated changelog from v3.0.x branch
2018-02-07 16:48:26 +01:00
Artem Pavlenko
976555041d
Merge pull request #3847 from mapycz/port-grid-placement
Grid placement
2018-02-07 16:44:21 +01:00
Blake Thompson
3e6d4aa58a Updated changelog from v3.0.x branch 2018-02-06 14:07:21 -05:00
Jiri Drbalek
1adebaaf73 Update visual tests 2018-02-06 16:47:34 +00:00
Jiri Drbalek
f10e051e17 Add grid placement for text and shield symbolizer 2018-02-06 15:19:05 +00:00
Artem Pavlenko
d4826eea6f
Merge pull request #3844 from mapycz/interior-scale-invariant
Interior, polylabel: Scale precision by polygon size
2018-02-05 11:28:35 +01:00
Artem Pavlenko
f4f63a1006
Merge pull request #3845 from mapycz/fix-vertex-adapter-test
Fix vertex_adapter test
2018-02-05 11:27:44 +01:00
Jiri Drbalek
953d1d1a01 Fix vertex_adapter test 2018-02-04 08:46:14 +00:00
Jiri Drbalek
c975c1b6b8 Update visual tests 2018-02-03 17:13:56 +00:00
Jiri Drbalek
69c3ee550d interior, polylabel: Scale precision by polygon size 2018-02-03 14:00:30 +00:00
Artem Pavlenko
5aebd821f6 Update boost to 1.65.1 and mason HEAD. 2018-01-31 21:18:01 +01:00
Artem Pavlenko
828346add3 require BOOST_VERSION >= 1.62.0 (#3835) 2018-01-31 14:11:55 +01:00
Jiri Drbalek
223a240751 Update visual tests 2018-01-26 11:55:04 +00:00
Jiri Drbalek
fb5ca1bb8e offset_converter: Don't filter out closing and moving segments 2018-01-26 11:55:04 +00:00
Artem Pavlenko
2461058ecc
Merge pull request #3838 from mapycz/fix-crash-polygon_vertex_adapter
Fix crash in polygon_vertex_adapter
2018-01-23 16:35:09 +01:00
Jiri Drbalek
0c5d167028 polygon_vertex_adapter: Fix crash in case of empty interior ring 2018-01-23 15:18:44 +00:00
Mathieu Champlon
22d0cb72fd Handle unicode file path on windows 2018-01-20 22:24:05 +01:00
Artem Pavlenko
c6b9036002
Merge pull request #3827 from mapycz/gdal-test-upscaling
Add a test that GDAL plugin does not upsample
2018-01-18 15:54:15 +00:00
Artem Pavlenko
8bc236ba7b
Merge pull request #3834 from mapycz/fix-interior-empty-polygon
Interior, Polylabel: cover empty polygon or exterior ring
2018-01-17 14:47:37 +00:00
Jiri Drbalek
4e160acc88 Avoid copying 2018-01-17 13:39:21 +00:00
Jiri Drbalek
99038229f7 Polylabel: cover the case of empty polygon or exterior ring 2018-01-17 13:39:15 +00:00
Jiri Drbalek
a97eace434 Interior: cover the case of empty polygon or exterior ring 2018-01-17 12:58:42 +00:00
Artem Pavlenko
da8b5c46d7
Merge pull request #3833 from mapycz/fix-crash-polygon_vertex_processor
Fix crash in case of empty ring
2018-01-17 10:06:32 +00:00
Jiri Drbalek
ec53f3d879 Fix crash in case of empty ring 2018-01-17 09:53:45 +00:00
Artem Pavlenko
ab4e1b77d0
Merge pull request #3828 from mikejcorey/except_syntax
Replaced old-style exception for Python 3 compatibility.
2018-01-11 09:53:57 +00:00
Michael Corey
e5e0b7674a Replaced old-style exception for Python 3 compatibility. 2018-01-10 21:50:49 -08:00
Jiri Drbalek
43a9f70314 Add a test that GDAL plugin does not upsample 2018-01-10 15:02:44 +00:00
Artem Pavlenko
5ab6db2607 benchmark - slightly better stderr 2018-01-10 10:04:10 +00:00
Artem Pavlenko
b193d03151 Merge remote-tracking branch 'origin/master' 2018-01-09 17:03:08 +00:00
Artem Pavlenko
2aab39b8e7
Merge pull request #3826 from mapycz/svg-clippath-test
SVG: Add a test of clipPath
2018-01-09 17:02:24 +00:00
Jiri Drbalek
3af3286436 SVG: Add a test of clipPath 2018-01-09 16:11:19 +00:00
Artem Pavlenko
f6b11b86a8 update test/data 2018-01-09 15:40:41 +00:00
Artem Pavlenko
ff31c6d6eb SVG parser - add ignore_ member variable to allow skipping of unsupported elements, currently clipPath (#3818) 2018-01-09 15:19:52 +00:00
Artem Pavlenko
a04ca98c6b Merge branch 'mapycz-polylabel-as-interior' 2018-01-08 10:21:49 +00:00
Artem Pavlenko
c24568f033 Merge branch 'polylabel-as-interior' of https://github.com/mapycz/mapnik into mapycz-polylabel-as-interior 2018-01-08 10:21:09 +00:00
Artem Pavlenko
e2d741bdb7
Merge pull request #3809 from IMQS/pr-text-placements-export
Export all text_placements_ classes from mapnik.dll
2018-01-05 13:02:58 +00:00
Artem Pavlenko
45d4d5afb3 Merge branch 'lightmare-fix-group-symbolizer-crash' 2018-01-05 12:17:11 +00:00
Artem Pavlenko
c29f944726 Merge branch 'fix-group-symbolizer-crash' of https://github.com/lightmare/mapnik into lightmare-fix-group-symbolizer-crash 2018-01-05 12:16:41 +00:00
Artem Pavlenko
92afd0bebf Use macro to apply __attribute__((init_priority(val))) where it's supported (gcc+clang) (#3821) 2018-01-04 14:29:00 +00:00
Artem Pavlenko
50169e95b2 Enforce global variables initialisation order via __attribute__((init_priority(<priority>))) (#3821) 2018-01-04 12:22:04 +00:00
Artem Pavlenko
a67f5abb67 consistent syntax 2018-01-03 17:38:16 +00:00
Jiri Drbalek
7febf6c24a update visual tests 2017-12-17 08:11:58 +00:00
Jiri Drbalek
f52a0fa4f6 new interior algorithm 2017-12-13 21:48:13 +00:00
Jiri Drbalek
ea7ba2c099 add polylabel placement method 2017-12-13 21:48:13 +00:00
Jiri Drbalek
e243e16fd9 find text interior placement after reprojection 2017-12-13 21:48:13 +00:00
Artem Pavlenko
43d7278352 Don't apply preserveAscpectRatio logic logic if width and height expressed as % values (#3812) 2017-12-06 11:23:54 +01:00
Dane Springmeyer
54532cecb5 use lowercase boolean to match check in scripts/check_glibcxx.sh 2017-11-28 15:24:10 +01:00
Ben Harper
5507ab817a Export all text_placements_ classes from mapnik.dll
Previously, only text_placements_dummy had a MAPNIK_DECL annotation.
This commit adds that annotation to text_placements_simple and
text_placements_list, so that they are also exposed from the Windows DLL
build.
2017-11-28 11:30:35 +02:00
Artem Pavlenko
5d9a5b99a5 Fix licence link (#3804) 2017-11-27 09:51:51 +01:00
Artem Pavlenko
bfb071233e fix 'prioritize_linking' option + remove depricated has_key usage 2017-11-23 11:30:35 +01:00
Artem Pavlenko
92150e9ca9 update deps 2017-11-23 11:11:21 +01:00
Artem Pavlenko
851708c26e Merge branch 'scons3' 2017-11-22 15:47:47 +01:00
Artem Pavlenko
a04caf339e Merge branch 'master' into scons3 2017-11-22 15:47:03 +01:00
Artem Pavlenko
8cd2ae322e support both python 2 and 3. 2017-11-22 14:56:20 +01:00
Artem Pavlenko
cf6b88f8da Revert "make python3 default"
This reverts commit a790d8cdb9.
2017-11-22 14:55:52 +01:00
Artem Pavlenko
ce12610adc Add copyleft notice 2017-11-21 15:53:08 +01:00
Artem Pavlenko
a790d8cdb9 make python3 default 2017-11-21 15:09:12 +01:00
Artem Pavlenko
047c3f4bba Scons/python3 - fix bytes to str conversions (#3798) 2017-11-21 13:12:52 +01:00
Artem Pavlenko
c18730a182 use exit ${CODE} 2017-11-20 09:44:33 +01:00
Dane Springmeyer
58d7c72a22
Merge pull request #3796 from mapnik/glibcxx-fix2
Glibcxx fix redux
2017-11-16 14:53:58 -08:00
artemp
a780581ebc Scons - update to 2.5.1 2017-11-16 12:05:21 +01:00
Artem Pavlenko
5732df452c support SCons 3 (initial attempt) 2017-11-16 11:59:55 +01:00
Dane Springmeyer
a2b7f642e0 check symbols for all modes, only error if symbols exist + ENABLE_GLIBC_WORKAROUND 2017-11-15 21:48:20 -08:00
Dane Springmeyer
5e06dfb50b add script that asserts on expected symbols 2017-11-15 20:32:47 -08:00
Dane Springmeyer
f32f3b34ae add glibc_workaround.cpp if option is chosen
This reverts commit 751d9bff1672f6b8cbd2b5ebe2eb460223746806.
2017-11-15 20:32:38 -08:00
Artem Pavlenko
3cb74f0871 attempting to fix #3793 2017-11-14 10:10:26 +01:00
Artem Pavlenko
97f520c7cf cleanup 2017-11-14 10:10:26 +01:00
Artem Pavlenko
2cd335509b
Merge pull request #3794 from mapycz/char_array_buffer-seekpos
char_array_buffer should implement also seekpos()
2017-11-14 09:55:43 +01:00
Jiri Drbalek
fe268b0e71 char_array_buffer should implement also seekpos() 2017-11-13 22:42:37 +00:00
Artem Pavlenko
5db45d9fa3 use semantic actions to fix #3744 ( >= boost_1_65) 2017-11-13 13:15:47 +01:00
Artem Pavlenko
4aaba786fa fix warning: comparison of integers of different signs 2017-11-13 09:48:31 +01:00
Artem Pavlenko
8258c7e621 Merge branch 'glibcxx-fix' 2017-11-13 09:26:15 +01:00
Dane Springmeyer
00a8aba245 drop back to boost 1.64.0 2017-11-09 12:31:18 -08:00
Dane Springmeyer
142c0373d7 upgrade to boost mason package built against libstdc++-4.9-dev instead of 5-dev 2017-11-09 12:12:44 -08:00
Dane Springmeyer
9f4e5844c4 also dump glibcxx symbols on circle 2017-11-09 10:20:30 -08:00
Dane Springmeyer
c2ca920181 remove inadvertent change 2017-11-09 10:08:23 -08:00
Dane Springmeyer
1ad3ae044b at workaround for throw_out_of_range_fmt 2017-11-09 10:07:26 -08:00
Dane Springmeyer
26a1c79efb start displaying glibcxx symbols needed in the binary (only relevant for linux) 2017-11-09 10:05:12 -08:00
Artem Pavlenko
98c26bcae0 SVG parser - fix default gradient vector in linear gradient [0,0,1,0] + support units in offset attribute. 2017-11-06 12:39:50 +01:00
Artem Pavlenko
743c14d3ff add UDL via operator"" _case 2017-11-06 10:31:53 +01:00
Artem Pavlenko
1a338bb924 update test data 2017-11-06 10:31:37 +01:00
Artem Pavlenko
be5085d2e9 apply mapnik/c++ formatting 2017-11-06 09:47:01 +01:00
Artem Pavlenko
0a4214fe36 use latest deps 2017-10-31 11:12:14 +01:00
Artem Pavlenko
2271e4a5a4 use unsigned int for indexed access 2017-10-31 10:52:09 +01:00
Artem Pavlenko
62b10d83be Merge pull request #3782 from IMQS/angled-point-master
Add new angled-point marker placement mode for lines
2017-10-26 17:27:08 +02:00
Ben Harper
05849f0da5 Add new angled-point marker placement mode for lines
This adds a new mode called 'angled-point' to the marker-placement modes.
The full list of modes is then:
  point, angled-point, interior, line, vertex-first, vertex-last

Angled point is identical to point, except that when placing a marker on
a line, the marker's angle is taken from the angle of the line segment.

There is another possible use of the "angled-point" concept for polygons,
and that is for placing labels on stand (aka erf) polygons. By computing
a dominant angle for a mostly rectangular polygon, this can produce quite
good results. I'm not sure whether I should implement that now, or if I
could do that later.
2017-10-26 15:09:17 +02:00
Artem Pavlenko
f02a259011 remove depth limit 2017-10-13 09:47:26 +02:00
Dane Springmeyer
e5b837ff97 remove -Wc++14-extensions flag (added in 064b99168) (#3778) 2017-10-11 16:26:39 +02:00
Artem Pavlenko
cdd8b35112 Merge branch 'mapycz-fix-viewer-linking' 2017-10-09 16:06:33 +02:00
Jiri Drbalek
4952baf494 fix linking of viewer 2017-10-09 11:35:24 +00:00
Jiri Drbalek
8c7d7e25cd update visual tests 2017-10-06 09:52:30 +00:00
talaj
8347778abb fix memory leak (#3775) 2017-10-06 09:27:58 +02:00
Artem Pavlenko
8dc1456766 update test-data 2017-09-29 10:26:04 +02:00
Artem Pavlenko
de9364d447 update deps + test data 2017-09-29 10:04:00 +02:00
talaj
377253bcc8 Check duplicate style names (#3770)
* Ported map I/O tests from Python.

These test loading, saving and round-tripping Map XML, and are
pretty much a direct port of the old Python `load_map_test.py` and
`save_map_test.py`.

* check duplicate style name

* update test data
2017-09-28 15:51:55 +02:00
Jiri Drbalek
43ea5dcb82 update visual tests data 2017-09-27 13:13:27 +00:00
Artem Pavlenko
eefe3de34b update visual data post centroid PR 2017-09-26 09:47:26 +02:00
Artem Pavlenko
71321e8e6b update protozero 2017-09-26 09:47:09 +02:00
Artem Pavlenko
53ad3f0fe8 increase init depth to 20 2017-09-25 16:53:16 +02:00
Artem Pavlenko
94ce4d530a update tests 2017-09-25 16:52:59 +02:00
talaj
f3cf1ad388 Fix centroid and interior algorithms (#3771)
* fix interior algorithm - closing segment handling

* fix centroid algorithm - closing segment handling

* update visual tests
2017-09-25 15:45:02 +02:00
Artem Pavlenko
304cce8efa update protozero to the latest 2017-09-22 15:21:32 +02:00
Artem Pavlenko
3d4963f40c move implementatio into *.cpp + return 'closest_point_result' struct. 2017-09-22 13:21:50 +02:00
Artem Pavlenko
afb2af84f7 assign second point 2017-09-22 13:21:02 +02:00
Artem Pavlenko
f210699884 add more tests 2017-09-22 13:20:23 +02:00
Artem Pavlenko
143d1e57cf add 'closest_point' geometry algorithm 2017-09-21 15:40:30 +02:00
Artem Pavlenko
e9f912bba9 Reserve memory via size() of range method in protozero (10c631d7e4 ) 2017-09-20 10:07:43 +02:00
Artem Pavlenko
fa96232258 update visual data 2017-09-20 09:54:25 +02:00
Artem Pavlenko
5d5ef602be rename 'geometry_type' to 'topojson_geometry_type' to avoid names clashing
(this was causing miscompilation on linux (ubuntu 17.04/clang))
2017-09-18 11:35:39 +01:00
talaj
13d678d9af visual tests: allow to ignore particular renderer (#3768)
* visual tests: refactor parsing parameters from the style

* visual tests: allow to ignore particular renderer

* update visual tests
2017-09-14 14:21:30 +01:00
Artem Pavlenko
c07397e71b update protozero 2017-09-14 11:25:51 +01:00
Artem Pavlenko
5a87d8fef9 update deps 2017-09-13 10:51:36 +01:00
talaj
d14203561d color font support improvements (#3758)
👍
2017-09-13 10:14:46 +01:00
talaj
c7c10fed46 basic unit test for feature_style_processor (#3766) 2017-09-13 10:14:13 +01:00
talaj
c80cde6044 visual tests: report failed tests (#3765) 2017-09-13 10:13:51 +01:00
Artem Pavlenko
acec6ae824 Merge branch 'master' into bbox-index 2017-09-12 14:57:12 +01:00
Artem Pavlenko
e54287293f Merge branch 'mapycz-nested-layers-fixes' 2017-09-12 14:10:22 +01:00
Artem Pavlenko
8bc080c7b8 Merge branch 'nested-layers-fixes' of https://github.com/mapycz/mapnik into mapycz-nested-layers-fixes 2017-09-12 14:09:47 +01:00
Artem Pavlenko
02c6124559 Revert "remove legacy defines"
This reverts commit ebb8d3b3ed.
2017-09-12 09:54:40 +01:00
Artem Pavlenko
01574e8038 update comment 2017-09-12 09:43:50 +01:00
Artem Pavlenko
797e8c7553 Merge branch 'master' into bbox-index 2017-09-11 17:59:23 +01:00
Artem Pavlenko
e97759d01b geojson test - require throwing on an empty feature collection
(not sure this is correct but needed to preserve 3.0.x behaviour)
2017-09-11 17:58:26 +01:00
Dane Springmeyer
aafc5d6d51 revert accidentally committed change to geobuf plugin 2017-09-11 09:48:10 -07:00
Artem Pavlenko
f19ca6672e Merge branch 'master' into bbox-index 2017-09-11 17:32:35 +01:00
Artem Pavlenko
04f9db4b18 minor format 2017-09-11 17:30:37 +01:00
Artem Pavlenko
6e9c56ee2c geojson.input - check and throw if bounding box extrator returns no boxes and not all input consumed (preserve 3.0.x caps) 2017-09-11 17:28:09 +01:00
Jiri Drbalek
6777721391 enclosing calls forgotten in https://github.com/mapnik/mapnik/pull/3474 2017-09-11 15:25:19 +00:00
Artem Pavlenko
b2f3fdb73b Merge branch 'master' into bbox-index 2017-09-11 10:47:50 +01:00
Artem Pavlenko
ebb8d3b3ed remove legacy defines 2017-09-11 10:46:57 +01:00
Dane Springmeyer
3135d58a40 Merge pull request #3762 from mapnik/collect-dep-data-paths-master
Port #3759 to master
2017-09-10 11:10:41 -07:00
Dane Springmeyer
13ff9e1706 adapt to spelling fix in svg tests 2017-09-10 10:22:08 -07:00
Dane Springmeyer
4bc7ec73de fix spelling in svg parser error 2017-09-10 08:59:54 -07:00
Dane Springmeyer
01bf0fb6ce make the configure script actually bash 2017-09-10 08:40:33 -07:00
Dane Springmeyer
8689048ba6 port #3759 to master 2017-09-10 08:19:04 -07:00
artemp
441687ecff boost_adapters - apply temp fix via @Algunenano for boost 1.64 (ref #3733) 2017-08-21 14:14:00 +01:00
artemp
9b0fd7a8d7 boost_adapters - apply temp fix via @Algunenano for boost 1.64. 2017-08-21 14:12:12 +01:00
artemp
40c51c469c shape.input/shapeindex - update to use bounding box per item *.index format. 2017-08-21 11:02:34 +01:00
artemp
6c19efa990 store box2d<float> directly in index_record to avoid conversions. 2017-08-18 16:59:58 +01:00
artemp
d81a7610d3 shapeindex - make index node 32-bytes (uint64_t, int32_t, int32_t) 2017-08-18 16:58:20 +01:00
artemp
541c1a35a0 mapnik-index - initialise quad-tree with bbox if present. 2017-08-18 13:55:04 +01:00
artemp
94ef6170d8 mapnik-index - add experimental --bbox,-b option to limit index to provided bounding box e.g
```mapnik-index -b -5.51418,50.1944,-5.46256,50.2241 data.geojson```
2017-08-18 13:42:54 +01:00
artemp
2aa0ce9d74 New *.index format (bounding box per item) implementation 2017-08-18 11:16:44 +01:00
artemp
a682575da2 Merge branch 'master' into bbox-index 2017-08-17 13:02:14 +01:00
Artem Pavlenko
0253653676 Geobuf.input (#3715)
* geobuf.input - initial implementation (WIP)

* geobuf.input - fix reading MultiPolygon's

* geobuf.input - don't store invalid bounding boxes in r-tree.

* Use `protozero` lib to read `geobuf` (Initial implementation, not complete!)

* geobuf.input - poring to `protozero`. (TODO: add support for `GeometryCollection`)

* add initial support for `GeometryCollection` + cleanup namespaces

* remove stderr + cleanup + update copyright

* fix GeometryCollection and MultiLineString decoding + add support for standalone Feature and Geometry

* don't use `reserve` as undelying data format doesn't allow for efficient `distance` implementation.

* add geobuf unit test + update test data

* update data
2017-08-17 10:52:07 +01:00
artemp
2426a44671 initial updated spatial-index implementation 2017-08-16 13:59:44 +01:00
artemp
e00152b262 update data 2017-08-16 13:59:44 +01:00
artemp
4064c8ae8e add geobuf unit test + update test data 2017-08-16 13:59:44 +01:00
artemp
947ce9a8d1 don't use reserve as undelying data format doesn't allow for efficient distance implementation. 2017-08-16 13:59:44 +01:00
artemp
e0a251c456 fix GeometryCollection and MultiLineString decoding + add support for standalone Feature and Geometry 2017-08-16 13:59:44 +01:00
artemp
0c814dbeb0 remove stderr + cleanup + update copyright 2017-08-16 13:59:44 +01:00
artemp
eee92a5420 add initial support for GeometryCollection + cleanup namespaces 2017-08-16 13:59:44 +01:00
artemp
9cea9707f3 geobuf.input - poring to protozero. (TODO: add support for GeometryCollection) 2017-08-16 13:59:44 +01:00
artemp
3bbb5f413a Use protozero lib to read geobuf (Initial implementation, not complete!) 2017-08-16 13:59:44 +01:00
artemp
dd507550c9 geobuf.input - don't store invalid bounding boxes in r-tree. 2017-08-16 13:59:44 +01:00
artemp
2715500533 geobuf.input - fix reading MultiPolygon's 2017-08-16 13:59:44 +01:00
artemp
28ffa84d44 geobuf.input - initial implementation (WIP) 2017-08-16 13:59:44 +01:00
artemp
add410e619 use arch independent types for serialised values 2017-08-15 11:14:11 +01:00
artemp
c4a1df6e91 simplify impl + const correctness + minor cleanup 2017-08-15 11:13:11 +01:00
artemp
a682cea51e svg-parser - unify error messages text + update unit test 2017-08-08 12:38:24 +01:00
artemp
6f73181e9b Enforce consistent error handling policy - always throw on fatal errors (both strict and non-strict). In strict mode throw on first parsing error. Remove return values from parse,parse_from_string and traverse_tree methods. Update unit tests. 2017-08-02 10:32:13 +01:00
artemp
a26723b4a5 add missing ' in error message. 2017-08-02 10:32:00 +01:00
artemp
093fcee6d1 only include <unicode/unistr.h> if ICU >= 59 (attempting to fix current coverage build on travis). 2017-07-21 10:37:22 +02:00
artemp
9e58c89043 Add support for U_ICU_VERSION_MAJOR_NUM >= 59 (#3729) 2017-07-19 16:07:39 +02:00
artemp
24d07e7792 Update CHANGELOG with missing #3688 [skip-ci] 2017-07-18 10:08:16 +02:00
talaj
a077ccd4f6 Merge pull request #3725 from mapycz/parse-raster-sym
remove superfluous line
2017-07-07 23:16:19 +02:00
Jiri Drbalek
a3247c8dce remove superfluous line 2017-07-07 20:44:15 +00:00
Artem Pavlenko
4ec9349389 Merge pull request #3722 from mapnik/fix_alpha_rgba_tiff_master
Use alpha over no data in RGBA tiffs
2017-07-07 16:52:06 +02:00
artemp
b164117d99 disable handling unsupported attributes (leaving only well-known unsupported elements) to reduce verbosity. 2017-07-07 10:09:08 +02:00
Blake Thompson
951f10791a Fix for #3714 in master, addresses RGBA tiffs that have an alpha value and no data value - and are using the no data value over the alpha. 2017-07-06 12:30:05 -05:00
artemp
3ae71eea0f JSON - wrap lamda functions into anonymous namespace to fix linking on Windows with VS2017. 2017-07-06 16:09:38 +02:00
artemp
b632633373 convert args to mapnik::geometry::geometry<std::int64_t> (VS2017) 2017-07-06 16:03:28 +02:00
artemp
cd0c746a42 split grammar into two rules (VS2017) 2017-07-06 16:02:47 +02:00
artemp
55776f0b8c add missing include directives (VS2017) 2017-07-06 16:02:17 +02:00
artemp
e653f4cc4c make constructor explicit to avoid C2664 error with VS2017. 2017-07-06 16:01:06 +02:00
artemp
e08616aed3 Didn't play well with VS2017, reverting "re-use lamdas definitions and aviod duplicate symbols when building with vs2017"
This reverts commit 4c9322bc0d.
2017-07-06 11:17:14 +02:00
artemp
631c0a59c4 Revert "trying to inline lambdas (VS2017) (!)" this is not allowed in c++14 requires c++17
This reverts commit 0ad1c58009.
2017-07-06 11:14:24 +02:00
artemp
0ad1c58009 trying to inline lambdas (VS2017) (!) 2017-07-06 11:11:01 +02:00
artemp
4c9322bc0d re-use lamdas definitions and aviod duplicate symbols when building with vs2017 2017-07-06 10:59:42 +02:00
talaj
53249053e4 cairo renderer: clear map background with given color as agg renderer does (#3718) 2017-07-04 16:32:45 +02:00
talaj
d0ecd51b63 Set premultiplied flag to the color font glyph bitmap (#3716)
* color font bitmap is premultiplied

* update visual tests
2017-07-03 17:15:07 +02:00
artemp
71344f78df wkb_reader : pre-allocate number of polygons in multi_polygon and number of geometries in geometry_collection via vector.reserce(...) 2017-07-03 15:18:23 +02:00
artemp
1e8ec57593 add <image> and <switch> to unsupported elements. 2017-06-29 09:41:16 +02:00
artemp
47bfe7cb91 make unsupported elements/attributes arrays const. 2017-06-29 09:41:16 +02:00
artemp
148e77884c don't include xml_parser_read_rapidxml.hpp - forward declaring xml_node is sufficient. 2017-06-29 09:41:16 +02:00
artemp
5118220c4c handle "well-known" unsupported elements and attributes. 2017-06-29 09:41:16 +02:00
artemp
017d6cb540 cleanup 2017-06-29 09:41:16 +02:00
artemp
8f2961b9e2 svg_parser - implement preserveAspectRatio support (ref https://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute) 2017-06-29 09:41:16 +02:00
artemp
a6bc69359a use SVG viewport as bounding box 2017-06-29 09:41:16 +02:00
artemp
12d077ea0c disable bbox comparison (WIP) 2017-06-29 09:41:16 +02:00
artemp
3edcd4afa2 fix viewBox coordinate system logic + apply transform in <use> element 2017-06-29 09:41:16 +02:00
artemp
3fbce913d0 store viewbox transform 2017-06-29 09:41:16 +02:00
artemp
fafc751e42 svg_parser - add support for "href" preserving deprecated (since SVG 2) "xlink:href" 2017-06-29 09:41:16 +02:00
artemp
c2ad505899 fix method name 2017-06-29 09:41:16 +02:00
artemp
aae7253ba1 SVG parser - refactor to use switch where appropriate + experimental support for <symbol> 2017-06-29 09:41:16 +02:00
artemp
87abf93da3 move name_to_int into separate header for re-use. 2017-06-29 09:41:16 +02:00
artemp
2de8ce0eb7 svg_parser - don't log unsupported entities just yet (ref #763) 2017-06-29 09:41:16 +02:00
artemp
53a69463ea SVG parser - add support for <use> element (ref #763). 2017-06-29 09:41:16 +02:00
artemp
a4e8603af1 svg transform - correct rotate(<a> [<x> <y>]) rule (ref #763)
(The transform attribute defines a list of transform definitions that are applied to an element and the element's children. The items in the transform list are separated by whitespace and/or commas, and are applied from right to left.)
2017-06-29 09:41:16 +02:00
artemp
199a281627 remove debug stderr 2017-06-29 09:41:16 +02:00
artemp
ca4d140fb0 cleanup 2017-06-29 09:41:16 +02:00
artemp
b6aa45144c svg_parser - refactor => remove mutable temporary_gradient_ member variable + process stop elements from within linearGradient and radialGradient. 2017-06-29 09:41:16 +02:00
artemp
6da83bc986 svg_parser - store unresolved gradient nodes for deferred initalisation. 2017-06-29 09:41:16 +02:00
artemp
0301399d40 svg2png - add short program options. 2017-06-29 09:41:16 +02:00
artemp
ef6c2e71b8 svg-parser : handle parsing failures via error_handler ( throw in strict mode and log+continue when strict==false) 2017-06-29 09:41:16 +02:00
artemp
e56233833e svg_parser - fix bug introduced in previous commit. 2017-06-29 09:41:16 +02:00
artemp
3f591af871 initial support for strict SVG parsing (WIP) 2017-06-29 09:41:16 +02:00
artemp
df0bbe404c update CHANGELOG post 3.0.15 release [skip-ci] 2017-06-19 17:13:02 +02:00
artemp
5aba57eb61 remove out-of-date comment line [skip ci] 2017-06-15 11:33:36 +02:00
Blake Thompson
5b51b8d061 Merge pull request #3701 from mapnik/fix_filter_factor2
Fix Filter Factor for Resampling.
2017-06-13 09:48:15 -05:00
Blake Thompson
5bc80e909e Restored the proper useage of filter factor for image rescaling, where it is used in a variety of different algorithms for resampling. 2017-06-13 09:17:54 -05:00
artemp
3451d11b00 tiff_reader - fix num_rows logic in read_stripped method ref #3679 2017-06-12 17:55:24 +02:00
Artem Pavlenko
294a8168da Merge pull request #3697 from mapnik/raster_plugin_fix
Fixes a bug associated with the raster plugin
2017-06-07 10:18:40 +02:00
artemp
5f9c8bc475 remove --depth 100 2017-06-07 10:17:53 +02:00
Blake Thompson
eb7ef5039c Fixes a bug assocaited with the raster plugin 2017-06-06 10:28:21 -05:00
Artem Pavlenko
d563b2e126 Merge pull request #3693 from mapnik/webp_more_tests
Updated the tests for webp
2017-06-05 17:12:26 +02:00
Blake Thompson
4b69974175 Merge branch 'master' into webp_more_tests 2017-06-05 09:50:53 -05:00
artemp
309b34a011 fix - add missing namespace qualifier. 2017-06-05 15:52:49 +02:00
Artem Pavlenko
03fb8fab4c Merge pull request #3694 from mapycz/layer-compositing-offset
Fix a layer compositing offset
2017-06-02 18:09:07 +02:00
Jiri Drbalek
0ecc4c6762 update visual tests 2017-06-02 15:43:11 +00:00
Jiri Drbalek
a734ff1e90 layers should be composited with zero offset 2017-06-02 15:32:00 +00:00
Blake Thompson
f285195f93 Updated the tests for webp in relation to #3661 2017-06-02 09:32:42 -05:00
artemp
82a7d07b7f return error code when no feature can be read from shapefile + update unit test. 2017-06-01 15:44:25 +02:00
artemp
dfa8f100b2 freetype_engine - port singleton changes from v3.0.x 2017-06-01 12:47:18 +02:00
Dane Springmeyer
aeefd1cb58 fix typo in changelog [skip ci] 2017-05-31 13:26:35 -07:00
Dane Springmeyer
b9be377a7c update font path in test file 2017-05-31 10:42:03 -07:00
Artem Pavlenko
4d7e95c0c0 Merge pull request #3678 from mapycz/fix-polygon-closing-on-reprojection
fix closing polygons on reprojection
2017-05-30 19:08:51 +02:00
Dane Springmeyer
928a42da81 use latest mason version 2017-05-25 11:34:09 -07:00
Jiri Drbalek
7f11a7ab30 update visual test data 2017-05-24 13:59:47 +00:00
Jiri Drbalek
7590cdabb0 fix typo in file name 2017-05-24 13:59:47 +00:00
Jiri Drbalek
c7561c1dc9 unit test - vertex-last marker placement 2017-05-24 13:59:47 +00:00
Jiri Drbalek
0781f230be fix polygon handling 2017-05-24 13:59:44 +00:00
Jiri Drbalek
8d980d434e unit tests - closing polygon on reprojection 2017-05-24 12:10:11 +00:00
Jiri Drbalek
4084e670ec fix closing polygons on reprojection 2017-05-24 12:10:11 +00:00
artemp
abff549ed0 Merge remote-tracking branch 'origin/master' 2017-05-23 18:53:41 +02:00
artemp
c61e85b875 unify namespace names 2017-05-23 18:49:25 +02:00
Artem Pavlenko
b84b819d5b Merge pull request #3681 from mapnik/tiff-memory-mapped
Tiff memory mapped
2017-05-23 12:34:21 +02:00
artemp
3a475517c0 TIFF I/O - use memory mapping in tiff_reader.cpp when MAPNIK_MEMORY_MAPPED_FILE is defined. 2017-05-22 16:29:22 +02:00
artemp
34a622f48e TIFF I/O - use memory mapping for file based I/O. 2017-05-22 13:07:42 +02:00
artemp
3c1be21162 tiff_reader - use image_reader_exception 2017-05-22 13:05:08 +02:00
artemp
3811acfc5d Correct english spelling is OK. 2017-05-19 14:43:17 +02:00
Blake Thompson
436610da3a Updated changelog 2017-05-19 14:41:25 +02:00
Artem Pavlenko
f205f3859d Merge pull request #3671 from mapnik/tiff-multiband-grey
TIFF I/O : add support for multiple bands in 'scanline` reading metho…
2017-05-19 10:10:01 +02:00
artemp
12d6662009 TIFF I/O - read_tiled: remove std::swap_ranges and apply the same logic as in read_stripped. 2017-05-18 16:43:27 +02:00
artemp
4d8796dbd3 remove unused code 2017-05-18 15:23:22 +02:00
artemp
545bcb6585 remove bogus assert 2017-05-18 14:24:01 +02:00
artemp
23bdfdd821 use latest visual data 2017-05-18 13:26:05 +02:00
artemp
9ecc0041a0 Merge branch 'tiff-multiband-grey' of https://github.com/mapnik/mapnik into tiff-multiband-grey 2017-05-18 13:19:18 +02:00
artemp
9ee0deb3a1 update test data 2017-05-18 13:18:33 +02:00
Artem Pavlenko
c5ee5072ad Merge pull request #3679 from mapnik/tiff-stripped-read
The last stripe of a tiff could be read incorrectly due to a swap
2017-05-18 13:17:14 +02:00
artemp
cb7a3abfcb follow up fix for the bug reported by @flippmoke + fix return value check in TIFFReadRGBAStrip 2017-05-18 13:12:52 +02:00
Blake Thompson
efcb667f03 The last stripe of a tiff could be read incorrectly due to a swap 2017-05-17 17:06:40 -05:00
artemp
599f187968 update visual-data. 2017-05-17 21:20:03 +02:00
artemp
0968e13159 fix compile oops #3669 #3670 2017-05-17 17:41:44 +02:00
artemp
bf1225cd76 Use updated visual data from `tiff-multiband-grey' branch. 2017-05-17 15:17:28 +02:00
artemp
310eb71bdf TIFF I/O tests - refactor to reduce code duplication + remove std::cerr 2017-05-17 15:07:51 +02:00
artemp
6ac4ce66b3 TIFF I/O unit tests - check tiff_reader is able to read various permutations of TIFF format (rgb8|rgba8|gray8 + interleave:band|pixel + tiled|stripped)
(ref #3669 #3670)
2017-05-17 15:07:23 +02:00
artemp
ef9b1025fa fix bug - use tile_width_ and tile_height_ + cleanup 2017-05-17 14:55:41 +02:00
artemp
1d95cad922 TIFF I/O - make read_stripped handle both RGBA and raw encoded strips (#3670) 2017-05-16 13:44:55 +02:00
artemp
62260dd3d4 raster.input - increase default tile size to 1024x1024 px. 2017-05-16 13:43:52 +02:00
artemp
e8cd4b9aef TIFF I/O : update and fix logic handling rgba vs grey scale. 2017-05-12 18:39:58 +02:00
artemp
e62bf6e18f TIFF I/O - use scanline to read stripped grey for now. 2017-05-12 15:55:46 +02:00
artemp
5d48d98697 port latest changes from "raster_overzoom_quest" branch. 2017-05-12 15:37:12 +02:00
artemp
88fb137061 TIFF I/O - make read_tiled templated on ImageData ref #3669 #3670 (WIP) 2017-05-11 17:25:07 +02:00
artemp
74f295c6c4 small formatting 2017-05-11 16:58:37 +02:00
artemp
db2eaf2e2b TIFF I/O : add support for interleaved data in void tiff_reader<T>::read_tiled(std::size_t x0,std::size_t y0, ImageData & image) ref #3669 #3670 2017-05-11 12:13:07 +02:00
artemp
1725b1ebba TIFF.input - port changes from https://github.com/mapnik/mapnik/pull/3668 (ref #3669) 2017-05-10 14:33:29 +02:00
artemp
77f849b136 TIFF I/O : add support for multiple bands in 'scanline reading method in read_any_gray` (partially fixes #3669)
(NOTE: we default to `scanline` even for `stripped` images, TODO add support as per #3670)
2017-05-10 13:21:51 +02:00
artemp
6e025956ae add simple WKT round-trip test (required updated data) 2017-05-05 16:32:17 +02:00
artemp
97a796ba0e fix polygon_coord rule to generate required enclosing brackets. 2017-05-05 16:29:33 +02:00
artemp
2847c3bee9 format WKT to be able to test WKT<->WKT round-trip. 2017-05-05 16:28:05 +02:00
artemp
333ef9fde1 update copyright year 2017-05-05 13:02:01 +02:00
artemp
d84991bae3 add debug log 2017-05-04 10:50:49 +02:00
artemp
85aebf7268 set most common language based on script for each text run (#3655) 2017-05-03 10:23:42 +02:00
artemp
82b876e267 upgrade to the latest variant 2017-05-01 11:38:45 +02:00
artemp
8ff24d1193 Only log warning in --verbose mode. 2017-04-25 14:03:18 +02:00
Artem Pavlenko
6c23504667 Merge pull request #3660 from rinigus/master_sqlite_twkb
add twkb support to sqlite plugin
2017-04-24 10:04:59 +01:00
Rinigus
9de7397043 add twkb support to sqlite plugin 2017-04-23 22:49:36 +03:00
Dane Springmeyer
7bd317a1bf link -ldl last 2017-04-19 18:30:57 -07:00
Dane Springmeyer
359372d3b2 pgsql2sqlite:also link -ldl on linux 2017-04-19 18:10:25 -07:00
Dane Springmeyer
9e7c842a26 Fix spelling mistakes in changelog [skip ci] 2017-04-13 16:39:13 -07:00
artemp
e75db3aa18 make box2d<T> adapters more generic. 2017-04-10 13:18:00 +01:00
artemp
2e0e61453b sync CHANGELOG.md with 3.0.x branch 2017-04-06 10:49:18 +01:00
artemp
20824cce79 add const_interior_rings type and stop abusing type system. (NOTE: iterator/const_iterator types are required by boost::range_iterator) 2017-04-03 13:00:35 +01:00
Dane Springmeyer
adbbdea0fb add codecov ignores 2017-03-31 17:50:18 -07:00
artemp
53a32b59b9 add boost::geometry::traits::push_back specialisation for mapnik::interior_rings<CoordinateType> 2017-03-30 14:04:57 +01:00
artemp
22c38b1046 use master branch 2017-03-30 10:07:10 +01:00
artemp
d96e6abe81 const correctness via @flippmoke 2017-03-30 09:54:12 +01:00
Artem Pavlenko
a6d3921957 Merge pull request #3646 from mapnik/geometry.hpp
Geometry.hpp
2017-03-30 09:35:56 +01:00
artemp
ef7da04cc9 cleanup 2017-03-30 09:23:58 +01:00
artemp
e3bf8cb558 use range based loop via @flippmoke 2017-03-30 09:23:11 +01:00
artemp
c28bf77d5d Merge branch 'master' into geometry.hpp 2017-03-30 08:23:56 +01:00
artemp
f9bfa596f1 update visual data 2017-03-30 08:05:24 +01:00
artemp
dd079183c5 add boost::geometry::resize and boost::geometry::clear traits specialisations for mapnik::interior_rings<CoordinateType> 2017-03-29 17:44:07 +01:00
artemp
433d95046b re-enable strategy tests 2017-03-29 15:41:39 +01:00
artemp
3e803b52bb remove has_empty + fix is_empty implementaion to work with geometry.hpp 2017-03-29 11:39:04 +01:00
Dane Springmeyer
5c81e80837 update test data to stay in sync with 3.0.x branch - mapnik/test-data-visual#46 2017-03-28 22:28:55 -07:00
Dane Springmeyer
d65fd4f7f7 improve check padding script to see deps via submodules 2017-03-28 15:19:14 -07:00
Dane Springmeyer
a53c90172c remove obsolete python remnants 2017-03-28 15:18:48 -07:00
Dane Springmeyer
641d7b647f consistently use pkg-config in both postgis plugin and pgsql2sqlite + use GDAL_CONFIG var in plugins 2017-03-28 15:18:48 -07:00
artemp
064b99168b geometry.hpp 2017-03-27 16:14:51 +01:00
artemp
1be4696d52 GeoJSON IO test - ensure geometries round-trip. 2017-03-23 14:58:39 +00:00
artemp
69e5340ceb add valid/invalid empty GeoJSON geometry tests 2017-03-23 13:44:51 +00:00
artemp
60e6f5a9ff geojson - fix geometry generator grammar. 2017-03-22 15:09:15 +00:00
Artem Pavlenko
135f70844b Merge pull request #3643 from mapnik/empty-geometries
Empty geometries
2017-03-22 09:10:03 +00:00
artemp
38b4b65911 GeoJSON - refactor geometry generator to preserve geometry type in output (ref https://github.com/mapnik/python-mapnik/issues/139) 2017-03-21 16:48:41 +00:00
artemp
b4b5e33b05 refactor WKT generator to retain geometry type for empty geometries (avoid short-cutting to POINT EMPTY)
For example:

| in |   | out   |
|`POINT EMPTY` |  <--> | 'POINT EMPTY`|
|`LINESTRING EMPTY` |  --> | 'POINT EMPTY`|

| in |   | out   |
|`POINT EMPTY` |  <--> | 'POINT EMPTY`|
|`LINESTRING EMPTY` |  <--> | 'LINESTRING EMPTY`|
etc.
2017-03-21 12:43:42 +00:00
artemp
d9063db0a0 GeoJSON - make geometry element stricter and throw on invalid input. 2017-03-21 12:40:58 +00:00
artemp
8a18ef93e0 update test data 2017-03-20 15:03:28 +00:00
artemp
5450255c5b revert back to separate tests #if HB_VERSION_MAJOR > 0 #if HB_VERSION_ATLEAST(1, 0 , 5) ref #3642 2017-03-20 14:24:34 +00:00
Dane Springmeyer
edaca3a015 update sqlite, icu, ccache, and libpq 2017-03-19 12:41:48 -07:00
artemp
f8241a96fb update visual data 2017-03-16 13:04:05 +00:00
artemp
a9aa1c69b8 save_map - support nested layers + serialize layer compositing mode 2017-03-16 12:59:52 +00:00
artemp
bb19ff948e remove QMAKE_MAC_SDK version requirement - just build with what is available 2017-03-16 12:16:54 +00:00
artemp
d44f7cc0a8 Merge branch 'mapycz-nested-layers' 2017-03-16 11:32:14 +00:00
artemp
c3bba38012 Merge branch 'nested-layers' of https://github.com/mapycz/mapnik into mapycz-nested-layers 2017-03-16 11:31:55 +00:00
Artem Pavlenko
c35ad96428 Merge pull request #3639 from mapnik/remove-mason-latest
Remove auto-publishing to mason
2017-03-16 10:06:31 +00:00
Jiri Drbalek
15daac26e7 cairo support for layer level comp-op and opacity 2017-03-16 06:54:16 +00:00
Jiri Drbalek
d7ba7dc0db agg renderer: recycle internal buffers 2017-03-16 06:54:16 +00:00
Jiri Drbalek
03929b5c76 nested layers, layer level comp-op and opacity 2017-03-16 06:54:16 +00:00
Dane Springmeyer
ee65bd33e3 remove auto-publishing to mason 2017-03-15 14:15:22 -07:00
Dane Springmeyer
0c24558db8 Merge pull request #3638 from mapnik/3.1.x-mason-upgrades
3.1.x mason upgrades
2017-03-15 12:26:46 -07:00
Dane Springmeyer
710379dce2 add codecov badge, drop coveralls [skip ci] 2017-03-15 10:05:09 -07:00
Dane Springmeyer
571ead47bc use clang++ 3.9.1 2017-03-15 09:44:33 -07:00
Dane Springmeyer
69fc58191f update compiler in circle 2017-03-15 09:41:13 -07:00
Dane Springmeyer
f42344e102 port 3614 to 3.1/master 2017-03-15 09:41:13 -07:00
artemp
d009bb8231 update visual data 2017-03-14 12:33:54 +00:00
artemp
21baa9e375 Merge branch 'lightmare-postgis-quoting' 2017-03-14 12:29:54 +00:00
artemp
1d06afeea2 Merge branch 'postgis-quoting' of https://github.com/lightmare/mapnik into lightmare-postgis-quoting 2017-03-14 12:29:32 +00:00
artemp
f3f4de154b Merge branch 'mapycz-text-extend' 2017-03-14 11:54:08 +00:00
artemp
c1053181f5 Merge branch 'text-extend' of https://github.com/mapycz/mapnik into mapycz-text-extend 2017-03-14 11:53:52 +00:00
artemp
b10d2a3dff Merge remote-tracking branch 'origin/master' 2017-03-14 11:35:20 +00:00
artemp
0e107135b2 update deps 2017-03-14 11:34:12 +00:00
Artem Pavlenko
a3d29ae52f Merge pull request #3636 from mapnik/color-emoji
Color emoji + updated harfbuzz_shaper and unicode_string_grammar
2017-03-14 11:22:57 +00:00
artemp
0dff423c44 cleanup 2017-03-14 11:22:11 +00:00
artemp
834f0ef312 add '-fno-omit-frame-pointer' to sanitize address builds for nicer stack traces in error messages. 2017-03-14 11:17:54 +00:00
artemp
203d767e73 follow up from 32f5703ed1 - more generic specialisation 2017-03-14 10:26:09 +00:00
artemp
32f5703ed1 provide is_substitute specialisation for mapnik::geometry::linear_ring<double> const& (gcc6) 2017-03-14 11:05:33 +01:00
artemp
cdfe280984 use updated test data 2017-03-08 10:56:32 +01:00
artemp
ae29012611 tests - update shaping test results 2017-03-08 10:55:52 +01:00
artemp
3ac70bb7ce update font_registration testx 2017-03-08 10:54:58 +01:00
artemp
791f7b51bb Revert "one more time."
This reverts commit 8dea549887.

Revert "fix following up 8c4fa25c8d65e75978c0a82bc6391906595ff190"

This reverts commit 8726312393.

Revert "attempt to fix "error: chosen constructor is explicit in copy-initialization" error with gcc"

This reverts commit 8c4fa25c8d.

Revert "use `initializer_list const&` to hold expected values (via @lighmare) ref #3636"

This reverts commit 47763afef3.
2017-03-07 14:25:56 +01:00
artemp
8dea549887 one more time. 2017-03-07 13:50:27 +01:00
artemp
8726312393 fix following up 8c4fa25c8d 2017-03-07 13:37:20 +01:00
artemp
8c4fa25c8d attempt to fix "error: chosen constructor is explicit in copy-initialization" error with gcc 2017-03-07 13:34:43 +01:00
artemp
47763afef3 use initializer_list const& to hold expected values (via @lighmare) ref #3636 2017-03-07 13:02:21 +01:00
artemp
d9a000372c remove -Wshadow warning (ref #3628) 2017-03-07 11:28:22 +01:00
artemp
3433397c30 test (expressions) - add more tests (ref #3616) 2017-03-06 15:59:07 +01:00
artemp
7f28246407 print compiler version during configure step (ref #3616) 2017-03-06 09:54:02 +01:00
artemp
4d57fb1a6c print compiler version during configure step (ref #3616) 2017-03-06 09:53:13 +01:00
artemp
a50efcb2bb refactor unicode string grammar - add escaped_unicode rule + use it in expressions. 2017-03-03 15:41:46 +01:00
artemp
fb7139bc63 expressions - only import escaped rule from unicode_string_grammar and construct single/double quoted string rules locally to match expression grammar. NOTE: single quoted strings don't accept unicode encodings 2017-03-03 15:14:01 +01:00
artemp
713b9e7788 take #2 - try using pair instead of tuple 2017-03-02 15:09:11 +01:00
artemp
f1de5758b2 attempting to pacify some compilers with an extra pair of brackets. 2017-03-02 14:55:00 +01:00
artemp
4509f23c94 Merge branch 'harfbuzz-shaper' into color-emoji 2017-03-02 12:27:45 +01:00
artemp
ab36ef9274 update visual test data to track harfbuzz-shaper branch. 2017-03-02 12:26:17 +01:00
artemp
1bdc8e6bad handle utf16 encoding correctly by parsing as sequence and applying utf16->utf32->utf8 conversion. 2017-03-02 11:50:38 +01:00
artemp
92f07b7a7a handle utf16 encoding correctly by parsing as sequence and applying utf16->utf32->utf8 conversion. 2017-03-01 18:46:48 +01:00
artemp
04dd05c971 minimise shared_ptr assignments and simplify code 2017-03-01 12:59:34 +01:00
artemp
d29be8a689 If I'm reading docs correctly \uNNNN + \UNNNNNNNN are correct
Revert "relax hex4 parser to allow 5 character \unnnnn code points"

This reverts commit 378fa41db6.
2017-03-01 12:08:22 +01:00
artemp
2d2c5a191b expression_grammar: re-use unicode_string_grammar and add initial support for \uNNNNN code points (TODO) 2017-03-01 11:58:18 +01:00
artemp
378fa41db6 relax hex4 parser to allow 5 character \unnnnn code points 2017-03-01 11:53:27 +01:00
artemp
571b2a0d6a Merge branch 'harfbuzz-shaper' into color-emoji 2017-03-01 11:30:33 +01:00
artemp
7cb587a901 Merge branch 'master' into harfbuzz-shaper 2017-03-01 11:30:08 +01:00
artemp
131f785dce Make parsing \xXX format strict via hex2 parser + append UTF8 encoded \xXX characters directly (fixes #3631) 2017-03-01 11:25:43 +01:00
artemp
e95b16c5ca make hex parser strict (expecting two characters after \x) to avoid greedy parsing of trailing characters as in
"\xF0\x9F\x8D\xB7abc" ==>  ... + "\xB7" +  "abc" not "\xB7abc"
2017-03-01 10:35:39 +01:00
artemp
0076a5a916 make hex parser strict (expecting two characters after \x) to avoid greedy parsing of trailing characters as in
"\xF0\x9F\x8D\xB7abc" ==>  ... + "\xB7" +  "abc" not "\xB7abc"
2017-03-01 10:34:16 +01:00
artemp
570126bd76 make hex parser strict (expecting two characters after \x) to avoid greedy parsing of trailing characters as in
"\xF0\x9F\x8D\xB7abc" ==>  ... + "\xB7" +  "abc" not "\xB7abc"
2017-03-01 10:27:12 +01:00
artemp
87c619cdc2 don't forget FT_LOAD_NO_HINTING 2017-02-28 15:13:40 +01:00
artemp
cbacaaf0c5 initialize to reasonable values. 2017-02-28 15:05:37 +01:00
artemp
1b67779290 implement color bitmap extraction/scaling/compositing into target pixmap 2017-02-28 15:04:49 +01:00
artemp
639dcae83f c++ style 2017-02-28 15:03:26 +01:00
artemp
7c93514fbc avoid division by zero (units_per_EM is set to 0 for bitmap fonts) 2017-02-28 15:01:46 +01:00
artemp
a6519c3f6b use FT_Load_Sfnt_Table to identify color fonts + load color glyphs with FT_LOAD_COLOR 2017-02-28 15:00:03 +01:00
artemp
8e97803e81 add color_font_ member 2017-02-28 14:59:14 +01:00
artemp
5492d93ccd Merge branch 'master' into harfbuzz-shaper 2017-02-27 13:24:11 +01:00
artemp
3eabd3141a sync mapnik-index and shapeindex versions with mapnik via MAPNIK_VERSION_STRING 2017-02-27 13:22:55 +01:00
artemp
6db89d459e Merge remote-tracking branch 'origin' into harfbuzz-shaper 2017-02-27 10:26:54 +01:00
Artem Pavlenko
147313af55 Merge pull request #3624 from poggs/master
Rename PostGIS' ST_Estimate_Extent to ST_EstimateExtent
2017-02-27 10:25:48 +01:00
Mickey Rose
8292edaa1a strip boost::optional from non-optional marker ptr 2017-02-22 13:37:52 +01:00
artemp
32e592fb7a use explicit const& 2017-02-22 12:33:18 +01:00
Mickey Rose
5464ae9cdf load_map: avoid segfault when ShieldSymbolizer has invalid placements 2017-02-22 12:25:20 +01:00
artemp
4faf5b054b add utf8 qualifier 2017-02-22 11:34:47 +01:00
artemp
0c0f3f1298 update test/data 2017-02-22 11:34:01 +01:00
artemp
b8523682cd use latest variant 2017-02-22 11:32:00 +01:00
artemp
43d940fe35 add berber+arabic shaping test 2017-02-22 11:31:06 +01:00
artemp
5e709997f2 add explicit u8 (utf8) qualifier 2017-02-21 13:37:22 +01:00
artemp
10b1ed2fa9 add debug mode to generate expected result + add one more test 2017-02-21 13:17:41 +01:00
artemp
8af91146c4 add an extra test 2017-02-21 12:56:36 +01:00
artemp
677ed0ebab refactor to make it easier to run multiple tests 2017-02-21 12:43:54 +01:00
artemp
745c291b1a simplify test 2017-02-20 14:23:09 +01:00
artemp
3584970fee make shaping unit test test something (work-in-progress) 2017-02-20 12:13:00 +01:00
artemp
d9c81d46fd use else if 2017-02-20 12:12:22 +01:00
Peter Hicks
f776977982 Rename PostGIS' ST_Estimate_Extent to ST_EstimateExtent 2017-02-19 20:46:30 +00:00
artemp
86e5f9305b quarantee glyphinfos has enough capacity to hold cluster 2017-02-17 17:16:36 +01:00
artemp
fbdff42d47 use std::vector<std::vector<T>> instead of std::map<unsigned,std::vector> to simplify lookups 2017-02-17 16:52:31 +01:00
artemp
20cafae780 ensure insert has worked 2017-02-17 15:40:37 +01:00
artemp
e55918788c fix test logic 2017-02-17 15:32:03 +01:00
artemp
302e4c75dd simplify further 2017-02-17 15:28:13 +01:00
artemp
fe7d1e2f53 simplify logic 2017-02-17 15:23:00 +01:00
artemp
49c28cb6ad new font fallback implementation - it is rather inefficient but attempting to do a right thing.
(NOTE: some visual text failures need further look to see if latest implementation is correct)
2017-02-17 14:20:32 +01:00
artemp
a5f00c6fa1 Merge branch 'master' into harfbuzz-shaper 2017-02-17 14:06:44 +01:00
Mickey Rose
428ba432b1 pgraster: copy quoting and interpolation changes from postgis 2017-02-10 18:55:23 +01:00
Mickey Rose
e35c1ca106 pgraster: indentation 2017-02-10 18:55:23 +01:00
Mickey Rose
a13cb382e0 postgis: test !@uservar! interpolation 2017-02-10 18:55:23 +01:00
Mickey Rose
6bbb391005 postgis: consistently quote parameters in sql 2017-02-10 18:55:22 +01:00
Mickey Rose
2587bb3a1d sql_utils: improved table_from_sql 2017-02-10 18:55:22 +01:00
Mickey Rose
a4e8ea21be sql_utils: deprecate flawed un-quote functions
unquote* just strip all quotes from both ends of the string,
and don't collapse inner quotes.

quote_attr doesn't duplicate inner quotes.
2017-02-10 18:55:22 +01:00
Mickey Rose
d0e7b715dd postgis: test table/column names containing quotes 2017-02-10 18:55:22 +01:00
Mickey Rose
d331b9d66a postgis: revamp substitution of special tokens in query
- replace boost::regex with std::regex
- use regex to match both  !mapnikvar!  and  !@uservar!
- no longer support @uservar (without surrounding !s)
2017-02-10 18:55:22 +01:00
Mickey Rose
195c3e14ce postgis: test query containing 'email@domain' 2017-02-10 18:55:22 +01:00
Mickey Rose
7b217133e2 sql_utils: on-the-fly quoting via operator << 2017-02-10 18:55:22 +01:00
artemp
4b17a417dc Merge remote-tracking branch 'origin/master' 2017-02-06 12:59:24 +01:00
artemp
f85636f769 mapnik-index - log and return on invalid bounding box if validate_features is set. 2017-02-03 10:10:09 +01:00
Mickey Rose
8e34b323b5 define PNG_FAST_FILTERS if png.h doesn't have it 2017-02-02 12:19:17 +01:00
Mickey Rose
7e2aab171f include png.h outside any namespace 2017-02-02 12:19:17 +01:00
artemp
5c9e48ef0c minor c++ style 2017-01-31 18:00:26 +01:00
artemp
755d178d20 alternative exaustive face fallback implementation ref #3534 #3559 2017-01-31 17:44:25 +01:00
artemp
df51f6087c minor c++ style 2017-01-31 17:42:24 +01:00
artemp
d053bddb43 add support for PNG filters (http://www.libpng.org/pub/png/libpng-manual.txt) ref #3479 2017-01-26 15:45:08 +01:00
artemp
2ede054e93 c++ style - use pre-(de)increment operators by default 2017-01-26 14:19:28 +01:00
artemp
f13848e210 move box2.hpp and related files into geometry dir 2017-01-26 09:51:37 +01:00
artemp
69bb8f4328 update test data 2017-01-20 09:43:37 +01:00
artemp
7c6f335fa5 fix blank line test for require headers.size() == 1 + reduce stderr verbosity. 2017-01-17 17:54:09 +01:00
artemp
a108068cf6 fix remaning std::fread usage - check return value 2017-01-13 14:57:15 +01:00
artemp
a220bda05d check return value from std::fread 2017-01-13 14:38:00 +01:00
artemp
bfc7ad397a update variant 2017-01-13 09:52:16 +01:00
artemp
f76060274d Revert back again fixing a typo! (thanks @springmeyer 2f55f0962e (commitcomment-20461372))
"It doesn't work with GCC reverting back "disable [-Wunused-result] warning GCC : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509""

This reverts commit 2f55f0962e.
2017-01-13 09:42:12 +01:00
artemp
28c51df986 more fix GCC shadows a member warning [-Wshadow] 2017-01-13 09:38:54 +01:00
artemp
1b940bebcc attributes not opacity (ref 1c704447b7) 2017-01-12 18:18:39 +01:00
artemp
1c704447b7 more fix GCC shadows a member warning [-Wshadow] 2017-01-12 18:09:10 +01:00
artemp
0a7e8bb429 fix GCC shadows a member warning [-Wshadow] 2017-01-12 17:48:56 +01:00
artemp
2f55f0962e It doesn't work with GCC reverting back "disable [-Wunused-result] warning GCC : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509"
This reverts commit 3c76e8d7ef.
2017-01-12 11:39:57 +01:00
artemp
3c76e8d7ef disable [-Wunused-result] warning GCC : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 2017-01-12 11:23:46 +01:00
artemp
7db3beda01 add parentheses to supress gcc warning [-Wparentheses] 2017-01-12 10:55:33 +01:00
artemp
de2b44712a move transform related headers into transform dir to minimize clutter 2017-01-11 11:10:03 +01:00
artemp
e582ca65b5 update test to include underscore characters in global attributes 2017-01-11 10:39:02 +01:00
artemp
91f9508654 relax expression_grammar: allow _ underscore characters in global attribute names 2017-01-11 10:38:11 +01:00
artemp
11c3d97654 transform_expressions_test - add global attribute tests ( e.g @value ) ref #3569 2017-01-11 10:25:21 +01:00
artemp
f207ec2da2 cleanup 2017-01-10 17:19:28 +01:00
artemp
fa7851ea06 add transform expressions tests (https://github.com/mapnik/mapnik/pull/141\
6) (ref #3569)
2017-01-10 17:15:05 +01:00
artemp
65dcb1c935 fix transform grammar to support whitespace/comma argument separation rules (https://github.com/mapnik/mapnik/pull/1416) ref #3569 2017-01-10 17:13:45 +01:00
artemp
243963fc2b expression_test - add tests for arbitrary space in mapnik::geometry_type attributes 2017-01-10 11:57:54 +01:00
artemp
7326c0d558 expressions - simplify attribute parsing by combining feature attribute and geometry_type attribute processing. 2017-01-10 11:54:08 +01:00
Artem Pavlenko
e5a93bce52 Merge pull request #3596 from mapycz/text-simple-placement-center
Text simple placement: add center 'C' placement
2017-01-09 11:57:03 +01:00
artemp
6190784350 remove remaining usage of deprecated dymamic exceptions: dtors are implicitely noexcept + qualify what methods with noexcept 2017-01-09 11:47:52 +01:00
artemp
baded7d9ab fix typo 2017-01-09 11:45:15 +01:00
artemp
4bc3a79f8c remove bogus throw() specifier from 'add_attribute' 2017-01-09 11:35:14 +01:00
Jiri Drbalek
4eae86b7bc text simple placement: add center 'C' placement 2017-01-08 09:05:44 +00:00
Jiri Drbalek
10deff9d5d remove unnecessary breaks 2017-01-08 09:04:12 +00:00
artemp
d9d842f29c dynamic exceptions deprecated in c++11 and removed in c++17 (http://en.cppreference.com/w/cpp/language/except_spec) 2017-01-06 19:06:49 +01:00
artemp
6e3dc91325 remove demo/python (moved to python-mapnik) 2017-01-05 16:51:59 +01:00
Dane Springmeyer
4a99e00177 Point as latest mason rather than branch 2017-01-04 11:45:03 -08:00
artemp
07ab49830f disable is_substitute instantiation for BOOST_VERSION > 106300, fixes gcc6+boost-1_63 build 2017-01-04 18:39:42 +01:00
artemp
e210dfaf8c fix GCC warning by adding missing parentheses around comparison in operand of '|' 2017-01-04 18:23:31 +01:00
Artem Pavlenko
d99c3f6cf2 Merge pull request #3585 from lightmare/groupsym-thunk-list
minor render_thunk_list change
2017-01-04 10:29:49 +01:00
Mickey Rose
ca89c587bd can't store noncopyable list in std::vector
std::list can have a throwing move constructor.
std::vector of such lists makes copies when growing its storage array,
it doesn't move them.
render_thunk_list is noncopyable (because render_thunk is noncopyable),
and so can't be stored in std::vector in some STL implementations.
2017-01-03 21:43:14 +01:00
Mickey Rose
962bcf84c5 change render_thunk_list to std::list<render_thunk>
Wrapping render_thunk in std::unique_ptr is one extra allocation per
element, with no purpose. The somewhat costly xyz_render_thunk move
constructor is only called once upon insertion, regardless of whether
we're emplacing render_thunk or unique_ptr.
2017-01-03 20:53:55 +01:00
artemp
d3a9e4c4d7 revive support for an empty array => geometry_empty
RFC 7946 "...GeoJSON processors MAY interpret Geometry objects with
          empty "coordinates" arrays as null objects."
2017-01-03 16:17:46 +01:00
artemp
7a8e8014b7 Revert "add ```template <typename T>" - oops we don't need this in master!
This reverts commit b3c4aff2c7.
2017-01-03 11:28:40 +01:00
artemp
b3c4aff2c7 add ```template <typename T>
transform_node(boost::value_initialized<T> const&)
          : base_() {}
``` to address

```c:\mb\windows-builds-64\packages\mapnik-windows\include\mapnik/transform_expression.hpp(175):
error C2664: 'mapbox::util::variant<mapnik::identity_node,mapnik::matrix_node,mapnik::translate_node,mapnik::scale_node,mapnik::rotate_node,mapnik::skewX_node,mapnik::skewY_node>::variant(mapbox::util::variant<mapnik::identity_node,mapnik::matrix_node,mapnik::translate_node,mapnik::scale_node,mapnik::rotate_node,mapnik::skewX_node,mapnik::skewY_node> &&) noexcept(false)':
cannot convert argument 1 from 'const boost::value_initialized<T>' to 'mapbox::util::no_init' [c:\mb\windows-builds-64\packages\mapnik-windows\mapnik-gyp\build\mapnik.vcxproj]
```
when building with VS2017 RC
2017-01-03 11:24:32 +01:00
artemp
d5405d55c7 use a copy of start iterator when extracting bounding boxes + increase verbose output on failures 2017-01-02 11:47:26 +01:00
lightmare
e41f41b0a6 Merge pull request #3566 from mapycz/better-largest-bbox
Better largest bbox
2017-01-02 03:25:14 +01:00
lightmare
a40ce9eefd Merge pull request #3578 from mapnik/cxx11-friendly
C++14-like type traits aliases
2017-01-02 03:24:59 +01:00
artemp
ed648ced46 SVG transform - implement in terms of boost::spirit::x3 2016-12-23 16:32:05 +01:00
artemp
3b52ae97c0 add missing header 2016-12-23 14:42:18 +01:00
artemp
95cc560167 SVG points - implement using boost::spirit::x3 + refactor parse_rule instantiations into separate *.cpp 2016-12-23 14:40:59 +01:00
artemp
584fda88e0 SVG path grammar - return start rule by const& 2016-12-23 13:26:37 +01:00
artemp
30749031cf SVG path parser - boost::spirit::x3 based implementation 2016-12-22 14:57:26 +01:00
artemp
9d0096eff6 remove unused include directive 2016-12-21 15:20:52 +01:00
artemp
506390b735 use curly braces initialiser (c++ style) 2016-12-21 09:05:31 +01:00
artemp
8452410784 minor formatting 2016-12-20 18:37:20 +01:00
artemp
5745bedbd9 update copyright year to 2016 2016-12-20 17:57:22 +01:00
artemp
7f4fd0cc76 include guards - add missing and normalise namings 2016-12-20 17:45:38 +01:00
artemp
b73901edab remove from forthcoming 3.1.x release 2016-12-20 17:45:00 +01:00
artemp
f3cd36f0cd reserve std::vector capacity prior oppending + remove const qualifier 2016-12-20 10:40:50 +01:00
artemp
8b049230b3 topojson_grammar_x3 : make rules const 2016-12-20 10:31:52 +01:00
artemp
f1ccc66162 avoid parsing synthesised std::tuple<> + more fine-grained rules 2016-12-19 17:53:58 +01:00
artemp
47cdd22fad simplify further 2016-12-19 17:06:27 +01:00
artemp
4475754e8a deduce types 2016-12-19 17:02:45 +01:00
artemp
c5b5bc0237 fix namespace prefix 2016-12-19 16:34:16 +01:00
artemp
18f721fd17 TopoJSON - implement parsing using spirit::x3 2016-12-19 16:18:19 +01:00
artemp
053eca1232 JSON - add geometry_grammar_x3 2016-12-16 11:21:20 +01:00
Dane Springmeyer
068ead5a13 remove duplicate sudo:false from travis 2016-12-15 13:34:08 -08:00
Mickey Rose
e6ed16e94e make mapnik_value_type_t C++11-friendly 2016-12-15 11:58:50 +01:00
Mickey Rose
568507349b bring C++14 type traits aliases for C++11 support 2016-12-15 11:51:02 +01:00
artemp
7affd45511 refactor json_value into separate header and reduce include bloat 2016-12-15 11:29:29 +01:00
artemp
b5b6548a81 update variant 2016-12-15 10:34:40 +01:00
artemp
4ba87b1e9d c++14 support is not sufficient on windows: reverting back and start tracking Windows workarounds in separate branch
Revert "move BOOST_SPIRIT_DEFINE into separate headers + use across all grammar defs (#3573)"

This reverts commit 81cfa721db.

Revert "windows : fix errors C3259 + C3249"

This reverts commit 8327905aba.

Revert "Workaround for VC++ C2995 via redifining BOOST_SPIRIT_DEFINE macro (#3573)"

This reverts commit 2a2f0bf00a.
2016-12-14 17:11:59 +01:00
artemp
81cfa721db move BOOST_SPIRIT_DEFINE into separate headers + use across all grammar defs (#3573) 2016-12-14 16:35:24 +01:00
artemp
8327905aba windows : fix errors C3259 + C3249 2016-12-14 15:53:07 +01:00
artemp
2a2f0bf00a Workaround for VC++ C2995 via redifining BOOST_SPIRIT_DEFINE macro (#3573) 2016-12-14 15:10:22 +01:00
artemp
9f91bb018a update deps 2016-12-14 11:17:42 +01:00
artemp
e46785a063 wrap grammar into anonymous namespace - attempting to fix VC++ compilation issue (#3573) 2016-12-14 10:49:11 +01:00
Artem Pavlenko
9010cd9ac6 Merge pull request #3572 from mapnik/issue-3570
simplify mapnik::value conversion rules
2016-12-14 10:22:35 +01:00
Mickey Rose
7c14964de3 simplify mapnik::value conversion rules
- fixes #3570

- avoids recursive exception-specification on value constructor
  by only constructing a temporary for arithmetic types (everything
  else passes a reference to the base variant constructor)

- also removes `is_same<decay_t<T>, value>` SFINAE check -- because
  we're only passing a reference down, explicitly forcing the compiler
  to use the implicitly-defined copy/move instead is pointless
2016-12-14 02:37:27 +01:00
artemp
81fafe8198 update test to use std::unordered_map<mapnik::value, mapnik::value> 2016-12-13 17:03:09 +01:00
artemp
e3a1efabe9 use latest mapbox::variant 2016-12-13 16:39:16 +01:00
artemp
e40a1d9a15 expand std::hash<mapnik::value> and operator== test for all types in mapnik::value 2016-12-13 16:16:19 +01:00
artemp
c2a61161a6 remove hash_combine (unused) 2016-12-13 15:51:57 +01:00
artemp
0307499753 simplify hash calculation (we don't need combine with which(), using hash<T> is sufficient) 2016-12-13 15:50:00 +01:00
artemp
8e15353818 minor format tweak 2016-12-13 15:49:03 +01:00
artemp
b7a4cd99d7 update BOOST_MIN_VERSION to 1.61 2016-12-09 17:55:51 +01:00
artemp
2924d736a8 update version to 3.1.0 2016-12-09 17:07:23 +01:00
artemp
fc54faac54 make parse_map_sizes standalone method + upgrade parser to use boost::spirit::x3 2016-12-09 11:52:25 +01:00
artemp
c5174d2862 port parse_hex to use boost::spirit::x3 2016-12-09 11:49:53 +01:00
artemp
5eaf37404a remove unused using directive 2016-12-09 11:49:08 +01:00
artemp
0d703ee552 cleanup include directives 2016-12-08 18:55:55 +01:00
artemp
1372ca48ef SConstruct - require c++14 2016-12-08 10:43:25 +01:00
artemp
fe7e9a7dc5 use mapbox namespace to fix name resolution 2016-12-06 15:14:28 +01:00
artemp
87c65e888d update variant dep 2016-12-06 14:56:52 +01:00
artemp
a07a8cd6fe use <mapnik/util/variant_io.hpp> which has specialisation for boolean type 2016-12-06 14:56:04 +01:00
artemp
df10fab439 only add valid bounding boxes (make backward compatible) 2016-12-06 12:23:09 +01:00
talaj
218fba4479 Merge pull request #3529 from lightmare/group-pair-layout
fix #3526 GroupSymbolizer PairLayout with 3+ items
2016-12-05 21:35:11 +01:00
Mickey Rose
cb41fc5d48 fix #3526 GroupSymbolizer PairLayout with 3+ items 2016-12-05 16:26:03 +01:00
Jiri Drbalek
6364e07d71 duplicate code elimination 2016-12-05 11:25:33 +01:00
Jiri Drbalek
2174c10b2f find max element instead of std::sort 2016-12-03 14:33:55 +00:00
Jiri Drbalek
4cdc3428bd remove redundant code 2016-12-03 13:10:07 +00:00
Dane Springmeyer
ec5964d855 Merge pull request #3568 from mapnik/gcc-again
Travis: Add g++ testing, upgrade to clang++ 3.9, downgrade to libstdc++-4.9
2016-12-02 14:11:09 -08:00
Dane Springmeyer
05936826b3 allow visual test failures with g++ https://github.com/mapnik/mapnik/issues/3567 2016-12-02 14:05:16 -08:00
Dane Springmeyer
8262eb5206 avoid -Wshadow and 'unrecognized command line option' with gcc 2016-12-02 13:43:43 -08:00
Dane Springmeyer
9cc8af9173 try g++6 on precise 2016-12-02 13:43:42 -08:00
Dane Springmeyer
e57ac30690 use clang 3.9, g++-6 2016-12-02 13:43:42 -08:00
artemp
5ea5f18a7e cleanups 2016-12-02 12:42:07 +01:00
artemp
6824f4c477 fix more gcc warnings 2016-12-02 11:42:57 +01:00
artemp
069de8e266 fix gcc6 compilation issue 2016-12-02 11:04:11 +01:00
Dane Springmeyer
8b6059eab6 mason packages are currently built with -D_GLIBCXX_USE_CXX11_ABI=0 2016-12-01 09:50:34 -08:00
artemp
2f8da6dfd5 reduce compiler warnings (gcc 6) 2016-12-01 17:17:56 +01:00
artemp
410a2ce7ca from_geojson(json, geometry) - remove temp feature/ parse directly into geometry 2016-11-30 12:21:56 +01:00
artemp
56d5ffb473 remove unused headers 2016-11-30 12:21:38 +01:00
artemp
b01481ded7 refactor feature_grammar_x3 to have a cleaner separation between feature and geometry rules 2016-11-30 11:33:35 +01:00
artemp
2dc57effb8 allow null geometry 2016-11-29 16:26:58 +01:00
Artem Pavlenko
2f5c12f28a Merge pull request #3560 from mapycz/minor-cleanup
remove methods that are not referenced anywhere
2016-11-29 16:02:58 +01:00
Jiri Drbalek
2b852ad1f9 remove methods that are not referenced anywhere 2016-11-29 14:55:06 +00:00
artemp
f7cf220688 fix Makefike - remove utils/mapnik-index/process_geojson_file.o 2016-11-29 15:28:32 +01:00
artemp
9887270b9e Merge branch 'develop-master' 2016-11-29 11:18:31 +01:00
artemp
d88bf9e1ef remove unused old headers 2016-11-29 10:48:48 +01:00
artemp
36eb7f61bd implement from_geojson in terms of parse_(feature|geometry) 2016-11-29 10:48:06 +01:00
artemp
941a025682 remove spirit::qi usage from (Geo)JSON 2016-11-29 10:46:23 +01:00
artemp
0ec510025d mapnik-index - remove -x3 option, use process_geojson_x3 always 2016-11-29 09:20:41 +01:00
artemp
2fcd608ab3 remove spirit spirit::qi usage 2016-11-28 18:42:29 +01:00
artemp
160c1c9471 pass iterator pair by ref,const& ref to match spirit::x3 APIs and be able check for fully consumed input (needed by geojson.input logic) 2016-11-28 18:40:03 +01:00
artemp
f4f39993d0 allow accessing geometry by ref 2016-11-28 18:38:40 +01:00
artemp
cc9f23c470 allow empty "properties" 2016-11-28 18:38:04 +01:00
artemp
b05d0caba1 implement support for "GeometryCollection" type 2016-11-28 17:05:46 +01:00
artemp
0ea1c7cce2 Merge branch 'master' into develop-master 2016-11-28 15:26:13 +01:00
artemp
e6eda7e8b9 use parse_feature() 2016-11-28 10:28:12 +01:00
artemp
ac3e72703d use spirit::x3 based extract_bounding_boxes 2016-11-28 10:16:25 +01:00
artemp
1e2b4c6bc1 instantiate require parse_rule's 2016-11-28 10:15:17 +01:00
artemp
af1b39c689 support both box2d<float> and box2d<double> 2016-11-28 10:14:49 +01:00
artemp
f422da8681 sanitise parse_rule instantiations via BOOST_SPIRIT_INSTANTIATE and OOST_SPIRIT_INSTANTIATE_UNUSED macros 2016-11-27 17:07:04 +01:00
artemp
d4e1cb9ae7 add an extra extract_bounding_boxes_reverse_context_type definition 2016-11-27 17:06:02 +01:00
Artem Pavlenko
765922e42f Merge pull request #3556 from mapnik/minor-cleanup
remove superfluous declaration
2016-11-25 20:39:23 +01:00
artemp
f32b423428 attempting to keep clang on Travis happy 2016-11-25 17:59:44 +01:00
artemp
c04d8bf082 re-enable GeoJSON feature validation 2016-11-25 17:50:33 +01:00
artemp
8158293b16 fix std:: namespace :) 2016-11-25 17:47:41 +01:00
artemp
1a16dfd8c2 fix namespace 2016-11-25 17:19:30 +01:00
artemp
c5e44cc7a6 add missing extract_bounding_boxes_x3.cpp back 2016-11-25 17:16:13 +01:00
artemp
a40d4ee83f Revert "move extract_bounding_boxes_x3 back into mapnik-json.a"
This reverts commit 44fc648cad.
2016-11-25 17:01:01 +01:00
artemp
483f709541 don't include xxx_def.hpp + make rules const 2016-11-25 16:52:56 +01:00
artemp
7decec426d mapnik-index update build script 2016-11-25 16:52:19 +01:00
artemp
7a819d94fa manually add missing parse_rule instantiation (FIXME) <-- must a better way perhaps via adding another macro 2016-11-25 16:51:15 +01:00
artemp
236d42402f instatiate parse_rules via BOOST_SPIRIT_INSTANTIATE 2016-11-25 16:50:15 +01:00
artemp
8a436c8cdc add extract_bounding_boxes_x3 parser configuration 2016-11-25 16:49:42 +01:00
artemp
00b2bf013a add missing generic_json_grammar_x3.cpp 2016-11-25 16:48:56 +01:00
artemp
44fc648cad move extract_bounding_boxes_x3 back into mapnik-json.a 2016-11-25 16:48:34 +01:00
artemp
be4f9ca79b add missing context type definitions + BOOST_SPIRIT_INSTANTIATE_UNUSED macro to instantiate parse_rule with boost::spirit::x3::unused_type attribute 2016-11-25 16:46:10 +01:00
artemp
163a82fd1e add feature_grammar_x3 implementation 2016-11-25 16:45:23 +01:00
artemp
cad029bf7c make hex rules const 2016-11-25 16:44:20 +01:00
talaj
994a327c7f remove superfluous declaration 2016-11-25 13:31:55 +01:00
artemp
23ba18ead2 make rules const 2016-11-25 11:48:16 +01:00
artemp
988966c68e declare in using one macro 2016-11-25 11:47:33 +01:00
artemp
4aa60d669e adapt box2d<float> to boost::geometry 2016-11-23 18:22:11 +01:00
artemp
71c112a0b0 add coord2f type 2016-11-23 18:21:44 +01:00
artemp
a112e88e23 fix compilation - move extract_bounding_boxes into mapnik-index src dir 2016-11-23 17:44:35 +01:00
artemp
ed5ee69c3c refactor GeoJSON bounding box extraction into separate method for re-use and more... 2016-11-23 16:18:38 +01:00
artemp
20d6f84b3b use char const* 2016-11-22 10:43:41 +01:00
artemp
5834de9b1f use parse_feature method in geojson.input 2016-11-21 16:35:27 +01:00
artemp
2a0bc9db6c GeoJSON - refactor feature/geometry parsing 2016-11-21 16:08:15 +01:00
artemp
fe0b0a7f2d update deps/mapbox/variant to the latest HEAD 2016-11-21 12:01:09 +01:00
artemp
3d629bf76d add missing generic_json_grammar_x3 2016-11-21 11:15:21 +01:00
artemp
7d77835080 update deps/mapbox/variant 2016-11-21 10:49:17 +01:00
artemp
e5c08800eb update deps/mapbox/variant 2016-11-21 10:48:10 +01:00
artemp
4e646c1323 handle properties 2016-11-18 15:51:39 +01:00
artemp
aca229c2bb implement custom feature GeoJSON parser for improved performance 2016-11-18 15:17:23 +01:00
artemp
f64db40a8a don't catch exceptions in featureset::next() as expected behaviour is to throw 2016-11-18 09:43:53 +01:00
artemp
ead152499b fix - ensure stringifier called recursively for nested json objects 2016-11-18 09:42:47 +01:00
artemp
e6e468dc9e Merge branch 'master' into develop-master 2016-11-18 09:05:19 +01:00
artemp
d286b75fb5 make keys member var + cache geojson grammar 2016-11-17 17:36:01 +01:00
Artem Pavlenko
a9af4e6b1c Merge pull request #3551 from tomhughes/pgraster
Use 2D box for pgraster bounding box
2016-11-17 17:34:00 +01:00
Tom Hughes
a3106a6a6e Use 2D box for pgraster bounding box
Using a 3D box causes errors with postgis 2.3 when clipping is
enabled as ST_Clip throws an error clipping a raster to a 3D box.
2016-11-17 16:30:18 +00:00
artemp
22a6652160 use spirit::x3 based parser for disk-indexed GeoJSON access 2016-11-17 16:45:11 +01:00
artemp
493b662f16 add create_feature helper method (geojson_value -> mapnik::feature_impl) 2016-11-17 16:44:09 +01:00
artemp
21a121df18 avoid name clashing 2016-11-17 13:13:07 +01:00
artemp
ca96d3e137 fix duplicate feature to geojson code 2016-11-17 10:33:05 +01:00
artemp
190023a085 remove unused include (#include <mapnik/json/value_converters.hpp>) 2016-11-17 10:31:55 +01:00
artemp
fec5715a69 update to use boost::bimap 2016-11-16 16:05:40 +01:00
artemp
4588c23274 use boost:bimap to store key/name mapping for inverse searching caps 2016-11-16 16:04:54 +01:00
artemp
69b79b303f make create_geometry a method 2016-11-16 16:03:25 +01:00
artemp
c2d7ecbef7 move keys_map initilizer with well-known-names into separate inline method 2016-11-15 17:23:27 +01:00
artemp
1b74544b08 start well-known-names enum from 1 + pre-initialise keys_map with well-known-names 2016-11-15 11:18:44 +01:00
artemp
d6bedd235c parse well-known-names as un-quoted strings 2016-11-15 11:16:58 +01:00
artemp
1e238be7ee move wkn_to_string to json_grammar_config.hpp 2016-11-15 10:15:10 +01:00
artemp
c860f9e465 add well_known_names to string mappings 2016-11-15 10:14:10 +01:00
artemp
ae30675e98 move json well_known_names 2016-11-15 10:13:36 +01:00
artemp
5ef77d07b9 update deps/mapbox/variant to the lastest HEAD 2016-11-15 09:32:27 +01:00
Dane Springmeyer
8adc190117 new publish vars 2016-11-14 15:47:20 -08:00
Dane Springmeyer
3283f50639 Merge branch 'master' of github.com:mapnik/mapnik into develop-master 2016-11-14 15:32:39 -08:00
Dane Springmeyer
5a6d16d4fe default scale_factor for filter_visitor (unbreaks node-mapnik compile) 2016-11-14 15:31:18 -08:00
Dane Springmeyer
4449f81e03 restore to_wkt on geometry<std::int64_t> 2016-11-14 15:23:29 -08:00
Dane Springmeyer
657dd7d73a suppress boost warnings 2016-11-14 15:04:07 -08:00
artemp
6b4638a955 add -x3 option to mapnik-index to test new json parser 2016-11-14 15:57:34 +01:00
artemp
0e9f06d221 more comprehensive validation implementation 2016-11-14 12:58:13 +01:00
artemp
92d35d1e40 fix json_value name clashing + add skeleton feature validation method 2016-11-14 12:18:36 +01:00
artemp
2b6f23890b remove redundant mapnik::util::recursive_wrapper 2016-11-14 12:13:26 +01:00
artemp
252a0366e9 consistent usage of iterator type + cleanups 2016-11-11 15:24:11 +01:00
artemp
f888fef86a update variant 2016-11-11 15:05:46 +01:00
artemp
99ce79fd36 allow short style syntax for long options e.g "-x3", "-validate-features" etc. 2016-11-11 10:48:03 +01:00
artemp
19f1af3861 mapnik-index - add optional 'fast' spirit::x3 GeoJSON parsing. Activated by "--x3" program option. 2016-11-11 10:40:52 +01:00
artemp
fd36ac5279 Merge branch 'master' into geometry-refactor 2016-11-10 18:01:11 +01:00
artemp
6fb3dbd63f remove BIGINT redifinition 2016-11-10 17:28:16 +01:00
artemp
e46a52c3f0 GeoJSON - spirit::x3 based parsing building blocks 2016-11-10 17:26:24 +01:00
artemp
f014555913 Merge branch 'master' into develop-master 2016-11-09 11:02:41 +01:00
artemp
2757ec8973 update variant submodule 2016-11-09 10:47:40 +01:00
artemp
7a880737e7 Merge branch 'master' into develop-master 2016-11-09 10:35:30 +01:00
Artem Pavlenko
bc9cb5d90c Remove Circle badge it appears to be broken 2016-11-09 10:20:00 +01:00
artemp
88b16e0ca8 pass context by const ref + extract _attr(ctx) once and re-use 2016-10-20 17:16:03 +02:00
artemp
eea427b19f cleanup include directives 2016-10-19 13:15:59 +02:00
artemp
7622aa25be cleanup include directives 2016-10-19 13:15:15 +02:00
artemp
e74af890fb Silence -Wundefined-var-template warnings in enumeration.hpp 2016-10-17 16:58:22 +02:00
artemp
9846632daa Merge branch 'master' into develop-master 2016-10-17 16:56:08 +02:00
artemp
f18737f974 update deps 2016-10-17 16:35:20 +02:00
artemp
7a64fae41f update visual test data 2016-10-17 16:34:40 +02:00
Artem Pavlenko
be2f1a147b Merge pull request #3537 from mapycz/fix-blur-scale-factor
Fix blur with scale_factor
2016-10-17 16:33:04 +02:00
Jiri Drbalek
9248fba0f0 update visual test data 2016-10-17 12:37:53 +00:00
Jiri Drbalek
0221cd36df take scale_factor into account when inflating buffer 2016-10-17 11:59:21 +00:00
Jiri Drbalek
b830469d2d multiply blur radius by scale_factor 2016-10-17 11:59:21 +00:00
artemp
1c0abe5e2f update deps/mapbox/variant 2016-10-17 11:01:07 +02:00
artemp
6790e27712 remove redundant includes directives 2016-10-17 10:49:56 +02:00
artemp
709d8409cc Merge branch 'master' into develop-master 2016-10-17 09:47:00 +02:00
Artem Pavlenko
e3041f07c7 Merge pull request #3535 from sebastic/dependencies-typo
Fix 'depedencies' typo, replace with 'dependencies'.
2016-10-17 09:42:52 +02:00
Bas Couwenberg
01699fe81e Fix 'depedencies' typo, replace with 'dependencies'. 2016-10-15 20:07:52 +02:00
artemp
62012fbf19 re-use literal parser implementation between separator and quote primitives 2016-10-14 14:32:44 +02:00
artemp
1e66580f0d add explicit 'types' branch to "deps/mapbox/variant" 2016-10-14 14:26:10 +02:00
artemp
df12183e10 re-use object file to avoid duplicate compilation 2016-10-14 14:25:34 +02:00
artemp
83cc819c39 upgrade CSV parser to boost::spirit::x3 2016-10-14 14:24:44 +02:00
artemp
01fbbafc26 remove duplicate 'transcoder_tag` 2016-10-14 09:24:52 +02:00
artemp
558fa0cdaa remove unused #include <mapnik/expression_grammar_x3_config.hpp> 2016-10-13 17:00:12 +02:00
artemp
4c7d4a51e6 remove unused <bitset> header 2016-10-13 17:00:12 +02:00
artemp
b27cddc101 Silence -Wundefined-var-template warnings in enumeration.hpp 2016-10-13 17:00:12 +02:00
artemp
75024c067c remove bogus template instantiations 2016-10-13 17:00:12 +02:00
artemp
d99b4eaeb4 remove unused include directive 2016-10-13 17:00:12 +02:00
artemp
4384178e3f update deps/mapbox/variant 2016-10-13 17:00:12 +02:00
artemp
d934630bc5 Fix clang >= 3.9.0 compilation by using mapbox::util::variant as alias (via deps/mapbox/variant => "types" branch) 2016-10-13 17:00:12 +02:00
artemp
ab86171c2b GeoJSON generator - implement using geometry<double> karma adapters 2016-10-13 17:00:12 +02:00
artemp
b770db56c3 remove unused rule 2016-10-13 17:00:12 +02:00
artemp
9de3c80b0d add specialisations for coord_type = std::int64_t 2016-10-13 17:00:12 +02:00
artemp
a63a491ba0 wkt generator - remove boost::phoenix headers 2016-10-13 17:00:12 +02:00
artemp
beee2fd539 mapnik::geometry - refactor karma adaper into separate header for re-use 2016-10-13 17:00:12 +02:00
artemp
9853353353 adapt mapnik::geometry::geometry<double> to work with boost::spirit::karma + simplify and optimise WKT generator 2016-10-13 17:00:12 +02:00
artemp
bdaef2cc91 variant - pin to 'types' branch (requires types typedef) 2016-10-13 17:00:11 +02:00
artemp
67468ef356 refactor path_expression_grammar 2016-10-13 17:00:11 +02:00
artemp
d2f64604a3 consistently return x3 grammars by const& 2016-10-13 17:00:11 +02:00
artemp
1cb966cee2 upgrade WKT grammar to boost::spirit::x3 2016-10-13 17:00:11 +02:00
artemp
3d80a62531 remove unused include directives 2016-10-13 17:00:11 +02:00
artemp
ce0f87fb71 merge spirit-x3 2016-10-13 17:00:11 +02:00
artemp
9a82ffbde7 add geometry and value dirs 2016-10-11 18:01:30 +02:00
artemp
923efd589c geometry_to_path.hpp => geometry/to_path.hpp 2016-10-11 18:01:30 +02:00
artemp
b5c9966e4b refactor value related objects into include/value dir 2016-10-11 18:01:30 +02:00
artemp
8ce7a1c43d refactor souce code files with the following rule: the physical filesytem path matches namespace structure
e.g `mapnik::geometry::centroid()` -> `$(MAPNIK_SOURCE)/include/mapnik/geometry/centroid.hpp`
2016-10-11 18:01:29 +02:00
Artem Pavlenko
d6a3be87a4 Merge pull request #3511 from mapnik/unbundle-unifont
Unbundle unifont
2016-10-11 17:57:06 +02:00
Artem Pavlenko
605ad3b2a8 Merge pull request #3525 from mapycz/fix-extent-intersect
fix intersecting extents in different projections
2016-10-11 17:56:45 +02:00
Mickey Rose
d18e65dbdf travis: also search unknown submodule commit in branches 2016-10-05 20:03:45 +02:00
Jiri Drbalek
0f3eecbe5e fix intersecting extents in different projections 2016-09-27 20:36:34 +00:00
artemp
a0a5085917 add GeoJSON num_features_to_query unit test (ref #3515) 2016-09-23 11:56:43 +02:00
artemp
dad0ca2071 clamp num_features_to_query to 1...max range (at least one feature will queried) + use std::size_t for feature count (ref #3515) 2016-09-23 11:56:32 +02:00
artemp
8a8427daed GeoJSON feature/geometry grammars - split (a | b | ...) % lit(',') rule to avoid creating bogus temp synthesised attribute e.g boost::variant<a,b,..> which causes clang compiler >= 3.9 to segfault. (ref #3507)
NOTE: In general many Boost.Spirit gotchas can be fixed by simplifying rules (better control what gets synthesied under the bonet)
2016-09-22 12:18:34 +02:00
artemp
094994ef54 update CHANGELOG for mapnik v3.0.12 release [skip ci] 2016-09-08 10:36:21 +02:00
Dane Springmeyer
1d22d860af Merge pull request #3513 from lightmare/fix-image-swap
Fix image swap
2016-09-07 21:03:32 -07:00
Dane Springmeyer
cbe86b0c59 add script for 'make test-release' 2016-09-07 21:02:04 -07:00
Dane Springmeyer
b6a48ff354 fixes to automated release process 2016-09-07 19:53:01 -07:00
Dane Springmeyer
c6c94e760e release process: move to github releases 2016-09-07 16:54:39 -07:00
Mickey Rose
870b890042 remove redundant member pData_ from mapnik::image
I believe this is better than fixing swap() by also
swapping pData_
2016-09-07 20:03:17 +02:00
Mickey Rose
e25bc271ec add unit test for image::swap 2016-09-07 19:23:36 +02:00
Jiri Drbalek
530cead861 update visual test data 2016-09-07 11:46:59 +00:00
Jiri Drbalek
6e489a95a3 add extend parameter of text symbolizer 2016-09-07 11:46:59 +00:00
Jiri Drbalek
8733622885 add extend_converter 2016-09-07 11:46:59 +00:00
Jiri Drbalek
237022719a unit tests: move fake_path to separate file 2016-09-07 11:15:31 +00:00
artemp
4f008c6f2f update CHANGELOG for mapnik v3.0.12 release [skip ci] 2016-09-07 09:54:07 +02:00
artemp
dcf3857d32 setting up for mapnik v3.0.12 release [skip ci] 2016-09-07 09:51:59 +02:00
Dane Springmeyer
0f81046632 unbundle unifont 2016-09-06 12:09:51 -07:00
artemp
a63a50556a Merge branch 'master' into geometry-refactor 2016-09-06 10:01:15 +02:00
Dane Springmeyer
b481d62d3d block invalid publish [skip ci] 2016-09-06 00:26:45 -07:00
Dane Springmeyer
48316d47b0 fixes for auto-release script 2016-09-06 00:21:20 -07:00
Dane Springmeyer
4cc0706940 start working on #3335 2016-09-06 00:21:20 -07:00
bergwerkgis
49a1799d4f Merge branch 'master' of https://github.com/mapnik/mapnik 2016-09-05 14:00:34 +00:00
bergwerkgis
28162f0720 [skip travis] fix relative path to get-boost-icu-version-from-sdk.ps1 (differs when called from windows-builds) 2016-09-05 14:00:17 +00:00
artemp
66999f1f87 travis up from 35 to 40 min 2016-09-05 15:54:40 +02:00
artemp
014f98043f add missing include path 2016-09-05 15:41:14 +02:00
artemp
fc0b57de24 update CHANGELOG 2016-09-05 15:41:14 +02:00
bergwerkgis
a79bd73105 refs #3509, get boost and icu versions directly from SDK files 2016-09-05 13:13:24 +00:00
artemp
747ca7470c remove duplicate #pragma 2016-09-05 11:39:36 +02:00
artemp
8e0e344b72 Merge branch 'master' into geometry-refactor 2016-09-05 09:41:52 +01:00
Dane Springmeyer
3741a7f348 fix -Wshadow warnings caught by g++-5 2016-09-03 09:58:40 -07:00
Dane Springmeyer
e580d0b1d6 simplify travis-command-wrapper.py output 2016-09-03 09:32:20 -07:00
Dane Springmeyer
076ab1fa6c fix mason cflags/ldflags return 2016-09-03 09:31:26 -07:00
Dane Springmeyer
c3f7d947a6 travis: up to 35 min limit 2016-09-02 21:12:08 -07:00
Dane Springmeyer
3be9a623fc travis: up to 25 min limit 2016-09-02 19:06:07 -07:00
Dane Springmeyer
c67e505a74 mason: install zlib system symlink to ensure consistently zlib linking [skip ci] 2016-09-02 17:52:02 -07:00
Dane Springmeyer
7dcf8eac35 increase deadline to 15 min 2016-09-02 17:47:40 -07:00
Dane Springmeyer
57331a40ce try to get travis-command-wrapper deadline working 2016-09-02 17:19:22 -07:00
Dane Springmeyer
acd90042fb geojson.input: minor code adjustments
- Avoids making copy of inline string to save memory
 - Moves duplicated code out of #ifdef to be more readible
2016-09-02 15:51:58 -07:00
Dane Springmeyer
fa44f0e247 Add memory_datasource test + fix returning of invalid_featureset for emptyset 2016-09-02 15:09:45 -07:00
Dane Springmeyer
73715afdb8 travis: fix broken grep 2016-09-02 14:44:35 -07:00
Dane Springmeyer
35d9435952 appveyor: only upload test failures not all visual tests 2016-09-02 12:56:00 -07:00
Dane Springmeyer
09ec0ba709 stop build at 25 minutes (well before travis fails the job at 50) to ensure at least partial ccache results are uploaded 2016-09-02 12:09:19 -07:00
Dane Springmeyer
687af49f47 bump BOOST_VERSION 2016-09-02 12:00:57 -07:00
Dane Springmeyer
5a21b1fc05 better wrapper args 2016-09-01 18:53:55 -07:00
Dane Springmeyer
7075a361cc try travis-command-wrapper.py to help cache get created even on job that timed out - refs travis-ci/travis-ci#4472 2016-09-01 18:13:06 -07:00
Dane Springmeyer
d19c38de17 upgrade ccache / convert to generic travis language 2016-09-01 16:59:18 -07:00
artemp
38bff90a99 Merge branch 'master' into geometry-refactor 2016-09-01 16:06:20 +01:00
Dane Springmeyer
4b06dfe9b4 Avoid warnings when building the g++5 2016-08-31 11:09:27 -07:00
Dane Springmeyer
02c2338c43 mapnik-config: strip clang specific warning flags 2016-08-31 11:09:11 -07:00
artemp
af099a57ef topojson grammar - change interface + instantiate with Iterator = char const* to reduce binary size 2016-08-31 17:42:18 +01:00
artemp
f360f50eed JSON - make generic_json a proper spirit grammar and reduce code bloat 2016-08-31 14:36:35 +01:00
Dane Springmeyer
3f26a1f23f use latest visual test data 2016-08-30 12:37:33 -07:00
artemp
f55b3b3bb3 Merge branch 'master' into geometry-refactor 2016-08-30 14:39:44 +01:00
Dane Springmeyer
d1301f4360 Merge pull request #3504 from mapnik/update-mason-deps
Target latest version of deps for visual/unit tests
2016-08-26 16:33:18 -07:00
Dane Springmeyer
8b954a6fc3 Get correct package of lndir 2016-08-26 14:30:47 -07:00
Dane Springmeyer
95331eda40 temporary workaround for https://github.com/mapbox/mason/issues/230 2016-08-26 13:40:28 -07:00
Dane Springmeyer
799178c7cc update to latest test data 2016-08-26 13:20:50 -07:00
artemp
d747f326f2 CHANGELOG - fix typo and update 2016-08-26 14:39:56 +01:00
artemp
842522b287 Merge branch 'master' into geometry-refactor 2016-08-26 09:06:05 +01:00
artemp
69b0ee1ada Merge branch 'mapycz-fix-building-symbolizer' 2016-08-25 18:21:35 +01:00
Jiri Drbalek
2f98b8965b update visual tests data 2016-08-25 09:36:30 +00:00
Jiri Drbalek
8b18c605fd no need for heap allocation 2016-08-25 08:01:31 +00:00
Jiri Drbalek
6da9de5739 fix closing segment 2016-08-25 08:01:25 +00:00
artemp
56c6a1ea62 Merge branch 'master' into geometry-refactor 2016-08-24 11:14:01 +01:00
artemp
603879f1c0 Merge remote-tracking branch 'origin/geometry-refactor' into geometry-refactor 2016-08-24 10:46:20 +01:00
artemp
fe007915df Revert "Revert "mapnik::variant - use std::tuple<Typess...> instead of mpl::vector<Types...> and remove Boost.MPL dependency""
and remove `<boost/fusion/adapted/std_tuple.hpp>`

This reverts commit b6cc48fd40.
2016-08-23 15:45:15 +01:00
Dane Springmeyer
f81583554a Merge branch 'master' of github.com:mapnik/mapnik into geometry-refactor 2016-08-22 16:19:17 -07:00
Dane Springmeyer
c6b1abcdb6 update mason deps and test data - refs mapnik/test-data#8 mapnik/test-data-visual#36 2016-08-22 15:12:25 -07:00
Dane Springmeyer
b6cc48fd40 Revert "mapnik::variant - use std::tuple<Typess...> instead of mpl::vector<Types...> and remove Boost.MPL dependency"
This reverts commit 6613222b84.
2016-08-22 11:40:06 -07:00
Dane Springmeyer
4dae4d43c5 restore test/data version - accidentally changed in 0ae2f1311c 2016-08-22 11:15:42 -07:00
Dane Springmeyer
0ae2f1311c update test data if UPDATE env set 2016-08-22 10:50:08 -07:00
artemp
6613222b84 mapnik::variant - use std::tuple<Typess...> instead of mpl::vector<Types...> and remove Boost.MPL dependency 2016-08-22 12:16:48 +01:00
artemp
7c45556138 update font path 2016-08-16 16:00:24 +01:00
artemp
1a29b35717 GeoJSON unit tests- ensure descriptors are ordered by name (ref #3494) 2016-08-16 15:46:10 +01:00
artemp
3788b2781e tiny format 2016-08-16 15:36:43 +01:00
artemp
f3252d00f4 expose "num_features_to_query" datasource parameter (ref #3495) 2016-08-16 10:55:56 +01:00
artemp
1e8f471448 minor formatting 2016-08-16 10:53:57 +01:00
artemp
b9279feee2 fix is_valid logic (ref #3494) 2016-08-15 12:49:43 +01:00
artemp
046c9638e1 GeoJSON - ensure descriptors order is consistent ( ref #3494) 2016-08-15 12:21:02 +01:00
artemp
0471f3369a add order_by_name helper method 2016-08-15 12:20:19 +01:00
artemp
008a6eb4cf test geojson - add empty featurecollection test 2016-08-15 10:44:54 +01:00
artemp
31814b32d0 rename empty_featureset => invalid_featureset to avoid ambiguity + add helper is_valid method 2016-08-15 10:41:30 +01:00
Dane Springmeyer
843f96083d update libwebp, always link mason packages 2016-08-12 16:00:21 -07:00
artemp
f9c321583f update CHANGELOG 2016-08-12 15:56:29 +01:00
artemp
5c11fe49f9 geoson+topojson tests - correct expected test data (ref #3491) 2016-08-12 11:05:50 +01:00
artemp
8dca305e7e json stringifier - add missing quoting in nested json objects (ref #3491) 2016-08-12 11:04:30 +01:00
artemp
9448901907 Merge branch 'windows-unicode' 2016-08-12 09:31:46 +01:00
artemp
cdad126fa3 Merge branch 'master' into windows-unicode 2016-08-12 09:31:29 +01:00
bergwerkgis
74d7726b2d remove unneeded 'u8' 2016-08-12 05:27:55 +00:00
artemp
5298a737c8 update deps 2016-08-11 15:57:22 +01:00
Dane Springmeyer
c777cc50d0 also install boost thread and python to ease python-mapnik build against masonized mapnik [skip ci] 2016-08-10 13:36:46 -07:00
Dane Springmeyer
53fb06e31a install consistent apt packages 2016-08-09 15:14:22 -07:00
Dane Springmeyer
4839b95072 install xutils to speed up mason install/link 2016-08-09 15:12:26 -07:00
Dane Springmeyer
3bfc358cb8 Merge pull request #3485 from mapnik/regex-unicode
Regex unicode
2016-08-09 14:58:51 -07:00
Dane Springmeyer
fc52a818d8 trigger new build 2016-08-09 14:30:13 -07:00
Dane Springmeyer
181feef253 bootstrap: exit trap not called when sourcing 2016-08-09 12:17:39 -07:00
Dane Springmeyer
8e84b6d853 stop caching mason_packages 2016-08-09 10:46:18 -07:00
Dane Springmeyer
f56c45b86b [bootstrap] upgrade to boost_regex package with icu + better error handling 2016-08-09 10:41:38 -07:00
artemp
2afae2a29b Expressions - more tests (ref #3483) 2016-08-09 16:25:59 +01:00
artemp
aa77eb4550 Expressions - add more regex tests to cover #3483 2016-08-09 16:13:12 +01:00
artemp
6eb7783f9e update data-visual 2016-08-08 12:21:31 +01:00
Artem Pavlenko
b0cf57aa53 Merge pull request #3477 from mapycz/cairo-style-level-comp-op
Style level comp-op and opacity for Cairo renderer
2016-08-08 10:52:54 +01:00
Artem Pavlenko
8d8442d647 Merge pull request #3480 from sebastic/spelling-errors
Fix spelling errors
2016-08-08 09:50:40 +01:00
Bas Couwenberg
2003415f09 Fix 'occured' typo, replace with 'occurred'. 2016-08-05 14:50:50 +02:00
Bas Couwenberg
388a8a7c4d Fix 'intialize' typo, replace with 'initialize'. 2016-08-05 14:49:45 +02:00
artemp
d09b6a4810 update font_registration test 2016-08-05 10:25:32 +01:00
artemp
f7fd102c34 update dejavu fonts to v2.37 2016-08-05 10:18:10 +01:00
artemp
922f4c4e1b update SCons to 2.5.0 2016-08-05 10:16:06 +01:00
artemp
4e66c69cf2 update unifont to the latest version 9.0.01 2016-08-05 10:15:31 +01:00
artemp
d9e04518a2 typo 2016-08-04 11:00:57 +01:00
artemp
0775e7bc3c more updates 2016-08-04 10:59:09 +01:00
artemp
9648099155 Add missing release date for 3.0.11 2016-08-04 10:54:39 +01:00
artemp
676d9184b4 update CHANGELOG in anticipation of v3.0.12 release 2016-08-04 10:53:04 +01:00
Jiri Drbalek
9925c3d50d update visual test data 2016-08-03 20:17:17 +00:00
Jiri Drbalek
621a5e51ac style level comp-op and opacity for Cairo renderer 2016-08-03 20:14:56 +00:00
artemp
a7c6df98a3 update variant deps 2016-08-03 12:35:34 +01:00
Artem Pavlenko
d1932b0401 Merge pull request #3476 from lightmare/inherit-ctor
use proper feature-test macro for inheriting constructors
2016-08-03 12:34:10 +01:00
Mickey Rose
f9d5c3a2f8 use proper feature-test macro for inheriting constructors 2016-08-03 00:29:51 +02:00
Artem Pavlenko
68db7ee224 Merge pull request #3475 from mapycz/logarithm
Add support for natural logarithm in expressions (via @talaj)
2016-08-01 15:07:01 +02:00
Jiri Drbalek
c1ab5c8e6c add support for natural logarithm function in expressions 2016-08-01 12:58:21 +00:00
artemp
b55f5dc895 image - add tiny image quantising tests (ref #3466) 2016-08-01 12:21:32 +02:00
Dane Springmeyer
148783da25 Revert "inherit ctor's from geometry_base"
- Fixes #3473 (windows compile)
 - TODO: @artemp get to the bottom of how to inherit from base class
   in a way that works with boost::variant and across platforms

This reverts commit bf99177da7.
2016-07-29 04:51:18 -07:00
artemp
b0d9467224 Merge branch 'master' into geometry-refactor 2016-07-26 12:16:39 +02:00
artemp
9a0d7b0d68 update variant 2016-07-26 10:38:28 +02:00
artemp
d3293f73e1 c++ format 2016-07-25 15:55:50 +02:00
artemp
bf99177da7 inherit ctor's from geometry_base 2016-07-25 15:55:20 +02:00
Dane Springmeyer
bd920daa16 fix decltype forwarding 2016-07-25 14:51:45 +02:00
Dane Springmeyer
7fc9dfe06b simplify visitor code in image_compositing 2016-07-25 14:51:45 +02:00
Dane Springmeyer
f734368a73 limit mpl list size as well as vector size 2016-07-25 14:51:45 +02:00
artemp
2864d90460 more explicit conversions to the target variant type 2016-07-25 13:45:35 +02:00
Dane Springmeyer
3c86ab77c4 [travis] fix indentation 2016-07-20 14:10:27 +02:00
artemp
7fa35f481e Support creating paletted images for any number of pixels e.g < 3 (ref #3466) 2016-07-20 14:01:14 +02:00
Dane Springmeyer
d17f1f076d workaround travis bug: 'shell_session_update: command not found' 2016-07-20 13:19:08 +02:00
artemp
7712f253c9 represent value_null as an empty string e.g "" (text rendering logic) 2016-07-20 12:39:55 +02:00
artemp
dc88582b4d Merge branch 'master' into geometry-refactor 2016-07-19 10:25:33 +01:00
artemp
85a6ef9a15 update variant deps 2016-07-19 10:24:31 +01:00
artemp
3d0b109739 value_null - always represent as "null" 2016-07-15 12:22:53 +01:00
artemp
6f8f286b8d Revert "allow "null" values when genrating Feature GeoJSON"
This reverts commit 8ce58ea29c.
2016-07-15 12:22:03 +01:00
artemp
54d51e2728 Revert "feature_kv_iterator - change logic in 'increment' to skip key/value's when value doesn't exist"
This reverts commit 3397b8f14f.
2016-07-15 12:21:41 +01:00
artemp
8ce58ea29c allow "null" values when genrating Feature GeoJSON 2016-07-14 10:09:34 +01:00
artemp
3397b8f14f feature_kv_iterator - change logic in 'increment' to skip key/value's when value doesn't exist 2016-07-14 09:46:37 +01:00
artemp
c457d93804 use count(key) 2016-07-14 09:45:55 +01:00
artemp
bab985dd04 always return am empty featureset instead of featureset_ptr() 2016-07-13 15:17:51 +01:00
artemp
75781a999c add empty_featureset (returning feature_ptr()) implementation 2016-07-13 15:17:41 +01:00
artemp
dc74551dc0 always return am empty featureset instead of featureset_ptr() 2016-07-13 15:16:33 +01:00
artemp
132aa6654f add empty_featureset (returning feature_ptr()) implementation 2016-07-13 15:07:08 +01:00
artemp
45c5a3768f extract_bounding_box_grammar - make features optional / ref #3463 2016-07-12 17:44:19 +01:00
artemp
abb4271bea extract_bounding_box_grammar - make features optional / ref #3463 2016-07-12 17:42:53 +01:00
artemp
e08c3c1a20 using alias() doesn't work: line_string and linear_ring are different types (no-conversion) 2016-07-12 11:13:45 +01:00
artemp
fd41b682be geometry_generator - fix synthesised attribute types 2016-07-12 11:11:35 +01:00
artemp
74bf270d21 geometry is_simple - handle empty polygons 2016-07-11 11:55:20 +01:00
artemp
01e962d216 centroid - re-implement avoiding inefficient remove_empty 2016-07-11 10:44:59 +01:00
artemp
033c54617c c++ format 2016-07-11 10:44:18 +01:00
artemp
359a3a845a update geometry.hpp 2016-07-11 10:17:45 +01:00
artemp
f0a37c761b polygon - add move ctor 2016-07-07 12:29:19 +01:00
artemp
d810ce46f2 re-enable geometry_strategy_test 2016-07-06 17:45:13 +01:00
artemp
c478849eba implement different strategy for adapting to boost::geometry using internal structure for accessing interior rings 2016-07-06 17:43:45 +01:00
artemp
710a9be5b0 update to the latest geometry.hpp 2016-07-05 10:47:41 +01:00
artemp
68f53cfcd0 uncomment is_empty/has_empty tests 2016-07-05 10:24:54 +01:00
artemp
335ce8e50b is_empty - fix implementation 2016-07-05 10:24:26 +01:00
artemp
e29ca884df has_empty - update logic to work with the current polygon model (FIXME: the naming is confusing to say the least) 2016-07-05 10:23:16 +01:00
artemp
fb398ad465 re-use typedefs 2016-07-04 15:46:04 +01:00
artemp
11fc2ceabd tidy 2016-07-04 15:11:06 +01:00
artemp
75b97eb64c temp disable failing tests 2016-07-04 10:32:31 +01:00
artemp
81419154eb update geometry adapters to use polygon_interior<T> as mutable interior rings proxy container 2016-07-04 10:32:20 +01:00
artemp
f5ec3ba0e0 add initial "proxy" interior rings implementation 2016-07-04 10:28:45 +01:00
Dane Springmeyer
8e31b8e2b9 remove debugging aborts [skip ci] 2016-06-30 11:51:37 -07:00
artemp
c27653066d bring back failing geometry tests 2016-06-29 18:40:47 +01:00
Dane Springmeyer
abe175c14f avoid calling correct on empty geometries 2016-06-29 09:20:02 -07:00
Dane Springmeyer
39f497ded6 re-enable centroid test which appears to be passing 2016-06-29 09:19:28 -07:00
artemp
e44f10460d disable "multi-polygon: one component empty" test 2016-06-29 15:02:19 +01:00
artemp
efabcc8081 make all mapnik::geometries aliases to mapbox::geometry and attempt to adapt new polygon model (one std::vector)
NOTE: some boost.geometry algorithms are broken as a result
2016-06-29 12:41:57 +01:00
Dane Springmeyer
71496e7828 install geometry.hpp 2016-06-27 16:49:30 -07:00
artemp
66da9cdb18 using linear_ring = mapbox::geometry::linear_ring<T>; 2016-06-27 10:56:38 +01:00
artemp
3b1c7308cc make mapnik::geometry::line_string<T> an alias to mapbox::geometry::line_string<T> 2016-06-27 10:23:13 +01:00
artemp
19d376b7e6 make mapnik::geometry::point<T> an alias to mapbox::geometry::point 2016-06-27 09:45:37 +01:00
artemp
d169fb473e add geometry.hpp as submodule 2016-06-27 09:45:25 +01:00
artemp
9dd00b28dc Merge remote-tracking branch 'origin/master' into geometry-refactor 2016-06-27 08:51:55 +01:00
Artem Pavlenko
00e5d00530 Fix unbound variable when number of JOBS is omitted 2016-06-23 09:46:45 +01:00
artemp
3536ad0902 even more tidy - remove left over stderr 2016-06-22 17:35:09 +01:00
artemp
7de7464caf tidy 2016-06-22 17:25:37 +01:00
artemp
2e8c0d36c2 implement custom char_array_bufrer and remove boost::iostreams dependency 2016-06-22 17:21:25 +01:00
artemp
67d2a0e141 Merge branch 'master' into geometry-refactor 2016-06-20 15:01:29 +01:00
Mickey Rose
8d3c08f3ef libc++ implementation of std::deque<T> needs T to be complete 2016-06-17 17:09:16 +02:00
Mickey Rose
fc3d194ad2 missed svg2png when renaming svg_renderer_agg 2016-06-16 23:16:39 +02:00
Mickey Rose
217d18a996 use std::deque to store svg::path_attributes
- refs #3453
2016-06-16 22:34:24 +02:00
Dane Springmeyer
b17dae8381 [travis][coverage] llvm-3.8 does not support --object-directory option 2016-06-14 22:26:17 -07:00
Dane Springmeyer
b9e7296460 update to latest visual test data 2016-06-14 22:02:53 -07:00
Dane Springmeyer
8955e3b189 [travis] attempt to fix coverage 2016-06-14 21:58:32 -07:00
Dane Springmeyer
915062c6a3 [travis] fix apt package installs 2016-06-14 21:25:33 -07:00
Dane Springmeyer
de88b47ded [travis] further debug configure failure 2016-06-14 21:15:50 -07:00
Dane Springmeyer
07f34f03de scons: don't recommend now oldish compilers [skip ci] 2016-06-14 21:12:42 -07:00
Dane Springmeyer
0cec24fe65 debug configure failure on travis 2016-06-14 21:08:18 -07:00
Dane Springmeyer
6fd4e974cf [travis] install clang after mason has been installed 2016-06-14 12:04:45 -07:00
Dane Springmeyer
d47f8353a9 remove tabs in .travis.yml 2016-06-14 12:00:48 -07:00
artemp
56bcc818dd update test data 2016-06-14 12:30:11 +02:00
Dane Springmeyer
f9969e7803 Add circleci badge [skip ci] 2016-06-13 13:25:00 -07:00
Dane Springmeyer
8336e4d43c update visual tests to get new gdal tests passing - refs mapnik/mapnik#3430 2016-06-13 13:07:40 -07:00
Dane Springmeyer
68d5cc34f2 upgrade mason to ensure clang v3.8.0 is available 2016-06-13 12:21:51 -07:00
Dane Springmeyer
0fa5ae5158 circleci - remove unneeded lines 2016-06-13 11:40:15 -07:00
Dane Springmeyer
2ef3ae47f6 use clang 3.8 from mason 2016-06-13 10:51:12 -07:00
artemp
13c48788db update .travis.yml to use clang-3.8 (https://github.com/mapbox/mason/pull/179) 2016-06-13 17:37:07 +02:00
artemp
7e6cc4cfac make get_overview_meta(band) standalone method 2016-06-13 11:14:59 +02:00
artemp
37d5a32875 make return type bool 2016-06-08 12:24:21 +02:00
artemp
9e3ccf6629 Issue a warning but don't fail if PostgreSQL is not running or it's not accessible (ref #3448) 2016-06-08 12:21:27 +02:00
artemp
b20ec7824b Merge branch 'CartoDB-pgraster-just-overviews' 2016-06-07 14:19:53 +02:00
artemp
1714d4317c Merge branch 'pgraster-just-overviews' of https://github.com/CartoDB/mapnik into CartoDB-pgraster-just-overviews 2016-06-07 14:19:42 +02:00
artemp
18aa50a59e update variant 2016-06-07 14:19:22 +02:00
artemp
1509426088 update test data (https://github.com/mapnik/mapnik/pull/3430) 2016-06-07 14:02:04 +02:00
artemp
d64016273f Merge branch 'rouault-gdal_support_mask_band' 2016-06-07 13:31:01 +02:00
artemp
3f224e3f4d Merge branch 'gdal_support_mask_band' of https://github.com/rouault/mapnik into rouault-gdal_support_mask_band 2016-06-07 13:30:45 +02:00
artemp
9f3b76fb94 update visual data (ref https://github.com/mapnik/mapnik/pull/3445) 2016-06-06 11:29:33 +02:00
Artem Pavlenko
631fb0293f Merge pull request #3445 from jojva/fix-ellipse-bounding-box
Fix stroke-width size not included in markers ellipse bounding box - cheers @jojva
2016-06-03 14:57:34 +02:00
artemp
beb34f9c5e topojson_grammar - rename properties to properties_ to avoid compilation error (gcc) ref #3446 2016-06-03 14:45:49 +02:00
Joris Valette
7ca86b0947 Fix stroke-width size not included in markers ellipse bounding box 2016-06-03 11:12:14 +02:00
artemp
deb5102aac convert shapefiles to use UTF-8 encoding in DBF files via @glarrain
( ref https://github.com/mapnik/mapnik/pull/3441)
2016-06-02 16:08:31 +02:00
artemp
ea7808d6e0 Merge branch 'glarrain-patch-1' 2016-06-02 16:07:23 +02:00
artemp
86d8b6ef5f Merge branch 'patch-1' of https://github.com/glarrain/mapnik into glarrain-patch-1 2016-06-02 16:06:53 +02:00
artemp
d30143c60f remove unsupported ESRI data files 2016-06-02 16:04:43 +02:00
artemp
bca9675b13 Merge remote-tracking branch 'origin/master' 2016-06-02 15:58:39 +02:00
artemp
2f9c2a3a9b update variant submodule 2016-06-02 11:33:43 +02:00
Artem Pavlenko
5aba65e54d Merge pull request #3442 from glarrain/patch-2
Fix markdown issue in C++ demo README
2016-05-31 18:30:51 +02:00
Germán Larraín
a876070ccb Fix markdown issue in C++ demo README
Commands were rendered incorrectly due to missing spaces, causing that `mapnik-config --prefix` was rendered without backticks, which are necessary.
2016-05-31 13:14:27 -03:00
Germán Larraín
503d4eaea1 fix shapefiles encoding in demo for C++
Mapnik builds without `boost_regex_icu` (see #3440) and the C++ demo does not run:

```
/mapnik# demo/c++/rundemo `mapnik-config --prefix`                                                                                                                                         
 running demo ... 
### std::exception: could not create converter for latin1
```
2016-05-31 12:40:27 -03:00
artemp
efdc90f699 fix building with BIGINT=no (NOTE: some tests will fail) 2016-05-26 17:23:53 +02:00
Artem Pavlenko
ddd61c55ff fix LGPL link 2016-05-26 17:12:18 +02:00
artemp
a24dfbf6a0 simplify logic a bit 2016-05-26 16:27:22 +02:00
artemp
081c003b0e c++ style 2016-05-26 16:27:22 +02:00
Wilhelm Berg
2fb0326892 Update appveyor.yml to use boost 1.60 2016-05-25 13:53:23 +02:00
artemp
cf604518a5 fix typo 2016-05-25 13:08:20 +02:00
Artem Pavlenko
ffe9b21b58 Merge pull request #3435 from woodpeck/patch-1
Fix DejaVu font directory
2016-05-25 10:30:50 +02:00
Frederik Ramm
8af8737272 Fix DejaVu font directory
Fonts in Mapnik tree are now 2.35 not 2.34
2016-05-25 10:12:53 +02:00
artemp
37a8aed62d transcode input strings to UTF-8 (portability) 2016-05-24 12:16:48 +02:00
artemp
acb2d56f49 prefix string literals with u8"" to force UTF8 encoding (windows) 2016-05-24 10:54:34 +02:00
artemp
b9cc746c07 sync up visual test data 2016-05-24 10:27:44 +02:00
artemp
65a23b436d bump visual test data 2016-05-24 10:15:00 +02:00
artemp
06d487c8d1 update visual data 2016-05-23 17:49:20 +02:00
artemp
de0d384ca9 update test data 2016-05-23 12:30:08 +02:00
Artem Pavlenko
44e1102166 Merge pull request #3434 from mapnik/topojson
Topojson (refactor)
2016-05-23 11:44:14 +02:00
artemp
f3ae60fed4 Merge branch 'master' into topojson 2016-05-23 10:52:19 +02:00
artemp
01967cfaff topojson grammar - re-factor to allow geometry elements to be in any order 2016-05-23 10:51:05 +02:00
Dane Springmeyer
d7b6b5669b upgrade to latest mason and latest boost via mason 2016-05-19 19:37:31 -04:00
Dane Springmeyer
20a9112135 remove boost thread checking since it is no longer a dependency 2016-05-19 19:37:31 -04:00
Jiri Drbalek
fee0ad05ce update changelog 2016-05-18 20:06:31 +00:00
Dane Springmeyer
c8cc2670be update visual test data - refs mapnik/mapnik#3416 / mapnik/test-data-visual#34 2016-05-18 13:40:00 -04:00
Dane Springmeyer
44ea60ad5f fix #3431 2016-05-18 13:38:07 -04:00
Artem Pavlenko
536ea734e8 Merge pull request #3418 from mapycz/visual-tests-cairo-vectors
visual tests: support for Cairo PS, PDF and SVG renderers
2016-05-18 15:05:27 +02:00
Artem Pavlenko
aec5949d5a Merge pull request #3416 from mapycz/scale-factor-improvements
Scale factor improvements
2016-05-18 15:05:04 +02:00
Artem Pavlenko
26aa516ee7 Merge pull request #3429 from mapnik/topojson
Topojson https://github.com/mapnik/mapnik/issues/3427
2016-05-18 14:16:29 +02:00
artemp
7b3f607a01 remove omit directive as it breaks type deduction and insists on boost::optional<boost::variant<int, mapnik::json::coordinates> attribute signature (boost 1.61.0) 2016-05-18 13:13:25 +02:00
artemp
c85c0fd025 prealloc memory with reserve 2016-05-18 11:18:26 +02:00
artemp
c10c271430 dereference once 2016-05-18 10:35:58 +02:00
Even Rouault
b2cb39dec8 [GDAL plugin] Add support for non-alpha mask band
GDAL can support non-alpha mask band, such as a TIFF IFD with
Subfile type=transparency mask. This can be typically used to
create a GeoTIFF with YCbCr JPEG compression for RGB bands and
DEFLATE compression for the mask band.
2016-05-17 19:44:12 +02:00
artemp
7d72cc1930 more cleanups 2016-05-17 13:47:31 +02:00
artemp
de13582004 remove stderr 2016-05-17 13:45:05 +02:00
artemp
c66fd480b5 simplify rules 2016-05-17 13:05:53 +02:00
artemp
8f74de8525 remove stderr 2016-05-17 13:05:37 +02:00
artemp
4ca0c21d73 move phoenix functions into ctor 2016-05-17 13:00:03 +02:00
artemp
25217549f1 fix topojson parsing (work-in-progress) 2016-05-17 12:53:07 +02:00
artemp
6e326f035d minor formatting 2016-05-17 12:44:46 +02:00
artemp
dc84943575 Fixed https://github.com/mapbox/windows-builds/issues/88
(inheriting constructors not working with msvc-14.0 2015)
2016-05-13 15:23:47 +02:00
artemp
9e5b7a9b5e update test data 2016-05-13 12:51:46 +02:00
artemp
3ec25e36fe test geojson.cpp - add empty properties (ref #3426) 2016-05-13 12:48:56 +02:00
artemp
4e6aeaedfc handle empty arrays and objects ref #3426 2016-05-13 11:50:43 +02:00
artemp
4429155759 update test data 2016-05-12 18:54:48 +02:00
artemp
38ec14c739 topojson - use json.value directly 2016-05-12 18:52:05 +02:00
artemp
04ce225728 update variant (again) to 7f7470fee6a42c3c68f1fa359a28cf762df385c3 2016-05-11 12:35:01 +02:00
artemp
5228dad91a update to latest variant 2016-05-11 10:58:08 +02:00
artemp
d19ff576dc geojson test - fix the order in 'object' to match input (escaped.json) 2016-05-10 16:03:04 +02:00
artemp
5e33dc0551 feature_grammar - simplify further, remove redundant rule 2016-05-10 15:53:14 +02:00
artemp
3909fe5b7d JSON - store 'object' properties in std::vector to preserve order 2016-05-10 15:52:02 +02:00
artemp
f0386e0469 issue pre-processor #warning if BOOST_MPL_LIMIT_VECTOR_SIZE is defined before config.hpp is included ref #3425 2016-05-10 15:15:03 +02:00
artemp
07ca572af4 fix mapbox/variant install path 2016-05-10 15:15:03 +02:00
Dane Springmeyer
e68de54883 re-enable osx unit tests now that ccache is working 2016-05-09 14:04:55 -07:00
Dane Springmeyer
83768dc3dd travis by compiler cache needs to use language:cpp 2016-05-09 12:21:54 -07:00
Dane Springmeyer
609e5ba7af attempt to get caching+ccache working on osx - refs https://blog.travis-ci.com/2016-05-03-caches-are-coming-to-everyone 2016-05-09 10:03:50 -07:00
artemp
75189905d6 upgrade to latest variant.hpp 2016-05-09 11:42:46 +02:00
artemp
d97583b53e geojson.cpp - fix and update test 2016-05-06 16:44:18 +02:00
Rafa de la Torre
8e8482803b If there're overviews, just use them for rendering
The current code falls back to the base table for small scales.

That approach has some drawbacks cause it forces the original table to
share some conditions with its overviews (same SRID, alginment, scale
constraints) for the rendering to work properly.

What we propose is to always fall back to the highest resolution
overview (lowest scale), rather than the original table, in order to
avoid coupling the original table with the constraints imposed by
rendering and still have them linked (in postgis raster metadata).

Please note this approach is not 100% compatible as the base table
won't be used. This should be no big deal because overviews can have
an arbitrary resolution/scale.
2016-05-06 14:43:24 +02:00
artemp
908203f15e Merge remote-tracking branch 'origin/json-properties' into json-properties 2016-05-06 10:58:44 +02:00
artemp
c4d80de56e update deps 2016-05-06 10:58:19 +02:00
artemp
97b8a11a72 fix includes + use typedefs for json types 2016-05-06 10:57:35 +02:00
Artem Pavlenko
ea7974d580 Merge pull request #3423 from mapnik/geojson-property-tests
Geojson property tests
2016-05-06 10:34:06 +02:00
artemp
7544f57efe Merge branch 'master' into json-properties 2016-05-06 10:27:18 +02:00
artemp
c2bf2be7ba json - simplify generic_json rules: remove redundant rule 2016-05-06 10:24:25 +02:00
artemp
21487f36b9 json - refactor stringifier and attribute_value_visitor into separate *.hpp and share between geojson and topojson grammars 2016-05-06 10:15:44 +02:00
artemp
6bd708af86 fix generic_json usage across grammars 2016-05-06 09:55:54 +02:00
artemp
e528b433d4 geojson feature_grammar - parse objects and arrays into json_value before applying "stringifier" #3419 https://github.com/mapnik/node-mapnik/issues/642 2016-05-06 09:50:45 +02:00
artemp
7374f82414 generic_json - add support for JSON object and array type in json_value + update rules attributes 2016-05-06 09:47:40 +02:00
Dane Springmeyer
966a4ae366 avoid warnings with boost 1.60 [skip ci] 2016-05-05 19:09:05 -07:00
mapsam
086157e26b one step deeper, moar arrays/objects 2016-05-05 13:38:28 -07:00
mapsam
0ed6eedfec Merge branch 'master' into geojson-property-tests 2016-05-05 09:17:44 -07:00
mapsam
9d9c8db233 add geojson unit test for property types/values 2016-05-05 09:17:08 -07:00
artemp
db912d9b67 disable white skipping in stringify_object/stringify_array (ref #3419) 2016-05-05 10:33:36 +02:00
artemp
d9e75f4ddb c++ prettify formatting 2016-05-05 10:31:58 +02:00
Jiri Drbalek
464e508dc5 visual tests: support for Cairo PS, PDF and SVG renderers 2016-05-04 14:27:34 +00:00
artemp
52df451ee3 geometry_envelope_test - fix linking/duplicate symbols (ref #3415) 2016-05-04 10:20:10 +02:00
artemp
e596ffc1c2 don't instantiate types that are not used in core library 2016-05-03 18:33:06 +02:00
artemp
c0dfc92022 geometry_envelope - add tests for double/float/int coord_type (ref #3415) 2016-05-03 18:26:46 +02:00
artemp
471d6dfe94 remove redundant recursive_wrapper (via @jfirebaugh : f00a7aebf1) 2016-05-03 18:13:41 +02:00
artemp
ff821c9239 geometry::envelope - deduct value_type of box2d<T> automatically + add missing typedefs 2016-05-03 18:02:42 +02:00
Jiri Drbalek
b930a5e7f7 apply scale factor to line spacing 2016-05-03 12:09:39 +00:00
Jiri Drbalek
cfc6b37d71 fix passing scale factor to evaluate_transform() 2016-05-03 12:09:39 +00:00
artemp
80176a6c83 fix `geometry_type' call 2016-04-29 18:09:32 +02:00
artemp
c4fcee7b66 add geometry dir 2016-04-29 17:08:17 +02:00
artemp
3184034414 refactor geometry core and algorithms templates + add missing typedefs + prepare for geometry update 2016-04-29 14:24:57 +02:00
artemp
de927a1571 Merge branch 'master' into geometry-refactor 2016-04-29 10:47:43 +02:00
artemp
f5d6af4bb8 agg - make cover unsigned to avoid left shift of negative values ref #3406 2016-04-26 15:30:50 +02:00
artemp
31e8cfc659 improve hash calc ref #3406 2016-04-26 15:29:27 +02:00
artemp
4b3b62a40c minor formatting 2016-04-25 20:43:40 +02:00
artemp
650e8eea8a bump up version to 3.0.12 in preparation to release 2016-04-25 20:43:40 +02:00
Dane Springmeyer
fca1075fec fix documentation for mapnik-render --open command - refs #3375 [skip ci] 2016-04-25 09:56:40 -07:00
artemp
9833bfb9ad make opening rendered image an optional op ( ref #3374) 2016-04-25 16:39:09 +02:00
artemp
49b23622db Don't compile visitor ref #3380 (thanks @lightmare) 2016-04-25 14:58:46 +02:00
artemp
988aa3ea43 add guard to get_object_severity ref #3322 2016-04-25 11:49:10 +02:00
artemp
be06a2d301 require boost >= 1.58 for spatially_equal(geom_0, geom_1) test ref #3380 2016-04-25 11:20:23 +02:00
artemp
1871e5f62d return EXIT_FAILURE on invalid input ref #3410 2016-04-25 10:11:55 +02:00
artemp
ed87cd2883 c++ - make bbox standalone method 2016-04-22 12:54:57 +02:00
artemp
4611d8cad1 c++ style : prefix increment 2016-04-22 12:54:57 +02:00
artemp
a89c3fc007 c++ - make bbox standalone method 2016-04-22 12:51:20 +02:00
artemp
51069fe88a c++ style : prefix increment 2016-04-22 12:50:32 +02:00
Dane Springmeyer
e5fafd31d1 skip boost check when cross compiling [skip ci] 2016-04-21 09:04:38 -07:00
Dane Springmeyer
2a46e4517a Add minimum recommended GDAL version to INSTALL.md - refs #3339 [skip ci] 2016-04-20 12:19:16 -07:00
Dane Springmeyer
00fbc29e9d Merge pull request #3376 from pnorman/patch-5
Use relative path for INSTALL.md
2016-04-20 11:50:27 -07:00
artemp
4e57f7b115 Merge branch 'master' into geometry-refactor 2016-04-20 16:45:08 +02:00
artemp
6105463602 split box2d<T> implementation into *.hpp, *._impl.hpp and *.cpp ref #3405 2016-04-20 10:51:33 +02:00
Dane Springmeyer
b0894bfda3 fix debug assert compile 2016-04-18 08:06:30 -07:00
artemp
633a2c1e07 Merge branch 'master' into geometry-refactor 2016-04-18 16:15:04 +02:00
artemp
66160e9754 mapnik::util::is_clockwise - translate coordinates relative to the origin (0,0) to avoid numeric precision issues while using double precision.
(ref #3402)
2016-04-18 16:08:30 +02:00
artemp
c8902ac875 remove is_clockwise, use mapnik::util::is_clockwise to avoid duplication 2016-04-18 11:16:32 +02:00
artemp
9caac23d3c remove bogus fwd decl 2016-04-12 14:56:32 +02:00
artemp
271b70f960 geometry - template on container type + move multi geometries into separate headers 2016-04-12 14:49:23 +02:00
artemp
2106d7b162 remove debug stderr 2016-04-12 14:48:24 +02:00
artemp
2e0d83aa91 geometry::multi_point - derive from std::vector<point<T>> instead of line_string<T> 2016-04-12 10:12:16 +02:00
artemp
fb385180cf include what you need 2016-04-12 09:27:37 +02:00
artemp
0f711c0863 geometry - move point/line_string/polygon into separate headers 2016-04-12 09:17:53 +02:00
Dane Springmeyer
15acb2b23f Add missing files after revert 2016-04-11 17:58:58 -07:00
Dane Springmeyer
c5d73a03cc pin mason in mason_latest.sh script [skip ci] 2016-04-11 16:50:09 -07:00
Dane Springmeyer
11487e681f amend f8a8ec616a by fixing invalid search and replace 2016-04-11 16:45:11 -07:00
Dane Springmeyer
abe943c983 revert geometry changes for now - will develop them in branch to reduce downstream breakage 2016-04-11 14:00:27 -07:00
Dane Springmeyer
0025f70a6b ensure geometry folder of headers is installed 2016-04-11 12:33:34 -07:00
artemp
19722595a9 move include/mapnik/geometry_fusion_adapted.hpp -> include/mapnik/geometry/fusion_adapted.hpp 2016-04-11 15:22:41 +02:00
artemp
caa03d78bd move geometry_adapters.hpp to geometry/boost_geometry_adapters.hpp 2016-04-11 15:14:52 +02:00
artemp
b24ade9a1c remove stderr for real 2016-04-11 13:08:19 +02:00
artemp
fa717bc698 Remove bogus updates from 90f06093ae "geometry - move point/line_string/polygon into separate headers" 2016-04-11 12:35:19 +02:00
artemp
90f06093ae geometry - move point/line_string/polygon into separate headers 2016-04-11 12:23:11 +02:00
artemp
c6425b8027 cleanup + make operator==, operator!= standalone 2016-04-08 10:43:06 +02:00
artemp
5f00171d3d fix warning: using namespace directive in global context in header [-Wheader-hygiene] warnings 2016-04-08 10:41:50 +02:00
artemp
9705844399 fix operator==,operator!= impl 2016-04-08 10:08:16 +02:00
artemp
8bc4b28a76 small formatting 2016-04-06 11:36:18 +02:00
artemp
ccf26a743d remove extra ; 2016-04-06 11:35:49 +02:00
Dane Springmeyer
585de5956b Merge pull request #3395 from mapnik/register-gdal-once
register gdal once at plugin load
2016-04-05 20:53:25 -04:00
Dane Springmeyer
8339202279 remove debug print 2016-04-05 17:24:12 -04:00
Dane Springmeyer
7ec640e989 register gdal once at plugin load - refs #3093 #3339 #3340 2016-04-05 16:43:07 -04:00
Dane Springmeyer
61cb4effb8 more explicit name for callback type from dlsym 2016-04-05 15:31:19 -04:00
Dane Springmeyer
f8a8ec616a c++ style: use nullptr rather than NULL 2016-04-05 15:27:32 -04:00
artemp
2cbb9f480a deduce box_type from T 2016-04-05 18:26:31 +02:00
artemp
0e07e5b5aa more update CHANGELOG for mapnik v3.0.11 release [skip ci] 2016-04-04 09:24:25 +02:00
artemp
8c4892a31a update CHANGELOG for mapnik v3.0.11 release [skip ci] 2016-04-01 19:00:59 +02:00
Artem Pavlenko
8d9dc27355 Merge pull request #3390 from mapnik/bare-strings
Bare strings
2016-04-01 18:33:44 +02:00
artemp
aac523f80e add no_skip directive in unquoted_ustring rule (ref: https://github.com/mapnik/mapnik/pull/3389#issuecomment-204344223) 2016-04-01 12:54:40 +02:00
artemp
751b691ff6 move unquoted_string to the end, remove ustring from top rule 2016-04-01 11:14:47 +02:00
artemp
890a5cff17 add back support for bare (unquoted strings) 2016-04-01 10:52:13 +02:00
artemp
5b6b64fc5a Merge branch 'string-concat-tests' 2016-04-01 10:36:58 +02:00
mapsam
c1b1e3d8f9 concatenating strings & values currently fails 2016-03-31 15:36:47 -07:00
artemp
7931295d33 quad_tree - fix offsets 2016-03-31 12:40:34 +02:00
artemp
51c1ed16ef c++ format 2016-03-31 11:22:40 +02:00
artemp
99bfd03b22 spatial_index - make generic 2016-03-31 11:21:57 +02:00
artemp
4faa9896bb quad_tree - make more generic by templating on bounding box type 2016-03-31 11:20:41 +02:00
Dane Springmeyer
5017740fbb [travis][osx] dodge Homebrew/homebrew#35240 2016-03-29 17:16:18 -07:00
artemp
7cd5301cbe mapnik-index - refactor to use box2d<float> and reduce memory requirement during index creations 2016-03-24 17:12:16 +00:00
artemp
450533ebc6 move boost::phoenix usage into _impl.hpp 2016-03-24 17:11:06 +00:00
artemp
b73a42131a box2<T> - add converting ctor 2016-03-24 17:08:44 +00:00
artemp
9bb20ce685 box2d<T> - expose value_type typedef + init(x, y) convinient method 2016-03-24 14:50:46 +00:00
lightmare
2239c805e5 Merge pull request #3382 from strk/nodata_for_datarasters
Fix reading nodata value for data rasters
2016-03-23 21:45:44 +01:00
Sandro Santilli
cdc800b086 Fix setting of nodata value for grayscale rasters 2016-03-23 20:28:58 +01:00
Sandro Santilli
f72baaade1 Declare variables where used/needed 2016-03-23 20:27:59 +01:00
Sandro Santilli
c3b8bbe511 Fix build 2016-03-23 18:59:00 +01:00
Sandro Santilli
ca5f92ab03 Fix reading nodata value for data rasters 2016-03-23 18:30:57 +01:00
artemp
0b18144859 GeoJSON - make extract_bounding_box grammar configurable 2016-03-23 11:28:51 +00:00
Paul Norman
8de584acad Use relative path for INSTALL.md 2016-03-21 13:56:27 -07:00
artemp
0fb587875e enable box2d<float> 2016-03-21 11:51:32 +01:00
artemp
7b0740c3b7 remove unused symbolizer_grammar.hpp (ref #3343) 2016-03-18 18:52:17 +01:00
Dane Springmeyer
342b78dc52 more trimming of unneeded phoenix includes - refs #3343 2016-03-18 09:51:17 -07:00
Dane Springmeyer
dc18051d80 minor optimization: call vector.reserve [skip ci] 2016-03-18 09:26:16 -07:00
Dane Springmeyer
a473abf1c7 remove unneeded includes [skip ci] 2016-03-18 09:26:16 -07:00
artemp
26f7856e83 grid - restore missing simplify_tag in process_polygon_pattern_symbolizer (ref #3329) 2016-03-18 16:38:38 +01:00
artemp
35190e81e0 rename open to is_open in utils/mapnik-index/process_geojson_file.cpp 2016-03-18 10:42:35 +01:00
artemp
8f9134c72d file_io - rename open to is_open to be consistent with STL i/o via @lightmare (0d032c2618 (commitcomment-16753722)) 2016-03-18 10:02:19 +01:00
artemp
3d555982fd file_io - make operator bool() explicit via @lightmare (0d032c2618 (commitcomment-16753722)) 2016-03-18 09:51:57 +01:00
artemp
7ad568b54a topojson test - add feature_generator 2016-03-17 15:10:29 +01:00
artemp
04890c4915 topojson - move feature_generator into topojson_utils.hpp 2016-03-17 14:36:53 +01:00
artemp
f65fae66ba topojson test - check bounding box is valid 2016-03-17 14:22:29 +01:00
artemp
0c2558c154 topojson bounding_box - fix multi_point logic (remove bogus if (num_arcs_ > 0) condition) 2016-03-17 14:19:29 +01:00
artemp
47e43a1faa update test data 2016-03-17 12:53:40 +01:00
artemp
ed37ff4b89 basic TopoJSON parsing tests (work-in-progress) 2016-03-17 12:52:35 +01:00
artemp
0d032c2618 mapnik:util::file_io - add bool operator bool() for STL I/O compatibility 2016-03-17 11:56:23 +01:00
Dane Springmeyer
ce3a78afc4 fix quoting in triggered commit json [skip ci] 2016-03-16 17:08:32 -07:00
Dane Springmeyer
706108e95c [travis] automatically trigger builds of python-mapnik after successful linux build - refs #3366 2016-03-16 17:01:28 -07:00
Dane Springmeyer
9ab832d792 [mason package] fix libmapnik id one last time :) 2016-03-16 16:29:48 -07:00
Dane Springmeyer
ce88fc51f7 [mason package] fix libmapnik id 2016-03-16 16:10:10 -07:00
Dane Springmeyer
d2239e7514 [travis] use consistent install prefix 2016-03-16 15:51:40 -07:00
Dane Springmeyer
1e46f1155f write to /tmp for default prefix 2016-03-16 15:34:00 -07:00
Dane Springmeyer
5ddf4cf01a [mason package] avoid needing sudo on linux 2016-03-16 15:24:04 -07:00
Dane Springmeyer
62931d0fc6 fix mason publish 2016-03-16 15:16:03 -07:00
Dane Springmeyer
274a4284c9 [mason package] install_name_tool fixes 2016-03-16 15:00:54 -07:00
Dane Springmeyer
25d30785aa [mason package] fix loader_path when publishing locally 2016-03-16 14:44:30 -07:00
Dane Springmeyer
c22d0ac97f simplify mason_latest.sh publishing 2016-03-16 13:49:46 -07:00
Dane Springmeyer
087add2c71 Remove MAPNIK_BUNDLED_SHARE_DIRECTORY build option
- this was intended to be used by python-mapnik
 - but it is not currently, so let's clean it up
 - todo: get actual ICU_DATA,PROJ_LIB,GDAL_DATA values from those depependent libs
2016-03-16 13:48:26 -07:00
artemp
61bcecbe95 WKB/TWKB - add reading tests for all geometry types 2016-03-16 15:06:27 +01:00
artemp
98a37d9c7a add well-known geometries in WKT, WKB, TKWB formats 2016-03-16 15:05:35 +01:00
artemp
d0e2a5b7d9 parse_hex - helper method 2016-03-16 15:04:42 +01:00
artemp
db9b3f46af create an geometry_empty when input WKB has x and y set to NaN
e.g `\x0101000000000000000000f87f000000000000f87f => mapnil::geometry::geometry_empty`
2016-03-16 14:52:42 +01:00
artemp
d5eb6c8ddf remove unused headers and codex 2016-03-16 09:52:43 +01:00
Dane Springmeyer
f50111d979 use latest test data 2016-03-15 16:10:27 -07:00
artemp
b164e010fd topojson_grammar - don't allocate generic_json structure holding boost::spirit::qi rules on stack (ref #3361) 2016-03-15 17:19:16 +01:00
artemp
29f19fe6bc update test data 2016-03-15 13:36:02 +01:00
artemp
b2fda7e17f [CORRECTED] sv_utils - check and skip processing lines consisting only of 0xa (windows) ( fixes #3359 ) 2016-03-15 13:03:48 +01:00
artemp
96b96c745d Revert "csv_utils - check and skip processing lines consisting only of 0xa (windows) ( fixes #3359 )"
This reverts commit 9c09f15de9.
2016-03-15 13:01:54 +01:00
artemp
9c09f15de9 csv_utils - check and skip processing lines consisting only of 0xa (windows) ( fixes #3359 ) 2016-03-15 12:26:00 +01:00
bergwerkgis
7044177af0 [skip travis] fix appveyor.yml syntax #2 2016-03-15 08:22:43 +00:00
bergwerkgis
fd99c7c3ae [skip travis] fix appveyor.yml syntax 2016-03-15 08:19:18 +00:00
bergwerkgis
0633e2794f [skip travis] AppVeyor: try another approach to visual test artifacts 2016-03-15 08:13:38 +00:00
bergwerkgis
ca98ce3d9a [skip travis] AppVeyor: try to add visual test images to artifacts 2016-03-15 07:27:00 +00:00
lightmare
787cc4d5e3 Merge pull request #3363 from lightmare/fix-empty-string-to-expr
fix empty string value to_expression_string => pair of quotes
2016-03-15 02:28:53 +01:00
Mickey Rose
a981f560b6 fix empty string value::to_expresssion_string 2016-03-15 00:29:17 +01:00
Mickey Rose
344e62e7db expressions_test: add empty string round-trip check 2016-03-15 00:26:21 +01:00
Dane Springmeyer
4a2ececea4 make bootstrap.sh executable 2016-03-14 15:59:28 -07:00
Dane Springmeyer
9e6b6a2670 [circleci] fix bootstrap.sh call [skip ci] 2016-03-14 15:39:27 -07:00
Dane Springmeyer
2b747db199 [circleci] fix multiline yaml syntax [skip ci] 2016-03-14 15:37:35 -07:00
Dane Springmeyer
18ac7444a6 [circleci] fix multiline yaml syntax [skip ci] 2016-03-14 15:21:36 -07:00
Dane Springmeyer
03f2d8563a [circleci] try catching apt packages [skip ci] 2016-03-14 14:55:08 -07:00
Dane Springmeyer
ba7e78ac7d [circleci] build mapnik before testing so that ccache dir is saved [skip ci] 2016-03-14 14:38:10 -07:00
Dane Springmeyer
5a9c6ae0f7 [bootstrap] avoid unbound variable [skip ci] 2016-03-14 14:02:32 -07:00
Dane Springmeyer
3481377a18 [circleci] initialize postgis database 2016-03-14 13:33:52 -07:00
Dane Springmeyer
742ad0748f [circleci] init submodules 2016-03-14 10:32:40 -07:00
Dane Springmeyer
d026d38047 [circleci] correct ccache path 2016-03-14 10:28:52 -07:00
Dane Springmeyer
75b57ab960 [circleci] use clang-3.7 2016-03-14 10:21:35 -07:00
Dane Springmeyer
b70fed842e [circleci] use clang-3.8 2016-03-14 10:15:39 -07:00
Dane Springmeyer
eb34d19c9f [circleci] upgrade to clang++-3.5 2016-03-14 08:46:29 -07:00
Dane Springmeyer
da8384310e add circleci config 2016-03-14 08:40:20 -07:00
artemp
7d4f894d98 postgis.input - add support for TWKB (https://github.com/TWKB/Specification/blob/master/twkb.md) via https://github.com/CartoDB/mapnik/tree/2.3.x.cartodb ref #3355 2016-03-14 12:12:54 +01:00
Dane Springmeyer
2204a983c6 [test][windows] use utf8 encoding + stop using non-portable path comparison 2016-03-12 08:59:54 -08:00
Dane Springmeyer
632dd7e76d [test][windows] ensure reader is destroyed before trying to remove file - refs #3359 2016-03-12 08:58:53 -08:00
Dane Springmeyer
c18e086026 [csv test][windows] fix string comparison issues on windows 2016-03-11 20:07:54 -08:00
Dane Springmeyer
df62c07a68 [io test] [windows] create directories recursively 2016-03-11 20:07:31 -08:00
Dane Springmeyer
78442547f8 fix directory assertion logic 2016-03-11 18:24:22 -08:00
Dane Springmeyer
b14d525968 write images to custom tmp directory and create it first 2016-03-11 18:08:35 -08:00
Dane Springmeyer
cd9b214d55 fix test runner 2016-03-11 18:08:08 -08:00
Dane Springmeyer
280978c422 [travis] Stop building/running OS X tests to try to finish before 50 min 2016-03-11 17:53:57 -08:00
Dane Springmeyer
0656e02ea0 clean up test binaries if not building them again [skip ci] 2016-03-11 17:52:07 -08:00
Dane Springmeyer
28c7cc548c [appveyor] initialize all submodules 2016-03-11 17:14:10 -08:00
Dane Springmeyer
5aff870e2d MAPNIK_DECL is invalid in plugins - proper fix is mapnik/mapnik-gyp@395a1b8 2016-03-11 15:51:14 -08:00
Dane Springmeyer
89db790dda rename parse_csv function to avoid confusion in inheritance 2016-03-11 14:23:16 -08:00
Dane Springmeyer
559ef78aca more agg ignores [skip ci] 2016-03-11 13:48:51 -08:00
Dane Springmeyer
d1b594e886 more agg ignores [skip ci] 2016-03-11 13:44:30 -08:00
artemp
1b207ae274 csv_util - move implementation details to .cpp 2016-03-11 16:49:26 +01:00
artemp
1f61aa3981 TWKB - port CartoDB implementation to mapnik 3.x.x
ref https://github.com/CartoDB/mapnik/blob/2.3.x.cartodb/plugins/input/postgis/postgis_utils.cpp
ref https://github.com/CartoDB/mapnik/tree/2.3.x.cartodb/plugins/input/postgis#23xcartodb
2016-03-11 16:20:07 +01:00
Dane Springmeyer
f9397e7e66 fix mason re-checkout [skip ci] 2016-03-10 17:48:20 -08:00
Dane Springmeyer
bb0565d4d8 pin mason to avoid breakage from upcoming improvements - refs mapbox/mason#131 2016-03-10 16:25:54 -08:00
Dane Springmeyer
1a10f271d8 ignore -Wfloat-equal from third party headers [skip ci] 2016-03-10 16:07:30 -08:00
Dane Springmeyer
228513cf3e back off -Wold-style-cast -Wreserved-id-macro -Wmissing-noreturn for now 2016-03-10 13:41:51 -08:00
Dane Springmeyer
1582f681ae fix -Wheader-hygiene warnings 2016-03-10 13:40:48 -08:00
Dane Springmeyer
821c4d2115 ignore warnings older compilers don't know 2016-03-10 13:00:29 -08:00
Dane Springmeyer
a1ffbe1ec8 suppress warnings from image_io libs 2016-03-10 12:58:29 -08:00
Dane Springmeyer
8f4e211ebd suppress more third party warnings 2016-03-10 12:46:00 -08:00
Dane Springmeyer
192f5c26c1 use c++ style casts 2016-03-10 12:45:47 -08:00
Dane Springmeyer
51cabe0d34 ignore -Wshadow from agg 2016-03-10 11:45:48 -08:00
Dane Springmeyer
c715b142ec suppress more third party warnings 2016-03-10 11:44:44 -08:00
Dane Springmeyer
9dd07fd40b use c++ style casts 2016-03-10 11:44:23 -08:00
Dane Springmeyer
aa8c543744 use c++ style casts 2016-03-10 11:44:01 -08:00
artemp
f90f6d83c6 update deps / ref https://github.com/mapbox/variant/issues/96 2016-03-10 11:59:49 +01:00
Dane Springmeyer
3985014c04 Add agg warning suppression header 2016-03-09 17:42:24 -08:00
Dane Springmeyer
57dbd77819 more warning_ignore usage - refs #2907 2016-03-09 16:43:00 -08:00
Dane Springmeyer
341db51aa7 finish wrapping boost includes to suppress warnings - add agg wrapper - refs #2907 2016-03-09 16:42:15 -08:00
Dane Springmeyer
7ae0e6d902 share stringify macro from common header 2016-03-09 16:16:14 -08:00
Dane Springmeyer
2eb24c970a avoid -Wdeprecated and -Wreserved-id-macro warnings 2016-03-09 16:11:17 -08:00
artemp
609fab5ab1 windows - MAPNIK_DECL csv_file_parser 2016-03-09 14:27:47 +01:00
artemp
bde9e61e21 split csv_line_grammar into *.hpp *_impl.hpp ref #3343 2016-03-09 12:26:07 +01:00
artemp
1c29054dea csv_grammar - use expectation directives throughout 2016-03-09 12:26:07 +01:00
artemp
e3bd74aa55 remove unused phoenix include 2016-03-09 12:26:07 +01:00
Jiri Drbalek
401e89ad3b update changelog after https://github.com/mapnik/mapnik/pull/3349 2016-03-08 14:30:08 +00:00
artemp
d030fdd667 bump version to 3.0.11 2016-03-07 19:17:36 +01:00
Dane Springmeyer
09f4de1e95 [travis] remove syntax that still breaks on osx [skip ci] 2016-03-07 10:13:45 -08:00
artemp
3fab234e0a update visual data submodule 2016-03-07 15:26:31 +01:00
Artem Pavlenko
cd3e484c04 Merge pull request #3349 from mapycz/raster-resample-division-by-zero
Raster resample division by zero
2016-03-07 14:54:44 +01:00
artemp
ff9cceeb9f use platform specific macros as return codes (EXIT_SUCCESS/EXIT_FAILURE) + check if extent read from shapefile is valid and has valid width and heoght before creating an index. 2016-03-07 13:52:58 +01:00
artemp
6856100433 box2d operator<< - output "box2d(INVALID)" for invalid box. 2016-03-07 13:51:50 +01:00
artemp
8dca8d3001 Merge branch 'lightmare-markers-placements-union' 2016-03-07 10:41:13 +01:00
Mickey Rose
e75feceaca markers_placement_finder: dispatch by switch(placement_type) 2016-03-06 13:18:25 +01:00
Mickey Rose
f96631f8e4 un-template markers_basic_placement
- move Locator/Detector-dependent stuff back to markers_point_placement
- slightly reduces library size, by about 20% of what #3338 added
2016-03-05 19:33:22 +01:00
Dane Springmeyer
fe57454029 [travis] fix invalid bash on osx [skip ci] 2016-03-04 15:27:41 -08:00
Dane Springmeyer
11dbd9c463 remove earlier debug 2016-03-04 13:41:52 -08:00
Dane Springmeyer
82c862d90c more ccache debugging 2016-03-04 13:41:15 -08:00
Dane Springmeyer
3591c137a5 upgrade ccache 2016-03-04 13:38:45 -08:00
Dane Springmeyer
efa31c6556 debug ccache - refs #3350 2016-03-04 12:59:49 -08:00
Dane Springmeyer
37b26c28b6 disable benchmarks from running on travis - refs #3351 2016-03-04 12:36:57 -08:00
Dane Springmeyer
c80c7d27bb Fix ccache stomping - refs #3350 2016-03-04 12:09:09 -08:00
Dane Springmeyer
f90cef44c3 [travis] switch coverage run to linux - closes #3344 2016-03-04 11:29:05 -08:00
Jiri Drbalek
d4ac105eca raster scaling: use mapnik::safe_cast, fixes clipping negative floats 2016-03-04 16:59:12 +00:00
Jiri Drbalek
f1f65664cd raster scaling: a bit of optimization 2016-03-04 15:14:01 +00:00
Jiri Drbalek
1054e1bddb raster scaling: check for division by zero 2016-03-04 15:13:55 +00:00
artemp
71af6a8fe3 css_color_grammar + image_filters_grammar - move phoenix into ctors 2016-03-04 15:53:15 +01:00
artemp
a5cfd27594 split svg_path_grammar,svg_points_grammar,svg_transform_grammar into *.hpp, *_impl.hpp + move boost::phoenix::function initialisation into ctor's
(ref #3343)
2016-03-04 15:34:45 +01:00
Jiri Drbalek
4d402c5ef1 raster scaling: fix accessing out of bounds pixels 2016-03-04 13:55:01 +00:00
artemp
76bb2d9c01 make svg_transform_grammar stateless ref #3343
(https://github.com/mapnik/mapnik/pull/2231)
2016-03-04 13:15:11 +01:00
artemp
4659f40401 make svg_path_grammar and svg_points_grammar stateless ref #3343
(https://github.com/mapnik/mapnik/pull/2231)
2016-03-04 12:42:44 +01:00
artemp
12aec35e2f GeoJSON feature_grammar - make ctor explicit 2016-03-04 11:35:38 +01:00
artemp
4f8bc40b83 update old boost::phoenix syntax 2016-03-04 10:25:03 +01:00
Dane Springmeyer
23fb010ea2 disable dlclose when building with --coverage - refs #3344 2016-03-03 15:02:03 -08:00
Dane Springmeyer
833703026d add COVERAGE configure option - only set coverage flags on libmapnik and plugins - refs #3344 2016-03-03 14:19:12 -08:00
Dane Springmeyer
fde36984de minor unit test cleanups to prepare to test amalgamation 2016-03-03 10:53:58 -08:00
Dane Springmeyer
4173fff42c add svg parsers to pre-compile [skip ci] 2016-03-03 10:15:29 -08:00
Dane Springmeyer
a855a12532 make code comment about needing immutable grammars - refs #3342 [skip ci] 2016-03-03 09:14:06 -08:00
Dane Springmeyer
4c369f7b68 add more files to pre-build that take a long time [skip ci] 2016-03-03 08:05:05 -08:00
Dane Springmeyer
9adafd71df avoid -Wshadow warning from boost [skip ci] 2016-03-03 07:36:33 -08:00
artemp
cbef855743 spirit grammars - move BOOST_FUSION_ADAPT_ADT into implementation files (*_impl.hpp) + reduce boost::phoenix includes to make headers lighter to include 2016-03-03 11:50:41 +01:00
Mickey Rose
ec2c5ddbdc gdal: RAII + minor cleanup 2016-03-03 01:48:07 +01:00
Mickey Rose
489631ca34 remove reference on template parameter Detector 2016-03-03 00:17:41 +01:00
Mickey Rose
c8e3a0d549 refactor render_markers_symbolizer_visitor
- extract some common code into functions
- for cleaner dif: git show -w --patience
2016-03-03 00:07:18 +01:00
Dane Springmeyer
b5ac75cdf0 MAPNIK_DECL breaks on windows when compiled into static libmapnik-json.a 2016-03-02 13:56:01 -08:00
lightmare
80d9aebb79 Merge pull request #3340 from lightmare/gdal-register-once
call GDALAllRegister once, from one thread only
2016-03-02 22:19:07 +01:00
Dane Springmeyer
296f8d467d avoid grammar_impl usage in headers - other minor refactoring around json spirit 2016-03-02 12:48:07 -08:00
Dane Springmeyer
024cb86eff travis osx machines have 2 cores, so let's limit to 4 jobs 2016-03-02 12:47:32 -08:00
Dane Springmeyer
4edb57bf11 Merge pull request #3315 from mapnik/faster-csv-compile
Speed up CSV plugin / mapnik-index compile
2016-03-02 12:22:16 -08:00
Mickey Rose
d4566c28d2 gdal: only register drivers once
- refs #3339, #3093
2016-03-02 21:21:59 +01:00
Dane Springmeyer
10a9dba143 trim includes in json/error_handler.hpp 2016-03-02 12:17:12 -08:00
Dane Springmeyer
d148a966c8 from_geojson/to_geojson are now used in unit tests, csv plugin, and node-mapnik so move these to cpp 2016-03-02 11:26:56 -08:00
Dane Springmeyer
72459b3140 Merge branch 'master' of github.com:mapnik/mapnik into faster-csv-compile 2016-03-02 11:10:23 -08:00
Dane Springmeyer
31171824ec Merge pull request #3326 from lightmare/faster-csv-compile
merge mapnik-index::process_csv_file and csv_datasource::parse_csv
2016-03-02 10:47:05 -08:00
artemp
9138d64725 value.hpp - fix error C2375: redefinition; different linkage 2016-03-02 17:15:05 +01:00
artemp
a549803b5b to_utf8 : fix visibility via MAPNIK_DECL 2016-03-02 17:02:25 +01:00
artemp
f11cc5920f revive lost to_utf8 method but move it into '<mapnik/unicode.hpp>' 2016-03-02 16:47:55 +01:00
artemp
65da617ec0 re-use vector_converter + move apply_marker_multi into *.cpp 2016-03-02 16:20:10 +01:00
artemp
ff7d04f209 Merge branch 'lightmare-markers-placements-union' 2016-03-02 12:48:26 +01:00
Mickey Rose
66e7ef58d7 refactor markers_placement_finder
- refs #3327

Replace member variant of placement-type implementations with plain
union. The active implementation is chosen at construction time like
before.

Make placement-type implementation classes virtual to allow invoking
the active union member through a base class pointer.
2016-03-02 00:53:45 +01:00
artemp
77eaaa1259 move vertex_adapters implementation into .cpp - mark extern 2016-03-01 21:55:47 +01:00
artemp
053faa8a27 remove unused vars/cleanup 2016-03-01 20:49:54 +01:00
artemp
bb78b178cd reuse type 2016-03-01 20:37:23 +01:00
Mickey Rose
c21778fdfc merge mapnik-index::process_csv_file and csv_datasource::parse_csv
- the function in plugin was already configurable via flags, and only
  contained two un-conditioned blocks that process_csv_file didn't have

- so I extracted the common parts into a separate function (in a class
  holding the flags and state), process_csv_file calls it with default
  flags, plugin sets them from params

- removed namespace ::detail, moving stuff that was used outside
  csv_utils to ::csv_utils, and the rest to ::csv_utils::detail
2016-02-26 20:28:42 +01:00
artemp
63df9eecff unconditionally emit the SRID via @pnorman (https://github.com/mapnik/mapnik/pull/3319#issuecomment-189263651) 2016-02-26 14:14:47 +01:00
artemp
442cc281e1 use ST_MakeEnvelope (ref #3317) 2016-02-26 13:50:34 +01:00
Mickey Rose
aaffb1c771 don't #include .cpp, add it to sources 2016-02-25 11:58:38 +01:00
Dane Springmeyer
d1a4268eb6 remove unneeded includes - found with http://include-what-you-use.org 2016-02-24 22:39:50 -08:00
Dane Springmeyer
08d7bf2152 no need for template usage for autodect_csv_flavour 2016-02-24 22:24:24 -08:00
Dane Springmeyer
f2782d0b67 [csv] move spirit usage to cpp 2016-02-24 17:42:51 -08:00
Dane Springmeyer
8ffee05048 Merge branch 'master' of github.com:mapnik/mapnik into faster-csv-compile 2016-02-24 16:42:23 -08:00
Dane Springmeyer
85d4596769 move getline impl to separate header to avoid as much spirit inclusion 2016-02-15 19:06:11 -08:00
2693 changed files with 534195 additions and 85176 deletions

94
.clang-format Normal file
View file

@ -0,0 +1,94 @@
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveAssignments: None
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
# AlwaysBreakAfterReturnType:
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BitFieldColonSpacing: After
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: Always
AfterEnum: false # see AllowShortEnumsOnASingleLine
AfterFunction: true # see AllowShortFunctionsOnASingleLine
AfterNamespace: false
AfterStruct: true
AfterExternBlock: false
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: AfterComma
BreakStringLiterals: true
ColumnLimit: 120
CompactNamespaces: false
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DeriveLineEnding: true
EmptyLineAfterAccessModifier: Leave
EmptyLineBeforeAccessModifier: LogicalBlock
FixNamespaceComments: true
IncludeBlocks: Preserve
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: NoIndent
IndentPPDirectives: None
IndentRequires: true
IndentWidth: 4
IndentWrappedFunctionNames: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
# PackConstructorInitializers: CurrentLine # only clang-format > 14
PointerAlignment: Left
#QualifierAlignment: Left # only clang-format > 14
ReferenceAlignment: Left
ReflowComments: true
SortIncludes: Never
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeInheritanceColon: true
Standard: c++14
BinPackParameters: false
BreakBeforeInheritanceComma: false
IncludeCategories:
# Headers in <> without extension.
- Regex: '<([A-Za-z0-9\Q/-_\E])+>'
Priority: 1
# Headers in <> from specific external libraries.
- Regex: '<(boost)\/'
Priority: 2
# Headers in <> from specific external libraries.
- Regex: '<(mapnik)\/'
Priority: 3
# Headers in <> with extension.
- Regex: '<([A-Za-z0-9.\Q/-_\E])+>'
Priority: 4
# Headers in "" with extension.
- Regex: '"([A-Za-z0-9.\Q/-_\E])+"'
Priority: 5

1
.gitattributes vendored
View file

@ -1 +1,2 @@
*.svg text eol=lf *.svg text eol=lf
scons/** linguist-vendored

85
.github/actions/run_tests/action.yml vendored Normal file
View file

@ -0,0 +1,85 @@
name: Run tests with coverage
description: Runs all mapnik tests with coverage
inputs:
cmake-preset:
description: The used CMake preset
required: true
runs:
using: composite
steps:
- name: Set PROJ_LIB
shell: bash
run: |
cmake --preset ${{ inputs.cmake-preset }} -N -L | grep -o "PROJ_LIB=.*" >> ${GITHUB_ENV}
- name: Set TEST_WRAPPER (Windows)
if: runner.os == 'Windows'
shell: bash
run: |-
echo "TEST_WRAPPER=OpenCppCoverage \
--cover_children \
--export_type binary \
--modules '*.input' \
--modules '*libmapnik*' \
--modules 'mapnik*.exe' \
--quiet \
--sources '${{ github.workspace }}' \
--" >> ${GITHUB_ENV}
- name: Test
shell: bash
env:
UPDATE: 1
run: |
${TEST_WRAPPER:-} ctest --preset ${{ inputs.cmake-preset }}
- name: Test visuals
continue-on-error: true
working-directory: build/out
shell: bash
run: |
${TEST_WRAPPER:-} ./mapnik-test-visual -j ${CTEST_PARALLEL_LEVEL} --output-dir visual-test-result
- name: Pack visual test results
working-directory: build/out
shell: bash
run: |
tar -vzcf visual-test-results.tar.gz visual-test-result
- name: Upload visual test results
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.cmake-preset }}-visual-tests-${{ github.sha }}
path: build/out/visual-test-results.tar.gz
- name: Run Benchmarks (Linux & macOS)
working-directory: build/out
if: runner.os != 'Windows'
shell: bash
run: |
./run_benchmarks
- name: Collect coverage (Linux & macOS)
working-directory: build
if: runner.os != 'Windows'
shell: bash
run: |
if [ "${RUNNER_OS}" == "macOS" ]; then
LCOV_EXTRA_OPTIONS="--ignore-errors count,gcov,inconsistent,range,unused --keep-going"
fi
lcov ${LCOV_EXTRA_OPTIONS:-} --directory . --capture --output-file coverage.info
lcov ${LCOV_EXTRA_OPTIONS:-} --remove coverage.info '/usr/*' '*/vcpkg_installed/*' '/.cache/*' '*/test/*' --output-file coverage.info
lcov ${LCOV_EXTRA_OPTIONS:-} --list coverage.info
- name: Upload coverage to Codecov (Linux & macOS)
if: runner.os != 'Windows'
uses: codecov/codecov-action@v4
with:
files: build/coverage.info
- name: Upload coverage to Codecov (Windows)
if: runner.os == 'Windows'
uses: codecov/codecov-action@v4
with:
files: ctest.cov,build/out/mapnik-test-visual.cov

136
.github/workflows/build_and_test.yml vendored Normal file
View file

@ -0,0 +1,136 @@
name: Build and Test
on:
push:
branches:
- "*"
pull_request:
branches-ignore:
- "no-ci-*"
env:
VCPKG_BINARY_SOURCES: clear;x-gha,readwrite
VCPKG_RELEASE: 2024.06.15
jobs:
checkSource:
name: Check Source Code
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: pre-commit/action@v3.0.1
buildAndTest:
name: >-
Build & Test
(${{ matrix.os }})
(C++ ${{ matrix.cxx-standard }})
${{ startsWith(matrix.os, 'macos-') && (matrix.os == 'macos-14' && '(ARM64)' || '(AMD64)') || '' }}
needs: checkSource
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-14
- ubuntu-22.04
- windows-2022
cxx-standard:
- 17
steps:
- name: Checkout Mapnik
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout vcpkg
uses: actions/checkout@v4
with:
path: vcpkg
ref: ${{ env.VCPKG_RELEASE }}
repository: microsoft/vcpkg
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install required system packages
shell: bash
run: |
if [ "${RUNNER_OS}" == "Linux" ]; then
sudo apt-get update
sudo apt-get -y install \
autoconf \
autoconf-archive \
automake \
gperf \
lcov \
libxxf86vm-dev \
ninja-build \
postgresql-client
elif [ "${RUNNER_OS}" == "macOS" ]; then
brew install \
autoconf \
autoconf-archive \
automake \
lcov \
libtool \
ninja \
vcpkg
elif [ "${RUNNER_OS}" == "Windows" ]; then
choco install \
ninja \
OpenCppCoverage
echo "C:\Program Files\OpenCppCoverage" >> ${GITHUB_PATH}
fi
- name: Enable Developer Command Prompt (Windows)
uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
- name: Set CMAKE_BUILD_PARALLEL_LEVEL, CTEST_PARALLEL_LEVEL & PRESET
shell: bash
run: |
PRESET=$(echo "${RUNNER_OS}" | perl -ne "print lc")-ci
if [ "${RUNNER_OS}" == "Linux" ]; then
echo "CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)" >> ${GITHUB_ENV}
echo "CTEST_PARALLEL_LEVEL=$(nproc)" >> ${GITHUB_ENV}
elif [ "${RUNNER_OS}" == "macOS" ]; then
echo "CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.logicalcpu)" >> ${GITHUB_ENV}
echo "CTEST_PARALLEL_LEVEL=$(sysctl -n hw.logicalcpu)" >> ${GITHUB_ENV}
PRESET=${PRESET}-${{ matrix.os == 'macos-14' && 'arm64' || 'x64' }}
elif [ "${RUNNER_OS}" == "Windows" ]; then
echo "CMAKE_BUILD_PARALLEL_LEVEL=$(pwsh -Command '(Get-CimInstance -ClassName Win32_ComputerSystem).NumberOfLogicalProcessors')" >> ${GITHUB_ENV}
echo "CTEST_PARALLEL_LEVEL=$(pwsh -Command '(Get-CimInstance -ClassName Win32_ComputerSystem).NumberOfLogicalProcessors')" >> ${GITHUB_ENV}
fi
echo "PRESET=${PRESET}" >> ${GITHUB_ENV}
- name: Configure CMake
shell: bash
run: |
cmake \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_CXX_STANDARD:STRING=${{ matrix.cxx-standard }} \
-DUSE_MEMORY_MAPPED_FILE:BOOL=ON \
-LA \
--preset ${PRESET}
- name: Build
shell: bash
run: |
cmake \
--build \
--preset ${PRESET}
- name: Run Tests
uses: ./.github/actions/run_tests
with:
cmake-preset: ${{ env.PRESET }}

55
.github/workflows/release_linux.yml vendored Normal file
View file

@ -0,0 +1,55 @@
name: Release Linux
on:
push:
branches:
- "*"
pull_request:
branches-ignore:
- "no-ci-*"
env:
PRESET: linux-ci-release
jobs:
build:
runs-on: "ubuntu-22.04"
steps:
- name: checkout mapnik
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: "Install required system packages"
shell: bash
run: |
sudo apt update
sudo apt install -y ninja-build\
libicu-dev \
libfreetype6-dev \
libharfbuzz-dev \
libxml2-dev \
libjpeg-dev \
libtiff-dev \
libwebp-dev \
libcairo2-dev \
libproj-dev \
libgdal-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-regex-dev
- name: Configure CMake
run: cmake -LA --preset ${{ env.PRESET }}
- name: Build
run: cmake --build --preset ${{ env.PRESET }}
- name: Package
run: cmake --build --preset ${{ env.PRESET }} --target package
- name: Upload mapnik debian package
uses: actions/upload-artifact@v4
with:
name: ${{ env.PRESET }}-deb
path: build/mapnik-*.deb

7
.gitignore vendored
View file

@ -1,4 +1,6 @@
.DS_Store .DS_Store
.vscode
.cache
*.gcov *.gcov
*.gcda *.gcda
*.gcno *.gcno
@ -56,3 +58,8 @@ demo/viewer/ui_layer_info.h
test/standalone/*-bin test/standalone/*-bin
test/unit/run test/unit/run
test/visual/run test/visual/run
# cmake
build
.vs
CMakeUserPresets.json

12
.gitmodules vendored
View file

@ -9,3 +9,15 @@
[submodule "deps/mapbox/variant"] [submodule "deps/mapbox/variant"]
path = deps/mapbox/variant path = deps/mapbox/variant
url = https://github.com/mapbox/variant.git url = https://github.com/mapbox/variant.git
branch = master
[submodule "deps/mapbox/geometry"]
path = deps/mapbox/geometry
url = https://github.com/mapbox/geometry.hpp.git
branch = master
[submodule "deps/mapbox/protozero"]
path = deps/mapbox/protozero
url = https://github.com/mapbox/protozero.git
branch = master
[submodule "deps/mapbox/polylabel"]
path = deps/mapbox/polylabel
url = https://github.com/mapbox/polylabel.git

16
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,16 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
files: ^.*\.cmake|CMakeLists\.txt$
- id: end-of-file-fixer
files: ^.*\.cmake|CMakeLists\.txt$
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.3
hooks:
- id: clang-format
types_or: [c++, c]

View file

@ -1,93 +0,0 @@
language: c
sudo: false
git:
depth: 10
submodules: false
env:
global:
- secure: "N3a5nzzsgpuu45k8qWdYsHNxrSnqeAGLTOYpfYoAH7B94vuf7pa7XV1tQjXbxrnx2D6ryTdtUtyRKwy7zXbwXxGt4DpczWEo8f6DUd6+obAp3kdnXABg2Sj4oA7KMs0F0CmoADy0jdUZD5YyOJHu64LCIIgzEQ9q49PFMNbU3IE="
- secure: "iQYPNpMtejcgYeUkWZGIWz1msIco5qydJrhZTSCQOYahAQerdT7q5WZEpEo3G6IWOGgO1eo7GFuY8DvqQjw1+jC9b9mhkRNdo3LhGTKS9Gsbl5Q27k0rjlaFZmmQHrfPlQJwhfAIp+KLugHtQw5bCoLh+95E3j0F0DayF1tuJ3s="
addons:
postgresql: "9.4"
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
packages:
- clang-3.5
cache:
directories:
- $HOME/.ccache
matrix:
include:
- os: linux
compiler: clang
env: JOBS=8 CXX="ccache clang++-3.5 -Qunused-arguments" CC="clang-3.5" MASON_PUBLISH=true BENCH=True
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5' ]
packages: [ 'clang-3.5' ]
# OOM killer knocking out build on render_markers_symbolizer.cpp
#
#- os: linux
# compiler: gcc
# env: JOBS=6 CXX="ccache g++-4.9" CC="gcc-4.9"
# addons:
# apt:
# sources: [ 'ubuntu-toolchain-r-test' ]
# packages: [ 'gcc-4.9', 'g++-4.9', 'libstdc++-4.9-dev', 'libstdc++6' ]
- os: osx
compiler: clang
# https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions
osx_image: xcode7.2 # upgrades clang from 6 -> 7
env: JOBS=8 MASON_PUBLISH=true HEAVY_JOBS=3
- os: osx
compiler: clang
osx_image: xcode7.2 # upgrades clang from 6 -> 7
env: JOBS=8 COVERAGE=true HEAVY_JOBS=3
before_install:
- source scripts/travis-common.sh
- export PYTHONUSERBASE=$(pwd)/mason_packages/.link
- export PATH=${PYTHONUSERBASE}/bin:${PATH}
- export COVERAGE=${COVERAGE:-false}
- export MASON_PUBLISH=${MASON_PUBLISH:-false}
- export BENCH=${BENCH:-false}
- if [[ ${TRAVIS_BRANCH} != 'master' ]]; then export MASON_PUBLISH=false; fi
- if [[ ${TRAVIS_PULL_REQUEST} != 'false' ]]; then export MASON_PUBLISH=false; fi
- git_submodule_update --init --depth=10
install:
- on 'linux' export PYTHONPATH=${PYTHONUSERBASE}/lib/python2.7/site-packages
- on 'osx' export PYTHONPATH=${PYTHONUSERBASE}/lib/python/site-packages
- on 'osx' brew rm postgis --force
- on 'osx' brew install postgis --force
- on 'osx' pg_ctl -w start -l postgres.log --pgdata /usr/local/var/postgres
- on 'osx' createuser -s postgres
- psql -c 'create database template_postgis;' -U postgres
- psql -c 'create extension postgis;' -d template_postgis -U postgres
- enabled ${COVERAGE} pip install --user cpp-coveralls
before_script:
- source bootstrap.sh
- commit_message_parse
script:
- export SCONSFLAGS='--debug=time'
- configure BENCHMARK=${BENCH}
- make
- make test
- enabled ${COVERAGE} coverage
- enabled ${BENCH} make bench
after_success:
- if enabled ${MASON_PUBLISH}; then
./mason_latest.sh build &&
./mason_latest.sh link &&
./mason_latest.sh publish;
fi

File diff suppressed because it is too large Load diff

34
CITATION.cff Normal file
View file

@ -0,0 +1,34 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: mapnik
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Artem
family-names: Pavlenko
identifiers:
- type: url
value: 'https://github.com/mapnik/mapnik'
description: GitHub Repository
- type: swh
value: >-
swh:1:dir:3f5758e17e9d54016ca694268da68cf6856fab58
description: Software Archive
repository-code: 'https://github.com/mapnik/mapnik'
url: 'https://mapnik.org/'
abstract: >-
Mapnik is an open source toolkit for developing
mapping applications. At the core is a C++ shared
library providing algorithms and patterns for
spatial data access and visualization.
keywords:
- mapping
- gis
- cartography
- beautiful-maps
- rendering
license: LGPL-2.1

472
CMakeLists.txt Normal file
View file

@ -0,0 +1,472 @@
cmake_minimum_required(VERSION 3.15)
# 3.15 is required since the Boost::XXXX targets was first added. https://cmake.org/cmake/help/latest/module/FindBoost.html#imported-targets
# 3.14 is required since SQLite3 Module was first added. https://cmake.org/cmake/help/latest/module/FindSQLite3.html#findsqlite3
include(cmake/GetVersion.cmake)
get_mapnik_version()
project(mapnik
VERSION ${MAPNIK_MAJOR_VERSION}.${MAPNIK_MINOR_VERSION}.${MAPNIK_PATCH_VERSION}
HOMEPAGE_URL "https://mapnik.org/"
DESCRIPTION "Mapnik is an open source toolkit for developing mapping applications"
LANGUAGES CXX
)
message(STATUS "mapnik version: ${PROJECT_VERSION}")
# https://cliutils.gitlab.io/modern-cmake/chapters/features/ides.html
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL ON) # with newer cmake versions put all find_package in global scope
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(FeatureSummary)
include(MapnikOption)
include(MapnikMinimumVersions)
include(MapnikFindPackage)
include(MapnikInstall)
include(CTest)
add_feature_info(BUILD_TESTING BUILD_TESTING "Adds tests")
mapnik_option(INSTALL_DEPENDENCIES "if ON, all dependencies (eg. required dlls) will be copied into CMAKE_INSTALL_PREFIX/MAPNIK_BIN_DIR." ON)
mapnik_option(BUILD_SHARED_LIBS "build mapnik dynamic(ON) or static(OFF)" ON)
mapnik_option(BUILD_SHARED_PLUGINS "build dynamic plugins" ${BUILD_SHARED_LIBS}) # use BUILD_SHARED_LIBS as default option
mapnik_option(BUILD_SHARED_CRT "(only windows with msvc) use msvc shared crt" ON)
if(WIN32 AND BUILD_SHARED_PLUGINS AND NOT BUILD_SHARED_LIBS)
message(FATAL_ERROR "static libmapnik and dynamic plugins won't work correctly")
endif()
mapnik_option(USE_EXTERNAL_MAPBOX_GEOMETRY "Use a external mapnik/geometry.hpp. If off, use the submodule" OFF)
mapnik_option(USE_EXTERNAL_MAPBOX_POLYLABEL "Use a external mapnik/polylabel. If off, use the submodule" OFF)
mapnik_option(USE_EXTERNAL_MAPBOX_PROTOZERO "Use a external mapnik/protozero. If off, use the submodule" OFF)
mapnik_option(USE_EXTERNAL_MAPBOX_VARIANT "Use a external mapnik/variant. If off, use the submodule" OFF)
mapnik_option(USE_JPEG "adds jpeg support" ON)
mapnik_option(USE_PNG "adds png support" ON)
mapnik_option(USE_TIFF "adds tiff support" ON)
mapnik_option(USE_WEBP "adds webp support" ON)
mapnik_option(USE_LIBXML2 "adds libxml2 support" ON)
mapnik_option(USE_CAIRO "adds the cairo renderer" ON)
mapnik_option(USE_PROJ "adds proj support" ON)
mapnik_option(USE_GRID_RENDERER "adds grid renderer" ON)
mapnik_option(USE_SVG_RENDERER "adds svg renderer" ON)
mapnik_option(USE_BIGINT "uses 64 bit instead of 32" ON)
mapnik_option(USE_BOOST_FILESYSTEM "use boost::filesytem even if `std::filesystem` is available (since c++17)" OFF)
mapnik_option(USE_MEMORY_MAPPED_FILE "uses file cache" ON)
mapnik_option(USE_MULTITHREADED "enables the multithreaded features (threadsafe)" ON)
mapnik_option(USE_NO_ATEXIT "disable atexit" OFF)
mapnik_option(USE_NO_DLCLOSE "disable dlclose" OFF)
mapnik_option(USE_DEBUG_OUTPUT "enables some debug messages for development" OFF)
mapnik_option(USE_LOG "enables logging output. See log severity level." OFF)
# 0 = debug
# 1 = warn
# 2 = error
# 3 = none
set(USE_LOG_SEVERITY "1" CACHE STRING "sets the logging severity (only applies when USE_LOG is ON")
mapnik_option(USE_STATS "Enable statistics reporting" OFF)
mapnik_option(DISABLE_MAPNIK_AUTOSETUP "disables the autosetup. Need to call mapnik::setup() then" OFF)
mapnik_option(USE_PLUGIN_INPUT_CSV "adds plugin input csv" ON)
mapnik_option(USE_PLUGIN_INPUT_GDAL "adds plugin input gdal" ON)
mapnik_option(USE_PLUGIN_INPUT_GEOBUF "adds plugin input geobuf" ON)
mapnik_option(USE_PLUGIN_INPUT_GEOJSON "adds plugin input geojson" ON)
mapnik_option(USE_PLUGIN_INPUT_OGR "adds plugin input ogr" ON)
mapnik_option(USE_PLUGIN_INPUT_PGRASTER "adds plugin input pgraster" ON)
mapnik_option(USE_PLUGIN_INPUT_POSTGIS "adds plugin input postgis" ON)
mapnik_option(USE_PLUGIN_INPUT_RASTER "adds plugin input raster" ON)
mapnik_option(USE_PLUGIN_INPUT_SHAPE "adds plugin input shape" ON)
mapnik_option(USE_PLUGIN_INPUT_SQLITE "adds plugin input sqlite" ON)
mapnik_option(USE_PLUGIN_INPUT_TOPOJSON "adds plugin input topojson" ON)
mapnik_option(BUILD_DEMO_VIEWER "builds the demo viewer" ON)
mapnik_option(BUILD_DEMO_CPP "builds the demo c++ application" ON)
mapnik_option(BUILD_BENCHMARK "builds benchmark project" ON)
mapnik_option(BUILD_UTILITY_GEOMETRY_TO_WKB "builds the utility program geometry_to_wkb" ON)
mapnik_option(BUILD_UTILITY_MAPNIK_INDEX "builds the utility program mapnik_index" ON)
mapnik_option(BUILD_UTILITY_MAPNIK_RENDER "builds the utility program mapnik_render" ON)
mapnik_option(BUILD_UTILITY_OGRINDEX "builds the utility program ogrindex" OFF)
mapnik_option(BUILD_UTILITY_PGSQL2SQLITE "builds the utility program pgsql2sqlite" ON)
mapnik_option(BUILD_UTILITY_SHAPEINDEX "builds the utility program shapeindex" ON)
mapnik_option(BUILD_UTILITY_SVG2PNG "builds the utility program svg2png" ON)
mapnik_option(USE_BOOST_REGEX_ICU_WORKAROUND "if you don't use your system libraries and get double linked icu libraries set this to ON" OFF)
mapnik_option(USE_GLIBC_WORKAROUND "see https://github.com/mapnik/mapnik/pull/3792 if you building with libstdc++-4.9" OFF)
feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)
feature_summary(FILENAME "${CMAKE_CURRENT_BINARY_DIR}/features.log" WHAT ENABLED_FEATURES DISABLED_FEATURES)
include(GNUInstallDirs)
# See for more details: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html
set(MAPNIK_BIN_DIR ${CMAKE_INSTALL_BINDIR} CACHE STRING "Install directory for binaries")
set(MAPNIK_LIB_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING "Install directory for libraries")
set(MAPNIK_ARCHIVE_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING "Install directory for archives")
set(MAPNIK_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE STRING "Install directory for the headers")
set(MAPNIK_CMAKE_DIR ${MAPNIK_LIB_DIR}/cmake/mapnik CACHE STRING "Install directory of the cmake targets")
set(MAPNIK_PKGCONF_DIR ${MAPNIK_LIB_DIR}/pkgconfig CACHE STRING "Install directory for the .pc files for pkg-config")
set(MAPNIK_OUTPUT_DIR "${CMAKE_BINARY_DIR}/out")
if(WIN32)
set(DEFAULT_PLUGINS_INSTALL_DIR ${MAPNIK_BIN_DIR}/mapnik/input)
else()
set(DEFAULT_PLUGINS_INSTALL_DIR ${MAPNIK_LIB_DIR}/mapnik/input)
endif()
set(PLUGINS_INSTALL_DIR ${DEFAULT_PLUGINS_INSTALL_DIR} CACHE STRING "installs the plugins in the specified directory")
message(STATUS "Installing plugins to ${PLUGINS_INSTALL_DIR}")
set(FONTS_INSTALL_DIR ${MAPNIK_LIB_DIR}/mapnik/fonts CACHE STRING "installs the fonts in the specified directory")
message(STATUS "Installing fonts to ${FONTS_INSTALL_DIR}")
set(MAPNIK_COMPILE_DEFS "")
set(MAPNIK_OPTIONAL_LIBS "")
set(MAPNIK_OPTIONAL_LIBS_INCLUDE "")
#############################
#############################
# Begin project configuration
#############################
#############################
set(CMAKE_CXX_STANDARD 17 CACHE STRING "Sets the c++ standard. c++17 is minimum.")
set(CMAKE_CXX_STANDARD_REQUIRED ON) # require the specified CMAKE_CXX_STANDARD
set(CMAKE_CXX_EXTENSIONS OFF CACHE STRING "Enables the compiler specific extensions.") # Fallsback to -std=c++<ver> if off
message(STATUS "Using c++${CMAKE_CXX_STANDARD}")
message(STATUS "Using c++ extensions: ${CXX_EXTENSIONS}")
# add debug postfix to the libraries
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "sets the debug library postfix on mapnik, wkt and json")
message(STATUS "postfix for debug libraries: ${CMAKE_DEBUG_POSTFIX}")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib")
# needs to be before the first call of find_boost.
if(CMAKE_CXX_STANDARD VERSION_LESS 17)
list(APPEND MAPNIK_COMPILE_DEFS BOOST_SPIRIT_X3_HIDE_CXX17_WARNING)
endif()
if(USE_MULTITHREADED)
set(Boost_USE_MULTITHREADED ON)
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_THREADSAFE)
else()
set(Boost_USE_MULTITHREADED OFF)
endif()
mapnik_find_package(PkgConfig REQUIRED)
mapnik_find_threads()
mapnik_find_package(ICU REQUIRED COMPONENTS uc i18n data)
mapnik_find_package(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS regex)
if(CMAKE_CXX_STANDARD VERSION_LESS 17)
set(USE_BOOST_FILESYSTEM ON CACHE BOOL "Use boost::filesystem" FORCE)
endif()
if(USE_BOOST_FILESYSTEM)
mapnik_find_package(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS filesystem system)
endif()
list(APPEND MAPNIK_COMPILE_DEFS BOOST_REGEX_HAS_ICU)
if(USE_BOOST_REGEX_ICU_WORKAROUND)
message(STATUS "using boost regex workaround")
set_property(TARGET Boost::regex PROPERTY INTERFACE_LINK_LIBRARIES)
endif()
include(CheckBoostRegexIcu)
check_boost_regex()
if(BOOST_REGEX_HAS_ICU)
message(STATUS "boost regex has icu support")
list(APPEND MAPNIK_COMPILE_DEFS BOOST_REGEX_HAS_ICU)
endif()
mapnik_find_package(Freetype REQUIRED)
# try to find harfbuzz with the native configuration and fallback to our "own" FindHarfBuzz
mapnik_find_package(harfbuzz CONFIG QUIET)
if(harfbuzz_FOUND)
message(STATUS "Found harfbuzz native cmake")
list(APPEND MAPNIK_OPTIONAL_LIBS harfbuzz::harfbuzz)
else()
# Use pkg-config when harfbuzz is not found.
# It might be possible that in future version harfbuzz could only be found via pkg-config.
# harfbuzz related discussion: https://github.com/harfbuzz/harfbuzz/issues/2653
message(STATUS "harfbuzz not found via cmake. Searching via pkg-config...")
mapnik_pkg_check_modules(harfbuzz REQUIRED IMPORTED_TARGET harfbuzz>=${HARFBUZZ_MIN_VERSION})
list(APPEND MAPNIK_OPTIONAL_LIBS PkgConfig::harfbuzz)
endif()
if(USE_EXTERNAL_MAPBOX_GEOMETRY)
# this is used to provide a way to specify include dirs with CACHE VARIABLES
if(NOT MAPBOX_GEOMETRY_INCLUDE_DIRS)
message(STATUS "Searching for the include dir of mapbox/geometry.hpp")
find_path(MAPBOX_GEOMETRY_INCLUDE_DIRS "mapbox/geometry.hpp" REQUIRED)
endif()
else()
set(MAPBOX_GEOMETRY_INCLUDE_DIRS
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/deps/mapbox/geometry/include>
$<INSTALL_INTERFACE:include>
)
endif()
if(NOT MAPBOX_GEOMETRY_INCLUDE_DIRS)
message(FATAL_ERROR "Set -DMAPBOX_GEOMETRY_INCLUDE_DIRS to the mapbox/geometry.hpp include dir")
endif()
if(USE_EXTERNAL_MAPBOX_POLYLABEL)
if(NOT MAPBOX_POLYLABEL_INCLUDE_DIRS)
message(STATUS "Searching for the include dir of mapbox/polylabel")
find_path(MAPBOX_POLYLABEL_INCLUDE_DIRS "mapbox/polylabel.hpp")
endif()
else()
set(MAPBOX_POLYLABEL_INCLUDE_DIRS
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/deps/mapbox/polylabel/include>
$<INSTALL_INTERFACE:include>
)
endif()
if(NOT MAPBOX_POLYLABEL_INCLUDE_DIRS)
message(FATAL_ERROR "Set MAPBOX_POLYLABEL_INCLUDE_DIRS to the mapbox/geometry include dir")
endif()
if(USE_EXTERNAL_MAPBOX_PROTOZERO)
if(NOT MAPBOX_PROTOZERO_INCLUDE_DIRS)
message(STATUS "Searching for the include dir of mapbox/protozero")
find_path(MAPBOX_PROTOZERO_INCLUDE_DIRS "protozero/pbf_message.hpp")
endif()
else()
set(MAPBOX_PROTOZERO_INCLUDE_DIRS
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/deps/mapbox/protozero/include>
$<INSTALL_INTERFACE:include>
)
endif()
if(NOT MAPBOX_PROTOZERO_INCLUDE_DIRS)
message(FATAL_ERROR "Set MAPBOX_PROTOZERO_INCLUDE_DIRS to the mapbox/protozero include dir")
endif()
if(USE_EXTERNAL_MAPBOX_VARIANT)
if(NOT MAPBOX_VARIANT_INCLUDE_DIRS)
message(STATUS "Searching for the include dir of mapbox/variant")
find_path(MAPBOX_VARIANT_INCLUDE_DIRS "mapbox/variant.hpp")
endif()
else()
set(MAPBOX_VARIANT_INCLUDE_DIRS
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/deps/mapbox/variant/include>
$<INSTALL_INTERFACE:include>
)
endif()
if(NOT MAPBOX_VARIANT_INCLUDE_DIRS)
message(FATAL_ERROR "Set MAPBOX_VARIANT_INCLUDE_DIRS to the mapbox/variant include dir")
endif()
# (used by MapnikInstall.cmake. properties are needed since "set(...)" will be out of scope
set_property(GLOBAL PROPERTY TARGETS "")
set_property(GLOBAL PROPERTY PLUGINS "")
set_property(GLOBAL PROPERTY MAPNIK_UTILITIES "")
if(USE_GLIBC_WORKAROUND)
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_ENABLE_GLIBC_WORKAROUND)
endif()
if(USE_BIGINT)
list(APPEND MAPNIK_COMPILE_DEFS BIGINT)
endif()
if(USE_BOOST_FILESYSTEM)
list(APPEND MAPNIK_COMPILE_DEFS USE_BOOST_FILESYSTEM)
list(APPEND MAPNIK_OPTIONAL_LIBS Boost::filesystem)
endif()
if(USE_MEMORY_MAPPED_FILE)
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_MEMORY_MAPPED_FILE)
endif()
if(USE_NO_ATEXIT)
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_NO_ATEXIT)
endif()
if(USE_NO_DLCLOSE)
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_NO_DLCLOSE)
endif()
if(USE_DEBUG_OUTPUT)
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_DEBUG)
endif()
if(USE_LOG)
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_LOG MAPNIK_DEFAULT_LOG_SEVERITY=${USE_LOG_SEVERITY})
endif()
if(USE_STATS)
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_STATS)
endif()
if(USE_LIBXML2)
mapnik_find_package(LibXml2 REQUIRED)
list(APPEND MAPNIK_COMPILE_DEFS HAVE_LIBXML2)
list(APPEND MAPNIK_OPTIONAL_LIBS LibXml2::LibXml2)
endif()
if(USE_PNG)
mapnik_find_package(PNG REQUIRED)
list(APPEND MAPNIK_COMPILE_DEFS HAVE_PNG)
list(APPEND MAPNIK_OPTIONAL_LIBS PNG::PNG)
endif()
if(USE_JPEG)
mapnik_find_package(JPEG REQUIRED)
list(APPEND MAPNIK_COMPILE_DEFS HAVE_JPEG)
list(APPEND MAPNIK_OPTIONAL_LIBS JPEG::JPEG)
endif()
if(USE_TIFF)
mapnik_find_package(TIFF REQUIRED)
list(APPEND MAPNIK_COMPILE_DEFS HAVE_TIFF)
list(APPEND MAPNIK_OPTIONAL_LIBS TIFF::TIFF)
endif()
if(USE_WEBP)
mapnik_pkg_check_modules(WebP REQUIRED IMPORTED_TARGET libwebp)
list(APPEND MAPNIK_COMPILE_DEFS HAVE_WEBP)
list(APPEND MAPNIK_OPTIONAL_LIBS PkgConfig::WebP)
endif()
if(USE_CAIRO)
mapnik_pkg_check_modules(Cairo REQUIRED IMPORTED_TARGET cairo)
list(APPEND MAPNIK_COMPILE_DEFS HAVE_CAIRO)
list(APPEND MAPNIK_OPTIONAL_LIBS PkgConfig::Cairo)
endif()
if(USE_PROJ)
#https://proj.org/development/cmake.html
mapnik_find_package(PROJ QUIET)
# currently the cmake files are not installed, when installing proj via apt-get. So search via pkg-config
if(NOT PROJ_FOUND)
message(STATUS "PROJ not found via FindPROJ. Searching via pkg-config...")
mapnik_pkg_check_modules(PROJ REQUIRED IMPORTED_TARGET proj>=${PROJ_MIN_VERSION})
string(REGEX MATCH "([0-9]+)\.([0-9]+)\.([0-9]+)" _dummy "${PROJ_VERSION}")
set(PROJ_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(PROJ_VERSION_MINOR "${CMAKE_MATCH_2}")
set(PROJ_VERSION_PATCH "${CMAKE_MATCH_3}")
list(APPEND MAPNIK_OPTIONAL_LIBS PkgConfig::PROJ)
else()
if(PROJ_VERSION VERSION_LESS PROJ_MIN_VERSION)
message(FATAL_ERROR "Proj needs to be at least version ${PROJ_MIN_VERSION}")
endif()
list(APPEND MAPNIK_OPTIONAL_LIBS ${PROJ_LIBRARIES})
list(APPEND MAPNIK_OPTIONAL_LIBS_INCLUDE $<BUILD_INTERFACE:${PROJ_INCLUDE_DIRS}>)
endif()
math(EXPR MAPNIK_PROJ_VERSION "${PROJ_VERSION_MAJOR}*10000 + ${PROJ_VERSION_MINOR}*100 + ${PROJ_VERSION_PATCH}" OUTPUT_FORMAT DECIMAL)
message(STATUS "Using mapnik PROJ version: ${MAPNIK_PROJ_VERSION}")
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_USE_PROJ MAPNIK_PROJ_VERSION=${MAPNIK_PROJ_VERSION})
endif()
if(USE_GRID_RENDERER)
list(APPEND MAPNIK_COMPILE_DEFS GRID_RENDERER)
endif()
if(USE_SVG_RENDERER)
list(APPEND MAPNIK_COMPILE_DEFS SVG_RENDERER)
endif()
if(NOT WIN32)
message(STATUS "Compiling with -DMAPNIK_HAS_DLCFN")
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_HAS_DLCFN)
list(APPEND MAPNIK_OPTIONAL_LIBS ${CMAKE_DL_LIBS})
endif()
if(NOT BUILD_SHARED_PLUGINS)
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_STATIC_PLUGINS)
endif()
# when building static, this have to be public so that all depending libs know about
if(NOT BUILD_SHARED_LIBS)
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_STATIC_DEFINE)
endif()
if(DISABLE_MAPNIK_AUTOSETUP)
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_DISABLE_AUTOSETUP)
endif()
# force utf-8 source code processing
# see https://docs.microsoft.com/de-de/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=msvc-170
add_compile_options(
"$<$<CXX_COMPILER_ID:MSVC>:/utf-8>"
"$<$<CXX_COMPILER_ID:MSVC>:/EHsc>"
)
add_library(core INTERFACE)
add_library(mapnik::core ALIAS core)
target_include_directories(core INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${MAPBOX_GEOMETRY_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${MAPBOX_POLYLABEL_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${MAPBOX_VARIANT_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${MAPBOX_PROTOZERO_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/deps>
$<INSTALL_INTERFACE:include>
${MAPNIK_OPTIONAL_LIBS_INCLUDE}
)
target_link_libraries(core INTERFACE
Threads::Threads
ICU::uc
ICU::data
ICU::i18n
Boost::headers
Boost::regex
Freetype::Freetype
${MAPNIK_OPTIONAL_LIBS}
)
target_compile_definitions(core INTERFACE ${MAPNIK_COMPILE_DEFS})
mapnik_install(core)
###
# forward declaring libraries to consume them when building static plugins (circle deps between mapnik <-> plugin_target)
add_library(mapnik "")
add_library(mapnik::mapnik ALIAS mapnik)
add_library(wkt STATIC "")
add_library(mapnik::wkt ALIAS wkt)
add_library(json STATIC "")
add_library(mapnik::json ALIAS json)
# end forward declaration
###
add_subdirectory(deps)
add_subdirectory(plugins)
add_subdirectory(src)
add_subdirectory(utils)
add_subdirectory(demo)
if(BUILD_BENCHMARK)
add_subdirectory(benchmark)
endif()
if(BUILD_TESTING)
add_subdirectory(test)
endif()
file(COPY fonts DESTINATION "${MAPNIK_OUTPUT_DIR}")
feature_summary(FILENAME "${CMAKE_CURRENT_BINARY_DIR}/packages.log" WHAT PACKAGES_FOUND PACKAGES_NOT_FOUND INCLUDE_QUIET_PACKAGES)
# start package mapnik
include(MapnikExport)
include(MapnikExportPkgConfig)
install(DIRECTORY include/mapnik/ DESTINATION "${MAPNIK_INCLUDE_DIR}/mapnik")
install(DIRECTORY deps/agg/include/ DESTINATION "${MAPNIK_INCLUDE_DIR}/mapnik/agg")
install(DIRECTORY deps/mapnik DESTINATION "${MAPNIK_INCLUDE_DIR}")
file(GLOB TTF_FONT_FILES "fonts/*/*/*.ttf")
install(FILES ${TTF_FONT_FILES} DESTINATION "${FONTS_INSTALL_DIR}")
if(NOT USE_EXTERNAL_MAPBOX_GEOMETRY)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/deps/mapbox/geometry/include/" DESTINATION "${MAPNIK_INCLUDE_DIR}")
endif()
if(NOT USE_EXTERNAL_MAPBOX_POLYLABEL)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/deps/mapbox/polylabel/include/" DESTINATION "${MAPNIK_INCLUDE_DIR}")
endif()
if(NOT USE_EXTERNAL_MAPBOX_PROTOZERO)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/deps/mapbox/protozero/include/" DESTINATION "${MAPNIK_INCLUDE_DIR}")
endif()
if(NOT USE_EXTERNAL_MAPBOX_VARIANT)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/deps/mapbox/variant/include/" DESTINATION "${MAPNIK_INCLUDE_DIR}")
endif()
mapnik_install_targets()
include(pack)

350
CMakePresets.json Normal file
View file

@ -0,0 +1,350 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 25,
"patch": 0
},
"configurePresets": [
{
"name": "use-ninja",
"hidden": true,
"generator": "Ninja",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
}
},
{
"name": "default-build-dir",
"hidden": true,
"binaryDir": "${sourceDir}/build"
},
{
"name": "debug-build",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"USE_DEBUG_OUTPUT": "ON",
"USE_LOG": "ON",
"USE_LOG_SEVERITY": "0"
}
},
{
"name": "release-with-debug-build",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"USE_DEBUG_OUTPUT": "OFF",
"USE_LOG": "OFF"
}
},
{
"name": "release-build",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"USE_DEBUG_OUTPUT": "OFF",
"USE_LOG": "OFF"
}
},
{
"name": "use-clang",
"hidden": true,
"inherits": [
"default-build-dir",
"use-ninja"
],
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_CXX_FLAGS": "-stdlib=libc++",
"CMAKE_EXE_LINKER_FLAGS": "-stdlib=libc++",
"CMAKE_SHARED_LINKER_FLAGS": "-stdlib=libc++"
}
},
{
"name": "use-gcc",
"hidden": true,
"inherits": [
"default-build-dir",
"use-ninja"
],
"cacheVariables": {
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++"
}
},
{
"name": "use-msvc-cl",
"hidden": true,
"inherits": [
"default-build-dir",
"use-ninja"
],
"cacheVariables": {
"CMAKE_C_COMPILER": "cl",
"CMAKE_CXX_COMPILER": "cl"
}
},
{
"name": "use-msvc-clang-cl",
"hidden": true,
"inherits": [
"default-build-dir",
"use-ninja"
],
"cacheVariables": {
"CMAKE_C_COMPILER": "clang-cl",
"CMAKE_CXX_COMPILER": "clang-cl"
}
},
{
"name": "linux-clang-debug",
"displayName": "Linux clang debug",
"inherits": [
"use-clang",
"debug-build"
]
},
{
"name": "linux-clang-release",
"displayName": "Linux clang release",
"inherits": [
"use-clang",
"release-build"
]
},
{
"name": "linux-gcc-debug",
"displayName": "Linux gcc debug",
"inherits": [
"use-gcc",
"debug-build"
]
},
{
"name": "linux-gcc-release",
"displayName": "Linux gcc release",
"inherits": [
"use-gcc",
"release-build"
]
},
{
"name": "windows-arch-x64",
"hidden": true,
"architecture": {
"value": "x64",
"strategy": "external"
},
"toolset": {
"value": "host=x64",
"strategy": "external"
}
},
{
"name": "windows-default",
"displayName": "Windows x64 Debug",
"hidden": true,
"inherits": [
"use-msvc-cl",
"windows-arch-x64"
],
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Windows"
]
}
}
},
{
"name": "windows-debug",
"displayName": "Windows x64 Debug",
"inherits": [
"windows-default",
"debug-build"
]
},
{
"name": "windows-release",
"displayName": "Windows x64 Release",
"inherits": [
"windows-default",
"release-build"
]
},
{
"name": "ci-options",
"hidden": true,
"cacheVariables": {
"BUILD_TESTING": "ON",
"BUILD_DEMO_VIEWER": "OFF",
"DISABLE_MAPNIK_AUTOSETUP": "ON"
},
"toolchainFile": "vcpkg/scripts/buildsystems/vcpkg.cmake"
},
{
"name": "windows-ci",
"description": "used by the ci pipeline",
"inherits": [
"windows-release",
"ci-options"
],
"cacheVariables": {
"INSTALL_DEPENDENCIES": "ON",
"ADDITIONAL_LIBARIES_PATHS": "${sourceDir}/build/vcpkg_installed/x64-windows/bin"
},
"environment": {
"PROJ_LIB": "${sourceDir}/build/vcpkg_installed/x64-windows/share/proj"
}
},
{
"name": "linux-ci",
"description": "used by the ci pipeline",
"inherits": [
"release-with-debug-build",
"use-gcc",
"ci-options"
],
"cacheVariables": {
"CMAKE_CXX_FLAGS": "--coverage"
},
"environment": {
"PROJ_LIB": "${sourceDir}/build/vcpkg_installed/x64-linux/share/proj"
}
},
{
"name": "linux-ci-release",
"description": "used by the ci pipeline for releasing",
"inherits": [
"release-build",
"linux-gcc-release"
],
"cacheVariables": {
"BUILD_TESTING": "OFF",
"BUILD_DEMO_VIEWER": "OFF",
"USE_MEMORY_MAPPED_FILE": "ON"
}
},
{
"name": "macos-ci-arm64",
"description": "used by the ci pipeline",
"inherits": [
"use-ninja",
"release-with-debug-build",
"default-build-dir",
"ci-options"
],
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-fprofile-arcs -ftest-coverage"
},
"environment": {
"PROJ_LIB": "${sourceDir}/build/vcpkg_installed/arm64-osx/share/proj"
}
},
{
"name": "macos-ci-x64",
"description": "used by the ci pipeline",
"inherits": [
"use-ninja",
"release-with-debug-build",
"default-build-dir",
"ci-options"
],
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-fprofile-arcs -ftest-coverage"
},
"environment": {
"PROJ_LIB": "${sourceDir}/build/vcpkg_installed/x64-osx/share/proj"
}
}
],
"buildPresets": [
{
"name": "windows-debug",
"configurePreset": "windows-debug"
},
{
"name": "windows-release",
"configurePreset": "windows-release"
},
{
"name": "linux-clang-debug",
"configurePreset": "linux-clang-debug"
},
{
"name": "linux-clang-release",
"configurePreset": "linux-clang-release"
},
{
"name": "linux-gcc-debug",
"configurePreset": "linux-gcc-debug"
},
{
"name": "linux-gcc-release",
"configurePreset": "linux-gcc-release"
},
{
"name": "windows-ci",
"configurePreset": "windows-ci"
},
{
"name": "linux-ci",
"configurePreset": "linux-ci"
},
{
"name": "linux-ci-release",
"configurePreset": "linux-ci-release"
},
{
"name": "macos-ci-arm64",
"configurePreset": "macos-ci-arm64"
},
{
"name": "macos-ci-x64",
"configurePreset": "macos-ci-x64"
}
],
"testPresets": [
{
"name": "test-default",
"hidden": true,
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": false
}
},
{
"name": "windows-ci",
"configurePreset": "windows-ci",
"inherits": [
"test-default"
]
},
{
"name": "linux-ci",
"configurePreset": "linux-ci",
"inherits": [
"test-default"
]
},
{
"name": "macos-ci-arm64",
"configurePreset": "macos-ci-arm64",
"inherits": [
"test-default"
]
},
{
"name": "macos-ci-x64",
"configurePreset": "macos-ci-x64",
"inherits": [
"test-default"
]
}
]
}

View file

@ -2,10 +2,18 @@
Mapnik runs on Linux, OS X, Windows, and BSD systems. Mapnik runs on Linux, OS X, Windows, and BSD systems.
## Package managers
### vcpkg
To install mapnik with vcpkg type `vcpkg install mapnik`. It will install a minimal version of mapnik and all the needed dependencies.
To install more features, type `vcpkg search mapnik` to see all available features.
## Source build
First clone mapnik from github and initialize submodules First clone mapnik from github and initialize submodules
```bash ```bash
git clone https://github.com/mapnik/mapnik.git git clone https://github.com/mapnik/mapnik.git
cd mapnik
git submodule update --init git submodule update --init
``` ```
@ -34,8 +42,8 @@ To use a Python interpreter that is not named `python` for your build, do
something like the following instead: something like the following instead:
```bash ```bash
$ PYTHON=python2 ./configure $ PYTHON=python3 ./configure
$ make PYTHON=python2 $ make PYTHON=python3
``` ```
NOTE: the above will not work on windows, rather see https://github.com/mapnik/mapnik/wiki/WindowsInstallation NOTE: the above will not work on windows, rather see https://github.com/mapnik/mapnik/wiki/WindowsInstallation
@ -63,15 +71,15 @@ For troubleshooting help see https://github.com/mapnik/mapnik/wiki/InstallationT
Build system dependencies are: Build system dependencies are:
* C++ compiler supporting `-std=c++11` (like >= g++ 4.8 or >= clang++ 3.4) * C++ compiler supporting `-std=c++17` (like >= g++ 9 or >= clang++ 5)
* >= 2 GB RAM (> 5 GB for g++) * \>= 2 GB RAM (> 5 GB for g++)
* Python 2.4-2.7 * Python 3
* Scons (a copy is bundled) * Scons (a copy is bundled) or CMake >= 3.15 see [docs/cmake-usage.md](./docs/cmake-usage.md)
Mapnik Core depends on: Mapnik Core depends on:
* Boost * Boost
- >= 1.47 is required and >= 1.56 recommended - \>= 1.73 is required
- These libraries are used: - These libraries are used:
- filesystem - filesystem
- system - system
@ -89,7 +97,7 @@ Mapnik Core optionally depends on:
* libjpeg - JPEG graphics (Default enabled, if found) * libjpeg - JPEG graphics (Default enabled, if found)
* libtiff - TIFF graphics (Default enabled, if found) * libtiff - TIFF graphics (Default enabled, if found)
* libwebp - WEBP graphics (Default enabled, if found) * libwebp - WEBP graphics (Default enabled, if found)
* libproj - PROJ.4 projection library (Default enabled, if found) * libproj >= 7.2.0 - PROJ projection library (Default enabled, if found)
Additional optional dependencies: Additional optional dependencies:
@ -98,7 +106,7 @@ Additional optional dependencies:
* PostgreSQL (for PostGIS plugin support) * PostgreSQL (for PostGIS plugin support)
- libpq - PostreSQL libraries - libpq - PostreSQL libraries
- pg_config - PostgreSQL installation capabilities - pg_config - PostgreSQL installation capabilities
* libgdal - GDAL/OGR input (For gdal and ogr plugin support) * libgdal - GDAL/OGR input (For gdal and ogr plugin support) (>= GDAL 2.0.2 for thread safety - https://github.com/mapnik/mapnik/issues/3339)
* libsqlite3 - SQLite input (needs RTree support builtin) (sqlite plugin support) * libsqlite3 - SQLite input (needs RTree support builtin) (sqlite plugin support)
Instructions for installing many of these dependencies on Instructions for installing many of these dependencies on
@ -183,7 +191,7 @@ If you need help or want to participate starting points include:
### Cartographers ### Cartographers
TileMill, which uses Mapnik internally, offers great step by step tutorials for TileMill, which uses Mapnik internally, offers great step by step tutorials for
learning advanced map styling: http://mapbox.com/tilemill/docs/crashcourse/introduction/ learning advanced map styling: https://tilemill-project.github.io/tilemill/docs/crashcourse/introduction/
### Programmers ### Programmers
@ -191,6 +199,6 @@ Mapnik is great for building your own mapping applications. Visit
https://github.com/mapnik/mapnik/wiki/LearningMapnik for basic https://github.com/mapnik/mapnik/wiki/LearningMapnik for basic
tutorials on how to programmatically use Mapnik. 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.

View file

@ -1,8 +1,5 @@
OS := $(shell uname -s) OS := $(shell uname -s)
PYTHON = python
ifeq ($(JOBS),) ifeq ($(JOBS),)
JOBS:=1 JOBS:=1
endif endif
@ -17,29 +14,10 @@ install:
$(PYTHON) scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 install $(PYTHON) scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 install
release: release:
export MAPNIK_VERSION=$(shell ./utils/mapnik-config/mapnik-config --version) && \ ./scripts/publish_release.sh
export TARBALL_NAME="mapnik-v$${MAPNIK_VERSION}" && \
cd /tmp/ && \
rm -rf $${TARBALL_NAME} && \
git clone --depth 1 --branch v$${MAPNIK_VERSION} git@github.com:mapnik/mapnik.git $${TARBALL_NAME} && \
cd $${TARBALL_NAME} && \
git checkout "tags/v$${MAPNIK_VERSION}" && \
git submodule update --depth 100 --init && \
rm -rf deps/mapbox/variant/.git && \
rm -rf test/data/.git && \
rm -rf test/data/.gitignore && \
rm -rf test/data-visual/.git && \
rm -rf test/data-visual/.gitignore && \
rm -rf .git && \
rm -rf .gitignore && \
cd ../ && \
tar cjf $${TARBALL_NAME}.tar.bz2 $${TARBALL_NAME}/ && \
aws s3 cp --acl public-read $${TARBALL_NAME}.tar.bz2 s3://mapnik/dist/v$${MAPNIK_VERSION}/
python: test-release:
if [ ! -d ./bindings/python ]; then git clone git@github.com:mapnik/python-mapnik.git --recursive ./bindings/python; else (cd bindings/python && git pull && git submodule update --init); fi; ./scripts/test_release.sh
make
python bindings/python/test/visual.py -q
src/json/libmapnik-json.a: src/json/libmapnik-json.a:
# we first build memory intensive files with -j$(HEAVY_JOBS) # we first build memory intensive files with -j$(HEAVY_JOBS)
@ -50,10 +28,20 @@ src/json/libmapnik-json.a:
src/renderer_common/render_thunk_extractor.os \ src/renderer_common/render_thunk_extractor.os \
src/json/libmapnik-json.a \ src/json/libmapnik-json.a \
src/wkt/libmapnik-wkt.a \ src/wkt/libmapnik-wkt.a \
src/css_color_grammar.os \ src/css/css_grammar_x3.os \
src/expression_grammar.os \ src/css/css_color_grammar_x3.os \
src/transform_expression_grammar.os \ src/expression_grammar_x3.os \
src/image_filter_grammar.os \ src/transform_expression_grammar_x3.os \
src/image_filter_grammar_x3.os \
src/marker_helpers.os \
src/svg/svg_transform_parser.os \
src/agg/process_line_symbolizer.os \
plugins/input/geojson/geojson_datasource.os \
src/svg/svg_path_parser.os \
src/svg/svg_parser.os \
src/svg/svg_points_parser.os \
src/svg/svg_transform_parser.os \
mapnik: src/json/libmapnik-json.a mapnik: src/json/libmapnik-json.a
# then install the rest with -j$(JOBS) # then install the rest with -j$(JOBS)
@ -71,6 +59,8 @@ clean:
@find ./src/ -name "*.so" -exec rm {} \; @find ./src/ -name "*.so" -exec rm {} \;
@find ./ -name "*.o" -exec rm {} \; @find ./ -name "*.o" -exec rm {} \;
@find ./src/ -name "*.a" -exec rm {} \; @find ./src/ -name "*.a" -exec rm {} \;
@find ./ -name "*.gcda" -exec rm {} \;
@find ./ -name "*.gcno" -exec rm {} \;
distclean: distclean:
if test -e "config.py"; then mv "config.py" "config.py.backup"; fi if test -e "config.py"; then mv "config.py" "config.py.backup"; fi
@ -83,10 +73,13 @@ rebuild:
uninstall: uninstall:
@$(PYTHON) scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 uninstall @$(PYTHON) scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 uninstall
test/data: test/data-visual:
git submodule update --init ./scripts/ensure_test_data.sh
test: ./test/data test/data:
./scripts/ensure_test_data.sh
test: ./test/data test/data-visual
@./test/run @./test/run
check: test check: test
@ -97,13 +90,6 @@ bench:
demo: demo:
cd demo/c++; ./rundemo `mapnik-config --prefix` cd demo/c++; ./rundemo `mapnik-config --prefix`
pep8:
# https://gist.github.com/1903033
# gsed on osx
@pep8 -r --select=W293 -q --filename=*.py `pwd`/tests/ | xargs gsed -i 's/^[ \r\t]*$$//'
@pep8 -r --select=W391 -q --filename=*.py `pwd`/tests/ | xargs gsed -i -e :a -e '/^\n*$$/{$$d;N;ba' -e '}'
@pep8 -r --select=W391 -q --filename=*.py `pwd`/tests/ | xargs ged -i '/./,/^$$/!d'
# note: pass --gen-suppressions=yes to create new suppression entries # note: pass --gen-suppressions=yes to create new suppression entries
grind: grind:
@source localize.sh && \ @source localize.sh && \

View file

@ -8,9 +8,8 @@ _/ _/ _/_/_/ _/_/_/ _/ _/ _/ _/ _/
_/ _/
``` ```
[![Build Status Linux](https://api.travis-ci.org/mapnik/mapnik.svg?branch=master)](http://travis-ci.org/mapnik/mapnik) [![TravisCI](https://api.travis-ci.com/mapnik/mapnik.svg?branch=master)](http://travis-ci.com/mapnik/mapnik)
[![Build Status Windows](https://ci.appveyor.com/api/projects/status/hc9l7okdjtucfqqn?branch=master&svg=true)](https://ci.appveyor.com/project/Mapbox/mapnik) [![codecov](https://codecov.io/gh/mapnik/mapnik/branch/master/graph/badge.svg)](https://codecov.io/gh/mapnik/mapnik)
[![Coverage Status](https://coveralls.io/repos/mapnik/mapnik/badge.svg?branch=master&service=github)](https://coveralls.io/github/mapnik/mapnik?branch=master)
Mapnik is an open source toolkit for developing mapping applications. At the core is a C++ shared library providing algorithms and patterns for spatial data access and visualization. Mapnik is an open source toolkit for developing mapping applications. At the core is a C++ shared library providing algorithms and patterns for spatial data access and visualization.
@ -20,7 +19,7 @@ For further information see [http://mapnik.org](http://mapnik.org) and also our
# Installation # Installation
See [INSTALL.md](https://github.com/mapnik/mapnik/blob/master/INSTALL.md) for installation instructions and the [Install](https://github.com/mapnik/mapnik/wiki/Mapnik-Installation) page on the wiki for guides. See [INSTALL.md](INSTALL.md) for installation instructions and the [Install](https://github.com/mapnik/mapnik/wiki/Mapnik-Installation) page on the wiki for guides.
# Code of Conduct # Code of Conduct
@ -28,4 +27,4 @@ Please note that this project is released with a [Contributor Code of Conduct](h
# License # License
Mapnik software is free and is released under the LGPL ([GNU Lesser General Public License](http://www.gnu.org/licenses/lgpl.html_)). Please see [COPYING](https://github.com/mapnik/mapnik/blob/master/COPYING) for more information. Mapnik software is free and is released under the LGPL v2.1 ([GNU Lesser General Public License, version 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html)). Please see [COPYING](https://github.com/mapnik/mapnik/blob/master/COPYING) for more information.

File diff suppressed because it is too large Load diff

View file

@ -1,34 +0,0 @@
environment:
msvs_toolset: 14
BOOST_VERSION: 59
FASTBUILD: 1
matrix:
- platform: x64
configuration: Release
os: Visual Studio 2015
#shallow_clone: true
# limit clone to latest 5 commits
clone_depth: 5
services:
- postgresql94 #if changing this, also change PATH below
install:
- SET PGUSER=postgres
- SET PGPASSWORD=Password12!
- SET PATH=C:\Program Files\PostgreSQL\9.4\bin\;%PATH%
- scripts\build-appveyor.bat
artifacts:
- path: mapnik-gyp\msbuild-summary.txt
name: msbuild-summary.txt
- path: mapnik-gyp\msbuild-errors.txt
name: msbuild-errors.txt
- path: mapnik-gyp\msbuild-warnings.txt
name: msbuild-warnings.txt
build: off
test: off
deploy: off

52
benchmark/CMakeLists.txt Normal file
View file

@ -0,0 +1,52 @@
project(mapnik-benchmark)
set(BENCHMARK_SRCS
src/normalize_angle.cpp
src/test_array_allocation.cpp
src/test_expression_parse.cpp
src/test_face_ptr_creation.cpp
src/test_font_registration.cpp
src/test_getline.cpp
src/test_marker_cache.cpp
src/test_noop_rendering.cpp
src/test_numeric_cast_vs_static_cast.cpp
src/test_offset_converter.cpp
src/test_png_encoding1.cpp
src/test_png_encoding2.cpp
src/test_polygon_clipping_rendering.cpp
src/test_polygon_clipping.cpp
src/test_proj_transform1.cpp
src/test_quad_tree.cpp
src/test_rendering_shared_map.cpp
src/test_rendering.cpp
src/test_to_bool.cpp
src/test_to_double.cpp
src/test_to_int.cpp
src/test_to_string1.cpp
src/test_to_string2.cpp
src/test_utf_encoding.cpp
)
function(mapnik_create_benchmark)
get_filename_component(BENCHNAME ${ARGV0} NAME_WE)
set(TARGET_NAME "mapnik-benchmark-${BENCHNAME}")
add_executable(${TARGET_NAME} ${ARGV0})
target_include_directories(${TARGET_NAME} PRIVATE include)
target_link_libraries(${TARGET_NAME} PRIVATE
mapnik::agg
mapnik::mapnik
ICU::data ICU::i18n ICU::uc # needed for the static build (TODO: why isn't this correctly propagated from mapnik::mapnik?)
)
set_target_properties(${TARGET_NAME} PROPERTIES
OUTPUT_NAME "${BENCHNAME}"
)
endfunction()
foreach(benchmark ${BENCHMARK_SRCS})
mapnik_create_benchmark(${benchmark})
endforeach()
file(COPY data DESTINATION "${MAPNIK_OUTPUT_DIR}/benchmark")
file(COPY run_benchmarks
DESTINATION "${MAPNIK_OUTPUT_DIR}"
FILE_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE GROUP_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ
)

View file

@ -9,6 +9,7 @@ test_env = env.Clone()
test_env['LIBS'] = [env['MAPNIK_NAME']] test_env['LIBS'] = [env['MAPNIK_NAME']]
test_env.AppendUnique(LIBS=copy(env['LIBMAPNIK_LIBS'])) test_env.AppendUnique(LIBS=copy(env['LIBMAPNIK_LIBS']))
test_env.AppendUnique(LIBS='mapnik-wkt') test_env.AppendUnique(LIBS='mapnik-wkt')
test_env.AppendUnique(LIBS='sqlite3')
if env['PLATFORM'] == 'Linux': if env['PLATFORM'] == 'Linux':
test_env.AppendUnique(LIBS='dl') test_env.AppendUnique(LIBS='dl')
test_env.AppendUnique(LIBS='rt') test_env.AppendUnique(LIBS='rt')
@ -18,40 +19,19 @@ test_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES'])
if test_env['HAS_CAIRO']: if test_env['HAS_CAIRO']:
test_env.PrependUnique(CPPPATH=test_env['CAIRO_CPPPATHS']) test_env.PrependUnique(CPPPATH=test_env['CAIRO_CPPPATHS'])
test_env.Append(CPPDEFINES = '-DHAVE_CAIRO') test_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
test_env.PrependUnique(CPPPATH='include', delete_existing=True)
test_env['LINKFLAGS'] = copy(test_env['LIBMAPNIK_LINKFLAGS']) test_env['LINKFLAGS'] = copy(test_env['LIBMAPNIK_LINKFLAGS'])
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
test_env.Append(LINKFLAGS='-F/ -framework CoreFoundation') test_env.Append(LINKFLAGS='-F/ -framework CoreFoundation')
test_env_local = test_env.Clone() test_env_local = test_env.Clone()
#benchmarks = glob.glob('test*cpp') benchmarks = glob.glob("src/*.cpp")
benchmarks = [
#"test_array_allocation.cpp", for src in benchmarks:
#"test_png_encoding1.cpp", name, ext = os.path.splitext(os.path.basename(src))
#"test_png_encoding2.cpp", out = os.path.join("out", name)
#"test_to_string1.cpp", test_program = test_env_local.Program(out, source=[src])
#"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])
if 'install' in COMMAND_LINE_TARGETS: if 'install' in COMMAND_LINE_TARGETS:
env.Alias('install',test_program) env.Alias('install',test_program)
#Depends(test_program, env.subst('../src/%s' % env['MAPNIK_LIB_NAME'])) #Depends(test_program, env.subst('../src/%s' % env['MAPNIK_LIB_NAME']))

View file

@ -1,37 +0,0 @@
#ifndef __MAPNIK_COMPARE_IMAGES_HPP__
#define __MAPNIK_COMPARE_IMAGES_HPP__
#include <mapnik/image.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/image_reader.hpp>
using namespace mapnik;
namespace benchmark {
bool compare_images(std::string const& src_fn,std::string const& dest_fn)
{
std::unique_ptr<mapnik::image_reader> reader1(mapnik::get_image_reader(dest_fn,"png"));
if (!reader1.get())
{
throw mapnik::image_reader_exception("Failed to load: " + dest_fn);
}
std::unique_ptr<mapnik::image_reader> reader2(mapnik::get_image_reader(src_fn,"png"));
if (!reader2.get())
{
throw mapnik::image_reader_exception("Failed to load: " + src_fn);
}
const image_any desc_any = reader1->read(0,0,reader1->width(), reader1->height());
const image_any src_any = reader2->read(0,0,reader2->width(), reader2->height());
image_rgba8 const& dest = util::get<image_rgba8>(desc_any);
image_rgba8 const& src = util::get<image_rgba8>(src_any);
return compare(dest, src, 0, true) == 0;
}
}
#endif // __MAPNIK_COMPARE_IMAGES_HPP__

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map[]> <!DOCTYPE Map[]>
<Map <Map
srs="+init=epsg:4326" srs="epsg:4326"
background-color="#dfd8c9"> background-color="#dfd8c9">
<Style name="style"> <Style name="style">
@ -10,7 +10,7 @@
</Rule> </Rule>
</Style> </Style>
<Layer name="layer" <Layer name="layer"
srs="+init=epsg:4326"> srs="epsg:4326">
<StyleName>style</StyleName> <StyleName>style</StyleName>
<Datasource> <Datasource>
<Parameter name="file">./valid.geotiff.tif</Parameter> <Parameter name="file">./valid.geotiff.tif</Parameter>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map[]> <!DOCTYPE Map[]>
<Map <Map
srs="+init=epsg:4326" srs="epsg:4326"
background-color="#dfd8c9"> background-color="#dfd8c9">
<Style name="style"> <Style name="style">
@ -10,7 +10,7 @@
</Rule> </Rule>
</Style> </Style>
<Layer name="layer" <Layer name="layer"
srs="+init=epsg:4326"> srs="epsg:4326">
<StyleName>style</StyleName> <StyleName>style</StyleName>
<Datasource> <Datasource>
<Parameter name="file">./valid.geotiff.tif</Parameter> <Parameter name="file">./valid.geotiff.tif</Parameter>

View file

@ -2,7 +2,7 @@
<!DOCTYPE Map[]> <!DOCTYPE Map[]>
<Map <Map
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over"
font-directory="../../fonts/dejavu-fonts-ttf-2.35/ttf/DejaVuSans.ttf" font-directory="../../fonts/dejavu-fonts-ttf-2.37/ttf/DejaVuSans.ttf"
background-color="#dfd8c9"> background-color="#dfd8c9">
<Style name="marking" filter-mode="first"> <Style name="marking" filter-mode="first">

View file

@ -1,78 +1,74 @@
#ifndef __MAPNIK_BENCH_FRAMEWORK_HPP__ #ifndef MAPNIK_BENCH_FRAMEWORK_HPP
#define __MAPNIK_BENCH_FRAMEWORK_HPP__ #define MAPNIK_BENCH_FRAMEWORK_HPP
// mapnik // mapnik
#include <mapnik/mapnik.hpp>
#include <mapnik/debug.hpp> #include <mapnik/debug.hpp>
#include <mapnik/params.hpp> #include <mapnik/params.hpp>
#include <mapnik/value_types.hpp> #include <mapnik/value/types.hpp>
#include <mapnik/safe_cast.hpp> #include <mapnik/safe_cast.hpp>
#include "../test/cleanup.hpp" #include "../test/cleanup.hpp"
// stl // stl
#include <chrono> #include <chrono>
#include <cmath> // log10, round #include <cmath> // log10, round
#include <cstdio> // snprintf #include <cstdio> // snprintf
#include <iomanip>
#include <iostream> #include <iostream>
#include <set>
#include <sstream>
#include <thread> #include <thread>
#include <mutex>
#include <vector> #include <vector>
namespace benchmark { namespace benchmark {
template <typename T> template<typename T>
using milliseconds = std::chrono::duration<T, std::milli>; using milliseconds = std::chrono::duration<T, std::milli>;
template <typename T> template<typename T>
using seconds = std::chrono::duration<T>; using seconds = std::chrono::duration<T>;
class test_case class test_case
{ {
protected: protected:
mapnik::parameters params_; mapnik::parameters params_;
std::size_t threads_; std::size_t threads_;
std::size_t iterations_; std::size_t iterations_;
public:
public:
test_case(mapnik::parameters const& params) test_case(mapnik::parameters const& params)
: params_(params), : params_(params)
threads_(mapnik::safe_cast<std::size_t>(*params.get<mapnik::value_integer>("threads",0))), , threads_(mapnik::safe_cast<std::size_t>(*params.get<mapnik::value_integer>("threads", 0)))
iterations_(mapnik::safe_cast<std::size_t>(*params.get<mapnik::value_integer>("iterations",0))) , iterations_(mapnik::safe_cast<std::size_t>(*params.get<mapnik::value_integer>("iterations", 0)))
{} {}
std::size_t threads() const std::size_t threads() const { return threads_; }
{ std::size_t iterations() const { return iterations_; }
return threads_; mapnik::parameters const& params() const { return params_; }
}
std::size_t iterations() const
{
return iterations_;
}
mapnik::parameters const& params() const
{
return params_;
}
virtual bool validate() const = 0; virtual bool validate() const = 0;
virtual bool operator()() const = 0; virtual bool operator()() const = 0;
virtual ~test_case() {}
}; };
// gathers --long-option values in 'params'; // gathers --long-option values in 'params';
// returns the index of the first non-option argument, // returns the index of the first non-option argument,
// or negated index of an ill-formed option argument // or negated index of an ill-formed option argument
inline int parse_args(int argc, char** argv, mapnik::parameters & params) inline int parse_args(int argc, char** argv, mapnik::parameters& params)
{ {
for (int i = 1; i < argc; ++i) { for (int i = 1; i < argc; ++i)
{
const char* opt = argv[i]; const char* opt = argv[i];
if (opt[0] != '-') { if (opt[0] != '-')
{
// non-option argument, return its index // non-option argument, return its index
return i; return i;
} }
if (opt[1] != '-') { if (opt[1] != '-')
{
// we only accept --long-options, but instead of throwing, // we only accept --long-options, but instead of throwing,
// just issue a warning and let the caller decide what to do // just issue a warning and let the caller decide what to do
std::clog << argv[0] << ": invalid option '" << opt << "'\n"; std::clog << argv[0] << ": invalid option '" << opt << "'\n";
return -i; // negative means ill-formed option #i return -i; // negative means ill-formed option #i
} }
if (opt[2] == '\0') { if (opt[2] == '\0')
{
// option-list terminator '--' // option-list terminator '--'
return i + 1; return i + 1;
} }
@ -80,15 +76,18 @@ inline int parse_args(int argc, char** argv, mapnik::parameters & params)
// take option name without the leading '--' // take option name without the leading '--'
std::string key(opt + 2); std::string key(opt + 2);
size_t eq = key.find('='); size_t eq = key.find('=');
if (eq != std::string::npos) { if (eq != std::string::npos)
{
// one-argument form '--foo=bar' // one-argument form '--foo=bar'
params[key.substr(0, eq)] = key.substr(eq + 1); params[key.substr(0, eq)] = key.substr(eq + 1);
} }
else if (i + 1 < argc) { else if (i + 1 < argc)
{
// two-argument form '--foo' 'bar' // two-argument form '--foo' 'bar'
params[key] = std::string(argv[++i]); params[key] = std::string(argv[++i]);
} }
else { else
{
// missing second argument // missing second argument
std::clog << argv[0] << ": missing option '" << opt << "' value\n"; std::clog << argv[0] << ": missing option '" << opt << "' value\n";
return -i; // negative means ill-formed option #i return -i; // negative means ill-formed option #i
@ -99,7 +98,8 @@ inline int parse_args(int argc, char** argv, mapnik::parameters & params)
inline void handle_common_args(mapnik::parameters const& params) inline void handle_common_args(mapnik::parameters const& params)
{ {
if (auto severity = params.get<std::string>("log")) { if (auto severity = params.get<std::string>("log"))
{
if (*severity == "debug") if (*severity == "debug")
mapnik::logger::set_severity(mapnik::logger::debug); mapnik::logger::set_severity(mapnik::logger::debug);
else if (*severity == "warn") else if (*severity == "warn")
@ -109,37 +109,37 @@ inline void handle_common_args(mapnik::parameters const& params)
else if (*severity == "none") else if (*severity == "none")
mapnik::logger::set_severity(mapnik::logger::none); mapnik::logger::set_severity(mapnik::logger::none);
else else
std::clog << "ignoring option --log='" << *severity std::clog << "ignoring option --log='" << *severity << "' (allowed values are: debug, warn, error, none)\n";
<< "' (allowed values are: debug, warn, error, none)\n";
} }
} }
inline int handle_args(int argc, char** argv, mapnik::parameters & params) inline int handle_args(int argc, char** argv, mapnik::parameters& params)
{ {
int res = parse_args(argc, argv, params); int res = parse_args(argc, argv, params);
handle_common_args(params); handle_common_args(params);
return res; return res;
} }
#define BENCHMARK(test_class,name) \ #define BENCHMARK(test_class, name) \
int main(int argc, char** argv) \ int main(int argc, char** argv) \
{ \ { \
try \ mapnik::setup(); \
{ \ try \
mapnik::parameters params; \ { \
benchmark::handle_args(argc,argv,params); \ mapnik::parameters params; \
test_class test_runner(params); \ benchmark::handle_args(argc, argv, params); \
auto result = run(test_runner,name); \ test_class test_runner(params); \
testing::run_cleanup(); \ auto result = run(test_runner, name); \
return result; \ testing::run_cleanup(); \
} \ return result; \
catch (std::exception const& ex) \ } \
{ \ catch (std::exception const& ex) \
std::clog << ex.what() << "\n"; \ { \
testing::run_cleanup(); \ std::clog << ex.what() << "\n"; \
return -1; \ testing::run_cleanup(); \
} \ return -1; \
} \ } \
}
struct big_number_fmt struct big_number_fmt
{ {
@ -148,7 +148,9 @@ struct big_number_fmt
const char* u; const char* u;
big_number_fmt(int width, double value, int base = 1000) big_number_fmt(int width, double value, int base = 1000)
: w(width), v(value), u("") : w(width)
, v(value)
, u("")
{ {
static const char* suffixes = "\0\0k\0M\0G\0T\0P\0E\0Z\0Y\0\0"; static const char* suffixes = "\0\0k\0M\0G\0T\0P\0E\0Z\0Y\0\0";
u = suffixes; u = suffixes;
@ -164,7 +166,7 @@ struct big_number_fmt
} }
}; };
template <typename T> template<typename T>
int run(T const& test_runner, std::string const& name) int run(T const& test_runner, std::string const& name)
{ {
try try
@ -195,8 +197,7 @@ int run(T const& test_runner, std::string const& name)
std::mutex mtx_ready; std::mutex mtx_ready;
std::unique_lock<std::mutex> lock_ready(mtx_ready); std::unique_lock<std::mutex> lock_ready(mtx_ready);
auto stub = [&](T const& test_copy) auto stub = [&](T const& test_copy) {
{
// workers will wait on this mutex until the main thread // workers will wait on this mutex until the main thread
// constructs all of them and starts measuring time // constructs all of them and starts measuring time
std::unique_lock<std::mutex> my_lock(mtx_ready); std::unique_lock<std::mutex> my_lock(mtx_ready);
@ -206,14 +207,14 @@ int run(T const& test_runner, std::string const& name)
std::vector<std::thread> tg; std::vector<std::thread> tg;
tg.reserve(num_threads); tg.reserve(num_threads);
for (auto i = num_threads; i-- > 0; ) for (auto i = num_threads; i-- > 0;)
{ {
tg.emplace_back(stub, test_runner); tg.emplace_back(stub, test_runner);
} }
start = std::chrono::high_resolution_clock::now(); start = std::chrono::high_resolution_clock::now();
lock_ready.unlock(); lock_ready.unlock();
// wait for all workers to finish // wait for all workers to finish
for (auto & t : tg) for (auto& t : tg)
{ {
if (t.joinable()) if (t.joinable())
t.join(); t.join();
@ -227,7 +228,8 @@ int run(T const& test_runner, std::string const& name)
else else
{ {
start = std::chrono::high_resolution_clock::now(); start = std::chrono::high_resolution_clock::now();
do { do
{
test_runner(); test_runner();
elapsed = std::chrono::high_resolution_clock::now() - start; elapsed = std::chrono::high_resolution_clock::now() - start;
total_iters += num_iters; total_iters += num_iters;
@ -240,14 +242,26 @@ int run(T const& test_runner, std::string const& name)
big_number_fmt itersf(4, total_iters); big_number_fmt itersf(4, total_iters);
big_number_fmt ips(5, total_iters / seconds<double>(elapsed_nonzero).count()); big_number_fmt ips(5, total_iters / seconds<double>(elapsed_nonzero).count());
std::snprintf(msg, sizeof(msg), std::clog << std::left << std::setw(43) << name;
"%-43s %3zu threads %*.0f%s iters %6.0f milliseconds %*.0f%s i/s\n", std::clog << std::resetiosflags(std::ios::adjustfield);
name.c_str(), if (num_threads > 0)
num_threads, {
itersf.w, itersf.v, itersf.u, std::clog << ' ' << std::setw(3) << num_threads << " worker" << (num_threads > 1 ? "s" : " ");
dur_total, }
ips.w, ips.v, ips.u else
); {
std::clog << " main thread";
}
std::snprintf(msg,
sizeof(msg),
" %*.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; std::clog << msg;
return 0; return 0;
} }
@ -261,18 +275,15 @@ int run(T const& test_runner, std::string const& name)
struct sequencer struct sequencer
{ {
sequencer(int argc, char** argv) sequencer(int argc, char** argv)
: exit_code_(0) : exit_code_(0)
{ {
benchmark::handle_args(argc, argv, params_); benchmark::handle_args(argc, argv, params_);
} }
int done() const int done() const { return exit_code_; }
{
return exit_code_;
}
template <typename Test, typename... Args> template<typename Test, typename... Args>
sequencer & run(std::string const& name, Args && ...args) sequencer& run(std::string const& name, Args&&... args)
{ {
// Test instance lifetime is confined to this function // Test instance lifetime is confined to this function
Test test_runner(params_, std::forward<Args>(args)...); Test test_runner(params_, std::forward<Args>(args)...);
@ -281,11 +292,11 @@ struct sequencer
return *this; // allow chaining calls return *this; // allow chaining calls
} }
protected: protected:
mapnik::parameters params_; mapnik::parameters params_;
int exit_code_; int exit_code_;
}; };
} } // namespace benchmark
#endif // __MAPNIK_BENCH_FRAMEWORK_HPP__ #endif // MAPNIK_BENCH_FRAMEWORK_HPP

View file

@ -0,0 +1,35 @@
#ifndef MAPNIK_COMPARE_IMAGES_HPP
#define MAPNIK_COMPARE_IMAGES_HPP
#include <mapnik/image.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/image_reader.hpp>
namespace benchmark {
bool compare_images(std::string const& src_fn, std::string const& dest_fn)
{
std::unique_ptr<mapnik::image_reader> reader1(mapnik::get_image_reader(dest_fn, "png"));
if (!reader1.get())
{
throw mapnik::image_reader_exception("Failed to load: " + dest_fn);
}
std::unique_ptr<mapnik::image_reader> reader2(mapnik::get_image_reader(src_fn, "png"));
if (!reader2.get())
{
throw mapnik::image_reader_exception("Failed to load: " + src_fn);
}
const mapnik::image_any desc_any = reader1->read(0, 0, reader1->width(), reader1->height());
const mapnik::image_any src_any = reader2->read(0, 0, reader2->width(), reader2->height());
mapnik::image_rgba8 const& dest = mapnik::util::get<mapnik::image_rgba8>(desc_any);
mapnik::image_rgba8 const& src = mapnik::util::get<mapnik::image_rgba8>(src_any);
return compare(dest, src, 0, true) == 0;
}
} // namespace benchmark
#endif // MAPNIK_COMPARE_IMAGES_HPP

View file

@ -24,11 +24,14 @@ run test_getline 30 10000000
#run test_polygon_clipping 10 1000 #run test_polygon_clipping 10 1000
#run test_polygon_clipping_rendering 10 100 #run test_polygon_clipping_rendering 10 100
run test_proj_transform1 10 100 run test_proj_transform1 10 100
run test_expression_parse 10 1000 run test_expression_parse 10 10000
run test_face_ptr_creation 10 1000 run test_face_ptr_creation 10 1000
run test_font_registration 10 100 run test_font_registration 10 100
run test_offset_converter 10 1000 run test_offset_converter 10 1000
#run normalize_angle 0 1000000 --min-duration=0.2
# commented since this is really slow on travis
: '
./benchmark/out/test_rendering \ ./benchmark/out/test_rendering \
--name "text rendering" \ --name "text rendering" \
--map benchmark/data/roads.xml \ --map benchmark/data/roads.xml \
@ -37,6 +40,7 @@ run test_offset_converter 10 1000
--height 600 \ --height 600 \
--iterations 20 \ --iterations 20 \
--threads 10 --threads 10
'
./benchmark/out/test_rendering \ ./benchmark/out/test_rendering \
--name "gdal tiff rendering" \ --name "gdal tiff rendering" \

65
benchmark/run_benchmarks Normal file
View file

@ -0,0 +1,65 @@
#!/bin/bash
BASE=.
function run {
local runner="$BASE/$1 --log=none"
local threads="$2"
local iters="$3"
shift 3
$runner --threads 0 --iterations $iters "$@"
if test $threads -gt 0; then
$runner --threads $threads --iterations $((iters/threads)) "$@"
fi
}
run test_getline 30 10000000
#run test_array_allocation 20 100000
#run test_png_encoding1 10 1000
#run test_png_encoding2 10 50
#run test_to_string1 10 100000
#run test_to_string2 10 100000
#run test_polygon_clipping 10 1000
#run test_polygon_clipping_rendering 10 100
run test_proj_transform1 10 100
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
: '
$BASE/test_rendering \
--name "text rendering" \
--map benchmark/data/roads.xml \
--extent 1477001.12245,6890242.37746,1480004.49012,6892244.62256 \
--width 600 \
--height 600 \
--iterations 20 \
--threads 10
'
$BASE/test_rendering \
--name "gdal tiff rendering" \
--map benchmark/data/gdal-wgs.xml \
--extent -180.0,-120.0,180.0,120.0 \
--width 600 \
--height 600 \
--iterations 20 \
--threads 10
$BASE/test_rendering \
--name "raster tiff rendering" \
--map benchmark/data/raster-wgs.xml \
--extent -180.0,-120.0,180.0,120.0 \
--width 600 \
--height 600 \
--iterations 20 \
--threads 10
$BASE/test_quad_tree \
--iterations 10000 \
--threads 1
$BASE/test_quad_tree \
--iterations 1000 \
--threads 10

View file

@ -0,0 +1,72 @@
#include "bench_framework.hpp"
#include <mapnik/util/math.hpp>
template<typename T>
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<bench_func<double>>(#func "(" #value ")", func, value)
int main(int argc, char** argv)
{
mapnik::setup();
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();
}

View file

@ -0,0 +1,370 @@
#include "bench_framework.hpp"
#include <cstring>
#include <cstdlib>
#include <deque>
#include <stdexcept>
#include <array>
#include <valarray>
#include <boost/version.hpp>
#if BOOST_VERSION >= 105400
#include <boost/container/static_vector.hpp>
#endif
// http://stackoverflow.com/questions/17347254/why-is-allocation-and-deallocation-of-stdvector-slower-than-dynamic-array-on-m
#define FULL_ZERO_CHECK
inline void ensure_zero(uint8_t* data, uint32_t size)
{
#ifdef FULL_ZERO_CHECK
for (std::size_t i = 0; i < size; ++i)
{
if (data[i] != 0)
{
throw std::runtime_error("found non zero value");
}
}
#else
if (data[0] != 0)
{
throw std::runtime_error("found non zero value");
}
#endif
}
class test1 : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test1(mapnik::parameters const& params)
: test_case(params)
, size_(*params.get<mapnik::value_integer>("size", 256 * 256))
, array_(size_, 0)
{}
bool validate() const { return true; }
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
// NOTE: sizeof(uint8_t) == 1
uint8_t* data = (uint8_t*)malloc(sizeof(uint8_t) * size_);
memcpy(data, &array_[0], size_);
ensure_zero(data, size_);
free(data);
}
return true;
}
};
class test1b : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test1b(mapnik::parameters const& params)
: test_case(params)
, size_(*params.get<mapnik::value_integer>("size", 256 * 256))
, array_(size_, 0)
{}
bool validate() const { return true; }
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
// NOTE: sizeof(uint8_t) == 1
uint8_t* data = (uint8_t*)malloc(sizeof(uint8_t) * size_);
memset(data, 0, sizeof(uint8_t) * size_);
ensure_zero(data, size_);
free(data);
}
return true;
}
};
class test1c : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test1c(mapnik::parameters const& params)
: test_case(params)
, size_(*params.get<mapnik::value_integer>("size", 256 * 256))
, array_(size_, 0)
{}
bool validate() const { return true; }
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
uint8_t* data = static_cast<uint8_t*>(::operator new(sizeof(uint8_t) * size_));
std::fill(data, data + size_, 0);
ensure_zero(data, size_);
::operator delete(data);
}
return true;
}
};
class test2 : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test2(mapnik::parameters const& params)
: test_case(params)
, size_(*params.get<mapnik::value_integer>("size", 256 * 256))
, array_(size_, 0)
{}
bool validate() const { return true; }
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
uint8_t* data = static_cast<uint8_t*>(::operator new(sizeof(uint8_t) * size_));
memcpy(data, &array_[0], size_);
ensure_zero(data, size_);
::operator delete(data), data = 0;
}
return true;
}
};
class test3 : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test3(mapnik::parameters const& params)
: test_case(params)
, size_(*params.get<mapnik::value_integer>("size", 256 * 256))
, array_(size_, 0)
{}
bool validate() const { return true; }
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
std::vector<uint8_t> data(size_);
ensure_zero(&data[0], data.size());
}
return true;
}
};
class test3b : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test3b(mapnik::parameters const& params)
: test_case(params)
, size_(*params.get<mapnik::value_integer>("size", 256 * 256))
, array_(size_, 0)
{}
bool validate() const { return true; }
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
std::vector<uint8_t> data(0);
data.resize(size_, 0);
ensure_zero(&data[0], data.size());
}
return true;
}
};
class test3c : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test3c(mapnik::parameters const& params)
: test_case(params)
, size_(*params.get<mapnik::value_integer>("size", 256 * 256))
, array_(size_, 0)
{}
bool validate() const { return true; }
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
std::vector<uint8_t> data(0);
data.assign(size_, 0);
ensure_zero(&data[0], data.size());
}
return true;
}
};
class test3d : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test3d(mapnik::parameters const& params)
: test_case(params)
, size_(*params.get<mapnik::value_integer>("size", 256 * 256))
, array_(size_, 0)
{}
bool validate() const { return true; }
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
std::deque<uint8_t> data(size_);
for (std::size_t i = 0; i < size_; ++i)
{
if (data[i] != 0)
{
throw std::runtime_error("found non zero value");
}
}
}
return true;
}
};
class test4 : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test4(mapnik::parameters const& params)
: test_case(params)
, size_(*params.get<mapnik::value_integer>("size", 256 * 256))
, array_(size_, 0)
{}
bool validate() const { return true; }
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
uint8_t* data = (uint8_t*)calloc(size_, sizeof(uint8_t));
ensure_zero(data, size_);
free(data);
}
return true;
}
};
class test5 : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test5(mapnik::parameters const& params)
: test_case(params)
, size_(*params.get<mapnik::value_integer>("size", 256 * 256))
, array_(size_, 0)
{}
bool validate() const { return true; }
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
std::string data(array_.begin(), array_.end());
ensure_zero((uint8_t*)&data[0], size_);
}
return true;
}
};
class test5b : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<char> array_;
test5b(mapnik::parameters const& params)
: test_case(params)
, size_(*params.get<mapnik::value_integer>("size", 256 * 256))
, array_(size_, 0)
{}
bool validate() const { return true; }
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
std::string data(&array_[0], array_.size());
ensure_zero((uint8_t*)&data[0], size_);
}
return true;
}
};
// C++14 dynarray<T>
// http://isocpp.org/blog/2013/04/trip-report-iso-c-spring-2013-meeting
// http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130909/088700.html
// http://stackoverflow.com/questions/17303902/any-alternative-to-stddynarray-presently-available
class test6 : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test6(mapnik::parameters const& params)
: test_case(params)
, size_(*params.get<mapnik::value_integer>("size", 256 * 256))
, array_(size_, 0)
{}
bool validate() const { return true; }
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
std::valarray<uint8_t> data(static_cast<uint8_t>(0), static_cast<size_t>(size_));
ensure_zero(&data[0], size_);
}
return true;
}
};
#if BOOST_VERSION >= 105400
// http://i42.co.uk/stuff/vecarray.htm
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost/container/static_vector.html
class test7 : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test7(mapnik::parameters const& params)
: test_case(params)
, size_(*params.get<mapnik::value_integer>("size", 256 * 256))
, array_(size_, 0)
{}
bool validate() const { return true; }
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
boost::container::static_vector<uint8_t, 256 * 256> data(size_, 0);
ensure_zero(&data[0], size_);
}
return true;
}
};
#endif
int main(int argc, char** argv)
{
mapnik::setup();
return benchmark::sequencer(argc, argv)
.run<test4>("calloc")
.run<test1>("malloc/memcpy")
.run<test1b>("malloc/memset")
.run<test1c>("operator new/std::fill")
.run<test2>("operator new/memcpy")
.run<test3>("vector(N)")
.run<test3b>("vector/resize")
.run<test3c>("vector/assign")
.run<test3d>("deque(N)")
.run<test5>("std::string range")
.run<test5b>("std::string &[0]")
.run<test6>("valarray")
#if BOOST_VERSION >= 105400
.run<test7>("static_vector")
#endif
.done();
}

View file

@ -1,16 +1,18 @@
#include "bench_framework.hpp" #include "bench_framework.hpp"
#include <mapnik/unicode.hpp> #include <mapnik/unicode.hpp>
#include <mapnik/attribute.hpp>
#include <mapnik/expression.hpp> #include <mapnik/expression.hpp>
#include <mapnik/expression_string.hpp> #include <mapnik/expression_string.hpp>
#include <mapnik/expression_grammar.hpp>
class test : public benchmark::test_case class test : public benchmark::test_case
{ {
std::string expr_; std::string expr_;
public:
public:
test(mapnik::parameters const& params) test(mapnik::parameters const& params)
: test_case(params), : test_case(params)
expr_("((([mapnik::geometry_type]=2) and ([oneway]=1)) and ([class]='path'))") {} , expr_("((([mapnik::geometry_type]=2) and ([oneway]=1)) and ([class]='path'))")
{}
bool validate() const bool validate() const
{ {
mapnik::expression_ptr expr = mapnik::parse_expression(expr_); mapnik::expression_ptr expr = mapnik::parse_expression(expr_);
@ -18,24 +20,25 @@ public:
bool ret = (result == expr_); bool ret = (result == expr_);
if (!ret) if (!ret)
{ {
std::clog << result << " != " << expr_ << "\n"; std::clog << result << " != " << expr_ << "\n";
} }
return ret; return ret;
} }
bool operator()() const bool operator()() const
{ {
for (std::size_t i=0;i<iterations_;++i) { for (std::size_t i = 0; i < iterations_; ++i)
mapnik::expression_ptr expr = mapnik::parse_expression(expr_); {
} mapnik::expression_ptr expr = mapnik::parse_expression(expr_);
return true; }
return true;
} }
}; };
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
mapnik::setup();
mapnik::parameters params; mapnik::parameters params;
benchmark::handle_args(argc,argv,params); benchmark::handle_args(argc, argv, params);
test test_runner(params); test test_runner(params);
return run(test_runner,"expr parsing"); return run(test_runner, "expr parsing");
} }

View file

@ -4,9 +4,10 @@
class test : public benchmark::test_case class test : public benchmark::test_case
{ {
public: public:
test(mapnik::parameters const& params) test(mapnik::parameters const& params)
: test_case(params) {} : test_case(params)
{}
bool validate() const bool validate() const
{ {
std::size_t count = 0; std::size_t count = 0;
@ -22,14 +23,15 @@ public:
font_cache, font_cache,
mapnik::freetype_engine::get_mapping(), mapnik::freetype_engine::get_mapping(),
mapnik::freetype_engine::get_cache()); mapnik::freetype_engine::get_cache());
if (f) ++count; if (f)
++count;
} }
return count == expected_count; return count == expected_count;
} }
bool operator()() const bool operator()() const
{ {
std::size_t expected_count = mapnik::freetype_engine::face_names().size(); std::size_t expected_count = mapnik::freetype_engine::face_names().size();
for (unsigned i=0;i<iterations_;++i) for (unsigned i = 0; i < iterations_; ++i)
{ {
std::size_t count = 0; std::size_t count = 0;
mapnik::freetype_engine::font_file_mapping_type font_file_mapping; mapnik::freetype_engine::font_file_mapping_type font_file_mapping;
@ -43,9 +45,11 @@ public:
font_cache, font_cache,
mapnik::freetype_engine::get_mapping(), mapnik::freetype_engine::get_mapping(),
mapnik::freetype_engine::get_cache()); mapnik::freetype_engine::get_cache());
if (f) ++count; if (f)
++count;
} }
if (count != expected_count) { if (count != expected_count)
{
std::clog << "warning: face creation not working as expected\n"; std::clog << "warning: face creation not working as expected\n";
} }
} }
@ -55,15 +59,16 @@ public:
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
mapnik::setup();
mapnik::parameters params; mapnik::parameters params;
benchmark::handle_args(argc,argv,params); benchmark::handle_args(argc, argv, params);
bool success = mapnik::freetype_engine::register_fonts("./fonts", true); bool success = mapnik::freetype_engine::register_fonts("./fonts", true);
if (!success) { if (!success)
std::clog << "warning, did not register any new fonts!\n"; {
return -1; std::clog << "warning, did not register any new fonts!\n";
} return -1;
}
std::size_t face_count = mapnik::freetype_engine::face_names().size(); std::size_t face_count = mapnik::freetype_engine::face_names().size();
test test_runner(params); test test_runner(params);
return run(test_runner,(boost::format("font_engine: creating %ld faces") % (face_count)).str()); return run(test_runner, (boost::format("font_engine: creating %ld faces") % (face_count)).str());
} }

View file

@ -1,21 +1,18 @@
#include "bench_framework.hpp" #include "bench_framework.hpp"
#include <mapnik/font_engine_freetype.hpp> #include <mapnik/font_engine_freetype.hpp>
#include <boost/format.hpp> #include <boost/format.hpp>
#include <boost/foreach.hpp>
class test : public benchmark::test_case class test : public benchmark::test_case
{ {
public: public:
test(mapnik::parameters const& params) test(mapnik::parameters const& params)
: test_case(params) {} : test_case(params)
bool validate() const {}
{ bool validate() const { return mapnik::freetype_engine::register_fonts("./fonts", true); }
return mapnik::freetype_engine::register_fonts("./fonts", true);
}
bool operator()() const bool operator()() const
{ {
unsigned long count = 0; unsigned long count = 0;
for (unsigned i=0;i<iterations_;++i) for (unsigned i = 0; i < iterations_; ++i)
{ {
mapnik::freetype_engine::register_fonts("./fonts", true); mapnik::freetype_engine::register_fonts("./fonts", true);
count++; count++;
@ -24,4 +21,4 @@ public:
} }
}; };
BENCHMARK(test,"font registration") BENCHMARK(test, "font registration")

View file

@ -1,22 +1,20 @@
#include "bench_framework.hpp" #include "bench_framework.hpp"
#include <cstring> #include "../plugins/input/csv/csv_getline.hpp"
#include <cstdlib>
#include "../plugins/input/csv/csv_utils.hpp"
class test : public benchmark::test_case class test : public benchmark::test_case
{ {
public: public:
std::string line_data_; std::string line_data_;
test(mapnik::parameters const& params) test(mapnik::parameters const& params)
: test_case(params), : test_case(params)
line_data_("this is one line\nand this is a second line\nand a third line") , line_data_("this is one line\nand this is a second line\nand a third line")
{ {
boost::optional<std::string> line_data = params.get<std::string>("line"); auto line_data = params.get<std::string>("line");
if (line_data) if (line_data)
{ {
line_data_ = *line_data; line_data_ = *line_data;
} }
} }
bool validate() const bool validate() const
{ {
@ -25,14 +23,15 @@ public:
std::string csv_line; std::string csv_line;
std::stringstream s; std::stringstream s;
s << line_data_; s << line_data_;
std::getline(s,csv_line,newline); std::getline(s, csv_line, newline);
if (csv_line != first) if (csv_line != first)
{ {
return true; return true;
} }
else else
{ {
std::clog << "Error: the parsed line (" << csv_line << ") should be a subset of the original line (" << line_data_ << ") (ensure you pass a line with a \\n)\n"; std::clog << "Error: the parsed line (" << csv_line << ") should be a subset of the original line ("
<< line_data_ << ") (ensure you pass a line with a \\n)\n";
} }
return true; return true;
} }
@ -42,29 +41,28 @@ public:
std::string csv_line; std::string csv_line;
std::stringstream s; std::stringstream s;
s << line_data_; s << line_data_;
for (unsigned i=0;i<iterations_;++i) for (unsigned i = 0; i < iterations_; ++i)
{ {
std::getline(s,csv_line,newline); std::getline(s, csv_line, newline);
} }
return true; return true;
} }
}; };
class test2 : public benchmark::test_case class test2 : public benchmark::test_case
{ {
public: public:
std::string line_data_; std::string line_data_;
test2(mapnik::parameters const& params) test2(mapnik::parameters const& params)
: test_case(params), : test_case(params)
line_data_("this is one line\nand this is a second line\nand a third line") , line_data_("this is one line\nand this is a second line\nand a third line")
{ {
boost::optional<std::string> line_data = params.get<std::string>("line"); auto line_data = params.get<std::string>("line");
if (line_data) if (line_data)
{ {
line_data_ = *line_data; line_data_ = *line_data;
} }
} }
bool validate() const bool validate() const
{ {
@ -74,14 +72,15 @@ public:
std::string csv_line; std::string csv_line;
std::stringstream s; std::stringstream s;
s << line_data_; s << line_data_;
csv_utils::getline_csv(s,csv_line,newline,quote); csv_utils::getline_csv(s, csv_line, newline, quote);
if (csv_line != first) if (csv_line != first)
{ {
return true; return true;
} }
else else
{ {
std::clog << "Error: the parsed line (" << csv_line << ") should be a subset of the original line (" << line_data_ << ") (ensure you pass a line with a \\n)\n"; std::clog << "Error: the parsed line (" << csv_line << ") should be a subset of the original line ("
<< line_data_ << ") (ensure you pass a line with a \\n)\n";
} }
return true; return true;
} }
@ -92,9 +91,9 @@ public:
std::string csv_line; std::string csv_line;
std::stringstream s; std::stringstream s;
s << line_data_; s << line_data_;
for (unsigned i=0;i<iterations_;++i) for (unsigned i = 0; i < iterations_; ++i)
{ {
csv_utils::getline_csv(s,csv_line,newline,quote); csv_utils::getline_csv(s, csv_line, newline, quote);
} }
return true; return true;
} }
@ -102,18 +101,19 @@ public:
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
mapnik::setup();
int return_value = 0; int return_value = 0;
try try
{ {
mapnik::parameters params; mapnik::parameters params;
benchmark::handle_args(argc,argv,params); benchmark::handle_args(argc, argv, params);
{ {
test test_runner(params); test test_runner(params);
return_value = return_value | run(test_runner,"std::getline"); return_value = return_value | run(test_runner, "std::getline");
} }
{ {
test2 test_runner2(params); test2 test_runner2(params);
return_value = return_value | run(test_runner2,"csv_utils::getline_csv"); return_value = return_value | run(test_runner2, "csv_utils::getline_csv");
} }
} }
catch (std::exception const& ex) catch (std::exception const& ex)

View file

@ -0,0 +1,40 @@
#include "bench_framework.hpp"
#include <mapnik/marker_cache.hpp>
class test : public benchmark::test_case
{
std::vector<std::string> images_;
public:
test(mapnik::parameters const& params)
: test_case(params)
, images_{"./test/data/images/dummy.jpg",
"./test/data/images/dummy.jpeg",
"./test/data/images/dummy.png",
"./test/data/images/dummy.tif",
"./test/data/images/dummy.tiff",
//"./test/data/images/landusepattern.jpeg", // will fail since it is a png
//"./test/data/images/xcode-CgBI.png", // will fail since its an invalid png
"./test/data/svg/octocat.svg",
"./test/data/svg/place-of-worship-24.svg",
"./test/data/svg/point_sm.svg",
"./test/data/svg/point.svg",
"./test/data/svg/airfield-12.svg"}
{}
bool validate() const { return true; }
bool operator()() const
{
unsigned count = 0;
for (std::size_t i = 0; i < iterations_; ++i)
{
for (auto filename : images_)
{
auto marker = mapnik::marker_cache::instance().find(filename, true);
}
++count;
}
return (count == iterations_);
}
};
BENCHMARK(test, "marker cache")

View file

@ -11,43 +11,41 @@
#include <mapnik/feature_type_style.hpp> #include <mapnik/feature_type_style.hpp>
#include <memory> #include <memory>
class test : public benchmark::test_case class test : public benchmark::test_case
{ {
public: public:
test(mapnik::parameters const& params) test(mapnik::parameters const& params)
: test_case(params) {} : test_case(params)
{}
bool validate() const bool validate() const { return true; }
{
return true;
}
bool operator()() const bool operator()() const
{ {
mapnik::Map m(256,256,"+init=epsg:3857"); mapnik::Map m(256, 256, "epsg:3857");
mapnik::parameters params; mapnik::parameters params;
params["type"]="memory"; params["type"] = "memory";
auto ds = std::make_shared<mapnik::memory_datasource>(params); auto ds = std::make_shared<mapnik::memory_datasource>(params);
// add whitespace to trigger phony "reprojection" // add whitespace to trigger phony "reprojection"
mapnik::layer lay("layer",m.srs() + " "); mapnik::layer lay("layer", m.srs() + " ");
lay.set_datasource(ds); lay.set_datasource(ds);
lay.add_style("style"); lay.add_style("style");
m.add_layer(lay); m.add_layer(lay);
// dummy style to ensure that layer is processed // dummy style to ensure that layer is processed
m.insert_style("style",mapnik::feature_type_style()); m.insert_style("style", mapnik::feature_type_style());
// dummy bbox, but "valid" because minx and miny are less // dummy bbox, but "valid" because minx and miny are less
// with an invalid bbox then layer.visible() returns false // with an invalid bbox then layer.visible() returns false
// and the initial rendering setup is not run // and the initial rendering setup is not run
m.zoom_to_box(mapnik::box2d<double>(-1,-1,0,0)); m.zoom_to_box(mapnik::box2d<double>(-1, -1, 0, 0));
for (unsigned i=0;i<iterations_;++i) for (unsigned i = 0; i < iterations_; ++i)
{ {
mapnik::image_rgba8 im(256,256); mapnik::image_rgba8 im(256, 256);
mapnik::agg_renderer<mapnik::image_rgba8> ren(m,im); mapnik::agg_renderer<mapnik::image_rgba8> ren(m, im);
ren.apply(); ren.apply();
} }
return true; return true;
} }
}; };
BENCHMARK(test,"rendering with reprojection") BENCHMARK(test, "rendering with reprojection")

View file

@ -9,23 +9,25 @@ class test_static : public benchmark::test_case
{ {
double step_; double step_;
std::uint8_t start_; std::uint8_t start_;
public:
public:
test_static(mapnik::parameters const& params) test_static(mapnik::parameters const& params)
: test_case(params), : test_case(params)
step_(STEP_NUM), , step_(STEP_NUM)
start_(START_NUM) {} , start_(START_NUM)
bool validate() const {}
{ bool validate() const { return true; }
return true;
}
bool operator()() const bool operator()() const
{ {
double value_ = 0.0; double value_ = 0.0;
std::uint8_t x; std::uint8_t x;
for (std::size_t i=0;i<iterations_;++i) { for (std::size_t i = 0; i < iterations_; ++i)
{
double c = static_cast<double>(start_) * value_; double c = static_cast<double>(start_) * value_;
if (c >= 256.0) c = 255.0; if (c >= 256.0)
if (c < 0.0) c = 0.0; c = 255.0;
if (c < 0.0)
c = 0.0;
x = static_cast<std::uint8_t>(c); x = static_cast<std::uint8_t>(c);
value_ += step_; value_ += step_;
} }
@ -33,35 +35,36 @@ public:
} }
}; };
using boost::numeric::positive_overflow;
using boost::numeric::negative_overflow; using boost::numeric::negative_overflow;
using boost::numeric::positive_overflow;
class test_numeric : public benchmark::test_case class test_numeric : public benchmark::test_case
{ {
double step_; double step_;
std::uint8_t start_; std::uint8_t start_;
public:
public:
test_numeric(mapnik::parameters const& params) test_numeric(mapnik::parameters const& params)
: test_case(params), : test_case(params)
step_(STEP_NUM), , step_(STEP_NUM)
start_(START_NUM) {} , start_(START_NUM)
bool validate() const {}
{ bool validate() const { return true; }
return true;
}
bool operator()() const bool operator()() const
{ {
double value_ = 0.0; double value_ = 0.0;
std::uint8_t x; std::uint8_t x;
for (std::size_t i=0;i<iterations_;++i) { for (std::size_t i = 0; i < iterations_; ++i)
try { {
try
{
x = boost::numeric_cast<std::uint8_t>(start_ * value_); x = boost::numeric_cast<std::uint8_t>(start_ * value_);
} }
catch(negative_overflow&) catch (negative_overflow&)
{ {
x = std::numeric_limits<std::uint8_t>::min(); x = std::numeric_limits<std::uint8_t>::min();
} }
catch(positive_overflow&) catch (positive_overflow&)
{ {
x = std::numeric_limits<std::uint8_t>::max(); x = std::numeric_limits<std::uint8_t>::max();
} }
@ -73,8 +76,6 @@ public:
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
return benchmark::sequencer(argc, argv) mapnik::setup();
.run<test_static>("static_cast") return benchmark::sequencer(argc, argv).run<test_static>("static_cast").run<test_numeric>("numeric_cast").done();
.run<test_numeric>("numeric_cast")
.done();
} }

View file

@ -14,31 +14,36 @@ struct fake_path
cont_type::iterator itr_; cont_type::iterator itr_;
fake_path(std::initializer_list<double> l) fake_path(std::initializer_list<double> l)
: fake_path(l.begin(), l.size()) { : fake_path(l.begin(), l.size())
} {}
fake_path(std::vector<double> const &v) fake_path(std::vector<double> const& v)
: fake_path(v.begin(), v.size()) { : fake_path(v.begin(), v.size())
} {}
template <typename Itr> template<typename Itr>
fake_path(Itr itr, size_t sz) { fake_path(Itr itr, size_t sz)
{
size_t num_coords = sz >> 1; size_t num_coords = sz >> 1;
vertices_.reserve(num_coords); vertices_.reserve(num_coords);
for (size_t i = 0; i < num_coords; ++i) { for (size_t i = 0; i < num_coords; ++i)
{
double x = *itr++; double x = *itr++;
double y = *itr++; double y = *itr++;
unsigned cmd = (i == 0) ? mapnik::SEG_MOVETO : mapnik::SEG_LINETO; unsigned cmd = (i == 0) ? mapnik::SEG_MOVETO : mapnik::SEG_LINETO;
vertices_.push_back(std::make_tuple(x, y, cmd)); vertices_.push_back(std::make_tuple(x, y, cmd));
if (i == num_coords - 1) cmd = mapnik::SEG_END; if (i == num_coords - 1)
cmd = mapnik::SEG_END;
vertices_.push_back(std::make_tuple(x, y, cmd)); vertices_.push_back(std::make_tuple(x, y, cmd));
} }
itr_ = vertices_.begin(); itr_ = vertices_.begin();
} }
unsigned vertex(double *x, double *y) { unsigned vertex(double* x, double* y)
if (itr_ == vertices_.end()) { {
if (itr_ == vertices_.end())
{
return mapnik::SEG_END; return mapnik::SEG_END;
} }
*x = std::get<0>(*itr_); *x = std::get<0>(*itr_);
@ -48,33 +53,30 @@ struct fake_path
return cmd; return cmd;
} }
void rewind(unsigned) { void rewind(unsigned) { itr_ = vertices_.begin(); }
itr_ = vertices_.begin();
}
}; };
class test_offset : public benchmark::test_case class test_offset : public benchmark::test_case
{ {
public: public:
test_offset(mapnik::parameters const& params) test_offset(mapnik::parameters const& params)
: test_case(params) {} : test_case(params)
bool validate() const {}
{ bool validate() const { return true; }
return true;
}
bool operator()() const bool operator()() const
{ {
std::vector<double> path; std::vector<double> path;
int mysize = 2500; int mysize = 2500;
int x1 = 0; int x1 = 0;
path.reserve(mysize*2); path.reserve(mysize * 2);
for( int i = 0; i < mysize; i++ ) for (int i = 0; i < mysize; i++)
{ {
path.push_back( i ); path.push_back(i);
path.push_back( 0 ); path.push_back(0);
} }
fake_path fpath(path); fake_path fpath(path);
for (std::size_t i=0;i<iterations_;++i) { for (std::size_t i = 0; i < iterations_; ++i)
{
mapnik::offset_converter<fake_path> off_path(fpath); mapnik::offset_converter<fake_path> off_path(fpath);
off_path.set_offset(10); off_path.set_offset(10);
unsigned cmd; unsigned cmd;
@ -88,15 +90,15 @@ public:
} }
}; };
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
mapnik::setup();
mapnik::parameters params; mapnik::parameters params;
benchmark::handle_args(argc,argv,params); benchmark::handle_args(argc, argv, params);
int return_value = 0; int return_value = 0;
{ {
test_offset test_runner(params); test_offset test_runner(params);
return_value = run(test_runner,"offset_test"); return_value = run(test_runner, "offset_test");
} }
return return_value; return return_value;
} }

View file

@ -4,23 +4,23 @@
class test : public benchmark::test_case class test : public benchmark::test_case
{ {
mapnik::image_rgba8 im_; mapnik::image_rgba8 im_;
public:
public:
test(mapnik::parameters const& params) test(mapnik::parameters const& params)
: test_case(params), : test_case(params)
im_(256,256) {} , im_(256, 256)
bool validate() const {}
{ bool validate() const { return true; }
return true;
}
bool operator()() const bool operator()() const
{ {
std::string out; std::string out;
for (std::size_t i=0;i<iterations_;++i) { for (std::size_t i = 0; i < iterations_; ++i)
{
out.clear(); out.clear();
out = mapnik::save_to_string(im_,"png8:m=h:z=1"); out = mapnik::save_to_string(im_, "png8:m=h:z=1");
} }
return true; return true;
} }
}; };
BENCHMARK(test,"encoding blank png") BENCHMARK(test, "encoding blank png")

View file

@ -1,37 +1,41 @@
#include "bench_framework.hpp" #include "bench_framework.hpp"
#include "compare_images.hpp" #include "compare_images.hpp"
#include <memory>
class test : public benchmark::test_case class test : public benchmark::test_case
{ {
std::shared_ptr<image_rgba8> im_; std::shared_ptr<mapnik::image_rgba8> im_;
public:
public:
test(mapnik::parameters const& params) test(mapnik::parameters const& params)
: test_case(params) { : test_case(params)
{
std::string filename("./benchmark/data/multicolor.png"); std::string filename("./benchmark/data/multicolor.png");
std::unique_ptr<mapnik::image_reader> reader(mapnik::get_image_reader(filename,"png")); std::unique_ptr<mapnik::image_reader> reader(mapnik::get_image_reader(filename, "png"));
if (!reader.get()) if (!reader.get())
{ {
throw mapnik::image_reader_exception("Failed to load: " + filename); throw mapnik::image_reader_exception("Failed to load: " + filename);
} }
im_ = std::make_shared<image_rgba8>(reader->width(),reader->height()); im_ = std::make_shared<mapnik::image_rgba8>(reader->width(), reader->height());
reader->read(0,0,*im_); reader->read(0, 0, *im_);
} }
bool validate() const bool validate() const
{ {
std::string expected("./benchmark/data/multicolor-hextree-expected.png"); std::string expected("./benchmark/data/multicolor-hextree-expected.png");
std::string actual("./benchmark/data/multicolor-hextree-actual.png"); std::string actual("./benchmark/data/multicolor-hextree-actual.png");
mapnik::save_to_file(*im_,actual, "png8:m=h:z=1"); mapnik::save_to_file(*im_, actual, "png8:m=h:z=1");
return benchmark::compare_images(actual,expected); return benchmark::compare_images(actual, expected);
} }
bool operator()() const bool operator()() const
{ {
std::string out; std::string out;
for (std::size_t i=0;i<iterations_;++i) { for (std::size_t i = 0; i < iterations_; ++i)
{
out.clear(); out.clear();
out = mapnik::save_to_string(*im_,"png8:m=h:z=1"); out = mapnik::save_to_string(*im_, "png8:m=h:z=1");
} }
return true; return true;
} }
}; };
BENCHMARK(test,"encoding multicolor png") BENCHMARK(test, "encoding multicolor png")

View file

@ -10,10 +10,10 @@
#include <mapnik/geometry.hpp> #include <mapnik/geometry.hpp>
#include <mapnik/vertex_adapters.hpp> #include <mapnik/vertex_adapters.hpp>
#include <mapnik/geometry.hpp> #include <mapnik/geometry.hpp>
#include <mapnik/geometry_adapters.hpp> #include <mapnik/geometry/boost_adapters.hpp>
#include <mapnik/geometry_envelope.hpp> #include <mapnik/geometry/envelope.hpp>
#include <mapnik/geometry_correct.hpp> #include <mapnik/geometry/correct.hpp>
#include <mapnik/geometry_is_empty.hpp> #include <mapnik/geometry/is_empty.hpp>
#include <mapnik/image_util.hpp> #include <mapnik/image_util.hpp>
#include <mapnik/color.hpp> #include <mapnik/color.hpp>
// boost geometry // boost geometry
@ -39,30 +39,31 @@ void render(mapnik::geometry::multi_polygon<double> const& geom,
mapnik::box2d<double> const& extent, mapnik::box2d<double> const& extent,
std::string const& name) std::string const& name)
{ {
using path_type = mapnik::transform_path_adapter<mapnik::view_transform,mapnik::geometry::polygon_vertex_adapter<double>>; using path_type =
mapnik::transform_path_adapter<mapnik::view_transform, mapnik::geometry::polygon_vertex_adapter<double>>;
using ren_base = agg::renderer_base<agg::pixfmt_rgba32_plain>; using ren_base = agg::renderer_base<agg::pixfmt_rgba32_plain>;
using renderer = agg::renderer_scanline_aa_solid<ren_base>; using renderer = agg::renderer_scanline_aa_solid<ren_base>;
mapnik::image_rgba8 im(256,256); mapnik::image_rgba8 im(256, 256);
mapnik::fill(im, mapnik::color("white")); mapnik::fill(im, mapnik::color("white"));
mapnik::box2d<double> padded_extent(155,134,665,466);//extent; mapnik::box2d<double> padded_extent(155, 134, 665, 466); // extent;
padded_extent.pad(10); padded_extent.pad(10);
mapnik::view_transform tr(im.width(),im.height(),padded_extent,0,0); mapnik::view_transform tr(im.width(), im.height(), padded_extent, 0, 0);
agg::rendering_buffer buf(im.bytes(),im.width(),im.height(), im.row_size()); agg::rendering_buffer buf(im.bytes(), im.width(), im.height(), im.row_size());
agg::pixfmt_rgba32_plain pixf(buf); agg::pixfmt_rgba32_plain pixf(buf);
ren_base renb(pixf); ren_base renb(pixf);
renderer ren(renb); renderer ren(renb);
mapnik::proj_transform prj_trans(mapnik::projection("+init=epsg:4326"),mapnik::projection("+init=epsg:4326")); mapnik::proj_transform prj_trans(mapnik::projection("epsg:4326"), mapnik::projection("epsg:4326"));
ren.color(agg::rgba8(127,127,127,255)); ren.color(agg::rgba8(127, 127, 127, 255));
agg::rasterizer_scanline_aa<> ras; agg::rasterizer_scanline_aa<> ras;
for (auto const& poly : geom) for (auto const& poly : geom)
{ {
mapnik::geometry::polygon_vertex_adapter<double> va(poly); mapnik::geometry::polygon_vertex_adapter<double> va(poly);
path_type path(tr,va,prj_trans); path_type path(tr, va, prj_trans);
ras.add_path(path); ras.add_path(path);
} }
agg::scanline_u8 sl; agg::scanline_u8 sl;
agg::render_scanlines(ras, sl, ren); agg::render_scanlines(ras, sl, ren);
mapnik::save_to_file(im,name); mapnik::save_to_file(im, name);
} }
class test1 : public benchmark::test_case class test1 : public benchmark::test_case
@ -70,15 +71,15 @@ class test1 : public benchmark::test_case
std::string wkt_in_; std::string wkt_in_;
mapnik::box2d<double> extent_; mapnik::box2d<double> extent_;
std::string expected_; std::string expected_;
public:
public:
using conv_clip = agg::conv_clip_polygon<mapnik::geometry::polygon_vertex_adapter<double>>; using conv_clip = agg::conv_clip_polygon<mapnik::geometry::polygon_vertex_adapter<double>>;
test1(mapnik::parameters const& params, test1(mapnik::parameters const& params, std::string const& wkt_in, mapnik::box2d<double> const& extent)
std::string const& wkt_in, : test_case(params)
mapnik::box2d<double> const& extent) , wkt_in_(wkt_in)
: test_case(params), , extent_(extent)
wkt_in_(wkt_in), , expected_("./benchmark/data/polygon_clipping_agg")
extent_(extent), {}
expected_("./benchmark/data/polygon_clipping_agg") {}
bool validate() const bool validate() const
{ {
mapnik::geometry::geometry<double> geom; mapnik::geometry::geometry<double> geom;
@ -99,14 +100,8 @@ public:
mapnik::geometry::polygon<double> const& poly = mapnik::util::get<mapnik::geometry::polygon<double>>(geom); mapnik::geometry::polygon<double> const& poly = mapnik::util::get<mapnik::geometry::polygon<double>>(geom);
mapnik::geometry::polygon_vertex_adapter<double> va(poly); mapnik::geometry::polygon_vertex_adapter<double> va(poly);
conv_clip clipped(va); conv_clip clipped(va);
clipped.clip_box( clipped.clip_box(extent_.minx(), extent_.miny(), extent_.maxx(), extent_.maxy());
extent_.minx(),
extent_.miny(),
extent_.maxx(),
extent_.maxy());
clipped.rewind(0); clipped.rewind(0);
mapnik::geometry::polygon<double> poly2; mapnik::geometry::polygon<double> poly2;
@ -118,47 +113,49 @@ public:
{ {
if (cmd == mapnik::SEG_MOVETO) if (cmd == mapnik::SEG_MOVETO)
{ {
x0 = x; y0 = y; x0 = x;
y0 = y;
} }
if (cmd == mapnik::SEG_CLOSE) if (cmd == mapnik::SEG_CLOSE)
{ {
ring.add_coord(x0, y0); ring.emplace_back(x0, y0);
break; break;
} }
ring.add_coord(x,y); ring.emplace_back(x, y);
} }
poly2.set_exterior_ring(std::move(ring)); poly2.push_back(std::move(ring));
// interior rings // interior rings
ring.clear(); ring.clear();
while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END) while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END)
{ {
if (cmd == mapnik::SEG_MOVETO) if (cmd == mapnik::SEG_MOVETO)
{ {
x0 = x; y0 = y; x0 = x;
y0 = y;
} }
else if (cmd == mapnik::SEG_CLOSE) else if (cmd == mapnik::SEG_CLOSE)
{ {
ring.add_coord(x0,y0); ring.emplace_back(x0, y0);
poly2.add_hole(std::move(ring)); poly2.push_back(std::move(ring));
ring.clear(); ring.clear();
continue; continue;
} }
ring.add_coord(x,y); ring.emplace_back(x, y);
} }
std::string expect = expected_+".png"; std::string expect = expected_ + ".png";
std::string actual = expected_+"_actual.png"; std::string actual = expected_ + "_actual.png";
mapnik::geometry::multi_polygon<double> mp; mapnik::geometry::multi_polygon<double> mp;
mp.emplace_back(poly2); mp.emplace_back(poly2);
auto env = mapnik::geometry::envelope(mp); auto env = mapnik::geometry::envelope(mp);
if (!mapnik::util::exists(expect) || (std::getenv("UPDATE") != nullptr)) if (!mapnik::util::exists(expect) || (std::getenv("UPDATE") != nullptr))
{ {
std::clog << "generating expected image: " << expect << "\n"; std::clog << "generating expected image: " << expect << "\n";
render(mp,env,expect); render(mp, env, expect);
} }
render(mp,env,actual); render(mp, env, actual);
return benchmark::compare_images(actual,expect); return benchmark::compare_images(actual, expect);
} }
bool operator()() const bool operator()() const
{ {
@ -178,29 +175,28 @@ public:
return false; return false;
} }
bool valid = true; bool valid = true;
for (unsigned i=0;i<iterations_;++i) for (unsigned i = 0; i < iterations_; ++i)
{ {
unsigned count = 0; unsigned count = 0;
mapnik::geometry::polygon<double> const& poly = mapnik::util::get<mapnik::geometry::polygon<double>>(geom); mapnik::geometry::polygon<double> const& poly = mapnik::util::get<mapnik::geometry::polygon<double>>(geom);
mapnik::geometry::polygon_vertex_adapter<double> va(poly); mapnik::geometry::polygon_vertex_adapter<double> va(poly);
conv_clip clipped(va); conv_clip clipped(va);
clipped.clip_box( clipped.clip_box(extent_.minx(), extent_.miny(), extent_.maxx(), extent_.maxy());
extent_.minx(),
extent_.miny(),
extent_.maxx(),
extent_.maxy());
unsigned cmd; unsigned cmd;
double x,y; double x, y;
// NOTE: this rewind is critical otherwise // NOTE: this rewind is critical otherwise
// agg_conv_adapter_vpgen will give garbage // agg_conv_adapter_vpgen will give garbage
// values for the first vertex // values for the first vertex
clipped.rewind(0); clipped.rewind(0);
while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END) { while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END)
{
count++; count++;
} }
unsigned expected_count = 30; unsigned expected_count = 30;
if (count != expected_count) { if (count != expected_count)
std::clog << "test1: clipping failed: processed " << count << " verticies but expected " << expected_count << "\n"; {
std::clog << "test1: clipping failed: processed " << count << " verticies but expected "
<< expected_count << "\n";
valid = false; valid = false;
} }
} }
@ -208,20 +204,19 @@ public:
} }
}; };
class test3 : public benchmark::test_case class test3 : public benchmark::test_case
{ {
std::string wkt_in_; std::string wkt_in_;
mapnik::box2d<double> extent_; mapnik::box2d<double> extent_;
std::string expected_; std::string expected_;
public:
test3(mapnik::parameters const& params, public:
std::string const& wkt_in, test3(mapnik::parameters const& params, std::string const& wkt_in, mapnik::box2d<double> const& extent)
mapnik::box2d<double> const& extent) : test_case(params)
: test_case(params), , wkt_in_(wkt_in)
wkt_in_(wkt_in), , extent_(extent)
extent_(extent), , expected_("./benchmark/data/polygon_clipping_boost")
expected_("./benchmark/data/polygon_clipping_boost") {} {}
bool validate() const bool validate() const
{ {
mapnik::geometry::geometry<double> geom; mapnik::geometry::geometry<double> geom;
@ -234,30 +229,30 @@ public:
std::clog << "empty geom!\n"; std::clog << "empty geom!\n";
return false; return false;
} }
if (!geom.is<mapnik::geometry::polygon<double> >()) if (!geom.is<mapnik::geometry::polygon<double>>())
{ {
std::clog << "not a polygon!\n"; std::clog << "not a polygon!\n";
return false; return false;
} }
mapnik::geometry::polygon<double> & poly = mapnik::util::get<mapnik::geometry::polygon<double> >(geom); mapnik::geometry::polygon<double>& poly = mapnik::util::get<mapnik::geometry::polygon<double>>(geom);
mapnik::geometry::correct(poly); mapnik::geometry::correct(poly);
mapnik::geometry::linear_ring<double> bbox; mapnik::geometry::linear_ring<double> bbox;
bbox.add_coord(extent_.minx(), extent_.miny()); bbox.emplace_back(extent_.minx(), extent_.miny());
bbox.add_coord(extent_.minx(), extent_.maxy()); bbox.emplace_back(extent_.minx(), extent_.maxy());
bbox.add_coord(extent_.maxx(), extent_.maxy()); bbox.emplace_back(extent_.maxx(), extent_.maxy());
bbox.add_coord(extent_.maxx(), extent_.miny()); bbox.emplace_back(extent_.maxx(), extent_.miny());
bbox.add_coord(extent_.minx(), extent_.miny()); bbox.emplace_back(extent_.minx(), extent_.miny());
std::deque<mapnik::geometry::polygon<double> > result; std::deque<mapnik::geometry::polygon<double>> result;
boost::geometry::intersection(bbox, poly, result); boost::geometry::intersection(bbox, poly, result);
std::string expect = expected_+".png"; std::string expect = expected_ + ".png";
std::string actual = expected_+"_actual.png"; std::string actual = expected_ + "_actual.png";
mapnik::geometry::multi_polygon<double> mp; mapnik::geometry::multi_polygon<double> mp;
for (auto const& _geom: result) for (auto const& _geom : result)
{ {
//std::clog << boost::geometry::dsv(geom) << "\n"; // std::clog << boost::geometry::dsv(geom) << "\n";
mp.emplace_back(_geom); mp.emplace_back(_geom);
} }
mapnik::geometry::geometry<double> geom2(mp); mapnik::geometry::geometry<double> geom2(mp);
@ -265,10 +260,10 @@ public:
if (!mapnik::util::exists(expect) || (std::getenv("UPDATE") != nullptr)) if (!mapnik::util::exists(expect) || (std::getenv("UPDATE") != nullptr))
{ {
std::clog << "generating expected image: " << expect << "\n"; std::clog << "generating expected image: " << expect << "\n";
render(mp,env,expect); render(mp, env, expect);
} }
render(mp,env,actual); render(mp, env, actual);
return benchmark::compare_images(actual,expect); return benchmark::compare_images(actual, expect);
} }
bool operator()() const bool operator()() const
{ {
@ -282,38 +277,41 @@ public:
std::clog << "empty geom!\n"; std::clog << "empty geom!\n";
return false; return false;
} }
if (!geom.is<mapnik::geometry::polygon<double> >()) if (!geom.is<mapnik::geometry::polygon<double>>())
{ {
std::clog << "not a polygon!\n"; std::clog << "not a polygon!\n";
return false; return false;
} }
mapnik::geometry::polygon<double> & poly = mapnik::util::get<mapnik::geometry::polygon<double> >(geom); mapnik::geometry::polygon<double>& poly = mapnik::util::get<mapnik::geometry::polygon<double>>(geom);
mapnik::geometry::correct(poly); mapnik::geometry::correct(poly);
mapnik::geometry::linear_ring<double> bbox; mapnik::geometry::linear_ring<double> bbox;
bbox.add_coord(extent_.minx(), extent_.miny()); bbox.emplace_back(extent_.minx(), extent_.miny());
bbox.add_coord(extent_.minx(), extent_.maxy()); bbox.emplace_back(extent_.minx(), extent_.maxy());
bbox.add_coord(extent_.maxx(), extent_.maxy()); bbox.emplace_back(extent_.maxx(), extent_.maxy());
bbox.add_coord(extent_.maxx(), extent_.miny()); bbox.emplace_back(extent_.maxx(), extent_.miny());
bbox.add_coord(extent_.minx(), extent_.miny()); bbox.emplace_back(extent_.minx(), extent_.miny());
bool valid = true; bool valid = true;
for (unsigned i=0;i<iterations_;++i) for (unsigned i = 0; i < iterations_; ++i)
{ {
std::deque<mapnik::geometry::polygon<double> > result; std::deque<mapnik::geometry::polygon<double>> result;
boost::geometry::intersection(bbox, poly, result); boost::geometry::intersection(bbox, poly, result);
unsigned count = 0; unsigned count = 0;
for (auto const& _geom : result) for (auto const& _geom : result)
{ {
mapnik::geometry::polygon_vertex_adapter<double> va(_geom); mapnik::geometry::polygon_vertex_adapter<double> va(_geom);
unsigned cmd; unsigned cmd;
double x,y; double x, y;
while ((cmd = va.vertex(&x, &y)) != mapnik::SEG_END) { while ((cmd = va.vertex(&x, &y)) != mapnik::SEG_END)
{
++count; ++count;
} }
unsigned expected_count = 29; unsigned expected_count = 29;
if (count != expected_count) { if (count != expected_count)
std::clog << "test3: clipping failed: processed " << count << " verticies but expected " << expected_count << "\n"; {
std::clog << "test3: clipping failed: processed " << count << " verticies but expected "
<< expected_count << "\n";
valid = false; valid = false;
} }
} }
@ -500,8 +498,8 @@ public:
} }
unsigned expected_count = 29; unsigned expected_count = 29;
if (count != expected_count) { if (count != expected_count) {
std::clog << "test3: clipping failed: processed " << count << " verticies but expected " << expected_count << "\n"; std::clog << "test3: clipping failed: processed " << count << " verticies but expected " <<
valid = false; expected_count << "\n"; valid = false;
} }
} }
} }
@ -512,15 +510,19 @@ public:
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
mapnik::setup();
mapnik::parameters params; mapnik::parameters params;
benchmark::handle_args(argc,argv,params); benchmark::handle_args(argc, argv, params);
// polygon/rect clipping // polygon/rect clipping
// IN : POLYGON ((155 203, 233 454, 315 340, 421 446, 463 324, 559 466, 665 253, 528 178, 394 229, 329 138, 212 134, 183 228, 200 264, 155 203),(313 190, 440 256, 470 248, 510 305, 533 237, 613 263, 553 397, 455 262, 405 378, 343 287, 249 334, 229 191, 313 190)) // IN : POLYGON ((155 203, 233 454, 315 340, 421 446, 463 324, 559 466, 665 253, 528 178, 394 229, 329 138, 212 134,
// RECT : POLYGON ((181 106, 181 470, 631 470, 631 106, 181 106)) // 183 228, 200 264, 155 203),(313 190, 440 256, 470 248, 510 305, 533 237, 613 263, 553 397, 455 262, 405 378, 343
// OUT (expected) // 287, 249 334, 229 191, 313 190)) RECT : POLYGON ((181 106, 181 470, 631 470, 631 106, 181 106)) OUT (expected)
// POLYGON ((181 286.6666666666667, 233 454, 315 340, 421 446, 463 324, 559 466, 631 321.3207547169811, 631 234.38686131386862, 528 178, 394 229, 329 138, 212 134, 183 228, 200 264, 181 238.24444444444444, 181 286.6666666666667),(313 190, 440 256, 470 248, 510 305, 533 237, 613 263, 553 397, 455 262, 405 378, 343 287, 249 334, 229 191, 313 190)) // POLYGON ((181 286.6666666666667, 233 454, 315 340, 421 446, 463 324, 559 466, 631 321.3207547169811, 631
// 234.38686131386862, 528 178, 394 229, 329 138, 212 134, 183 228, 200 264, 181 238.24444444444444, 181
// 286.6666666666667),(313 190, 440 256, 470 248, 510 305, 533 237, 613 263, 553 397, 455 262, 405 378, 343 287, 249
// 334, 229 191, 313 190))
#if 0
mapnik::box2d<double> clipping_box(181,106,631,470); mapnik::box2d<double> clipping_box(181,106,631,470);
std::string filename_("./benchmark/data/polygon.wkt"); std::string filename_("./benchmark/data/polygon.wkt");
std::ifstream in(filename_.c_str(),std::ios_base::in | std::ios_base::binary); std::ifstream in(filename_.c_str(),std::ios_base::in | std::ios_base::binary);
@ -543,5 +545,6 @@ int main(int argc, char** argv)
return_value = return_value | run(test_runner,"clipping polygon with clipper_tree"); return_value = return_value | run(test_runner,"clipping polygon with clipper_tree");
} }
*/ */
return return_value; #endif
return 0; // return_value;
} }

View file

@ -0,0 +1,59 @@
#include "bench_framework.hpp"
#include <mapnik/map.hpp>
#include <mapnik/load_map.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/datasource_cache.hpp>
class test : public benchmark::test_case
{
std::string xml_;
mapnik::box2d<double> extent_;
public:
test(mapnik::parameters const& params, std::string const& xml, mapnik::box2d<double> const& extent)
: test_case(params)
, xml_(xml)
, extent_(extent)
{}
bool validate() const
{
mapnik::Map m(256, 256);
mapnik::load_map(m, xml_);
m.zoom_to_box(extent_);
mapnik::image_rgba8 im(m.width(), m.height());
mapnik::agg_renderer<mapnik::image_rgba8> ren(m, im);
ren.apply();
// mapnik::save_to_file(im.data(),"test.png");
return true;
}
bool operator()() const
{
mapnik::Map m(256, 256);
mapnik::load_map(m, xml_);
m.zoom_to_box(extent_);
for (unsigned i = 0; i < iterations_; ++i)
{
mapnik::image_rgba8 im(m.width(), m.height());
mapnik::agg_renderer<mapnik::image_rgba8> ren(m, im);
ren.apply();
}
return true;
}
};
int main(int argc, char** argv)
{
mapnik::setup();
mapnik::parameters params;
benchmark::handle_args(argc, argv, params);
mapnik::datasource_cache::instance().register_datasources("./plugins/input/");
mapnik::box2d<double> z1(-20037508.3428, -8317435.0606, 20037508.3428, 18399242.7298);
// bbox for 16/10491/22911.png
mapnik::box2d<double> z16(-13622912.929097254, 6026906.8062295765, -13621689.93664469, 6028129.79868214);
return benchmark::sequencer(argc, argv)
.run<test>("polygon clip render z1", "benchmark/data/polygon_rendering_clip.xml", z1)
.run<test>("polygon noclip render z1", "benchmark/data/polygon_rendering_no_clip.xml", z1)
.run<test>("polygon clip render z16", "benchmark/data/polygon_rendering_clip.xml", z16)
.run<test>("polygon noclip render z16", "benchmark/data/polygon_rendering_no_clip.xml", z16)
.done();
}

View file

@ -0,0 +1,77 @@
#include "bench_framework.hpp"
#include <mapnik/geometry/box2d.hpp>
#include <mapnik/projection.hpp>
#include <mapnik/proj_transform.hpp>
class test : public benchmark::test_case
{
std::string src_;
std::string dest_;
mapnik::box2d<double> from_;
mapnik::box2d<double> to_;
bool defer_proj_init_;
public:
test(mapnik::parameters const& params,
std::string const& src,
std::string const& dest,
mapnik::box2d<double> const& from,
mapnik::box2d<double> const& to,
bool defer_proj)
: test_case(params)
, src_(src)
, dest_(dest)
, from_(from)
, to_(to)
, defer_proj_init_(defer_proj)
{}
bool validate() const
{
mapnik::projection src(src_, defer_proj_init_);
mapnik::projection dest(dest_, defer_proj_init_);
mapnik::proj_transform tr(src, dest);
mapnik::box2d<double> bbox = from_;
if (!tr.forward(bbox))
return false;
return ((std::fabs(bbox.minx() - to_.minx()) < .5) && (std::fabs(bbox.maxx() - to_.maxx()) < .5) &&
(std::fabs(bbox.miny() - to_.miny()) < .5) && (std::fabs(bbox.maxy() - to_.maxy()) < .5));
}
bool operator()() const
{
mapnik::projection src(src_, defer_proj_init_);
mapnik::projection dest(dest_, defer_proj_init_);
mapnik::proj_transform tr(src, dest);
for (std::size_t i = 0; i < iterations_; ++i)
{
for (int j = -180; j < 180; j = j + 5)
{
for (int k = -85; k < 85; k = k + 5)
{
mapnik::box2d<double> box(j, k, j, k);
if (!tr.forward(box))
throw std::runtime_error("could not transform coords");
}
}
}
return true;
}
};
// echo -180 -60 | cs2cs -f "%.10f" epsg:4326 +to epsg:3857
int main(int argc, char** argv)
{
mapnik::setup();
mapnik::box2d<double> from(-180, -80, 180, 80);
mapnik::box2d<double> to(-20037508.3427892476, -15538711.0963092316, 20037508.3427892476, 15538711.0963092316);
std::string from_str("epsg:4326");
std::string to_str("epsg:3857");
std::string from_str2("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs");
std::string to_str2("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m "
"+nadgrids=@null +wktext +no_defs +over");
return benchmark::sequencer(argc, argv)
.run<test>("lonlat->merc epsg (internal)", from_str, to_str, from, to, true)
.run<test>("lonlat->merc literal (libproj)", from_str2, to_str2, from, to, true)
.run<test>("merc->lonlat epsg (internal)", to_str, from_str, to, from, true)
.run<test>("merc->lonlat literal (libproj)", to_str2, from_str2, to, from, true)
.done();
}

View file

@ -6,43 +6,41 @@ using quad_tree_type = mapnik::quad_tree<std::size_t>;
class test : public benchmark::test_case class test : public benchmark::test_case
{ {
public: public:
test(mapnik::parameters const& params) test(mapnik::parameters const& params)
: test_case(params) {} : test_case(params)
{}
bool validate() const bool validate() const { return true; }
{
return true;
}
bool operator()() const bool operator()() const
{ {
std::random_device rd; std::random_device rd;
std::default_random_engine engine(rd()); std::default_random_engine engine(rd());
std::uniform_int_distribution<int> uniform_dist(0, 2048); std::uniform_int_distribution<int> uniform_dist(0, 2048);
quad_tree_type tree(mapnik::box2d<double>(0,0,2048,2048)); quad_tree_type tree(mapnik::box2d<double>(0, 0, 2048, 2048));
//populate // populate
for (size_t i = 0; i < iterations_; ++i) for (size_t i = 0; i < iterations_; ++i)
{ {
int cx = uniform_dist(engine); int cx = uniform_dist(engine);
int cy = uniform_dist(engine); int cy = uniform_dist(engine);
int sx = 0.2 * uniform_dist(engine); int sx = 0.2 * uniform_dist(engine);
int sy = 0.2 * uniform_dist(engine); int sy = 0.2 * uniform_dist(engine);
mapnik::box2d<double> box(cx - sx,cy - sy, cx + sx, cy + sy); mapnik::box2d<double> box(cx - sx, cy - sy, cx + sx, cy + sy);
tree.insert(i, box); tree.insert(i, box);
} }
// bounding box query // bounding box query
std::size_t count=0; std::size_t count = 0;
for (size_t i = 0; i < iterations_; ++i) for (size_t i = 0; i < iterations_; ++i)
{ {
int cx = uniform_dist(engine); int cx = uniform_dist(engine);
int cy = uniform_dist(engine); int cy = uniform_dist(engine);
int sx = 0.4 * uniform_dist(engine); int sx = 0.4 * uniform_dist(engine);
int sy = 0.4 * uniform_dist(engine); int sy = 0.4 * uniform_dist(engine);
mapnik::box2d<double> box(cx - sx,cy - sy, cx + sx, cy + sy); mapnik::box2d<double> box(cx - sx, cy - sy, cx + sx, cy + sy);
auto itr = tree.query_in_box(box); auto itr = tree.query_in_box(box);
auto end = tree.query_end(); auto end = tree.query_end();
for ( ;itr != end; ++itr) for (; itr != end; ++itr)
{ {
++count; ++count;
} }
@ -51,4 +49,4 @@ public:
} }
}; };
BENCHMARK(test,"quad_tree creation") BENCHMARK(test, "quad_tree creation")

View file

@ -15,24 +15,25 @@ class test : public benchmark::test_case
mapnik::value_integer height_; mapnik::value_integer height_;
double scale_factor_; double scale_factor_;
std::string preview_; std::string preview_;
public:
public:
test(mapnik::parameters const& params) test(mapnik::parameters const& params)
: test_case(params), : test_case(params)
xml_(), , xml_()
extent_(), , extent_()
width_(*params.get<mapnik::value_integer>("width",256)), , width_(*params.get<mapnik::value_integer>("width", 256))
height_(*params.get<mapnik::value_integer>("height",256)), , height_(*params.get<mapnik::value_integer>("height", 256))
scale_factor_(*params.get<mapnik::value_double>("scale_factor",1.0)), , scale_factor_(*params.get<mapnik::value_double>("scale_factor", 1.0))
preview_(*params.get<std::string>("preview","")) , preview_(*params.get<std::string>("preview", ""))
{ {
boost::optional<std::string> map = params.get<std::string>("map"); const auto map = params.get<std::string>("map");
if (!map) if (!map)
{ {
throw std::runtime_error("please provide a --map <path to xml> arg"); throw std::runtime_error("please provide a --map <path to xml> arg");
} }
xml_ = *map; xml_ = *map;
boost::optional<std::string> ext = params.get<std::string>("extent"); const auto ext = params.get<std::string>("extent");
if (ext && !ext->empty()) if (ext && !ext->empty())
{ {
if (!extent_.from_string(*ext)) if (!extent_.from_string(*ext))
@ -43,67 +44,74 @@ public:
{ {
throw std::runtime_error("please provide a --extent=<minx,miny,maxx,maxy> arg"); throw std::runtime_error("please provide a --extent=<minx,miny,maxx,maxy> arg");
}*/ }*/
}
}
bool validate() const bool validate() const
{ {
mapnik::Map m(width_,height_); mapnik::Map m(width_, height_);
mapnik::load_map(m,xml_,true); mapnik::load_map(m, xml_, true);
if (extent_.valid()) { if (extent_.valid())
{
m.zoom_to_box(extent_); m.zoom_to_box(extent_);
} else { }
else
{
m.zoom_all(); m.zoom_all();
} }
mapnik::image_rgba8 im(m.width(),m.height()); mapnik::image_rgba8 im(m.width(), m.height());
mapnik::agg_renderer<mapnik::image_rgba8> ren(m,im,scale_factor_); mapnik::agg_renderer<mapnik::image_rgba8> ren(m, im, scale_factor_);
ren.apply(); ren.apply();
if (!preview_.empty()) { if (!preview_.empty())
{
std::clog << "preview available at " << preview_ << "\n"; std::clog << "preview available at " << preview_ << "\n";
mapnik::save_to_file(im,preview_); mapnik::save_to_file(im, preview_);
} }
return true; return true;
} }
bool operator()() const bool operator()() const
{ {
if (!preview_.empty()) { if (!preview_.empty())
{
return false; return false;
} }
mapnik::Map m(width_,height_); mapnik::Map m(width_, height_);
mapnik::load_map(m,xml_); mapnik::load_map(m, xml_);
if (extent_.valid()) { if (extent_.valid())
{
m.zoom_to_box(extent_); m.zoom_to_box(extent_);
} else { }
else
{
m.zoom_all(); m.zoom_all();
} }
for (unsigned i=0;i<iterations_;++i) for (unsigned i = 0; i < iterations_; ++i)
{ {
mapnik::image_rgba8 im(m.width(),m.height()); mapnik::image_rgba8 im(m.width(), m.height());
mapnik::agg_renderer<mapnik::image_rgba8> ren(m,im,scale_factor_); mapnik::agg_renderer<mapnik::image_rgba8> ren(m, im, scale_factor_);
ren.apply(); ren.apply();
} }
return true; return true;
} }
}; };
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
mapnik::setup();
int return_value = 0; int return_value = 0;
try try
{ {
mapnik::parameters params; mapnik::parameters params;
benchmark::handle_args(argc,argv,params); benchmark::handle_args(argc, argv, params);
boost::optional<std::string> name = params.get<std::string>("name"); const auto name = params.get<std::string>("name");
if (!name) if (!name)
{ {
std::clog << "please provide a name for this test\n"; std::clog << "please provide a name for this test\n";
return -1; return -1;
} }
mapnik::freetype_engine::register_fonts("./fonts/",true); mapnik::freetype_engine::register_fonts("./fonts/", true);
mapnik::datasource_cache::instance().register_datasources("./plugins/input/"); mapnik::datasource_cache::instance().register_datasources("./plugins/input/");
{ {
test test_runner(params); test test_runner(params);
return_value = run(test_runner,*name); return_value = run(test_runner, *name);
} }
} }
catch (std::exception const& ex) catch (std::exception const& ex)

View file

@ -12,14 +12,15 @@
#include <mapnik/datasource_cache.hpp> #include <mapnik/datasource_cache.hpp>
#include <stdexcept> #include <stdexcept>
template <typename Renderer> void process_layers(Renderer & ren, template<typename Renderer>
mapnik::request const& m_req, void process_layers(Renderer& ren,
mapnik::projection const& map_proj, mapnik::request const& m_req,
std::vector<mapnik::layer> const& layers, mapnik::projection const& map_proj,
double scale_denom) std::vector<mapnik::layer> const& layers,
double scale_denom)
{ {
unsigned layers_size = layers.size(); unsigned layers_size = layers.size();
for (unsigned i=0; i < layers_size; ++i) for (unsigned i = 0; i < layers_size; ++i)
{ {
mapnik::layer const& lyr = layers[i]; mapnik::layer const& lyr = layers[i];
if (lyr.visible(scale_denom)) if (lyr.visible(scale_denom))
@ -50,27 +51,28 @@ class test : public benchmark::test_case
double scale_factor_; double scale_factor_;
std::string preview_; std::string preview_;
mutable mapnik::image_rgba8 im_; mutable mapnik::image_rgba8 im_;
public:
public:
test(mapnik::parameters const& params) test(mapnik::parameters const& params)
: test_case(params), : test_case(params)
xml_(), , xml_()
extent_(), , extent_()
width_(*params.get<mapnik::value_integer>("width",256)), , width_(*params.get<mapnik::value_integer>("width", 256))
height_(*params.get<mapnik::value_integer>("height",256)), , height_(*params.get<mapnik::value_integer>("height", 256))
m_(new mapnik::Map(width_,height_)), , m_(new mapnik::Map(width_, height_))
scale_factor_(*params.get<mapnik::value_double>("scale_factor",2.0)), , scale_factor_(*params.get<mapnik::value_double>("scale_factor", 2.0))
preview_(*params.get<std::string>("preview","")), , preview_(*params.get<std::string>("preview", ""))
im_(m_->width(),m_->height()) , im_(m_->width(), m_->height())
{ {
boost::optional<std::string> map = params.get<std::string>("map"); const auto map = params.get<std::string>("map");
if (!map) if (!map)
{ {
throw std::runtime_error("please provide a --map=<path to xml> arg"); throw std::runtime_error("please provide a --map=<path to xml> arg");
} }
xml_ = *map; xml_ = *map;
boost::optional<std::string> ext = params.get<std::string>("extent"); auto ext = params.get<std::string>("extent");
mapnik::load_map(*m_,xml_,true); mapnik::load_map(*m_, xml_, true);
if (ext && !ext->empty()) if (ext && !ext->empty())
{ {
if (!extent_.from_string(*ext)) if (!extent_.from_string(*ext))
@ -87,42 +89,44 @@ public:
bool validate() const bool validate() const
{ {
mapnik::request m_req(width_,height_,extent_); mapnik::request m_req(width_, height_, extent_);
mapnik::attributes variables; mapnik::attributes variables;
m_req.set_buffer_size(m_->buffer_size()); m_req.set_buffer_size(m_->buffer_size());
mapnik::projection map_proj(m_->srs(),true); mapnik::projection map_proj(m_->srs(), true);
double scale_denom = mapnik::scale_denominator(m_req.scale(),map_proj.is_geographic()); double scale_denom = mapnik::scale_denominator(m_req.scale(), map_proj.is_geographic());
scale_denom *= scale_factor_; scale_denom *= scale_factor_;
mapnik::agg_renderer<mapnik::image_rgba8> ren(*m_,m_req,variables,im_,scale_factor_); mapnik::agg_renderer<mapnik::image_rgba8> ren(*m_, m_req, variables, im_, scale_factor_);
ren.start_map_processing(*m_); ren.start_map_processing(*m_);
std::vector<mapnik::layer> const& layers = m_->layers(); std::vector<mapnik::layer> const& layers = m_->layers();
process_layers(ren,m_req,map_proj,layers,scale_denom); process_layers(ren, m_req, map_proj, layers, scale_denom);
ren.end_map_processing(*m_); ren.end_map_processing(*m_);
if (!preview_.empty()) { if (!preview_.empty())
{
std::clog << "preview available at " << preview_ << "\n"; std::clog << "preview available at " << preview_ << "\n";
mapnik::save_to_file(im_,preview_); mapnik::save_to_file(im_, preview_);
} }
return true; return true;
} }
bool operator()() const bool operator()() const
{ {
if (!preview_.empty()) { if (!preview_.empty())
{
return false; return false;
} }
for (unsigned i=0;i<iterations_;++i) for (unsigned i = 0; i < iterations_; ++i)
{ {
mapnik::request m_req(width_,height_,extent_); mapnik::request m_req(width_, height_, extent_);
mapnik::image_rgba8 im(m_->width(),m_->height()); mapnik::image_rgba8 im(m_->width(), m_->height());
mapnik::attributes variables; mapnik::attributes variables;
m_req.set_buffer_size(m_->buffer_size()); m_req.set_buffer_size(m_->buffer_size());
mapnik::projection map_proj(m_->srs(),true); mapnik::projection map_proj(m_->srs(), true);
double scale_denom = mapnik::scale_denominator(m_req.scale(),map_proj.is_geographic()); double scale_denom = mapnik::scale_denominator(m_req.scale(), map_proj.is_geographic());
scale_denom *= scale_factor_; scale_denom *= scale_factor_;
mapnik::agg_renderer<mapnik::image_rgba8> ren(*m_,m_req,variables,im,scale_factor_); mapnik::agg_renderer<mapnik::image_rgba8> ren(*m_, m_req, variables, im, scale_factor_);
ren.start_map_processing(*m_); ren.start_map_processing(*m_);
std::vector<mapnik::layer> const& layers = m_->layers(); std::vector<mapnik::layer> const& layers = m_->layers();
process_layers(ren,m_req,map_proj,layers,scale_denom); process_layers(ren, m_req, map_proj, layers, scale_denom);
ren.end_map_processing(*m_); ren.end_map_processing(*m_);
bool diff = false; bool diff = false;
mapnik::image_rgba8 const& dest = im; mapnik::image_rgba8 const& dest = im;
@ -133,34 +137,36 @@ public:
const unsigned int* row_to = dest.get_row(y); const unsigned int* row_to = dest.get_row(y);
for (unsigned int x = 0; x < width_; ++x) for (unsigned int x = 0; x < width_; ++x)
{ {
if (row_from[x] != row_to[x]) diff = true; if (row_from[x] != row_to[x])
diff = true;
} }
} }
if (diff) throw std::runtime_error("images differ"); if (diff)
throw std::runtime_error("images differ");
} }
return true; return true;
} }
}; };
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
mapnik::setup();
int return_value = 0; int return_value = 0;
try try
{ {
mapnik::parameters params; mapnik::parameters params;
benchmark::handle_args(argc,argv,params); benchmark::handle_args(argc, argv, params);
boost::optional<std::string> name = params.get<std::string>("name"); const auto name = params.get<std::string>("name");
if (!name) if (!name)
{ {
std::clog << "please provide a name for this test\n"; std::clog << "please provide a name for this test\n";
return -1; return -1;
} }
mapnik::freetype_engine::register_fonts("./fonts/",true); mapnik::freetype_engine::register_fonts("./fonts/", true);
mapnik::datasource_cache::instance().register_datasources("./plugins/input/"); mapnik::datasource_cache::instance().register_datasources("./plugins/input/");
{ {
test test_runner(params); test test_runner(params);
return_value = run(test_runner,*name); return_value = run(test_runner, *name);
} }
} }
catch (std::exception const& ex) catch (std::exception const& ex)

View file

@ -0,0 +1,34 @@
#include "bench_framework.hpp"
#include <mapnik/util/conversions.hpp>
class test : public benchmark::test_case
{
std::string value_;
public:
test(mapnik::parameters const& params)
: test_case(params)
, value_("true")
{}
bool validate() const
{
bool result = false;
mapnik::util::string2bool(value_.data(), value_.data() + value_.size(), result);
if (!result)
return result;
mapnik::util::string2bool(value_, result);
return (result == true);
}
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
bool result = false;
mapnik::util::string2bool(value_, result);
mapnik::util::string2bool(value_.data(), value_.data() + value_.size(), result);
}
return true;
}
};
BENCHMARK(test, "string->bool")

View file

@ -0,0 +1,39 @@
#include "bench_framework.hpp"
#include <mapnik/util/conversions.hpp>
class test : public benchmark::test_case
{
std::string value_;
public:
test(mapnik::parameters const& params)
: test_case(params)
, value_("1.23456789")
{}
bool validate() const
{
double result = 0;
if (!mapnik::util::string2double(value_.data(), value_.data() + value_.size(), result))
return false;
if (result != 1.23456789)
return false;
result = 0;
if (!mapnik::util::string2double(value_, result))
return false;
if (result != 1.23456789)
return false;
return true;
}
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
double result = 0;
mapnik::util::string2double(value_, result);
mapnik::util::string2double(value_.data(), value_.data() + value_.size(), result);
}
return true;
}
};
BENCHMARK(test, "string->double")

View file

@ -0,0 +1,39 @@
#include "bench_framework.hpp"
#include <mapnik/util/conversions.hpp>
class test : public benchmark::test_case
{
std::string value_;
public:
test(mapnik::parameters const& params)
: test_case(params)
, value_("123456789")
{}
bool validate() const
{
mapnik::value_integer result = 0;
if (!mapnik::util::string2int(value_.data(), value_.data() + value_.size(), result))
return false;
if (result != 123456789)
return false;
result = 0;
if (!mapnik::util::string2int(value_, result))
return false;
if (result != 123456789)
return false;
return true;
}
bool operator()() const
{
for (std::size_t i = 0; i < iterations_; ++i)
{
mapnik::value_integer result = 0;
mapnik::util::string2int(value_, result);
mapnik::util::string2int(value_.data(), value_.data() + value_.size(), result);
}
return true;
}
};
BENCHMARK(test, "string->int")

View file

@ -4,25 +4,28 @@
class test : public benchmark::test_case class test : public benchmark::test_case
{ {
double value_; double value_;
public:
public:
test(mapnik::parameters const& params) test(mapnik::parameters const& params)
: test_case(params), : test_case(params)
value_(-0.1234) {} , value_(-0.1234)
{}
bool validate() const bool validate() const
{ {
std::string s; std::string s;
mapnik::util::to_string(s,value_); mapnik::util::to_string(s, value_);
return (s == "-0.1234"); return (s == "-0.1234");
} }
bool operator()() const bool operator()() const
{ {
std::string out; std::string out;
for (std::size_t i=0;i<iterations_;++i) { for (std::size_t i = 0; i < iterations_; ++i)
{
out.clear(); out.clear();
mapnik::util::to_string(out,value_); mapnik::util::to_string(out, value_);
} }
return true; return true;
} }
}; };
BENCHMARK(test,"to_string double->string") BENCHMARK(test, "to_string double->string")

View file

@ -4,10 +4,12 @@
class test : public benchmark::test_case class test : public benchmark::test_case
{ {
double value_; double value_;
public:
public:
test(mapnik::parameters const& params) test(mapnik::parameters const& params)
: test_case(params), : test_case(params)
value_(-0.1234) {} , value_(-0.1234)
{}
bool validate() const bool validate() const
{ {
std::ostringstream s; std::ostringstream s;
@ -17,7 +19,8 @@ public:
bool operator()() const bool operator()() const
{ {
std::string out; std::string out;
for (std::size_t i=0;i<iterations_;++i) { for (std::size_t i = 0; i < iterations_; ++i)
{
std::ostringstream s; std::ostringstream s;
s << value_; s << value_;
out = s.str(); out = s.str();
@ -26,4 +29,4 @@ public:
} }
}; };
BENCHMARK(test,"ostringstream double->string") BENCHMARK(test, "ostringstream double->string")

View file

@ -1,34 +1,41 @@
#include "bench_framework.hpp" #include "bench_framework.hpp"
#include <mapnik/unicode.hpp> #include <mapnik/unicode.hpp>
#include <mapnik/util/from_u8string.hpp>
#include <mapnik/value.hpp> #include <mapnik/value.hpp>
#include <boost/locale.hpp> #include <boost/locale.hpp>
#ifndef __linux__ #ifndef __linux__
#include <codecvt> #include <codecvt>
#endif
using mapnik::util::from_u8string;
#ifndef __linux__
class test : public benchmark::test_case class test : public benchmark::test_case
{ {
std::string utf8_; std::string utf8_;
public:
public:
test(mapnik::parameters const& params) test(mapnik::parameters const& params)
: test_case(params), : test_case(params)
utf8_(u8"שלום") {} , utf8_(from_u8string(u8"שלום"))
{}
bool validate() const bool validate() const
{ {
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> utf32conv; std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> utf32conv;
std::u32string utf32 = utf32conv.from_bytes(utf8_); std::u32string utf32 = utf32conv.from_bytes(utf8_);
if (utf32.size() != 4) return false; if (utf32.size() != 4)
if (utf32[0] != 0x5e9 && return false;
utf32[1] != 0x5dc && if (utf32[0] != 0x5e9 && utf32[1] != 0x5dc && utf32[2] != 0x5d5 && utf32[3] != 0x5dd)
utf32[2] != 0x5d5 && return false;
utf32[3] != 0x5dd) return false;
return true; return true;
} }
bool operator()() const bool operator()() const
{ {
std::u32string utf32; std::u32string utf32;
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> utf32conv; std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> utf32conv;
for (std::size_t i=0;i<iterations_;++i) { for (std::size_t i = 0; i < iterations_; ++i)
utf32 = utf32conv.from_bytes(utf8_); {
utf32 = utf32conv.from_bytes(utf8_);
} }
return true; return true;
} }
@ -39,26 +46,28 @@ public:
class test2 : public benchmark::test_case class test2 : public benchmark::test_case
{ {
std::string utf8_; std::string utf8_;
public:
public:
test2(mapnik::parameters const& params) test2(mapnik::parameters const& params)
: test_case(params), : test_case(params)
utf8_(u8"שלום") {} , utf8_(from_u8string(u8"שלום"))
{}
bool validate() const bool validate() const
{ {
std::u32string utf32 = boost::locale::conv::utf_to_utf<char32_t>(utf8_); std::u32string utf32 = boost::locale::conv::utf_to_utf<char32_t>(utf8_);
if (utf32.size() != 4) return false; if (utf32.size() != 4)
if (utf32[0] != 0x5e9 && return false;
utf32[1] != 0x5dc && if (utf32[0] != 0x5e9 && utf32[1] != 0x5dc && utf32[2] != 0x5d5 && utf32[3] != 0x5dd)
utf32[2] != 0x5d5 && return false;
utf32[3] != 0x5dd) return false;
return true; return true;
} }
bool operator()() const bool operator()() const
{ {
std::u32string utf32; std::u32string utf32;
for (std::size_t i=0;i<iterations_;++i) { for (std::size_t i = 0; i < iterations_; ++i)
utf32 = boost::locale::conv::utf_to_utf<char32_t>(utf8_); {
} utf32 = boost::locale::conv::utf_to_utf<char32_t>(utf8_);
}
return true; return true;
} }
}; };
@ -66,28 +75,30 @@ public:
class test3 : public benchmark::test_case class test3 : public benchmark::test_case
{ {
std::string utf8_; std::string utf8_;
public:
public:
test3(mapnik::parameters const& params) test3(mapnik::parameters const& params)
: test_case(params), : test_case(params)
utf8_(u8"שלום") {} , utf8_(from_u8string(u8"שלום"))
{}
bool validate() const bool validate() const
{ {
mapnik::transcoder tr_("utf-8"); mapnik::transcoder tr_("utf-8");
mapnik::value_unicode_string utf32 = tr_.transcode(utf8_.data(),utf8_.size()); mapnik::value_unicode_string utf32 = tr_.transcode(utf8_.data(), utf8_.size());
//std::u32string utf32 = boost::locale::conv::utf_to_utf<char32_t>(utf8_); // std::u32string utf32 = boost::locale::conv::utf_to_utf<char32_t>(utf8_);
if (utf32.length() != 4) return false; if (utf32.length() != 4)
if (utf32[0] != 0x5e9 && return false;
utf32[1] != 0x5dc && if (utf32[0] != 0x5e9 && utf32[1] != 0x5dc && utf32[2] != 0x5d5 && utf32[3] != 0x5dd)
utf32[2] != 0x5d5 && return false;
utf32[3] != 0x5dd) return false;
return true; return true;
} }
bool operator()() const bool operator()() const
{ {
mapnik::transcoder tr_("utf-8"); mapnik::transcoder tr_("utf-8");
mapnik::value_unicode_string utf32; mapnik::value_unicode_string utf32;
for (std::size_t i=0;i<iterations_;++i) { for (std::size_t i = 0; i < iterations_; ++i)
utf32 = tr_.transcode(utf8_.data(),utf8_.size()); {
utf32 = tr_.transcode(utf8_.data(), utf8_.size());
} }
return true; return true;
} }
@ -95,18 +106,19 @@ public:
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
mapnik::setup();
mapnik::parameters params; mapnik::parameters params;
benchmark::handle_args(argc,argv,params); benchmark::handle_args(argc, argv, params);
int return_value = 0; int return_value = 0;
#ifndef __linux__ #ifndef __linux__
test test_runner(params); test test_runner(params);
return_value = return_value | run(test_runner,"utf encode std::codecvt"); return_value = return_value | run(test_runner, "utf encode std::codecvt");
#else #else
std::clog << "skipping 'utf encode std::codecvt' test since <codecvt> is not supported on __linux__\n"; std::clog << "skipping 'utf encode std::codecvt' test since <codecvt> is not supported on __linux__\n";
#endif #endif
test2 test_runner2(params); test2 test_runner2(params);
return_value = return_value | run(test_runner2,"utf encode boost::locale"); return_value = return_value | run(test_runner2, "utf encode boost::locale");
test3 test_runner3(params); test3 test_runner3(params);
return_value = return_value | run(test_runner3,"utf encode ICU"); return_value = return_value | run(test_runner3, "utf encode ICU");
return return_value; return return_value;
} }

View file

@ -2,16 +2,12 @@
class test : public benchmark::test_case class test : public benchmark::test_case
{ {
public: public:
test(mapnik::parameters const& params) test(mapnik::parameters const& params)
: test_case(params) {} : test_case(params)
bool validate() const {}
{ bool validate() const { return true; }
return true; void operator()() const {}
}
void operator()() const
{
}
}; };
BENCHMARK(test,"test name") BENCHMARK(test, "test name")

View file

@ -1,379 +0,0 @@
#include "bench_framework.hpp"
#include <cstring>
#include <cstdlib>
#include <deque>
#include <stdexcept>
#include <array>
#include <valarray>
#include <boost/version.hpp>
#if BOOST_VERSION >= 105400
#include <boost/container/static_vector.hpp>
#endif
// http://stackoverflow.com/questions/17347254/why-is-allocation-and-deallocation-of-stdvector-slower-than-dynamic-array-on-m
#define FULL_ZERO_CHECK
inline void ensure_zero(uint8_t * data, uint32_t size) {
#ifdef FULL_ZERO_CHECK
for (std::size_t i=0;i<size;++i) {
if (data[i] != 0) {
throw std::runtime_error("found non zero value");
}
}
#else
if (data[0] != 0) {
throw std::runtime_error("found non zero value");
}
#endif
}
class test1 : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test1(mapnik::parameters const& params)
: test_case(params),
size_(*params.get<mapnik::value_integer>("size",256*256)),
array_(size_,0) { }
bool validate() const
{
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
// NOTE: sizeof(uint8_t) == 1
uint8_t *data = (uint8_t *)malloc(sizeof(uint8_t)*size_);
memcpy(data, &array_[0], size_);
ensure_zero(data,size_);
free(data);
}
return true;
}
};
class test1b : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test1b(mapnik::parameters const& params)
: test_case(params),
size_(*params.get<mapnik::value_integer>("size",256*256)),
array_(size_,0) { }
bool validate() const
{
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
// NOTE: sizeof(uint8_t) == 1
uint8_t *data = (uint8_t *)malloc(sizeof(uint8_t)*size_);
memset(data, 0, sizeof(uint8_t)*size_);
ensure_zero(data,size_);
free(data);
}
return true;
}
};
class test1c : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test1c(mapnik::parameters const& params)
: test_case(params),
size_(*params.get<mapnik::value_integer>("size",256*256)),
array_(size_,0) { }
bool validate() const
{
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
uint8_t *data = static_cast<uint8_t *>(::operator new(sizeof(uint8_t) * size_));
std::fill(data,data + size_,0);
ensure_zero(data,size_);
::operator delete(data);
}
return true;
}
};
class test2 : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test2(mapnik::parameters const& params)
: test_case(params),
size_(*params.get<mapnik::value_integer>("size",256*256)),
array_(size_,0) { }
bool validate() const
{
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
uint8_t * data = static_cast<uint8_t*>(::operator new(sizeof(uint8_t)*size_));
memcpy(data, &array_[0], size_);
ensure_zero(data,size_);
::operator delete(data),data=0;
}
return true;
}
};
class test3 : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test3(mapnik::parameters const& params)
: test_case(params),
size_(*params.get<mapnik::value_integer>("size",256*256)),
array_(size_,0) { }
bool validate() const
{
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
std::vector<uint8_t> data(size_);
ensure_zero(&data[0],data.size());
}
return true;
}
};
class test3b : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test3b(mapnik::parameters const& params)
: test_case(params),
size_(*params.get<mapnik::value_integer>("size",256*256)),
array_(size_,0) { }
bool validate() const
{
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
std::vector<uint8_t> data(0);
data.resize(size_,0);
ensure_zero(&data[0],data.size());
}
return true;
}
};
class test3c : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test3c(mapnik::parameters const& params)
: test_case(params),
size_(*params.get<mapnik::value_integer>("size",256*256)),
array_(size_,0) { }
bool validate() const
{
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
std::vector<uint8_t> data(0);
data.assign(size_,0);
ensure_zero(&data[0],data.size());
}
return true;
}
};
class test3d : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test3d(mapnik::parameters const& params)
: test_case(params),
size_(*params.get<mapnik::value_integer>("size",256*256)),
array_(size_,0) { }
bool validate() const
{
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
std::deque<uint8_t> data(size_);
for (std::size_t i=0;i<size_;++i) {
if (data[i] != 0) {
throw std::runtime_error("found non zero value");
}
}
}
return true;
}
};
class test4 : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test4(mapnik::parameters const& params)
: test_case(params),
size_(*params.get<mapnik::value_integer>("size",256*256)),
array_(size_,0) { }
bool validate() const
{
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
uint8_t *data = (uint8_t *)calloc(size_,sizeof(uint8_t));
ensure_zero(data,size_);
free(data);
}
return true;
}
};
class test5 : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test5(mapnik::parameters const& params)
: test_case(params),
size_(*params.get<mapnik::value_integer>("size",256*256)),
array_(size_,0) { }
bool validate() const
{
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
std::string data(array_.begin(),array_.end());
ensure_zero((uint8_t *)&data[0],size_);
}
return true;
}
};
class test5b : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<char> array_;
test5b(mapnik::parameters const& params)
: test_case(params),
size_(*params.get<mapnik::value_integer>("size",256*256)),
array_(size_,0) { }
bool validate() const
{
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
std::string data(&array_[0],array_.size());
ensure_zero((uint8_t *)&data[0],size_);
}
return true;
}
};
// C++14 dynarray<T>
// http://isocpp.org/blog/2013/04/trip-report-iso-c-spring-2013-meeting
// http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130909/088700.html
// http://stackoverflow.com/questions/17303902/any-alternative-to-stddynarray-presently-available
class test6 : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test6(mapnik::parameters const& params)
: test_case(params),
size_(*params.get<mapnik::value_integer>("size",256*256)),
array_(size_,0) { }
bool validate() const
{
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
std::valarray<uint8_t> data(static_cast<uint8_t>(0),static_cast<size_t>(size_));
ensure_zero(&data[0],size_);
}
return true;
}
};
#if BOOST_VERSION >= 105400
// http://i42.co.uk/stuff/vecarray.htm
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost/container/static_vector.html
class test7 : public benchmark::test_case
{
public:
uint32_t size_;
std::vector<uint8_t> array_;
test7(mapnik::parameters const& params)
: test_case(params),
size_(*params.get<mapnik::value_integer>("size",256*256)),
array_(size_,0) { }
bool validate() const
{
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
boost::container::static_vector<uint8_t,256*256> data(size_,0);
ensure_zero(&data[0],size_);
}
return true;
}
};
#endif
int main(int argc, char** argv)
{
return benchmark::sequencer(argc, argv)
.run<test4>("calloc")
.run<test1>("malloc/memcpy")
.run<test1b>("malloc/memset")
.run<test1c>("operator new/std::fill")
.run<test2>("operator new/memcpy")
.run<test3>("vector(N)")
.run<test3b>("vector/resize")
.run<test3c>("vector/assign")
.run<test3d>("deque(N)")
.run<test5>("std::string range")
.run<test5b>("std::string &[0]")
.run<test6>("valarray")
#if BOOST_VERSION >= 105400
.run<test7>("static_vector")
#endif
.done();
}

View file

@ -1,42 +0,0 @@
#include "bench_framework.hpp"
#include <mapnik/marker_cache.hpp>
class test : public benchmark::test_case
{
std::vector<std::string> images_;
public:
test(mapnik::parameters const& params)
: test_case(params),
images_{
"./test/data/images/dummy.jpg",
"./test/data/images/dummy.jpeg",
"./test/data/images/dummy.png",
"./test/data/images/dummy.tif",
"./test/data/images/dummy.tiff",
//"./test/data/images/landusepattern.jpeg", // will fail since it is a png
//"./test/data/images/xcode-CgBI.png", // will fail since its an invalid png
"./test/data/svg/octocat.svg",
"./test/data/svg/place-of-worship-24.svg",
"./test/data/svg/point_sm.svg",
"./test/data/svg/point.svg",
"./test/data/svg/airfield-12.svg"
} {}
bool validate() const
{
return true;
}
bool operator()() const
{
unsigned count = 0;
for (std::size_t i=0;i<iterations_;++i) {
for (auto filename : images_)
{
auto marker = mapnik::marker_cache::instance().find(filename,true);
}
++count;
}
return (count == iterations_);
}
};
BENCHMARK(test,"marker cache")

View file

@ -1,60 +0,0 @@
#include "bench_framework.hpp"
#include <mapnik/map.hpp>
#include <mapnik/load_map.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/datasource_cache.hpp>
class test : public benchmark::test_case
{
std::string xml_;
mapnik::box2d<double> extent_;
public:
test(mapnik::parameters const& params,
std::string const& xml,
mapnik::box2d<double> const& extent)
: test_case(params),
xml_(xml),
extent_(extent)
{}
bool validate() const
{
mapnik::Map m(256,256);
mapnik::load_map(m,xml_);
m.zoom_to_box(extent_);
mapnik::image_rgba8 im(m.width(),m.height());
mapnik::agg_renderer<mapnik::image_rgba8> ren(m,im);
ren.apply();
//mapnik::save_to_file(im.data(),"test.png");
return true;
}
bool operator()() const
{
mapnik::Map m(256,256);
mapnik::load_map(m,xml_);
m.zoom_to_box(extent_);
for (unsigned i=0;i<iterations_;++i)
{
mapnik::image_rgba8 im(m.width(),m.height());
mapnik::agg_renderer<mapnik::image_rgba8> ren(m,im);
ren.apply();
}
return true;
}
};
int main(int argc, char** argv)
{
mapnik::parameters params;
benchmark::handle_args(argc,argv,params);
mapnik::datasource_cache::instance().register_datasources("./plugins/input/");
mapnik::box2d<double> z1(-20037508.3428,-8317435.0606,20037508.3428,18399242.7298);
// bbox for 16/10491/22911.png
mapnik::box2d<double> z16(-13622912.929097254,6026906.8062295765,-13621689.93664469,6028129.79868214);
return benchmark::sequencer(argc, argv)
.run<test>("polygon clip render z1", "benchmark/data/polygon_rendering_clip.xml", z1)
.run<test>("polygon noclip render z1", "benchmark/data/polygon_rendering_no_clip.xml", z1)
.run<test>("polygon clip render z16", "benchmark/data/polygon_rendering_clip.xml", z16)
.run<test>("polygon noclip render z16", "benchmark/data/polygon_rendering_no_clip.xml", z16)
.done();
}

View file

@ -1,74 +0,0 @@
#include "bench_framework.hpp"
#include <mapnik/box2d.hpp>
#include <mapnik/projection.hpp>
#include <mapnik/proj_transform.hpp>
class test : public benchmark::test_case
{
std::string src_;
std::string dest_;
mapnik::box2d<double> from_;
mapnik::box2d<double> to_;
bool defer_proj4_init_;
public:
test(mapnik::parameters const& params,
std::string const& src,
std::string const& dest,
mapnik::box2d<double> const& from,
mapnik::box2d<double> const& to,
bool defer_proj)
: test_case(params),
src_(src),
dest_(dest),
from_(from),
to_(to),
defer_proj4_init_(defer_proj) {}
bool validate() const
{
mapnik::projection src(src_,defer_proj4_init_);
mapnik::projection dest(dest_,defer_proj4_init_);
mapnik::proj_transform tr(src,dest);
mapnik::box2d<double> bbox = from_;
if (!tr.forward(bbox)) return false;
return ((std::fabs(bbox.minx() - to_.minx()) < .5) &&
(std::fabs(bbox.maxx() - to_.maxx()) < .5) &&
(std::fabs(bbox.miny() - to_.miny()) < .5) &&
(std::fabs(bbox.maxy() - to_.maxy()) < .5)
);
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i)
{
for (int j=-180;j<180;j=j+5)
{
for (int k=-85;k<85;k=k+5)
{
mapnik::projection src(src_,defer_proj4_init_);
mapnik::projection dest(dest_,defer_proj4_init_);
mapnik::proj_transform tr(src,dest);
mapnik::box2d<double> box(j,k,j,k);
if (!tr.forward(box)) throw std::runtime_error("could not transform coords");
}
}
}
return true;
}
};
// echo -180 -60 | cs2cs -f "%.10f" +init=epsg:4326 +to +init=epsg:3857
int main(int argc, char** argv)
{
mapnik::box2d<double> from(-180,-80,180,80);
mapnik::box2d<double> to(-20037508.3427892476,-15538711.0963092316,20037508.3427892476,15538711.0963092316);
std::string from_str("+init=epsg:4326");
std::string to_str("+init=epsg:3857");
std::string from_str2("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs");
std::string to_str2("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over");
return benchmark::sequencer(argc, argv)
.run<test>("lonlat->merc epsg", from_str, to_str, from, to, true)
.run<test>("lonlat->merc literal", from_str2, to_str2, from, to, true)
.run<test>("merc->lonlat epsg", to_str, from_str, to, from, true)
.run<test>("merc->lonlat literal", to_str2, from_str2, to, from, true)
.done();
}

View file

@ -1,30 +0,0 @@
#include "bench_framework.hpp"
#include <mapnik/util/conversions.hpp>
class test : public benchmark::test_case
{
std::string value_;
public:
test(mapnik::parameters const& params)
: test_case(params),
value_("true") {}
bool validate() const
{
bool result = false;
mapnik::util::string2bool(value_.data(),value_.data()+value_.size(),result);
if (!result) return result;
mapnik::util::string2bool(value_,result);
return (result == true);
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
bool result = false;
mapnik::util::string2bool(value_,result);
mapnik::util::string2bool(value_.data(),value_.data()+value_.size(),result);
}
return true;
}
};
BENCHMARK(test,"string->bool")

View file

@ -1,32 +0,0 @@
#include "bench_framework.hpp"
#include <mapnik/util/conversions.hpp>
class test : public benchmark::test_case
{
std::string value_;
public:
test(mapnik::parameters const& params)
: test_case(params),
value_("1.23456789") {}
bool validate() const
{
double result = 0;
if (!mapnik::util::string2double(value_.data(),value_.data()+value_.size(),result)) return false;
if (result != 1.23456789) return false;
result = 0;
if (!mapnik::util::string2double(value_,result)) return false;
if (result != 1.23456789) return false;
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
double result = 0;
mapnik::util::string2double(value_,result);
mapnik::util::string2double(value_.data(),value_.data()+value_.size(),result);
}
return true;
}
};
BENCHMARK(test,"string->double")

View file

@ -1,32 +0,0 @@
#include "bench_framework.hpp"
#include <mapnik/util/conversions.hpp>
class test : public benchmark::test_case
{
std::string value_;
public:
test(mapnik::parameters const& params)
: test_case(params),
value_("123456789") {}
bool validate() const
{
mapnik::value_integer result = 0;
if (!mapnik::util::string2int(value_.data(),value_.data()+value_.size(),result)) return false;
if (result != 123456789) return false;
result = 0;
if (!mapnik::util::string2int(value_,result)) return false;
if (result != 123456789) return false;
return true;
}
bool operator()() const
{
for (std::size_t i=0;i<iterations_;++i) {
mapnik::value_integer result = 0;
mapnik::util::string2int(value_,result);
mapnik::util::string2int(value_.data(),value_.data()+value_.size(),result);
}
return true;
}
};
BENCHMARK(test,"string->int")

View file

@ -3,8 +3,8 @@ import random
im = mapnik.Image(256,256) im = mapnik.Image(256,256)
for x in xrange(0,im.width()): for x in range(im.width()):
for y in xrange(0,im.height()): for y in range(im.height()):
r = int(random.random() * 255) r = int(random.random() * 255)
g = random.random() * 255 g = random.random() * 255
b = random.random() * 255 b = random.random() * 255

View file

@ -1,136 +0,0 @@
#!/usr/bin/env bash
#set -eu
: '
todo
- docs for base setup: sudo apt-get -y install zlib1g-dev make git
- shrink icu data
'
function setup_mason() {
if [[ ! -d ./.mason ]]; then
git clone --depth 1 https://github.com/mapbox/mason.git ./.mason
else
echo "Updating to latest mason"
(cd ./.mason && git pull)
fi
export MASON_DIR=$(pwd)/.mason
export PATH=$(pwd)/.mason:$PATH
export CXX=${CXX:-clang++}
export CC=${CC:-clang}
}
function install() {
MASON_PLATFORM_ID=$(mason env MASON_PLATFORM_ID)
if [[ ! -d ./mason_packages/${MASON_PLATFORM_ID}/${1}/${2} ]]; then
mason install $1 $2
mason link $1 $2
if [[ $3 ]]; then
LA_FILE=$(${MASON_DIR:-~/.mason}/mason prefix $1 $2)/lib/$3.la
if [[ -f ${LA_FILE} ]]; then
perl -i -p -e 's:\Q$ENV{HOME}/build/mapbox/mason\E:$ENV{PWD}:g' ${LA_FILE}
else
echo "$LA_FILE not found"
fi
fi
fi
}
ICU_VERSION="55.1"
function install_mason_deps() {
install jpeg_turbo 1.4.0 libjpeg &
install libpng 1.6.20 libpng &
install libtiff 4.0.4beta libtiff &
install libpq 9.4.1 &
install sqlite 3.8.8.3 libsqlite3 &
install expat 2.1.0 libexpat &
wait
install icu ${ICU_VERSION} &
install proj 4.8.0 libproj &
install pixman 0.32.6 libpixman-1 &
install cairo 1.14.2 libcairo &
install protobuf 2.6.1 &
# technically protobuf is not a mapnik core dep, but installing
# here by default helps make mapnik-vector-tile builds easier
wait
install webp 0.4.2 libwebp &
install gdal 1.11.2 libgdal &
install boost 1.59.0 &
install boost_liball 1.59.0 &
install freetype 2.6 libfreetype &
install harfbuzz 0.9.41 libharfbuzz &
wait
}
MASON_LINKED_ABS=$(pwd)/mason_packages/.link
MASON_LINKED_REL=./mason_packages/.link
export C_INCLUDE_PATH="${MASON_LINKED_ABS}/include"
export CPLUS_INCLUDE_PATH="${MASON_LINKED_ABS}/include"
export LIBRARY_PATH="${MASON_LINKED_ABS}/lib"
function make_config() {
echo "
CXX = '$CXX'
CC = '$CC'
RUNTIME_LINK = 'static'
INPUT_PLUGINS = 'all'
PATH = '${MASON_LINKED_REL}/bin'
PKG_CONFIG_PATH = '${MASON_LINKED_REL}/lib/pkgconfig'
PATH_REMOVE = '/usr:/usr/local'
PATH_REPLACE = '$HOME/build/mapbox/mason/mason_packages:./mason_packages'
BOOST_INCLUDES = '${MASON_LINKED_REL}/include'
BOOST_LIBS = '${MASON_LINKED_REL}/lib'
ICU_INCLUDES = '${MASON_LINKED_REL}/include'
ICU_LIBS = '${MASON_LINKED_REL}/lib'
HB_INCLUDES = '${MASON_LINKED_REL}/include'
HB_LIBS = '${MASON_LINKED_REL}/lib'
PNG_INCLUDES = '${MASON_LINKED_REL}/include/libpng16'
PNG_LIBS = '${MASON_LINKED_REL}/lib'
JPEG_INCLUDES = '${MASON_LINKED_REL}/include'
JPEG_LIBS = '${MASON_LINKED_REL}/lib'
TIFF_INCLUDES = '${MASON_LINKED_REL}/include'
TIFF_LIBS = '${MASON_LINKED_REL}/lib'
WEBP_INCLUDES = '${MASON_LINKED_REL}/include'
WEBP_LIBS = '${MASON_LINKED_REL}/lib'
PROJ_INCLUDES = '${MASON_LINKED_REL}/include'
PROJ_LIBS = '${MASON_LINKED_REL}/lib'
PG_INCLUDES = '${MASON_LINKED_REL}/include'
PG_LIBS = '${MASON_LINKED_REL}/lib'
FREETYPE_INCLUDES = '${MASON_LINKED_REL}/include/freetype2'
FREETYPE_LIBS = '${MASON_LINKED_REL}/lib'
SVG_RENDERER = True
CAIRO_INCLUDES = '${MASON_LINKED_REL}/include'
CAIRO_LIBS = '${MASON_LINKED_REL}/lib'
SQLITE_INCLUDES = '${MASON_LINKED_REL}/include'
SQLITE_LIBS = '${MASON_LINKED_REL}/lib'
BENCHMARK = True
CPP_TESTS = True
PGSQL2SQLITE = True
XMLPARSER = 'ptree'
SVG2PNG = True
"
}
# NOTE: the `mapnik-settings.env` is used by test/run (which is run by `make test`)
function setup_runtime_settings() {
echo "export PROJ_LIB=${MASON_LINKED_ABS}/share/proj" > mapnik-settings.env
echo "export ICU_DATA=${MASON_LINKED_ABS}/share/icu/${ICU_VERSION}" >> mapnik-settings.env
echo "export GDAL_DATA=${MASON_LINKED_ABS}/share/gdal" >> mapnik-settings.env
source mapnik-settings.env
}
function main() {
setup_mason
install_mason_deps
make_config > ./config.py
setup_runtime_settings
echo "Ready, now run:"
echo ""
echo " ./configure && make"
}
main

View file

@ -0,0 +1,23 @@
include(CheckCXXSourceRuns)
function(check_boost_regex)
set(CMAKE_REQUIRED_LIBRARIES ICU::uc ICU::data ICU::i18n Boost::headers Boost::regex)
check_cxx_source_runs([[
#include <boost/regex/icu.hpp>
#include <unicode/unistr.h>
int main()
{
U_NAMESPACE_QUALIFIER UnicodeString ustr;
try {
boost::u32regex pattern = boost::make_u32regex(ustr);
}
// an exception is fine, still indicates support is
// likely compiled into regex
catch (...) {
return 0;
}
return 0;
}
]] BOOST_REGEX_HAS_ICU)
set(BOOST_REGEX_HAS_ICU ${BOOST_REGEX_HAS_ICU} PARENT_SCOPE)
endfunction(check_boost_regex)

14
cmake/GetVersion.cmake Normal file
View file

@ -0,0 +1,14 @@
macro(get_mapnik_version)
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/include/mapnik/version.hpp VERSION_FILE)
string(REGEX MATCH "MAPNIK_MAJOR_VERSION ([0-9]*)" _ ${VERSION_FILE})
set(MAPNIK_MAJOR_VERSION ${CMAKE_MATCH_1})
string(REGEX MATCH "MAPNIK_MINOR_VERSION ([0-9]*)" _ ${VERSION_FILE})
set(MAPNIK_MINOR_VERSION ${CMAKE_MATCH_1})
string(REGEX MATCH "MAPNIK_PATCH_VERSION ([0-9]*)" _ ${VERSION_FILE})
set(MAPNIK_PATCH_VERSION ${CMAKE_MATCH_1})
set(MAPNIK_VERSION ${MAPNIK_MAJOR_VERSION}.${MAPNIK_MINOR_VERSION}.${MAPNIK_PATCH_VERSION})
endmacro()

68
cmake/MapnikExport.cmake Normal file
View file

@ -0,0 +1,68 @@
include(CMakePackageConfigHelpers)
### exports mapnik cmake config files (mapnikConfigVersion and mapnikConfig)
function(mapnik_export_cmake_config)
# export mapnik configuration
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/mapnikConfigVersion.cmake"
VERSION ${MAPNIK_VERSION}
COMPATIBILITY ExactVersion
)
get_property(MAPNIK_UTILITIES GLOBAL PROPERTY MAPNIK_UTILITIES)
# generate all find_dependency and pkg_config calls
set(mapnik_find_deps)
foreach(dep IN LISTS mapnik_deps)
set(ver_comment "# ${dep} used with version ${mapnik_${dep}_version}")
set(mapnik_find_deps "${mapnik_find_deps}\n${ver_comment}\n")
if(mapnik_${dep}_find_args)
list(REMOVE_DUPLICATES mapnik_${dep}_find_args)
list(JOIN mapnik_${dep}_find_args " " m_args_joined)
set(mapnik_find_deps "${mapnik_find_deps}find_dependency(${dep} ${m_args_joined})")
else()
list(JOIN mapnik_${dep}_pkg_args " " m_args_joined)
set(mapnik_find_deps "${mapnik_find_deps}pkg_check_modules(${dep} ${m_args_joined})")
endif()
endforeach()
configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/mapnikConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/mapnikConfig.cmake"
INSTALL_DESTINATION ${MAPNIK_CMAKE_DIR}
PATH_VARS MAPNIK_INCLUDE_DIR PLUGINS_INSTALL_DIR FONTS_INSTALL_DIR mapnik_find_deps MAPNIK_UTILITIES
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/mapnikConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/mapnikConfigVersion.cmake"
DESTINATION ${MAPNIK_CMAKE_DIR}
)
endfunction()
mapnik_export_cmake_config()
install(EXPORT MapnikTargets
DESTINATION ${MAPNIK_CMAKE_DIR}
FILE mapnikTargets.cmake
NAMESPACE mapnik::
)
### install plugin cmake config files ###
# Create configuration dependend files for the plugin install dirs.
# some package managers are using different paths per configuration.
string(TOLOWER "${CMAKE_BUILD_TYPE}" _build_type)
string(TOUPPER "${CMAKE_BUILD_TYPE}" _build_type_l)
set(m_mapnik_plugin_file_name mapnikPlugins-${_build_type})
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${m_mapnik_plugin_file_name}.cmake.in" "set(MAPNIK_PLUGINS_DIR_${_build_type_l} \"@PACKAGE_PLUGINS_INSTALL_DIR@\" CACHE STRING \"\")\n")
include(CMakePackageConfigHelpers)
configure_package_config_file(
"${CMAKE_CURRENT_BINARY_DIR}/${m_mapnik_plugin_file_name}.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${m_mapnik_plugin_file_name}.cmake"
PATH_VARS PLUGINS_INSTALL_DIR
INSTALL_DESTINATION ${MAPNIK_CMAKE_DIR}
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/${m_mapnik_plugin_file_name}.cmake"
DESTINATION ${MAPNIK_CMAKE_DIR}
)

View file

@ -0,0 +1,92 @@
function(create_pkg_config_file _target _lib_name _description)
string(CONFIGURE [[
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/@MAPNIK_LIB_DIR@
Name: @_lib_name@
Description: @_description@
Version: @MAPNIK_VERSION@
Libs: -L"${libdir}" -l$<TARGET_FILE_BASE_NAME:@_target@>$<TARGET_PROPERTY:@_target@,$<CONFIG>_POSTFIX>
Cflags: -I"${includedir}" -I"${includedir}/mapnik" ]]
_contents @ONLY)
file(GENERATE
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}-$<CONFIG>.pc
CONTENT "${_contents}"
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}-$<CONFIG>.pc
DESTINATION ${MAPNIK_PKGCONF_DIR}
RENAME ${_lib_name}.pc
)
endfunction()
function(create_pkg_config_file_mapnik _lib_name _description)
get_target_property(m_compile_defs core INTERFACE_COMPILE_DEFINITIONS)
string(JOIN " -D" m_str_compile_defs ${m_compile_defs})
if(m_str_compile_defs)
set(m_str_compile_defs "-D${m_str_compile_defs}")
endif()
set(m_requires
libmapnikwkt
libmapnikjson
icu-uc
icu-i18n
harfbuzz
freetype2
)
if(USE_LIBXML2)
list(APPEND m_requires libxml-2.0)
endif()
if(USE_PNG)
list(APPEND m_requires libpng)
endif()
if(USE_JPEG)
list(APPEND m_requires libjpeg)
endif()
if(USE_TIFF)
list(APPEND m_requires libtiff-4)
endif()
if(USE_WEBP)
list(APPEND m_requires libwebp)
endif()
if(USE_CAIRO)
list(APPEND m_requires cairo)
endif()
if(USE_PROJ)
list(APPEND m_requires "proj >= ${PROJ_MIN_VERSION}")
endif()
string(JOIN " " m_requires ${m_requires})
string(CONFIGURE [[
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/@MAPNIK_LIB_DIR@
fonts_dir=${prefix}/@FONTS_INSTALL_DIR@
plugins_dir=${prefix}/@PLUGINS_INSTALL_DIR@
Name: @_lib_name@
Description: @_description@
Version: @MAPNIK_VERSION@
Requires: @m_requires@
Libs: -L"${libdir}" -l$<TARGET_FILE_BASE_NAME:mapnik>$<TARGET_PROPERTY:mapnik,$<CONFIG>_POSTFIX>
Cflags: -I"${includedir}" -I"${includedir}/mapnik" -I"${includedir}/mapnik/agg" @m_str_compile_defs@]]
_contents @ONLY)
file(GENERATE
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}-$<CONFIG>.pc
CONTENT "${_contents}"
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}-$<CONFIG>.pc
DESTINATION ${MAPNIK_PKGCONF_DIR}
RENAME ${_lib_name}.pc
)
endfunction()
create_pkg_config_file(wkt libmapnikwkt "wkt library")
create_pkg_config_file(json libmapnikjson "json library")
create_pkg_config_file_mapnik("libmapnik" "mapnik library")

View file

@ -0,0 +1,64 @@
function(mapnik_set_dep_version dep var)
string(TOUPPER ${dep} m_package_name_upc)
set(m_package_name ${dep})
if(${m_package_name}_VERSION_STRING)
set(${var} ${${m_package_name}_VERSION_STRING} PARENT_SCOPE)
elseif(${m_package_name}_VERSION)
set(${var} ${${m_package_name}_VERSION} PARENT_SCOPE)
elseif(${m_package_name_upc}_VERSION_STRING)
set(${var} ${${m_package_name_upc}_VERSION_STRING} PARENT_SCOPE)
elseif(${m_package_name_upc}_VERSION)
set(${var} ${${m_package_name_upc}_VERSION} PARENT_SCOPE)
endif()
endfunction()
function(mapnik_print_package_info dep)
message(STATUS "Using ${dep} version: ${mapnik_${dep}_version}")
endfunction()
macro(mapnik_find_package dep)
find_package(${dep} ${ARGN})
if(${dep}_FOUND)
list(APPEND mapnik_deps ${dep})
if(mapnik_${dep}_find_args)
list(APPEND mapnik_${dep}_find_args ${ARGN})
else()
set(mapnik_${dep}_find_args ${ARGN})
endif()
mapnik_set_dep_version(${dep} mapnik_${dep}_version)
mapnik_print_package_info(${dep})
else()
message(STATUS "not found: ${dep}")
endif()
endmacro()
macro(mapnik_pkg_check_modules dep)
pkg_check_modules(${dep} ${ARGN})
if(${dep}_FOUND)
list(APPEND mapnik_deps ${dep})
set(mapnik_${dep}_pkg_args ${ARGN})
mapnik_set_dep_version(${dep} mapnik_${dep}_version)
mapnik_print_package_info(${dep})
else()
message(STATUS "not found: ${dep}")
endif()
endmacro()
macro(mapnik_find_threads)
find_package(Threads REQUIRED)
if(CMAKE_THREAD_LIBS_INIT)
message(STATUS "Using Threads (system libraries)")
elseif(CMAKE_USE_WIN32_THREADS_INIT)
message(STATUS "Using Threads (win32 threads)")
elseif(CMAKE_USE_PTHREADS_INIT)
message(STATUS "Using Threads (pthread)")
elseif(CMAKE_HP_PTHREADS_INIT)
message(STATUS "Using Threads (HP thread)")
else()
message(STATUS "Using Threads (unknown backend)")
endif()
endmacro()

98
cmake/MapnikInstall.cmake Normal file
View file

@ -0,0 +1,98 @@
#
# Install library targets that consuming users need.
#
function(mapnik_install _target)
install(TARGETS ${_target}
EXPORT MapnikTargets
INCLUDES DESTINATION ${MAPNIK_INCLUDE_DIR}
RUNTIME DESTINATION ${MAPNIK_BIN_DIR}
COMPONENT MapnikRuntime
LIBRARY DESTINATION ${MAPNIK_LIB_DIR}
COMPONENT MapnikRuntime
NAMELINK_COMPONENT MapnikDevelopment
ARCHIVE DESTINATION ${MAPNIK_ARCHIVE_DIR}
COMPONENT MapnikDevelopment
)
get_target_property(TARGET_TYPE "${_target}" TYPE)
if (TARGET_TYPE STREQUAL "SHARED_LIBRARY")
set_property(GLOBAL APPEND PROPERTY TARGETS ${_target})
endif()
endfunction()
#
# Install plugins
#
function(mapnik_install_plugin _target)
if(NOT BUILD_SHARED_PLUGINS)
return()
endif()
install(TARGETS ${_target}
RUNTIME DESTINATION ${PLUGINS_INSTALL_DIR}
COMPONENT MapnikPluginRuntime
LIBRARY DESTINATION ${PLUGINS_INSTALL_DIR}
COMPONENT MapnikPluginRuntime
NAMELINK_COMPONENT MapnikPluginDevelopment
ARCHIVE DESTINATION ${PLUGINS_INSTALL_DIR}
COMPONENT MapnikPluginDevelopment
)
set_property(GLOBAL APPEND PROPERTY PLUGINS ${_target})
endfunction()
#
# Install executables. These are available via COMPONENTS in find_package
#
function(mapnik_install_utility _target)
set(_target_name "mapnikUtilityTargets_${_target}")
install(TARGETS ${_target}
EXPORT ${_target_name}
INCLUDES DESTINATION ${MAPNIK_INCLUDE_DIR}
RUNTIME DESTINATION ${MAPNIK_BIN_DIR}
COMPONENT MapnikRuntime
LIBRARY DESTINATION ${MAPNIK_LIB_DIR}
COMPONENT MapnikRuntime
NAMELINK_COMPONENT MapnikDevelopment
ARCHIVE DESTINATION ${MAPNIK_ARCHIVE_DIR}
COMPONENT MapnikDevelopment
)
install(EXPORT ${_target_name}
FILE ${_target_name}.cmake
NAMESPACE mapnik::
DESTINATION ${MAPNIK_CMAKE_DIR}
)
set_property(GLOBAL APPEND PROPERTY MAPNIK_UTILITIES ${_target})
endfunction()
function(mapnik_install_targets)
if(INSTALL_DEPENDENCIES AND WIN32)
# https://cmake.org/cmake/help/latest/policy/CMP0087.html
cmake_policy(SET CMP0087 NEW)
get_property(_installed_utilities GLOBAL PROPERTY MAPNIK_UTILITIES)
get_property(_installed_targets GLOBAL PROPERTY TARGETS)
get_property(_installed_plugins GLOBAL PROPERTY PLUGINS)
set(_internal_executables "")
set(_internal_libraries "")
foreach(_target IN LISTS _installed_utilities)
list(APPEND _internal_executables "\${CMAKE_INSTALL_PREFIX}/${MAPNIK_BIN_DIR}/$<TARGET_FILE_NAME:${_target}>")
endforeach()
foreach(_target IN LISTS _installed_targets)
list(APPEND _internal_libraries "\${CMAKE_INSTALL_PREFIX}/${MAPNIK_BIN_DIR}/$<TARGET_FILE_NAME:${_target}>")
endforeach()
foreach(_target IN LISTS _installed_plugins)
list(APPEND _internal_libraries "\${CMAKE_INSTALL_PREFIX}/${PLUGINS_INSTALL_DIR}/$<TARGET_FILE_NAME:${_target}>")
endforeach()
# all other executables get auto detected and fixed.
if(_internal_executables)
list(GET _internal_executables 0 _internal_executables)
endif()
INSTALL(CODE "
message(STATUS \"internal_executables: ${_internal_executables}\")
message(STATUS \"internal_libraries: ${_internal_libraries}\")
message(STATUS \"ADDITIONAL_LIBARIES_PATHS: ${ADDITIONAL_LIBARIES_PATHS}\")
include(BundleUtilities)
fixup_bundle(\"${_internal_executables}\" \"${_internal_libraries}\" \"${ADDITIONAL_LIBARIES_PATHS}\")
" COMPONENT MapnikRuntime)
endif()
endfunction()

View file

@ -0,0 +1,3 @@
set(BOOST_MIN_VERSION 1.73)
set(HARFBUZZ_MIN_VERSION 0.9.34)
set(PROJ_MIN_VERSION 7.2.0)

4
cmake/MapnikOption.cmake Normal file
View file

@ -0,0 +1,4 @@
macro(mapnik_option option_name option_description option_default_value)
option(${option_name} "${option_description}" ${option_default_value})
add_feature_info(${option_name} ${option_name} "${option_description}")
endmacro()

16
cmake/clang-format.cmake Normal file
View file

@ -0,0 +1,16 @@
function(format_dir dir)
file(GLOB_RECURSE sources
"${dir}/*.cpp"
"${dir}/*.hpp"
)
execute_process(COMMAND clang-format -style=file -i ${sources})
endfunction()
format_dir(benchmark)
format_dir(demo)
format_dir(include)
format_dir(plugins)
format_dir(src)
format_dir(test)
format_dir(utils)

View file

@ -0,0 +1,52 @@
@PACKAGE_INIT@
set_and_check(MAPNIK_INCLUDE_DIR "@PACKAGE_MAPNIK_INCLUDE_DIR@" CACHE STRING "")
set_and_check(MAPNIK_FONTS_DIR "@PACKAGE_FONTS_INSTALL_DIR@" CACHE STRING "")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/Modules/")
include(CMakeFindDependencyMacro)
find_dependency(Threads REQUIRED)
@mapnik_find_deps@
include("${CMAKE_CURRENT_LIST_DIR}/mapnikTargets.cmake")
set(_supported_components @MAPNIK_UTILITIES@)
foreach(_comp ${mapnik_FIND_COMPONENTS})
if (NOT _comp IN_LIST _supported_components)
set(mapnik_FOUND False)
set(mapnik_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/mapnikUtilityTargets_${_comp}.cmake")
endforeach()
get_filename_component(_plugin_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
file(GLOB CONFIG_FILES "${_plugin_dir}/mapnikPlugins-*.cmake")
foreach(f ${CONFIG_FILES})
include(${f})
endforeach()
function(mapnik_find_plugin_dir PLUGIN_DIR)
string(TOUPPER "${CMAKE_BUILD_TYPE}" _build_type_l)
set(_plugin_dir "${MAPNIK_PLUGINS_DIR_${_build_type_l}}")
# only release has more then one configuration
if(NOT _plugin_dir)
set(_all_rel_cfgs RELEASE RELWITHDEBINFO MINSIZEREL)
list(FIND _all_rel_cfgs ${_build_type_l} _is_rel_cfg)
# check if the current configuration is a known release configuration
if(${_is_rel_cfg} GREATER_EQUAL 0)
foreach(_rel_cfg IN LISTS _all_rel_cfgs)
set(_plugin_dir "${MAPNIK_PLUGINS_DIR_${_rel_cfg}}")
if(_plugin_dir)
break()
endif()
endforeach()
endif()
endif()
if(NOT _plugin_dir)
message(WARNING "Could not find a plugin install dir for configuration ${_build_type_l}")
endif()
set(${PLUGIN_DIR} ${_plugin_dir} PARENT_SCOPE)
endfunction()

18
cmake/pack.cmake Normal file
View file

@ -0,0 +1,18 @@
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_NAME "mapnik")
set(CPACK_PACKAGE_CONTACT "ubuntu-mathis@outlook.com")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://mapnik.org")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING")
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_GENERATOR "DEB;TGZ")
set(CPACK_SOURCE_IGNORE_FILES
\\.git/
build/
".*~$"
out/
\\.vs/
\\.vscode/
)
set(CPACK_VERBATIM_VARIABLES YES)
include(CPack)

10
codecov.yml Normal file
View file

@ -0,0 +1,10 @@
ignore:
- "mason_packages"
- "benchmark"
- "deps"
- ".sconf_temp"
- "scons"
- "test"
- "demo"
- "docs"
- "fonts"

33
configure vendored
View file

@ -1,5 +1,32 @@
#!/bin/sh #! /usr/bin/env bash
PYTHON=${PYTHON:-python} set -eu
$PYTHON scons/scons.py --implicit-deps-changed configure "$@" : ${PYTHON:=python}
# Only some shells (Bash and Z shell) support arrays. Therefore,
# the following code provides an alternative for users calling the script
# with shells other than Bash or Z shell (e.g. Debian users using Dash).
THE_SHELL=$(basename $SHELL)
if [ "$THE_SHELL" != "bash" ] && [ "$THE_SHELL" != "zsh" ]; then
if [ -f mapnik-settings.env ]; then
echo "WARNING: Reading from mapnik-settings.env is supported with Bash or Z shell only."
fi
$PYTHON scons/scons.py --implicit-deps-changed configure "$@"
exit 0
fi
# mapnik-settings.env is an optional file to store
# environment variables that should be used before
# running tests like PROJ_LIB, GDAL_DATA, and ICU_DATA
# These do not normally need to be set except when
# building against binary versions of dependencies like
# done via bootstrap.sh
if [ -f mapnik-settings.env ]; then
echo "Inheriting from mapnik-settings.env"
. ./mapnik-settings.env
VARS=( $(cat mapnik-settings.env) )
fi
$PYTHON scons/scons.py --implicit-deps-changed configure ${VARS[*]:-} "$@"

7
demo/CMakeLists.txt Normal file
View file

@ -0,0 +1,7 @@
if(BUILD_DEMO_VIEWER)
add_subdirectory(viewer)
endif()
if(BUILD_DEMO_CPP)
add_subdirectory(c++)
endif()

6
demo/c++/CMakeLists.txt Normal file
View file

@ -0,0 +1,6 @@
add_executable(mapnik-demo rundemo.cpp)
target_link_libraries(mapnik-demo PRIVATE
mapnik::agg
mapnik::mapnik
ICU::data ICU::i18n ICU::uc # needed for the static build (TODO: why isn't this correctly propagated from mapnik::mapnik?)
)

View file

@ -52,11 +52,11 @@ If you do not have svn installed you can grab gyp from:
Simply type: Simply type:
make make
Then to run do: Then to run do:
./rundemo `mapnik-config --prefix` ./rundemo `mapnik-config --prefix`
On OS X you can also create an xcode project: On OS X you can also create an xcode project:

View file

@ -41,7 +41,7 @@ if env['HAS_CAIRO']:
demo_env.Append(CPPDEFINES = '-DHAVE_CAIRO') demo_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
libraries = [env['MAPNIK_NAME']] libraries = [env['MAPNIK_NAME']]
libraries.extend(copy(env['LIBMAPNIK_LIBS'])) libraries.extend([copy(env['LIBMAPNIK_LIBS']), 'sqlite3', 'pthread'])
rundemo = demo_env.Program('rundemo', source, LIBS=libraries) rundemo = demo_env.Program('rundemo', source, LIBS=libraries)
Depends(rundemo, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME'])) Depends(rundemo, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME']))

View file

@ -2,7 +2,7 @@
* *
* This file is part of Mapnik (c++ mapping toolkit) * This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2015 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,6 +20,7 @@
* *
*****************************************************************************/ *****************************************************************************/
#include <mapnik/mapnik.hpp>
#include <mapnik/map.hpp> #include <mapnik/map.hpp>
#include <mapnik/layer.hpp> #include <mapnik/layer.hpp>
#include <mapnik/rule.hpp> #include <mapnik/rule.hpp>
@ -45,19 +46,21 @@
#include <iostream> #include <iostream>
int main(int, char**)
int main ( int, char** )
{ {
using namespace mapnik; using namespace mapnik;
const std::string srs_lcc="+proj=lcc +ellps=GRS80 +lat_0=49 +lon_0=-95 +lat+1=49 +lat_2=77 +datum=NAD83 +units=m +no_defs"; const std::string srs_lcc =
const std::string srs_merc="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over"; "+proj=lcc +ellps=GRS80 +lat_0=49 +lon_0=-95 +lat+1=49 +lat_2=77 +datum=NAD83 +units=m +no_defs";
const std::string srs_merc = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 "
try { "+units=m +nadgrids=@null +wktext +no_defs +over";
mapnik::setup();
try
{
std::cout << " running demo ... \n"; std::cout << " running demo ... \n";
datasource_cache::instance().register_datasources("plugins/input/"); datasource_cache::instance().register_datasources("plugins/input/");
freetype_engine::register_font("fonts/dejavu-fonts-ttf-2.34/ttf/DejaVuSans.ttf"); freetype_engine::register_font("fonts/dejavu-fonts-ttf-2.37/ttf/DejaVuSans.ttf");
Map m(800,600); Map m(800, 600);
m.set_background(parse_color("white")); m.set_background(parse_color("white"));
m.set_srs(srs_merc); m.set_srs(srs_merc);
// create styles // create styles
@ -93,13 +96,13 @@ int main ( int, char** )
rule r; rule r;
{ {
line_symbolizer line_sym; line_symbolizer line_sym;
put(line_sym,keys::stroke,color(0,0,0)); put(line_sym, keys::stroke, color(0, 0, 0));
put(line_sym,keys::stroke_width,1.0); put(line_sym, keys::stroke_width, 1.0);
dash_array dash; dash_array dash;
dash.emplace_back(8,4); dash.emplace_back(8, 4);
dash.emplace_back(2,2); dash.emplace_back(2, 2);
dash.emplace_back(2,2); dash.emplace_back(2, 2);
put(line_sym,keys::stroke_dasharray,dash); put(line_sym, keys::stroke_dasharray, dash);
r.append(std::move(line_sym)); r.append(std::move(line_sym));
} }
provlines_style.add_rule(std::move(r)); provlines_style.add_rule(std::move(r));
@ -127,10 +130,10 @@ int main ( int, char** )
r.set_filter(parse_expression("[CLASS] = 3 or [CLASS] = 4")); r.set_filter(parse_expression("[CLASS] = 3 or [CLASS] = 4"));
{ {
line_symbolizer line_sym; line_symbolizer line_sym;
put(line_sym,keys::stroke,color(171,158,137)); put(line_sym, keys::stroke, color(171, 158, 137));
put(line_sym,keys::stroke_width,2.0); put(line_sym, keys::stroke_width, 2.0);
put(line_sym,keys::stroke_linecap,ROUND_CAP); put(line_sym, keys::stroke_linecap, line_cap_enum::ROUND_CAP);
put(line_sym,keys::stroke_linejoin,ROUND_JOIN); put(line_sym, keys::stroke_linejoin, line_join_enum::ROUND_JOIN);
r.append(std::move(line_sym)); r.append(std::move(line_sym));
} }
roads34_style.add_rule(std::move(r)); roads34_style.add_rule(std::move(r));
@ -144,10 +147,10 @@ int main ( int, char** )
r.set_filter(parse_expression("[CLASS] = 2")); r.set_filter(parse_expression("[CLASS] = 2"));
{ {
line_symbolizer line_sym; line_symbolizer line_sym;
put(line_sym,keys::stroke,color(171,158,137)); put(line_sym, keys::stroke, color(171, 158, 137));
put(line_sym,keys::stroke_width,4.0); put(line_sym, keys::stroke_width, 4.0);
put(line_sym,keys::stroke_linecap,ROUND_CAP); put(line_sym, keys::stroke_linecap, line_cap_enum::ROUND_CAP);
put(line_sym,keys::stroke_linejoin,ROUND_JOIN); put(line_sym, keys::stroke_linejoin, line_join_enum::ROUND_JOIN);
r.append(std::move(line_sym)); r.append(std::move(line_sym));
} }
roads2_style_1.add_rule(std::move(r)); roads2_style_1.add_rule(std::move(r));
@ -160,10 +163,10 @@ int main ( int, char** )
r.set_filter(parse_expression("[CLASS] = 2")); r.set_filter(parse_expression("[CLASS] = 2"));
{ {
line_symbolizer line_sym; line_symbolizer line_sym;
put(line_sym,keys::stroke,color(255,250,115)); put(line_sym, keys::stroke, color(255, 250, 115));
put(line_sym,keys::stroke_width,2.0); put(line_sym, keys::stroke_width, 2.0);
put(line_sym,keys::stroke_linecap,ROUND_CAP); put(line_sym, keys::stroke_linecap, line_cap_enum::ROUND_CAP);
put(line_sym,keys::stroke_linejoin,ROUND_JOIN); put(line_sym, keys::stroke_linejoin, line_join_enum::ROUND_JOIN);
r.append(std::move(line_sym)); r.append(std::move(line_sym));
} }
roads2_style_2.add_rule(std::move(r)); roads2_style_2.add_rule(std::move(r));
@ -177,10 +180,10 @@ int main ( int, char** )
r.set_filter(parse_expression("[CLASS] = 1")); r.set_filter(parse_expression("[CLASS] = 1"));
{ {
line_symbolizer line_sym; line_symbolizer line_sym;
put(line_sym,keys::stroke,color(188,149,28)); put(line_sym, keys::stroke, color(188, 149, 28));
put(line_sym,keys::stroke_width,7.0); put(line_sym, keys::stroke_width, 7.0);
put(line_sym,keys::stroke_linecap,ROUND_CAP); put(line_sym, keys::stroke_linecap, line_cap_enum::ROUND_CAP);
put(line_sym,keys::stroke_linejoin,ROUND_JOIN); put(line_sym, keys::stroke_linejoin, line_join_enum::ROUND_JOIN);
r.append(std::move(line_sym)); r.append(std::move(line_sym));
} }
roads1_style_1.add_rule(std::move(r)); roads1_style_1.add_rule(std::move(r));
@ -193,10 +196,10 @@ int main ( int, char** )
r.set_filter(parse_expression("[CLASS] = 1")); r.set_filter(parse_expression("[CLASS] = 1"));
{ {
line_symbolizer line_sym; line_symbolizer line_sym;
put(line_sym,keys::stroke,color(242,191,36)); put(line_sym, keys::stroke, color(242, 191, 36));
put(line_sym,keys::stroke_width,5.0); put(line_sym, keys::stroke_width, 5.0);
put(line_sym,keys::stroke_linecap,ROUND_CAP); put(line_sym, keys::stroke_linecap, line_cap_enum::ROUND_CAP);
put(line_sym,keys::stroke_linejoin,ROUND_JOIN); put(line_sym, keys::stroke_linejoin, line_join_enum::ROUND_JOIN);
r.append(std::move(line_sym)); r.append(std::move(line_sym));
} }
roads1_style_2.add_rule(std::move(r)); roads1_style_2.add_rule(std::move(r));
@ -212,10 +215,11 @@ int main ( int, char** )
text_placements_ptr placement_finder = std::make_shared<text_placements_dummy>(); text_placements_ptr placement_finder = std::make_shared<text_placements_dummy>();
placement_finder->defaults.format_defaults.face_name = "DejaVu Sans Book"; placement_finder->defaults.format_defaults.face_name = "DejaVu Sans Book";
placement_finder->defaults.format_defaults.text_size = 10.0; placement_finder->defaults.format_defaults.text_size = 10.0;
placement_finder->defaults.format_defaults.fill = color(0,0,0); placement_finder->defaults.format_defaults.fill = color(0, 0, 0);
placement_finder->defaults.format_defaults.halo_fill = color(255,255,200); placement_finder->defaults.format_defaults.halo_fill = color(255, 255, 200);
placement_finder->defaults.format_defaults.halo_radius = 1.0; placement_finder->defaults.format_defaults.halo_radius = 1.0;
placement_finder->defaults.set_format_tree(std::make_shared<mapnik::formatting::text_node>(parse_expression("[GEONAME]"))); placement_finder->defaults.set_format_tree(
std::make_shared<mapnik::formatting::text_node>(parse_expression("[GEONAME]")));
put<text_placements_ptr>(text_sym, keys::text_placements_, placement_finder); put<text_placements_ptr>(text_sym, keys::text_placements_, placement_finder);
r.append(std::move(text_sym)); r.append(std::move(text_sym));
} }
@ -228,9 +232,9 @@ int main ( int, char** )
// Provincial polygons // Provincial polygons
{ {
parameters p; parameters p;
p["type"]="shape"; p["type"] = "shape";
p["file"]="demo/data/boundaries"; p["file"] = "demo/data/boundaries";
p["encoding"]="latin1"; p["encoding"] = "utf8";
layer lyr("Provinces"); layer lyr("Provinces");
lyr.set_datasource(datasource_cache::instance().create(p)); lyr.set_datasource(datasource_cache::instance().create(p));
@ -242,8 +246,8 @@ int main ( int, char** )
// Drainage // Drainage
{ {
parameters p; parameters p;
p["type"]="shape"; p["type"] = "shape";
p["file"]="demo/data/qcdrainage"; p["file"] = "demo/data/qcdrainage";
layer lyr("Quebec Hydrography"); layer lyr("Quebec Hydrography");
lyr.set_datasource(datasource_cache::instance().create(p)); lyr.set_datasource(datasource_cache::instance().create(p));
lyr.set_srs(srs_lcc); lyr.set_srs(srs_lcc);
@ -253,8 +257,8 @@ int main ( int, char** )
{ {
parameters p; parameters p;
p["type"]="shape"; p["type"] = "shape";
p["file"]="demo/data/ontdrainage"; p["file"] = "demo/data/ontdrainage";
layer lyr("Ontario Hydrography"); layer lyr("Ontario Hydrography");
lyr.set_datasource(datasource_cache::instance().create(p)); lyr.set_datasource(datasource_cache::instance().create(p));
lyr.set_srs(srs_lcc); lyr.set_srs(srs_lcc);
@ -265,8 +269,8 @@ int main ( int, char** )
// Provincial boundaries // Provincial boundaries
{ {
parameters p; parameters p;
p["type"]="shape"; p["type"] = "shape";
p["file"]="demo/data/boundaries_l"; p["file"] = "demo/data/boundaries_l";
layer lyr("Provincial borders"); layer lyr("Provincial borders");
lyr.set_srs(srs_lcc); lyr.set_srs(srs_lcc);
lyr.set_datasource(datasource_cache::instance().create(p)); lyr.set_datasource(datasource_cache::instance().create(p));
@ -277,8 +281,8 @@ int main ( int, char** )
// Roads // Roads
{ {
parameters p; parameters p;
p["type"]="shape"; p["type"] = "shape";
p["file"]="demo/data/roads"; p["file"] = "demo/data/roads";
layer lyr("Roads"); layer lyr("Roads");
lyr.set_srs(srs_lcc); lyr.set_srs(srs_lcc);
lyr.set_datasource(datasource_cache::instance().create(p)); lyr.set_datasource(datasource_cache::instance().create(p));
@ -293,9 +297,9 @@ int main ( int, char** )
// popplaces // popplaces
{ {
parameters p; parameters p;
p["type"]="shape"; p["type"] = "shape";
p["file"]="demo/data/popplaces"; p["file"] = "demo/data/popplaces";
p["encoding"] = "latin1"; p["encoding"] = "utf8";
layer lyr("Populated Places"); layer lyr("Populated Places");
lyr.set_srs(srs_lcc); lyr.set_srs(srs_lcc);
lyr.set_datasource(datasource_cache::instance().create(p)); lyr.set_datasource(datasource_cache::instance().create(p));
@ -303,28 +307,28 @@ int main ( int, char** )
m.add_layer(lyr); m.add_layer(lyr);
} }
m.zoom_to_box(box2d<double>(-8024477.28459,5445190.38849,-7381388.20071,5662941.44855)); m.zoom_to_box(box2d<double>(-8024477.28459, 5445190.38849, -7381388.20071, 5662941.44855));
image_rgba8 buf(m.width(),m.height()); image_rgba8 buf(m.width(), m.height());
agg_renderer<image_rgba8> ren(m,buf); agg_renderer<image_rgba8> ren(m, buf);
ren.apply(); ren.apply();
std::string msg("These maps have been rendered using AGG in the current directory:\n"); std::string msg("These maps have been rendered using AGG in the current directory:\n");
#ifdef HAVE_JPEG #ifdef HAVE_JPEG
save_to_file(buf,"demo.jpg","jpeg"); save_to_file(buf, "demo.jpg", "jpeg");
msg += "- demo.jpg\n"; msg += "- demo.jpg\n";
#endif #endif
#ifdef HAVE_PNG #ifdef HAVE_PNG
save_to_file(buf,"demo.png","png"); save_to_file(buf, "demo.png", "png");
save_to_file(buf,"demo256.png","png8"); save_to_file(buf, "demo256.png", "png8");
msg += "- demo.png\n"; msg += "- demo.png\n";
msg += "- demo256.png\n"; msg += "- demo256.png\n";
#endif #endif
#ifdef HAVE_TIFF #ifdef HAVE_TIFF
save_to_file(buf,"demo.tif","tiff"); save_to_file(buf, "demo.tif", "tiff");
msg += "- demo.tif\n"; msg += "- demo.tif\n";
#endif #endif
#ifdef HAVE_WEBP #ifdef HAVE_WEBP
save_to_file(buf,"demo.webp","webp"); save_to_file(buf, "demo.webp", "webp");
msg += "- demo.webp\n"; msg += "- demo.webp\n";
#endif #endif
msg += "Have a look!\n"; msg += "Have a look!\n";
@ -332,8 +336,8 @@ int main ( int, char** )
#if defined(HAVE_CAIRO) #if defined(HAVE_CAIRO)
// save to pdf/svg files // save to pdf/svg files
save_to_cairo_file(m,"cairo-demo.pdf"); save_to_cairo_file(m, "cairo-demo.pdf");
save_to_cairo_file(m,"cairo-demo.svg"); save_to_cairo_file(m, "cairo-demo.svg");
/* we could also do: /* we could also do:
@ -342,38 +346,38 @@ int main ( int, char** )
but instead let's build up a surface for more flexibility but instead let's build up a surface for more flexibility
*/ */
cairo_surface_ptr image_surface( cairo_surface_ptr image_surface(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, m.width(), m.height()),
cairo_image_surface_create(CAIRO_FORMAT_ARGB32,m.width(),m.height()), cairo_surface_closer());
cairo_surface_closer());
double scale_factor = 1.0; double scale_factor = 1.0;
cairo_ptr image_context(create_context(image_surface)); cairo_ptr image_context(create_context(image_surface));
mapnik::cairo_renderer<cairo_ptr> png_render(m,image_context,scale_factor); mapnik::cairo_renderer<cairo_ptr> png_render(m, image_context, scale_factor);
png_render.apply(); png_render.apply();
// we can now write to png with cairo functionality // we can now write to png with cairo functionality
cairo_surface_write_to_png(&*image_surface, "cairo-demo.png"); cairo_surface_write_to_png(&*image_surface, "cairo-demo.png");
// but we can also benefit from quantization by converting // but we can also benefit from quantization by converting
// to a mapnik image object and then saving that // to a mapnik image object and then saving that
mapnik::image_rgba8 im_data(cairo_image_surface_get_width(&*image_surface), cairo_image_surface_get_height(&*image_surface)); mapnik::image_rgba8 im_data(cairo_image_surface_get_width(&*image_surface),
cairo_image_surface_get_height(&*image_surface));
cairo_image_to_rgba8(im_data, image_surface); cairo_image_to_rgba8(im_data, image_surface);
save_to_file(im_data, "cairo-demo256.png","png8"); save_to_file(im_data, "cairo-demo256.png", "png8");
cairo_surface_finish(&*image_surface); cairo_surface_finish(&*image_surface);
std::cout << "Three maps have been rendered using Cairo in the current directory:\n" std::cout << "Three maps have been rendered using Cairo in the current directory:\n"
"- cairo-demo.png\n" "- cairo-demo.png\n"
"- cairo-demo256.png\n" "- cairo-demo256.png\n"
"- cairo-demo.pdf\n" "- cairo-demo.pdf\n"
"- cairo-demo.svg\n" "- cairo-demo.svg\n"
"Have a look!\n"; "Have a look!\n";
#endif #endif
// save map definition (data + style) // save map definition (data + style)
save_map(m, "map.xml"); save_map(m, "map.xml");
} }
catch ( std::exception const& ex ) catch (std::exception const& ex)
{ {
std::cerr << "### std::exception: " << ex.what() << std::endl; std::cerr << "### std::exception: " << ex.what() << std::endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
catch ( ... ) catch (...)
{ {
std::cerr << "### Unknown exception." << std::endl; std::cerr << "### Unknown exception." << std::endl;
return EXIT_FAILURE; return EXIT_FAILURE;

Binary file not shown.

View file

@ -1 +0,0 @@
PROJCS["Atlas of Canada Lambert Conformal Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-95.0],PARAMETER["Standard_Parallel_1",49.0],PARAMETER["Standard_Parallel_2",77.0],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]

Binary file not shown.

Binary file not shown.

View file

@ -1 +0,0 @@
PROJCS["Atlas of Canada Lambert Conformal Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-95.0],PARAMETER["Standard_Parallel_1",49.0],PARAMETER["Standard_Parallel_2",77.0],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]

Binary file not shown.

Binary file not shown.

View file

@ -1 +0,0 @@
PROJCS["Atlas of Canada Lambert Conformal Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-95.0],PARAMETER["Standard_Parallel_1",49.0],PARAMETER["Standard_Parallel_2",77.0],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]

Binary file not shown.

Binary file not shown.

View file

@ -1 +0,0 @@
PROJCS["Atlas of Canada Lambert Conformal Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-95.0],PARAMETER["Standard_Parallel_1",49.0],PARAMETER["Standard_Parallel_2",77.0],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]

Binary file not shown.

Binary file not shown.

View file

@ -1 +0,0 @@
PROJCS["Atlas of Canada Lambert Conformal Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-95.0],PARAMETER["Standard_Parallel_1",49.0],PARAMETER["Standard_Parallel_2",77.0],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]

Binary file not shown.

Binary file not shown.

View file

@ -1 +0,0 @@
PROJCS["Atlas of Canada Lambert Conformal Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-95.0],PARAMETER["Standard_Parallel_1",49.0],PARAMETER["Standard_Parallel_2",77.0],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]

Binary file not shown.

View file

@ -1,20 +0,0 @@
This directory contains a sample python script implementing the Mapnik API.
The script is thoroughly commented and also acts as a mini tutorial. Reading
it should get you on your way, and you can use it as a base for your work.
You must compile and install mapnik and the python bindings FIRST.
Once this is done, run it:
/path/to/python rundemo.py
If all goes well, it should render 2 map images:
demo.jpg
demo.png
Have a look!
Cheers,
J.F.

View file

@ -1,379 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
#
# This file is part of Mapnik (c++ mapping toolkit)
# Copyright (C) 2005 Jean-Francois Doyon
#
# Mapnik is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
from __future__ import print_function
import sys
from os import path
import mapnik
# Instanciate a map, giving it a width and height. Remember: the word "map" is
# reserved in Python! :)
root = path.dirname(__file__)
m = mapnik.Map(800,600,"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs")
# Set its background colour. More on colours later ...
m.background = mapnik.Color('white')
# Now we can start adding layers, in stacking order (i.e. bottom layer first)
# Canadian Provinces (Polygons)
# Instanciate a layer. The parameters depend on the type of data:
# shape:
# type='shape'
# file='/path/to/shape'
# raster:
# type='raster'
# file='/path/to/raster'
# postgis:
# type='postgis'
# host='127.0.0.1'
# dbname='mydatabase'
# user='myusername'
# password='mypassword'
# table= TODO
provpoly_lyr = mapnik.Layer('Provinces')
provpoly_lyr.srs = "+proj=lcc +ellps=GRS80 +lat_0=49 +lon_0=-95 +lat+1=49 +lat_2=77 +datum=NAD83 +units=m +no_defs"
provpoly_lyr.datasource = mapnik.Shapefile(file=path.join(root,'../data/boundaries'), encoding='latin1')
# We then define a style for the layer. A layer can have one or many styles.
# Styles are named, so they can be shared across different layers.
# Multiple styles per layer behaves functionally like multiple layers. The
# data is completely re-scanned for each style within one layer, and a style
# will be drawn entirely "above" the previous one. Performance wise using
# multiple styles in one layer is the same has having multiple layers.
# The paradigm is useful mostly as a convenience.
provpoly_style = mapnik.Style()
# A Style needs one or more rules. A rule will normally consist of a filter
# for feature selection, and one or more symbolizers.
provpoly_rule_on = mapnik.Rule()
# A Expression() allows the selection of features to which the symbology will
# be applied. More on Mapnik expressions can be found in Tutorial #2.
# A given feature can only match one filter per rule per style.
provpoly_rule_on.filter = mapnik.Expression("[NAME_EN] = 'Ontario'")
# Here a symbolizer is defined. Available are:
# - LineSymbolizer(Color(),<width>)
# - LineSymbolizer(Stroke())
# - PolygonSymbolizer(Color())
# - PointSymbolizer(<file>,<type>,<width>,<height>)
# Some of them can accept a Color() instance, which can be created with:
# - Color(<red>, <green>, <blue>)
# - Color(<red>, <green>, <blue>, <alpha>)
# - Color(<string>) where <string> will be something like '#00FF00'
# or '#0f0' or 'green'
sym = mapnik.PolygonSymbolizer()
sym.fill = mapnik.Color(250, 190, 183);
provpoly_rule_on.symbols.append(sym)
provpoly_style.rules.append(provpoly_rule_on)
provpoly_rule_qc = mapnik.Rule()
provpoly_rule_qc.filter = mapnik.Expression("[NOM_FR] = 'Québec'")
sym = mapnik.PolygonSymbolizer()
sym.fill = mapnik.Color(217, 235, 203)
provpoly_rule_qc.symbols.append(sym)
provpoly_style.rules.append(provpoly_rule_qc)
# Add the style to the map, giving it a name. This is the name that will be
# used to refer to it from here on. Having named styles allows them to be
# re-used throughout the map.
m.append_style('provinces', provpoly_style)
# Then associate the style to the layer itself.
provpoly_lyr.styles.append('provinces')
# Then add the layer to the map. In reality, it's the order in which you
# append them to the map that will determine the drawing order, though by
# convention it is recommended to define them in drawing order as well.
m.layers.append(provpoly_lyr)
# Drainage
# A simple example ...
qcdrain_lyr = mapnik.Layer('Quebec Hydrography')
qcdrain_lyr.srs = "+proj=lcc +ellps=GRS80 +lat_0=49 +lon_0=-95 +lat+1=49 +lat_2=77 +datum=NAD83 +units=m +no_defs"
qcdrain_lyr.datasource = mapnik.Shapefile(file=path.join(root,'../data/qcdrainage'))
qcdrain_style = mapnik.Style()
qcdrain_rule = mapnik.Rule()
qcdrain_rule.filter = mapnik.Expression('[HYC] = 8')
sym = mapnik.PolygonSymbolizer()
sym.fill = mapnik.Color(153, 204, 255)
sym.smooth = 1.0 # very smooth
qcdrain_rule.symbols.append(sym)
qcdrain_style.rules.append(qcdrain_rule)
m.append_style('drainage', qcdrain_style)
qcdrain_lyr.styles.append('drainage')
m.layers.append(qcdrain_lyr)
# In this case, we have 2 data sets with similar schemas (same filtering
# attributes, and same desired style), so we're going to
# re-use the style defined in the above layer for the next one.
ondrain_lyr = mapnik.Layer('Ontario Hydrography')
ondrain_lyr.srs = "+proj=lcc +ellps=GRS80 +lat_0=49 +lon_0=-95 +lat+1=49 +lat_2=77 +datum=NAD83 +units=m +no_defs"
ondrain_lyr.datasource = mapnik.Shapefile(file=path.join(root,'../data/ontdrainage'))
ondrain_lyr.styles.append('drainage')
m.layers.append(ondrain_lyr)
# Provincial boundaries
provlines_lyr = mapnik.Layer('Provincial borders')
provlines_lyr.srs = "+proj=lcc +ellps=GRS80 +lat_0=49 +lon_0=-95 +lat+1=49 +lat_2=77 +datum=NAD83 +units=m +no_defs"
provlines_lyr.datasource = mapnik.Shapefile(file=path.join(root,'../data/boundaries_l'))
# Here we define a "dash dot dot dash" pattern for the provincial boundaries.
provlines_style = mapnik.Style()
provlines_rule = mapnik.Rule()
sym = mapnik.LineSymbolizer()
# FIXME - currently adding dash arrays is broken
# https://github.com/mapnik/mapnik/issues/2324
sym.stroke = mapnik.Color('black')
sym.stroke_width = 1.0
provlines_rule.symbols.append(sym)
provlines_style.rules.append(provlines_rule)
m.append_style('provlines', provlines_style)
provlines_lyr.styles.append('provlines')
m.layers.append(provlines_lyr)
# Roads 3 and 4 (The "grey" roads)
roads34_lyr = mapnik.Layer('Roads')
roads34_lyr.srs = "+proj=lcc +ellps=GRS80 +lat_0=49 +lon_0=-95 +lat+1=49 +lat_2=77 +datum=NAD83 +units=m +no_defs"
# create roads datasource (we're going to re-use it later)
roads34_lyr.datasource = mapnik.Shapefile(file=path.join(root,'../data/roads'))
roads34_style = mapnik.Style()
roads34_rule = mapnik.Rule()
roads34_rule.filter = mapnik.Expression('([CLASS] = 3) or ([CLASS] = 4)')
# With lines of a certain width, you can control how the ends
# are closed off using line_cap as below.
# Available options are:
# line_cap: BUTT_CAP, SQUARE_CAP, ROUND_CAP
# line_join: MITER_JOIN, MITER_REVERT_JOIN, ROUND_JOIN, BEVEL_JOIN
# And one last Stroke() attribute not used here is "opacity", which
# can be set to a numerical value.
sym = mapnik.LineSymbolizer()
sym.stroke = mapnik.Color(171,158,137)
sym.stroke_width = 2.0
sym.stroke_linecap = mapnik.stroke_linecap.ROUND_CAP
roads34_rule.symbols.append(sym)
roads34_style.rules.append(roads34_rule)
m.append_style('smallroads', roads34_style)
roads34_lyr.styles.append('smallroads')
m.layers.append(roads34_lyr)
# Roads 2 (The thin yellow ones)
roads2_lyr = mapnik.Layer('Roads')
roads2_lyr.srs = "+proj=lcc +ellps=GRS80 +lat_0=49 +lon_0=-95 +lat+1=49 +lat_2=77 +datum=NAD83 +units=m +no_defs"
# Just get a copy from roads34_lyr
roads2_lyr.datasource = roads34_lyr.datasource
roads2_style_1 = mapnik.Style()
roads2_rule_1 = mapnik.Rule()
roads2_rule_1.filter = mapnik.Expression('[CLASS] = 2')
sym = mapnik.LineSymbolizer()
sym.stroke = mapnik.Color(171,158,137)
sym.stroke_width = 4.0
sym.stroke_linecap = mapnik.stroke_linecap.ROUND_CAP
roads2_rule_1.symbols.append(sym)
roads2_style_1.rules.append(roads2_rule_1)
m.append_style('road-border', roads2_style_1)
roads2_style_2 = mapnik.Style()
roads2_rule_2 = mapnik.Rule()
roads2_rule_2.filter = mapnik.Expression('[CLASS] = 2')
sym = mapnik.LineSymbolizer()
sym.stroke = mapnik.Color(255,250,115)
sym.stroke_linecap = mapnik.stroke_linecap.ROUND_CAP
sym.stroke_width = 2.0
roads2_rule_2.symbols.append(sym)
roads2_style_2.rules.append(roads2_rule_2)
m.append_style('road-fill', roads2_style_2)
roads2_lyr.styles.append('road-border')
roads2_lyr.styles.append('road-fill')
m.layers.append(roads2_lyr)
# Roads 1 (The big orange ones, the highways)
roads1_lyr = mapnik.Layer('Roads')
roads1_lyr.srs = "+proj=lcc +ellps=GRS80 +lat_0=49 +lon_0=-95 +lat+1=49 +lat_2=77 +datum=NAD83 +units=m +no_defs"
roads1_lyr.datasource = roads34_lyr.datasource
roads1_style_1 = mapnik.Style()
roads1_rule_1 = mapnik.Rule()
roads1_rule_1.filter = mapnik.Expression('[CLASS] = 1')
sym = mapnik.LineSymbolizer()
sym.stroke = mapnik.Color(188,149,28)
sym.stroke_linecap = mapnik.stroke_linecap.ROUND_CAP
sym.stroke_width = 7.0
roads1_rule_1.symbols.append(sym)
roads1_style_1.rules.append(roads1_rule_1)
m.append_style('highway-border', roads1_style_1)
roads1_style_2 = mapnik.Style()
roads1_rule_2 = mapnik.Rule()
roads1_rule_2.filter = mapnik.Expression('[CLASS] = 1')
sym.stroke = mapnik.Color(242,191,36)
sym.stroke_linecap = mapnik.stroke_linecap.ROUND_CAP
sym.stroke_width = 5.0
roads1_rule_2.symbols.append(sym)
roads1_style_2.rules.append(roads1_rule_2)
m.append_style('highway-fill', roads1_style_2)
roads1_lyr.styles.append('highway-border')
roads1_lyr.styles.append('highway-fill')
m.layers.append(roads1_lyr)
# Populated Places
popplaces_lyr = mapnik.Layer('Populated Places')
popplaces_lyr.srs = "+proj=lcc +ellps=GRS80 +lat_0=49 +lon_0=-95 +lat+1=49 +lat_2=77 +datum=NAD83 +units=m +no_defs"
popplaces_lyr.datasource = mapnik.Shapefile(file=path.join(root,'../data/popplaces'),encoding='latin1')
popplaces_style = mapnik.Style()
popplaces_rule = mapnik.Rule()
# And here we have a TextSymbolizer, used for labeling.
# The first parameter is the name of the attribute to use as the source of the
# text to label with. Then there is font size in points (I think?), and colour.
# TODO - currently broken: https://github.com/mapnik/mapnik/issues/2324
#popplaces_text_symbolizer = mapnik.TextSymbolizer(mapnik.Expression("[GEONAME]"),
# 'DejaVu Sans Book',
# 10, mapnik.Color('black'))
# We set a "halo" around the text, which looks like an outline if thin enough,
# or an outright background if large enough.
#popplaces_text_symbolizer.label_placement= mapnik.label_placement.POINT_PLACEMENT
#popplaces_text_symbolizer.halo_fill = mapnik.Color(255,255,200)
#popplaces_text_symbolizer.halo_radius = 1
#popplaces_text_symbolizer.avoid_edges = True
#popplaces_text_symbolizer.minimum_padding = 30
#popplaces_rule.symbols.append(popplaces_text_symbolizer)
popplaces_style.rules.append(popplaces_rule)
m.append_style('popplaces', popplaces_style)
popplaces_lyr.styles.append('popplaces')
m.layers.append(popplaces_lyr)
# Draw map
# Set the initial extent of the map in 'master' spherical Mercator projection
m.zoom_to_box(mapnik.Box2d(-8024477.28459,5445190.38849,-7381388.20071,5662941.44855))
# Render map
im = mapnik.Image(m.width,m.height)
mapnik.render(m, im)
# Save image to files
images_ = []
if mapnik.has_png():
im.save('demo.png', 'png') # true-colour RGBA
images_.append('demo.png')
# old behavior, now can do 'png8:c=256'
im.save('demo256.png', 'png256') # save to palette based (max 256 colours) png
images_.append('demo256.png')
im.save('demo64_binary_transparency.png', 'png8:c=64:t=1')
images_.append('demo64_binary_transparency.png')
im.save('demo128_colors_hextree_no_alpha.png', 'png8:c=100:m=h:t=0')
images_.append('demo128_colors_hextree_no_alpha.png')
if mapnik.has_jpeg():
im.save('demo_high.jpg', 'jpeg100')
images_.append('demo_high.jpg')
im.save('demo_low.jpg', 'jpeg50')
images_.append('demo_low.jpg')
if mapnik.has_tiff():
im.save('demo.tif', 'tiff')
images_.append('demo.tif')
if mapnik.has_webp():
im.save('demo.webp', 'webp') # default quality is 90
images_.append('demo.webp')
im.save('demo_highest.webp', 'webp:quality=100')
images_.append('demo_med.webp')
im.save('demo_low.webp', 'webp:quality=50')
images_.append('demo_low.webp')
# Render cairo examples
if mapnik.has_cairo():
mapnik.render_to_file(m,'demo.pdf')
images_.append('demo.pdf')
mapnik.render_to_file(m,'demo.ps')
images_.append('demo.ps')
mapnik.render_to_file(m,'demo.svg')
images_.append('demo.svg')
mapnik.render_to_file(m,'demo_cairo_rgb24.png','RGB24')
images_.append('demo_cairo_rgb.png')
mapnik.render_to_file(m,'demo_cairo_argb32.png','ARGB32')
images_.append('demo_cairo_argb.png')
print ("\n\n", len(images_), "maps have been rendered in the current directory:")
for im_ in images_:
print ("-", im_)
print ("\n\nHave a look!\n\n")
mapnik.save_map(m,"map.xml")

Some files were not shown because too many files have changed in this diff Show more