Compare commits

...

244 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
Artem Pavlenko
ce073c64c7 Merge branch 'master' into svg-group-render 2023-01-24 14:30:28 +00:00
Artem Pavlenko
00e2027d86 Merge branch 'master' into svg-group-render 2023-01-18 09:52:43 +00:00
Artem Pavlenko
edddd08d73 Merge branch 'master' into svg-group-render 2023-01-18 09:48:29 +00: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
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
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
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
Artem Pavlenko
8c04fb1262 Use feature_id in render_id [WIP] [skip ci] 2022-11-22 10:57:05 +00: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
2325 changed files with 433531 additions and 13828 deletions

View file

@ -1,90 +1,85 @@
name: "Run tests with coverage" name: Run tests with coverage
description: "Runs all mapnik tests with coverage" description: Runs all mapnik tests with coverage
inputs: inputs:
cmake-preset: cmake-preset:
description: "the used cmake preset" description: The used CMake preset
required: true required: true
runs: runs:
using: "composite" using: composite
steps: steps:
- name: Set proj enviroment - name: Set PROJ_LIB
shell: "pwsh" shell: bash
run: | run: |
$out = cmake --preset ${{ inputs.cmake-preset }} -N -L cmake --preset ${{ inputs.cmake-preset }} -N -L | grep -o "PROJ_LIB=.*" >> ${GITHUB_ENV}
$proj_lib = $out -match "PROJ_LIB=*"
echo ("PROJ_LIB=" + $proj_lib.Substring(11)) >> $env: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 - name: Test
shell: "bash" shell: bash
env: env:
UPDATE: "1" UPDATE: 1
run: | run: |
if [ "$RUNNER_OS" == "Windows" ]; then ${TEST_WRAPPER:-} ctest --preset ${{ inputs.cmake-preset }}
OpenCppCoverage --modules *libmapnik* --modules mapnik*.exe --modules *.input --sources ${{ github.workspace }} --export_type binary --cover_children -- ctest --preset ${{ inputs.cmake-preset }}
else
ctest --preset ${{ inputs.cmake-preset }}
fi
- name: Test visuals (windows) - name: Test visuals
continue-on-error: true continue-on-error: true
working-directory: build/out working-directory: build/out
shell: "pwsh" shell: bash
if: runner.os == 'Windows'
run: OpenCppCoverage --modules *libmapnik* --modules mapnik*.exe --modules *.input --sources ${{ github.workspace }} --export_type binary --input_coverage=${{ github.workspace }}/ctest.cov --cover_children -- .\mapnik-test-visual.exe -j (Get-CimInstance -ClassName Win32_ComputerSystem).NumberOfLogicalProcessors --output-dir ./visual-test-result
- name: Test visuals (linux & mac)
continue-on-error: true
working-directory: build/out
shell: "bash"
if: runner.os != 'Windows'
run: | run: |
if [ "$RUNNER_OS" == "Linux" ]; then ${TEST_WRAPPER:-} ./mapnik-test-visual -j ${CTEST_PARALLEL_LEVEL} --output-dir visual-test-result
./mapnik-test-visual -j $(nproc) --output-dir ./visual-test-result
else
./mapnik-test-visual -j $(sysctl -n hw.logicalcpu) --output-dir ./visual-test-result
fi
- name: Pack visual test results - name: Pack visual test results
working-directory: build/out working-directory: build/out
shell: "pwsh" shell: bash
run: tar cfvz visual-test-results.tar.gz ./visual-test-result
- name: Generate run guid
id: run-guid
shell: "pwsh"
run: | run: |
$guid = New-Guid tar -vzcf visual-test-results.tar.gz visual-test-result
echo ("GUID=" + $guid.toString()) >> $env:GITHUB_OUTPUT
- name: Upload visual test results - name: Upload visual test results
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: ${{ inputs.cmake-preset }}-visual-tests-${{ steps.run-guid.outputs.GUID }} name: ${{ inputs.cmake-preset }}-visual-tests-${{ github.sha }}
path: build/out/visual-test-results.tar.gz path: build/out/visual-test-results.tar.gz
- name: Run Benchmarks - name: Run Benchmarks (Linux & macOS)
working-directory: build/out working-directory: build/out
if: runner.os != 'Windows' if: runner.os != 'Windows'
shell: "pwsh" shell: bash
run: ./run_benchmarks run: |
./run_benchmarks
- name: Collect coverage (linux & macos) - name: Collect coverage (Linux & macOS)
working-directory: build working-directory: build
if: runner.os != 'Windows' if: runner.os != 'Windows'
shell: "bash" shell: bash
run: | run: |
lcov --directory . --capture --output-file coverage.info if [ "${RUNNER_OS}" == "macOS" ]; then
lcov --remove coverage.info '/usr/*' '*/vcpkg_installed/*' '/.cache/*' '*/test/*' --output-file coverage.info LCOV_EXTRA_OPTIONS="--ignore-errors count,gcov,inconsistent,range,unused --keep-going"
lcov --list coverage.info 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) - name: Upload coverage to Codecov (Linux & macOS)
if: runner.os != 'Windows' if: runner.os != 'Windows'
uses: codecov/codecov-action@v3 uses: codecov/codecov-action@v4
with: with:
files: build/coverage.info files: build/coverage.info
- name: Upload coverage to Codecov (windows) - name: Upload coverage to Codecov (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'
uses: codecov/codecov-action@v3 uses: codecov/codecov-action@v4
with: with:
files: build/out/mapnik-test-visual.cov files: ctest.cov,build/out/mapnik-test-visual.cov

View file

@ -1,50 +0,0 @@
name: "Setup vcpkg"
description: "Sets up vcpkg"
inputs:
vcpkg-sha:
description: "vcpkg git sha to use"
required: true
nuget-source:
description: "The nuget json"
required: true
nuget-username:
description: "The username for the nuget repository"
required: true
nuget-pat:
description: "The PAT for the nuget repository"
required: true
mono:
description: "mono exec"
required: true
runs:
using: "composite"
steps:
- name: checkout vcpkg
uses: actions/checkout@v3
with:
repository: "microsoft/vcpkg"
ref: ${{ inputs.vcpkg-sha }}
path: vcpkg
- name: "Setup vcpkg"
shell: bash
run: ./vcpkg/bootstrap-vcpkg.sh
- name: "Setup NuGet Credentials"
shell: "bash"
run: >
${{ inputs.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "${{ inputs.nuget-source }}"
-storepasswordincleartext
-name "GitHub"
-username "${{ inputs.nuget-username }}"
-password "${{ inputs.nuget-pat }}"
- name: "Setup NuGet apikey"
shell: "bash"
run: >
${{ inputs.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
setapikey "${{ inputs.nuget-pat }}" -Source "${{ inputs.nuget-source }}"

View file

@ -9,84 +9,126 @@ on:
- "no-ci-*" - "no-ci-*"
env: env:
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite" VCPKG_BINARY_SOURCES: clear;x-gha,readwrite
VCPKG_NUGET_REPOSITORY: https://github.com/mathisloge/vcpkg-nuget.git VCPKG_RELEASE: 2024.06.15
jobs: jobs:
checkSource: checkSource:
name: Check Source Code name: Check Source Code
runs-on: ubuntu-latest runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/setup-python@v4 - uses: actions/setup-python@v5
with: with:
python-version: '3.10' python-version: "3.10"
- uses: pre-commit/action@v3.0.0 - uses: pre-commit/action@v3.0.1
buildAndTest: buildAndTest:
name: Build and Test name: >-
Build & Test
(${{ matrix.os }})
(C++ ${{ matrix.cxx-standard }})
${{ startsWith(matrix.os, 'macos-') && (matrix.os == 'macos-14' && '(ARM64)' || '(AMD64)') || '' }}
needs: checkSource needs: checkSource
runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [macos-latest, windows-latest, ubuntu-latest] os:
memory-mapped: ["OFF", "ON"] - macos-14
static-build: ["OFF", "ON"] - ubuntu-22.04
include: - windows-2022
- os: ubuntu-latest cxx-standard:
mono: mono - 17
- os: macos-latest
mono: mono
runs-on: ${{ matrix.os }}
steps: steps:
- name: "Install required system packages" - 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 shell: bash
run: | run: |
if [ "$RUNNER_OS" == "Windows" ]; then if [ "${RUNNER_OS}" == "Linux" ]; then
choco install ninja OpenCppCoverage 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} echo "C:\Program Files\OpenCppCoverage" >> ${GITHUB_PATH}
elif [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update
sudo apt install -y gperf libxxf86vm-dev ninja-build postgresql-client lcov autoconf-archive
else
brew install automake ninja lcov autoconf-archive
fi fi
- uses: ilammy/msvc-dev-cmd@v1 - name: Enable Developer Command Prompt (Windows)
uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows' if: runner.os == 'Windows'
- name: checkout mapnik - name: Set CMAKE_BUILD_PARALLEL_LEVEL, CTEST_PARALLEL_LEVEL & PRESET
uses: actions/checkout@v3 shell: bash
with:
submodules: "recursive"
- name: setup vcpkg
uses: ./.github/actions/setup_vcpkg
with:
vcpkg-sha: 71d3fa60b67540e9bf5fde2bf2188f579ff09433
nuget-source: https://nuget.pkg.github.com/mapnik/index.json
nuget-username: ${{ github.actor }}
nuget-pat: ${{ secrets.GITHUB_TOKEN }}
mono: ${{ matrix.mono }}
- id: lc_platform
uses: ASzc/change-string-case-action@v5
with:
string: ${{ runner.os }}
- name: set lower case runner os
shell: "bash"
run: | run: |
echo "PRESET=${{ steps.lc_platform.outputs.lowercase }}-ci" >>${GITHUB_ENV} 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 - name: Configure CMake
run: cmake -DUSE_MEMORY_MAPPED_FILE=${{ matrix.memory-mapped }} -DBUILD_SHARED_LIBS=${{ matrix.static-build }} --preset ${{ env.PRESET }} 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 - name: Build
run: cmake --build --preset ${{ env.PRESET }} shell: bash
run: |
cmake \
--build \
--preset ${PRESET}
- name: Run Tests - name: Run Tests
uses: ./.github/actions/run_tests uses: ./.github/actions/run_tests

View file

@ -16,7 +16,7 @@ jobs:
steps: steps:
- name: checkout mapnik - name: checkout mapnik
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
submodules: "recursive" submodules: "recursive"
@ -40,7 +40,7 @@ jobs:
libboost-regex-dev libboost-regex-dev
- name: Configure CMake - name: Configure CMake
run: cmake --preset ${{ env.PRESET }} run: cmake -LA --preset ${{ env.PRESET }}
- name: Build - name: Build
run: cmake --build --preset ${{ env.PRESET }} run: cmake --build --preset ${{ env.PRESET }}
@ -49,7 +49,7 @@ jobs:
run: cmake --build --preset ${{ env.PRESET }} --target package run: cmake --build --preset ${{ env.PRESET }} --target package
- name: Upload mapnik debian package - name: Upload mapnik debian package
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: ${{ env.PRESET }}-deb name: ${{ env.PRESET }}-deb
path: build/${{ env.PRESET }}/mapnik-*.deb path: build/mapnik-*.deb

View file

@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks # See https://pre-commit.com/hooks.html for more hooks
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0 rev: v4.6.0
hooks: hooks:
- id: trailing-whitespace - id: trailing-whitespace
files: ^.*\.cmake|CMakeLists\.txt$ files: ^.*\.cmake|CMakeLists\.txt$
@ -10,7 +10,7 @@ repos:
files: ^.*\.cmake|CMakeLists\.txt$ files: ^.*\.cmake|CMakeLists\.txt$
- repo: https://github.com/pre-commit/mirrors-clang-format - repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6 rev: v18.1.3
hooks: hooks:
- id: clang-format - id: clang-format
types_or: [c++, c] types_or: [c++, c]

View file

@ -1,98 +0,0 @@
language: cpp
git:
depth: 10
submodules: false
env:
global:
- CCACHE_TEMPDIR=/tmp/.ccache-temp
- CCACHE_COMPRESS=1
- PREFIX=/tmp/mapnik
- PYTHON=python3
cache:
directories:
- $HOME/.ccache
dist: xenial
matrix:
include:
- os: linux
name: Linux clang
env: >-
CXX="ccache clang++ -Qunused-arguments"
CC="clang"
addons:
postgresql: "9.5"
apt:
sources: [ 'ubuntu-toolchain-r-test' ]
packages: [ 'xutils-dev', 'libstdc++-6-dev', 'postgresql-9.5-postgis-2.4' ]
- os: linux
name: Linux clang + coverage
env: >-
CXX="ccache clang++ -Qunused-arguments"
CC="clang"
COVERAGE=true
QUIET=true
before_install:
- export LLVM_COV="llvm-cov"
addons:
postgresql: "9.5"
apt:
sources: [ 'ubuntu-toolchain-r-test' ]
packages: [ 'xutils-dev', 'libstdc++-6-dev','postgresql-9.5-postgis-2.4' ]
- os: osx
name: OSX clang
#https://docs.travis-ci.com/user/reference/osx#macos-version
osx_image: xcode12.2
env: >-
CXX="ccache clang++ -Qunused-arguments"
before_install:
install:
- source scripts/travis-common.sh
# workaround travis rvm bug
# http://superuser.com/questions/1044130/why-am-i-having-how-can-i-fix-this-error-shell-session-update-command-not-f
- on 'osx' rvm get head || true
- export PATH=${PREFIX}/bin:$(pwd)/mason_packages/.link/bin:${PATH}
- export COVERAGE=${COVERAGE:-false}
- export BENCH=${BENCH:-false}
- on 'osx' export DATA_PATH=$(brew --prefix)/var/postgres
- on 'osx' rm -rf ${DATA_PATH}
- on 'osx' initdb ${DATA_PATH} -E utf8
- on 'osx' pg_ctl -w start -l postgres.log --pgdata ${DATA_PATH};
- on 'osx' cat postgres.log;
- 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} curl -S -f https://codecov.io/bash -o codecov
- enabled ${COVERAGE} chmod +x codecov
before_script:
- export JOBS=${JOBS:-4}
- export HEAVY_JOBS=${HEAVY_JOBS:-2}
- export SCONSFLAGS='--debug=time'
- source bootstrap.sh
- ccache --version
- ccache -p || true
- ccache --show-stats || true
- commit_message_parse
script:
- git_submodule_update --init deps/
- on 'osx' brew unlink $(brew list --formula)
- on 'osx' brew link git postgresql postgis
- configure BENCHMARK=${BENCH} ENABLE_GLIBC_WORKAROUND=${ENABLE_GLIBC_WORKAROUND:-false} QUIET=${QUIET:-false}
#- cat config.log => comment out to reduce log size limit on travis-ci
# we limit the `make` to 40 min
# to ensure that slow builds still upload their
# ccache results and therefore should be faster
# (and might work) for the next build
- DEADLINE=$(( $(date +%s) + 40 * 60 ))
- scripts/travis-command-wrapper.py -s "date" -i 120 --deadline="$DEADLINE" make
- test_ok && git_submodule_update --init --depth=50 test/
- test_ok && make test
- test_ok && enabled ${COVERAGE} coverage
- test_ok && enabled ${BENCH} make bench
- ./scripts/check_glibcxx.sh

View file

@ -6,12 +6,38 @@ Developers: Please commit along with changes.
For a complete change history, see the git log. For a complete change history, see the git log.
## Mapnik 4.0.3
## UNRELEASED Released October 30th, 2024
(Packaged from [05389e3c7](https://github.com/mapnik/mapnik/commit/05389e3c7))
- Remove 'final' specifier from invalid_featureset implementation
(issues with dynamic_cast<> when building using Apple clang version 16.0.0 on darwin-arm64)
- Rename invalid_featureset to empty_featureset
- Upgrade to SCons v4.8.1
- Fix unit tests e.g #endif statement (via @bgardner-noggin)
## Mapnik 4.0.2
Released August 21st, 2024
- CMake build - set `SOVERSION` to `${MAPNIK_MAJOR_VERSION}.${MAPNIK_MINOR_VERSION}`
- Upgraded SCons build system to v4.8.0
## Mapnik 4.0.1
- Use CMAKE_INSTALL_LIBDIR for libdir in pkg-config files
- Support gcc 14
- Improved accuracy of bounding box re-projections. Automatic spliting at (0, 0) and merging results.
- Fixes missing features when using WGS 84 / Arctic Polar Stereographic (`epsg:4326 <-> epsg:3995`)
- Added `area_of_use` method to `mapnik::projection`
## Mapnik 4.0.0
#### Notice #### Notice
- Mapnik now requires C++14 compliant compiler (`-std=c++14`) - Mapnik now requires C++17 compliant compiler (`-std=c++17`)
- Mapnik now supports CMake as a build system. See [#4191](https://github.com/mapnik/mapnik/pull/4191) and the [docs](https://github.com/mapnik/mapnik/blob/master/docs/cmake-usage.md) for more info. - Mapnik now supports CMake as a build system. See [#4191](https://github.com/mapnik/mapnik/pull/4191) and the [docs](https://github.com/mapnik/mapnik/blob/master/docs/cmake-usage.md) for more info.
#### Breaking Changes #### Breaking Changes

View file

@ -49,6 +49,7 @@ mapnik_option(USE_PROJ "adds proj support" ON)
mapnik_option(USE_GRID_RENDERER "adds grid renderer" ON) mapnik_option(USE_GRID_RENDERER "adds grid renderer" ON)
mapnik_option(USE_SVG_RENDERER "adds svg 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_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_MEMORY_MAPPED_FILE "uses file cache" ON)
mapnik_option(USE_MULTITHREADED "enables the multithreaded features (threadsafe)" ON) mapnik_option(USE_MULTITHREADED "enables the multithreaded features (threadsafe)" ON)
mapnik_option(USE_NO_ATEXIT "disable atexit" OFF) mapnik_option(USE_NO_ATEXIT "disable atexit" OFF)
@ -125,7 +126,7 @@ set(MAPNIK_OPTIONAL_LIBS_INCLUDE "")
############################# #############################
############################# #############################
set(CMAKE_CXX_STANDARD 14 CACHE STRING "Sets the c++ standard. c++14 is minimum.") 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_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 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++${CMAKE_CXX_STANDARD}")
@ -141,7 +142,10 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib")
# needs to be before the first call of find_boost. # needs to be before the first call of find_boost.
list(APPEND MAPNIK_COMPILE_DEFS BOOST_SPIRIT_X3_HIDE_CXX17_WARNING) if(CMAKE_CXX_STANDARD VERSION_LESS 17)
list(APPEND MAPNIK_COMPILE_DEFS BOOST_SPIRIT_X3_HIDE_CXX17_WARNING)
endif()
if(USE_MULTITHREADED) if(USE_MULTITHREADED)
set(Boost_USE_MULTITHREADED ON) set(Boost_USE_MULTITHREADED ON)
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_THREADSAFE) list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_THREADSAFE)
@ -154,7 +158,14 @@ mapnik_find_package(PkgConfig REQUIRED)
mapnik_find_threads() mapnik_find_threads()
mapnik_find_package(ICU REQUIRED COMPONENTS uc i18n data) mapnik_find_package(ICU REQUIRED COMPONENTS uc i18n data)
mapnik_find_package(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS filesystem system regex) 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) list(APPEND MAPNIK_COMPILE_DEFS BOOST_REGEX_HAS_ICU)
if(USE_BOOST_REGEX_ICU_WORKAROUND) if(USE_BOOST_REGEX_ICU_WORKAROUND)
message(STATUS "using boost regex workaround") message(STATUS "using boost regex workaround")
@ -257,6 +268,11 @@ if(USE_BIGINT)
list(APPEND MAPNIK_COMPILE_DEFS BIGINT) list(APPEND MAPNIK_COMPILE_DEFS BIGINT)
endif() 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) if(USE_MEMORY_MAPPED_FILE)
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_MEMORY_MAPPED_FILE) list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_MEMORY_MAPPED_FILE)
endif() endif()
@ -394,10 +410,10 @@ target_link_libraries(core INTERFACE
ICU::i18n ICU::i18n
Boost::headers Boost::headers
Boost::regex Boost::regex
Boost::filesystem
Freetype::Freetype Freetype::Freetype
${MAPNIK_OPTIONAL_LIBS} ${MAPNIK_OPTIONAL_LIBS}
) )
target_compile_definitions(core INTERFACE ${MAPNIK_COMPILE_DEFS}) target_compile_definitions(core INTERFACE ${MAPNIK_COMPILE_DEFS})
mapnik_install(core) mapnik_install(core)
@ -432,8 +448,8 @@ feature_summary(FILENAME "${CMAKE_CURRENT_BINARY_DIR}/packages.log" WHAT PACKAGE
include(MapnikExport) include(MapnikExport)
include(MapnikExportPkgConfig) include(MapnikExportPkgConfig)
install(DIRECTORY include/ DESTINATION "${MAPNIK_INCLUDE_DIR}") install(DIRECTORY include/mapnik/ DESTINATION "${MAPNIK_INCLUDE_DIR}/mapnik")
install(DIRECTORY deps/agg/include/ DESTINATION "${MAPNIK_INCLUDE_DIR}") install(DIRECTORY deps/agg/include/ DESTINATION "${MAPNIK_INCLUDE_DIR}/mapnik/agg")
install(DIRECTORY deps/mapnik DESTINATION "${MAPNIK_INCLUDE_DIR}") install(DIRECTORY deps/mapnik DESTINATION "${MAPNIK_INCLUDE_DIR}")
file(GLOB TTF_FONT_FILES "fonts/*/*/*.ttf") file(GLOB TTF_FONT_FILES "fonts/*/*/*.ttf")
install(FILES ${TTF_FONT_FILES} DESTINATION "${FONTS_INSTALL_DIR}") install(FILES ${TTF_FONT_FILES} DESTINATION "${FONTS_INSTALL_DIR}")

View file

@ -228,7 +228,23 @@
} }
}, },
{ {
"name": "macos-ci", "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", "description": "used by the ci pipeline",
"inherits": [ "inherits": [
"use-ninja", "use-ninja",
@ -282,8 +298,12 @@
"configurePreset": "linux-ci-release" "configurePreset": "linux-ci-release"
}, },
{ {
"name": "macos-ci", "name": "macos-ci-arm64",
"configurePreset": "macos-ci" "configurePreset": "macos-ci-arm64"
},
{
"name": "macos-ci-x64",
"configurePreset": "macos-ci-x64"
} }
], ],
"testPresets": [ "testPresets": [
@ -313,8 +333,15 @@
] ]
}, },
{ {
"name": "macos-ci", "name": "macos-ci-arm64",
"configurePreset": "macos-ci", "configurePreset": "macos-ci-arm64",
"inherits": [
"test-default"
]
},
{
"name": "macos-ci-x64",
"configurePreset": "macos-ci-x64",
"inherits": [ "inherits": [
"test-default" "test-default"
] ]

View file

@ -42,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
@ -71,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++14` (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) or CMake >= 3.15 see [docs/cmake-usage.md](./docs/cmake-usage.md) * 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.73 is required - \>= 1.73 is required
- These libraries are used: - These libraries are used:
- filesystem - filesystem
- system - system

View file

@ -1,6 +1,6 @@
# This file is part of Mapnik (c++ mapping toolkit) # This file is part of Mapnik (c++ mapping toolkit)
# #
# Copyright (C) 2021 Artem Pavlenko # Copyright (C) 2024 Artem Pavlenko
# #
# Mapnik is free software; you can redistribute it and/or # Mapnik 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
@ -22,7 +22,7 @@ import re
import platform import platform
from glob import glob from glob import glob
from copy import copy from copy import copy
from subprocess import Popen, PIPE from subprocess import run, Popen, PIPE
from SCons.SConf import SetCacheMode from SCons.SConf import SetCacheMode
import pickle import pickle
@ -43,7 +43,7 @@ ICU_LIBS_DEFAULT='/usr/'
DEFAULT_CC = "cc" DEFAULT_CC = "cc"
DEFAULT_CXX = "c++" DEFAULT_CXX = "c++"
DEFAULT_CXX_STD = "14" DEFAULT_CXX_STD = "17"
DEFAULT_CXX_CXXFLAGS = " -DU_USING_ICU_NAMESPACE=0" DEFAULT_CXX_CXXFLAGS = " -DU_USING_ICU_NAMESPACE=0"
DEFAULT_CXX_LINKFLAGS = "" DEFAULT_CXX_LINKFLAGS = ""
if sys.platform == 'darwin': if sys.platform == 'darwin':
@ -410,8 +410,8 @@ opts.AddVariables(
PathVariable('WEBP_INCLUDES', 'Search path for libwebp include files', '/usr/include', PathVariable.PathAccept), PathVariable('WEBP_INCLUDES', 'Search path for libwebp include files', '/usr/include', PathVariable.PathAccept),
PathVariable('WEBP_LIBS','Search path for libwebp library files','/usr/' + LIBDIR_SCHEMA_DEFAULT, PathVariable.PathAccept), PathVariable('WEBP_LIBS','Search path for libwebp library files','/usr/' + LIBDIR_SCHEMA_DEFAULT, PathVariable.PathAccept),
BoolVariable('PROJ', 'Build Mapnik with proj support to enable transformations between many different projections', 'True'), BoolVariable('PROJ', 'Build Mapnik with proj support to enable transformations between many different projections', 'True'),
PathVariable('PROJ_INCLUDES', 'Search path for PROJ.4 include files', '/usr/include', PathVariable.PathAccept), PathVariable('PROJ_INCLUDES', 'Search path for libproj include files', '/usr/include', PathVariable.PathAccept),
PathVariable('PROJ_LIBS', 'Search path for PROJ.4 library files', '/usr/' + LIBDIR_SCHEMA_DEFAULT, PathVariable.PathAccept), PathVariable('PROJ_LIBS', 'Search path for libproj library files', '/usr/' + LIBDIR_SCHEMA_DEFAULT, PathVariable.PathAccept),
('PG_INCLUDES', 'Search path for libpq (postgres client) include files', ''), ('PG_INCLUDES', 'Search path for libpq (postgres client) include files', ''),
('PG_LIBS', 'Search path for libpq (postgres client) library files', ''), ('PG_LIBS', 'Search path for libpq (postgres client) library files', ''),
('FREETYPE_INCLUDES', 'Search path for Freetype include files', ''), ('FREETYPE_INCLUDES', 'Search path for Freetype include files', ''),
@ -467,8 +467,9 @@ opts.AddVariables(
BoolVariable('MAPNIK_RENDER', 'Compile and install a utility to render a map to an image', 'True'), BoolVariable('MAPNIK_RENDER', 'Compile and install a utility to render a map to an image', 'True'),
BoolVariable('COLOR_PRINT', 'Print build status information in color', 'True'), BoolVariable('COLOR_PRINT', 'Print build status information in color', 'True'),
BoolVariable('BIGINT', 'Compile support for 64-bit integers in mapnik::value', 'True'), BoolVariable('BIGINT', 'Compile support for 64-bit integers in mapnik::value', 'True'),
BoolVariable('USE_BOOST_FILESYSTEM','Use boost::filesytem even if `std::filesystem` is available (since c++17)', 'False'),
BoolVariable('QUIET', 'Reduce build verbosity', 'False'), BoolVariable('QUIET', 'Reduce build verbosity', 'False'),
) )
# variables to pickle after successful configure step # variables to pickle after successful configure step
# these include all scons core variables as well as custom # these include all scons core variables as well as custom
@ -535,6 +536,7 @@ pickle_store = [# Scons internal variables
'SQLITE_LINKFLAGS', 'SQLITE_LINKFLAGS',
'BOOST_LIB_VERSION_FROM_HEADER', 'BOOST_LIB_VERSION_FROM_HEADER',
'BIGINT', 'BIGINT',
'USE_BOOST_FILESYSTEM',
'HOST', 'HOST',
'QUERIED_GDAL_DATA', 'QUERIED_GDAL_DATA',
'QUERIED_ICU_DATA', 'QUERIED_ICU_DATA',
@ -947,54 +949,17 @@ int main()
return ret return ret
def CheckProjData(context, silent=False): def CheckProjData(context, silent=False):
if not silent: if not silent:
context.Message('Checking for PROJ_LIB directory...') context.Message('Checking for PROJ_LIB directory...')
ret, out = context.TryRun(""" result = run(['pkg-config', 'proj', '--variable=datadir'], stdout=PIPE)
value = result.stdout.decode('utf-8').strip()
#include <proj.h>
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <fstream>
std::vector<std::string> split_searchpath(std::string const& paths)
{
std::vector<std::string> output;
std::stringstream ss(paths);
std::string path;
for( std::string path;std::getline(ss, path, ':');)
{
output.push_back(path);
}
return output;
}
int main()
{
PJ_INFO info = proj_info();
std::string result = info.searchpath;
for (auto path : split_searchpath(result))
{
std::ifstream file(path + "/proj.db");
if (file)
{
std::cout << path;
return 0;
}
}
return -1;
}
""", '.cpp')
value = out.strip()
if silent: if silent:
context.did_show_result=1 context.did_show_result=1
if ret: if os.path.exists(value):
context.Result('proj_info.searchpath returned %s' % value) context.Result('`pkg-config proj --variable=datadir` returned:\n%s ' % value)
else: else:
value = None
context.Result('Failed to detect (mapnik-config will have null value)') context.Result('Failed to detect (mapnik-config will have null value)')
return value return value
@ -1580,11 +1545,25 @@ if not preconfigured:
env['SKIPPED_DEPS'].append('png') env['SKIPPED_DEPS'].append('png')
if env['WEBP']: if env['WEBP']:
OPTIONAL_LIBSHEADERS.append(['webp', 'webp/decode.h', False,'C','-DHAVE_WEBP']) if env.get('WEBP_LIBS') or env.get('WEBP_INCLUDES'):
inc_path = env['%s_INCLUDES' % 'WEBP'] OPTIONAL_LIBSHEADERS.append(['webp', 'webp/decode.h', False,'C','-DHAVE_WEBP'])
lib_path = env['%s_LIBS' % 'WEBP'] inc_path = env['WEBP_INCLUDES']
env.AppendUnique(CPPPATH = fix_path(inc_path)) lib_path = env['WEBP_LIBS']
env.AppendUnique(LIBPATH = fix_path(lib_path)) env.AppendUnique(CPPPATH = fix_path(inc_path))
env.AppendUnique(LIBPATH = fix_path(lib_path))
else:
cmd = 'pkg-config libwebp --libs --cflags'
if env['RUNTIME_LINK'] == 'static':
cmd += ' --static'
temp_env = Environment(ENV=os.environ)
try:
temp_env.ParseConfig(cmd)
for lib in temp_env['LIBS']:
env.AppendUnique(LIBPATH = fix_path(lib))
for inc in temp_env['CPPPATH']:
env.AppendUnique(CPPPATH = fix_path(inc))
except OSError as e:
pass
else: else:
env['SKIPPED_DEPS'].append('webp') env['SKIPPED_DEPS'].append('webp')
@ -1631,6 +1610,12 @@ if not preconfigured:
if env['BIGINT']: if env['BIGINT']:
env.Append(CPPDEFINES = '-DBIGINT') env.Append(CPPDEFINES = '-DBIGINT')
if int(env['CXX_STD']) < 17:
env['USE_BOOST_FILESYSTEM'] = True
if env['USE_BOOST_FILESYSTEM']:
env.Append(CPPDEFINES = '-DUSE_BOOST_FILESYSTEM')
if env['THREADING'] == 'multi': if env['THREADING'] == 'multi':
thread_flag = thread_suffix thread_flag = thread_suffix
else: else:
@ -1650,12 +1635,13 @@ if not preconfigured:
# The other required boost headers. # The other required boost headers.
BOOST_LIBSHEADERS = [ BOOST_LIBSHEADERS = [
['system', 'boost/system/system_error.hpp', True],
['filesystem', 'boost/filesystem/operations.hpp', True],
['regex', 'boost/regex.hpp', True], ['regex', 'boost/regex.hpp', True],
['program_options', 'boost/program_options.hpp', False] ['program_options', 'boost/program_options.hpp', False]
] ]
if env['USE_BOOST_FILESYSTEM']:
BOOST_LIBSHEADERS.append(['system', 'boost/system/system_error.hpp', True])
BOOST_LIBSHEADERS.append(['filesystem', 'boost/filesystem/operations.hpp', True])
# if requested, sort LIBPATH and CPPPATH before running CheckLibWithHeader tests # if requested, sort LIBPATH and CPPPATH before running CheckLibWithHeader tests
if env['PRIORITIZE_LINKING']: if env['PRIORITIZE_LINKING']:
conf.prioritize_paths(silent=True) conf.prioritize_paths(silent=True)

View file

@ -1,39 +0,0 @@
environment:
msvs_toolset: 14
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%
build_script:
- scripts\build-appveyor.bat
after_build:
- 7z a visual-test-results.zip C:\tmp\mapnik-visual-images\visual-test-results
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
- path: visual-test-results.zip
name: visual-test-results.zip
test: off
deploy: off

View file

@ -15,8 +15,6 @@
#include <cstdio> // snprintf #include <cstdio> // snprintf
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include <set>
#include <sstream>
#include <thread> #include <thread>
#include <mutex> #include <mutex>
#include <vector> #include <vector>

View file

@ -1,7 +1,6 @@
#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
{ {

View file

@ -9,7 +9,7 @@ class test : public benchmark::test_case
: 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;
@ -57,7 +57,7 @@ class test2 : public benchmark::test_case
: 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;

View file

@ -26,14 +26,14 @@ class test : public benchmark::test_case
, 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))
@ -101,7 +101,7 @@ int main(int argc, char** argv)
{ {
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";

View file

@ -64,14 +64,14 @@ class test : public benchmark::test_case
, 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())
{ {
@ -156,7 +156,7 @@ int main(int argc, char** argv)
{ {
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";

View file

@ -1,173 +0,0 @@
#!/usr/bin/env bash
: '
todo
- docs for base setup: sudo apt-get -y install zlib1g-dev make git
- shrink icu data
'
MASON_VERSION="485514d8"
function setup_mason() {
if [[ ! -d ./.mason ]]; then
git clone https://github.com/mapbox/mason.git .mason || return
elif ! git -C .mason rev-parse -q --verify "$MASON_VERSION" >/dev/null; then
git -C .mason fetch --all || true # non-fatal
fi
git -C .mason checkout --detach "$MASON_VERSION" -- || return
case ":$PATH:" in
*":$PWD/.mason:"*) : already there ;;
*) export PATH="$PWD/.mason:$PATH" ;;
esac
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
if [[ ${3:-false} != false ]]; then
LA_FILE=$(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
# the rm here is to workaround https://github.com/mapbox/mason/issues/230
rm -f ./mason_packages/.link/mason.ini
mason link $1 $2
}
ICU_VERSION="58.1"
BOOST_VERSION="1.75.0"
function install_mason_deps() {
install ccache 3.3.1
install zlib 1.2.8
install jpeg_turbo 1.5.2 libjpeg
install libpng 1.6.32 libpng
install libtiff 4.0.8 libtiff
install libpq 9.6.5
install sqlite 3.34.0 libsqlite3
install icu ${ICU_VERSION}
install proj 7.2.1 libproj
install pixman 0.34.0 libpixman-1
install cairo 1.14.8 libcairo
install webp 0.6.0 libwebp
install libgdal 2.2.3 libgdal
install boost ${BOOST_VERSION}
install boost_libsystem ${BOOST_VERSION}
install boost_libfilesystem ${BOOST_VERSION}
install boost_libprogram_options ${BOOST_VERSION}
install boost_libregex_icu58 ${BOOST_VERSION}
# technically boost thread and python are not a core dep, but installing
# here by default helps make python-mapnik builds easier
install boost_libthread ${BOOST_VERSION}
install boost_libpython ${BOOST_VERSION}
install freetype 2.7.1 libfreetype
install harfbuzz 1.4.4-ft libharfbuzz
}
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'
CUSTOM_CXXFLAGS = '-D_GLIBCXX_USE_CXX11_ABI=0'
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
}
# turn arguments of the form NAME=VALUE into exported variables;
# any other arguments are reported and cause error return status
function export_variables() {
local arg= ret=0
for arg
do
if [[ "$arg" =~ ^[[:alpha:]][_[:alnum:]]*= ]]
then
export "$arg"
else
printf >&2 "bootstrap.sh: invalid argument: %s\n" "$arg"
ret=1
fi
done
return $ret
}
function main() {
export_variables "$@" || return
# setup_mason must not run in subshell, because it sets default
# values of CC, CXX and adds mason to PATH, which we want to keep
# when sourced
setup_mason || return
(
# this is wrapped in subshell to allow sourcing this script
# without having the terminal closed on error
set -eu
set -o pipefail
install_mason_deps
make_config > ./config.py
setup_runtime_settings
printf "\n\e[1;32m%s\e[m\n" "bootstrap successful, now run:"
echo ""
echo " ./configure && make"
echo ""
)
}
main "$@"

View file

@ -3,13 +3,13 @@ function(create_pkg_config_file _target _lib_name _description)
prefix=@CMAKE_INSTALL_PREFIX@ prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix} exec_prefix=${prefix}
includedir=${prefix}/include includedir=${prefix}/include
libdir=${exec_prefix}/lib libdir=${exec_prefix}/@MAPNIK_LIB_DIR@
Name: @_lib_name@ Name: @_lib_name@
Description: @_description@ Description: @_description@
Version: @MAPNIK_VERSION@ Version: @MAPNIK_VERSION@
Libs: -L"${libdir}" -l$<TARGET_FILE_BASE_NAME:@_target@>$<TARGET_PROPERTY:@_target@,$<CONFIG>_POSTFIX> Libs: -L"${libdir}" -l$<TARGET_FILE_BASE_NAME:@_target@>$<TARGET_PROPERTY:@_target@,$<CONFIG>_POSTFIX>
Cflags: -I"${includedir}" ]] Cflags: -I"${includedir}" -I"${includedir}/mapnik" ]]
_contents @ONLY) _contents @ONLY)
file(GENERATE file(GENERATE
@ -64,14 +64,16 @@ function(create_pkg_config_file_mapnik _lib_name _description)
prefix=@CMAKE_INSTALL_PREFIX@ prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix} exec_prefix=${prefix}
includedir=${prefix}/include includedir=${prefix}/include
libdir=${exec_prefix}/lib libdir=${exec_prefix}/@MAPNIK_LIB_DIR@
fonts_dir=${prefix}/@FONTS_INSTALL_DIR@
plugins_dir=${prefix}/@PLUGINS_INSTALL_DIR@
Name: @_lib_name@ Name: @_lib_name@
Description: @_description@ Description: @_description@
Version: @MAPNIK_VERSION@ Version: @MAPNIK_VERSION@
Requires: @m_requires@ Requires: @m_requires@
Libs: -L"${libdir}" -l$<TARGET_FILE_BASE_NAME:mapnik>$<TARGET_PROPERTY:mapnik,$<CONFIG>_POSTFIX> Libs: -L"${libdir}" -l$<TARGET_FILE_BASE_NAME:mapnik>$<TARGET_PROPERTY:mapnik,$<CONFIG>_POSTFIX>
Cflags: -I"${includedir}" @m_str_compile_defs@]] Cflags: -I"${includedir}" -I"${includedir}/mapnik" -I"${includedir}/mapnik/agg" @m_str_compile_defs@]]
_contents @ONLY) _contents @ONLY)
file(GENERATE file(GENERATE
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}-$<CONFIG>.pc OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}-$<CONFIG>.pc

18
configure vendored
View file

@ -1,18 +1,32 @@
#! /bin/sh #! /usr/bin/env bash
set -eu set -eu
: ${PYTHON:=python} : ${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 # mapnik-settings.env is an optional file to store
# environment variables that should be used before # environment variables that should be used before
# running tests like PROJ_LIB, GDAL_DATA, and ICU_DATA # running tests like PROJ_LIB, GDAL_DATA, and ICU_DATA
# These do not normally need to be set except when # These do not normally need to be set except when
# building against binary versions of dependencies like # building against binary versions of dependencies like
# done via bootstrap.sh # done via bootstrap.sh
if [ -f mapnik-settings.env ]; then if [ -f mapnik-settings.env ]; then
echo "Inheriting from mapnik-settings.env" echo "Inheriting from mapnik-settings.env"
. ./mapnik-settings.env . ./mapnik-settings.env
VARS=( $(cat mapnik-settings.env) )
fi fi
$PYTHON scons/scons.py --implicit-deps-changed configure "$@" $PYTHON scons/scons.py --implicit-deps-changed configure ${VARS[*]:-} "$@"

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) 2021 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

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -51,7 +51,7 @@ layer_info_dialog::layer_info_dialog(mapnik::layer& lay, QWidget* parent)
int index = 0; int index = 0;
for (pos = ps.begin(); pos != ps.end(); ++pos) for (pos = ps.begin(); pos != ps.end(); ++pos)
{ {
boost::optional<std::string> result; std::optional<std::string> result;
mapnik::util::apply_visitor(mapnik::value_extractor_visitor<std::string>(result), pos->second); mapnik::util::apply_visitor(mapnik::value_extractor_visitor<std::string>(result), pos->second);
if (result) if (result)
{ {

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -38,7 +38,7 @@
// mapnik // mapnik
#ifndef Q_MOC_RUN // QT moc chokes on BOOST_JOIN #ifndef Q_MOC_RUN // QT moc chokes on BOOST_JOIN
//#include <mapnik/config_error.hpp> // #include <mapnik/config_error.hpp>
#include <mapnik/load_map.hpp> #include <mapnik/load_map.hpp>
#include <mapnik/save_map.hpp> #include <mapnik/save_map.hpp>
#include <mapnik/projection.hpp> #include <mapnik/projection.hpp>
@ -106,10 +106,7 @@ MainWindow::MainWindow()
// slider // slider
connect(slider_, SIGNAL(valueChanged(int)), mapWidget_, SLOT(zoomToLevel(int))); connect(slider_, SIGNAL(valueChanged(int)), mapWidget_, SLOT(zoomToLevel(int)));
// renderer selector // renderer selector
connect(renderer_selector_, connect(renderer_selector_, SIGNAL(currentIndexChanged(int)), mapWidget_, SLOT(updateRenderer(int)));
SIGNAL(currentIndexChanged(QString const&)),
mapWidget_,
SLOT(updateRenderer(QString const&)));
// scale factor // scale factor
connect(scale_factor_, SIGNAL(valueChanged(double)), mapWidget_, SLOT(updateScaleFactor(double))); connect(scale_factor_, SIGNAL(valueChanged(double)), mapWidget_, SLOT(updateScaleFactor(double)));
@ -390,7 +387,7 @@ void MainWindow::createToolBars()
scale_factor_ = new QDoubleSpinBox(fileToolBar); scale_factor_ = new QDoubleSpinBox(fileToolBar);
scale_factor_->setMinimum(0.1); scale_factor_->setMinimum(0.1);
scale_factor_->setMaximum(5.0); scale_factor_->setMaximum(10.0);
scale_factor_->setSingleStep(0.1); scale_factor_->setSingleStep(0.1);
scale_factor_->setValue(1.0); scale_factor_->setValue(1.0);

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -545,15 +545,15 @@ void render_cairo(mapnik::Map const& map, double scaling_factor, QPixmap& pix)
#endif #endif
} }
void MapWidget::updateRenderer(QString const& txt) void MapWidget::updateRenderer(int index)
{ {
if (txt == "AGG") std::cerr << "updateRenderer:" << index << std::endl;
if (index == 0)
cur_renderer_ = AGG; cur_renderer_ = AGG;
else if (txt == "Cairo") else if (index == 1)
cur_renderer_ = Cairo; cur_renderer_ = Cairo;
else if (txt == "Grid") else if (index == 2)
cur_renderer_ = Grid; cur_renderer_ = Grid;
std::cerr << "Update renderer called" << std::endl;
updateMap(); updateMap();
} }

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -82,7 +82,7 @@ class MapWidget : public QWidget
void zoomToLevel(int level); void zoomToLevel(int level);
void updateMap(); void updateMap();
void layerSelected(int); void layerSelected(int);
void updateRenderer(QString const& txt); void updateRenderer(int);
void updateScaleFactor(double scale_factor); void updateScaleFactor(double scale_factor);
signals: signals:
void mapViewChanged(); void mapViewChanged();

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
/* This file is part of Mapnik (c++ mapping toolkit) /* This file is part of Mapnik (c++ mapping toolkit)
* *
* Copyright (C) 2021 Artem Pavlenko * Copyright (C) 2024 Artem Pavlenko
* *
* Mapnik is free software; you can redistribute it and/or * Mapnik is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View file

@ -24,6 +24,7 @@
#ifndef AGG_PIXFMT_RGBA_INCLUDED #ifndef AGG_PIXFMT_RGBA_INCLUDED
#define AGG_PIXFMT_RGBA_INCLUDED #define AGG_PIXFMT_RGBA_INCLUDED
#include <mapnik/config.hpp>
#include <cstring> #include <cstring>
#include <cmath> #include <cmath>
#include "agg_basics.h" #include "agg_basics.h"
@ -3166,6 +3167,10 @@ private:
extern template struct MAPNIK_DECL comp_op_rgba_hue<agg::rgba8, agg::order_rgba>;
extern template struct MAPNIK_DECL comp_op_rgba_saturation<agg::rgba8, agg::order_rgba>;
extern template struct MAPNIK_DECL comp_op_rgba_color<agg::rgba8, agg::order_rgba>;
extern template struct MAPNIK_DECL comp_op_rgba_value<agg::rgba8, agg::order_rgba>;
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
typedef blender_rgba<rgba8, order_rgba> blender_rgba32; //----blender_rgba32 typedef blender_rgba<rgba8, order_rgba> blender_rgba32; //----blender_rgba32

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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
@ -92,7 +92,7 @@ class buffer_stack
void pop() void pop()
{ {
// ^ ensure irator is not out-of-range // ^ ensure iterator is not out-of-range
// prior calling this method // prior calling this method
++position_; ++position_;
} }

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) 2021 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

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) 2021 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
@ -175,14 +175,14 @@ struct symbolizer_attributes
void operator()(raster_symbolizer const& sym) void operator()(raster_symbolizer const& sym)
{ {
boost::optional<double> filter_factor = get_optional<double>(sym, keys::filter_factor); const auto filter_factor = get_optional<double>(sym, keys::filter_factor);
if (filter_factor) if (filter_factor)
{ {
filter_factor_ = *filter_factor; filter_factor_ = *filter_factor;
} }
else else
{ {
boost::optional<scaling_method_e> scaling_method = get_optional<scaling_method_e>(sym, keys::scaling); const auto scaling_method = get_optional<scaling_method_e>(sym, keys::scaling);
if (scaling_method && *scaling_method != SCALING_NEAR) if (scaling_method && *scaling_method != SCALING_NEAR)
{ {
filter_factor_ = 2; filter_factor_ = 2;

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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
@ -34,7 +34,7 @@ class cairo_context;
void render_vector_marker(cairo_context& context, void render_vector_marker(cairo_context& context,
svg_path_adapter& svg_path, svg_path_adapter& svg_path,
svg_attribute_type const& attributes, svg::group const& group_attr,
box2d<double> const& bbox, box2d<double> const& bbox,
agg::trans_affine const& tr, agg::trans_affine const& tr,
double opacity); double opacity);

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) 2021 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

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) 2021 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
@ -56,11 +56,11 @@ struct cairo_renderer_process_visitor_p
cairo_context context(cairo); cairo_context context(cairo);
svg_storage_type& svg = *marker.get_data(); svg_storage_type& svg = *marker.get_data();
svg_attribute_type const& svg_attributes = svg.attributes(); auto const& svg_group = svg.svg_group();
svg::vertex_stl_adapter<svg::svg_path_storage> stl_storage(svg.source()); svg::vertex_stl_adapter<svg::svg_path_storage> stl_storage(svg.source());
svg::svg_path_adapter svg_path(stl_storage); svg::svg_path_adapter svg_path(stl_storage);
render_vector_marker(context, svg_path, svg_attributes, bbox, tr, opacity_); render_vector_marker(context, svg_path, svg_group, bbox, tr, opacity_);
return surface; return surface;
} }

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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
@ -94,7 +94,7 @@ struct coord<T, 2>
} }
template<typename T2> template<typename T2>
bool operator==(coord<T2, 2> const& rhs) bool operator==(coord<T2, 2> const& rhs) const
{ {
return x == rhs.x && y == rhs.y; return x == rhs.x && y == rhs.y;
} }

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) 2021 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

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) 2021 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
@ -352,9 +352,9 @@ auto const rgb_color_def = lit("rgb")
>> attr(255) >> lit(')'); >> attr(255) >> lit(')');
auto const rgb_color_percent_def = lit("rgb") auto const rgb_color_percent_def = lit("rgb")
>> lit('(') >> dec3[percent_red] >> lit('%') >> lit('(') >> double_[percent_red] >> lit('%')
>> lit(',') >> dec3[percent_green] >> lit('%') >> lit(',') >> double_[percent_green] >> lit('%')
>> lit(',') >> dec3[percent_blue] >> lit('%') >> lit(',') >> double_[percent_blue] >> lit('%')
>> attr(255) >> lit(')'); >> attr(255) >> lit(')');
auto const rgba_color_def = lit("rgba") auto const rgba_color_def = lit("rgba")
@ -364,24 +364,24 @@ auto const rgba_color_def = lit("rgba")
>> lit(',') >> double_[opacity] >> lit(')'); >> lit(',') >> double_[opacity] >> lit(')');
auto const rgba_color_percent_def = lit("rgba") auto const rgba_color_percent_def = lit("rgba")
>> lit('(') >> dec3[percent_red] >> lit('%') >> lit('(') >> double_[percent_red] >> lit('%')
>> lit(',') >> dec3[percent_green] >> lit('%') >> lit(',') >> double_[percent_green] >> lit('%')
>> lit(',') >> dec3[percent_blue] >> lit('%') >> lit(',') >> double_[percent_blue] >> lit('%')
>> lit(',') >> double_[opacity] >> lit(')'); >> lit(',') >> double_[opacity] >> lit(')');
auto const hsl_values = x3::rule<class hsl_values, std::tuple<std::uint16_t,std::uint8_t,std::uint8_t, double >> {} = auto const hsl_values = x3::rule<class hsl_values, std::tuple<std::uint16_t, double, double, double >> {} =
lit("hsl") lit("hsl")
>> lit('(') >> dec3 >> lit('(') >> dec3
>> lit(',') >> dec3 >> lit('%') >> lit(',') >> double_ >> lit('%')
>> lit(',') >> dec3 >> lit('%') >> lit(',') >> double_ >> lit('%')
>> attr(1.0) >> lit(')') >> attr(1.0) >> lit(')')
; ;
auto const hsla_values = x3::rule<class hsla_values, std::tuple<std::uint16_t,std::uint8_t,std::uint8_t, double >> {} = auto const hsla_values = x3::rule<class hsla_values, std::tuple<std::uint16_t, double, double, double >> {} =
lit("hsla") lit("hsla")
>> lit('(') >> dec3 >> lit('(') >> dec3
>> lit(',') >> dec3 >> lit('%') >> lit(',') >> double_ >> lit('%')
>> lit(',') >> dec3 >> lit('%') >> lit(',') >> double_ >> lit('%')
>> lit(',') >> double_ >> lit(')') >> lit(',') >> double_ >> lit(')')
; ;

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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
@ -38,6 +38,7 @@
#include <map> #include <map>
#include <string> #include <string>
#include <memory> #include <memory>
#include <optional>
namespace mapnik { namespace mapnik {
@ -91,7 +92,7 @@ class MAPNIK_DECL datasource : private util::noncopyable
// default implementation without context use features method // default implementation without context use features method
return features(q); return features(q);
} }
virtual boost::optional<datasource_geometry_t> get_geometry_type() const = 0; virtual std::optional<datasource_geometry_t> get_geometry_type() const = 0;
virtual featureset_ptr features(query const& q) const = 0; virtual featureset_ptr features(query const& q) const = 0;
virtual featureset_ptr features_at_point(coord2d const& pt, double tol = 0) const = 0; virtual featureset_ptr features_at_point(coord2d const& pt, double tol = 0) const = 0;
virtual box2d<double> envelope() const = 0; virtual box2d<double> envelope() const = 0;

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) 2021 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

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) 2021 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

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) 2021 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
@ -96,10 +96,7 @@ class MAPNIK_DECL logger : public singleton<logger, CreateStatic>,
} }
// format // format
static std::string const& get_format() static std::string const& get_format() { return format_; }
{
return format_;
}
static void set_format(std::string const& format) static void set_format(std::string const& format)
{ {
@ -211,10 +208,7 @@ class base_log : public util::noncopyable
private: private:
#ifdef MAPNIK_LOG #ifdef MAPNIK_LOG
inline bool check_severity() inline bool check_severity() { return Severity >= logger::get_object_severity(object_name_); }
{
return Severity >= logger::get_object_severity(object_name_);
}
typename output_policy::stream_buffer streambuf_; typename output_policy::stream_buffer streambuf_;
std::string object_name_; std::string object_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) 2021 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
@ -35,11 +35,7 @@
#include <tuple> #include <tuple>
#include <stdexcept> #include <stdexcept>
#include <map> #include <map>
#if __cpp_lib_string_view >= 201606L
#include <string_view> #include <string_view>
#endif
#include <mapnik/warning.hpp>
namespace mapnik { namespace mapnik {
@ -62,60 +58,9 @@ class illegal_enum_value : public std::exception
}; };
namespace detail { namespace detail {
#if __cpp_lib_string_view >= 201606L
using mapnik_string_view = std::string_view;
#else
class mapnik_string_view // use std::string_view in C++17
{
public:
template<std::size_t N>
constexpr mapnik_string_view(const char (&s)[N])
: size_(N)
, data_(s)
{}
constexpr mapnik_string_view(const char* s, std::size_t N)
: size_(N)
, data_(s)
{}
constexpr char operator[](std::size_t index) const
{
return (index >= size_) ? throw std::out_of_range("Invalid index.") : data_[index];
}
constexpr char const* data() const { return data_; }
private:
std::size_t size_;
const char* data_;
};
constexpr bool mapnik_string_view_equals(mapnik_string_view const& a, char const* b, std::size_t i)
{
if (a[i] != b[i])
{
return false;
}
else if (a[i] == 0 || b[i] == 0)
{
return true;
}
else
{
return mapnik_string_view_equals(a, b, i + 1);
}
}
constexpr bool operator==(mapnik_string_view const& a, char const* b)
{
return mapnik_string_view_equals(a, b, 0);
}
#endif
template<class EnumT> template<class EnumT>
using EnumStringT = std::tuple<EnumT, mapnik_string_view>; using EnumStringT = std::tuple<EnumT, std::string_view>;
template<class EnumT, std::size_t N> template<class EnumT, std::size_t N>
using EnumMapT = std::array<EnumStringT<EnumT>, N>; using EnumMapT = std::array<EnumStringT<EnumT>, N>;
@ -149,9 +94,7 @@ struct MAPNIK_DECL enumeration
{ {
using native_type = ENUM; using native_type = ENUM;
constexpr operator ENUM() const { return value_; } constexpr operator ENUM() const { return value_; }
// constexpr bool operator==(const enumeration_new& rhs) { return value_ == rhs.value_; }
void operator=(ENUM v) { value_ = v; } void operator=(ENUM v) { value_ = v; }
void operator=(const enumeration& other) { value_ = other.value_; }
enumeration() enumeration()
: value_() : value_()
@ -191,13 +134,13 @@ struct MAPNIK_DECL enumeration
std::map<enum_class, std::string> fnc_name##_lookup() \ std::map<enum_class, std::string> fnc_name##_lookup() \
{ \ { \
std::map<enum_class, std::string> val_map; \ std::map<enum_class, std::string> val_map; \
std::transform( \ std::transform(fnc_name##_map.begin(), \
fnc_name##_map.begin(), \ fnc_name##_map.end(), \
fnc_name##_map.end(), \ std::inserter(val_map, val_map.end()), \
std::inserter(val_map, val_map.end()), \ [](const mapnik::detail::EnumStringT<enum_class>& val) { \
[](const mapnik::detail::EnumStringT<enum_class>& val) { \ return std::pair<enum_class, std::string>{std::get<0>(val), \
return std::pair<enum_class, std::string>{std::get<0>(val), std::string{std::get<1>(val).data()}}; \ std::string{std::get<1>(val).data()}}; \
}); \ }); \
return val_map; \ return val_map; \
} }

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) 2021 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
@ -131,11 +131,11 @@ struct evaluate_expression
}; };
template<typename T> template<typename T>
struct evaluate_expression<T, boost::none_t> struct evaluate_expression<T, std::nullopt_t>
{ {
using value_type = T; using value_type = T;
evaluate_expression(boost::none_t) {} evaluate_expression(std::nullopt_t) {}
value_type operator()(attribute const&) const value_type operator()(attribute const&) const
{ {
@ -265,7 +265,7 @@ std::tuple<T, bool> pre_evaluate_expression(expression_ptr const& expr)
{ {
try try
{ {
return std::make_tuple(util::apply_visitor(mapnik::evaluate_expression<T, boost::none_t>(boost::none), *expr), return std::make_tuple(util::apply_visitor(mapnik::evaluate_expression<T, std::nullopt_t>(std::nullopt), *expr),
true); true);
} }
catch (...) catch (...)

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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

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) 2021 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
@ -29,7 +29,6 @@
MAPNIK_DISABLE_WARNING_PUSH MAPNIK_DISABLE_WARNING_PUSH
MAPNIK_DISABLE_UNUSED_VARIABLE MAPNIK_DISABLE_UNUSED_VARIABLE
#include <mapnik/warning_ignore.hpp> #include <mapnik/warning_ignore.hpp>
#include <boost/optional.hpp>
#include <boost/msm/back/state_machine.hpp> #include <boost/msm/back/state_machine.hpp>
#include <boost/msm/front/state_machine_def.hpp> #include <boost/msm/front/state_machine_def.hpp>
#include <boost/msm/front/functor_row.hpp> #include <boost/msm/front/functor_row.hpp>
@ -37,6 +36,7 @@ MAPNIK_DISABLE_WARNING_POP
// stl // stl
#include <cmath> #include <cmath>
#include <optional>
namespace mapnik { namespace mapnik {
@ -91,7 +91,7 @@ struct store
{ {
m.v2 = m.v1; m.v2 = m.v1;
m.v1 = e.vertex; m.v1 = e.vertex;
m.output = boost::none; m.output = std::nullopt;
} }
}; };
@ -177,7 +177,7 @@ struct extender_def : public msm::front::state_machine_def<extender_def>
: extend_length(extend_length) : extend_length(extend_length)
{} {}
boost::optional<vertex2d> output; std::optional<vertex2d> output;
vertex2d v1, v2; vertex2d v1, v2;
double extend_length; double extend_length;
}; };

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) 2021 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

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) 2021 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

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) 2021 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
@ -28,7 +28,7 @@
#include <mapnik/value/types.hpp> #include <mapnik/value/types.hpp>
// boost // boost
//#include <boost/pool/pool_alloc.hpp> // #include <boost/pool/pool_alloc.hpp>
namespace mapnik { namespace mapnik {
struct feature_factory struct feature_factory

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) 2021 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

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) 2021 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

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) 2021 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
@ -47,7 +47,11 @@ struct layer_rendering_material;
enum eAttributeCollectionPolicy { DEFAULT = 0, COLLECT_ALL = 1 }; enum eAttributeCollectionPolicy { DEFAULT = 0, COLLECT_ALL = 1 };
template<typename Processor> template<typename Processor>
#ifdef __GNUC__
class MAPNIK_DECL feature_style_processor
#else
class feature_style_processor class feature_style_processor
#endif
{ {
public: public:
explicit feature_style_processor(Map const& m, double scale_factor = 1.0); explicit feature_style_processor(Map const& m, double scale_factor = 1.0);

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) 2021 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

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) 2021 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
@ -248,7 +248,7 @@ void feature_style_processor<Processor>::prepare_layer(layer_rendering_material&
box2d<double> buffered_query_ext(query_ext); // buffered box2d<double> buffered_query_ext(query_ext); // buffered
double buffer_padding = 2.0 * scale * p.scale_factor(); double buffer_padding = 2.0 * scale * p.scale_factor();
boost::optional<int> layer_buffer_size = lay.buffer_size(); const auto layer_buffer_size = lay.buffer_size();
if (layer_buffer_size) // if layer overrides buffer size, use this value to compute buffered extent if (layer_buffer_size) // if layer overrides buffer size, use this value to compute buffered extent
{ {
buffer_padding *= *layer_buffer_size; buffer_padding *= *layer_buffer_size;
@ -261,7 +261,7 @@ void feature_style_processor<Processor>::prepare_layer(layer_rendering_material&
buffered_query_ext.height(query_ext.height() + buffer_padding); buffered_query_ext.height(query_ext.height() + buffer_padding);
// clip buffered extent by maximum extent, if supplied // clip buffered extent by maximum extent, if supplied
boost::optional<box2d<double>> const& maximum_extent = m_.maximum_extent(); auto&& maximum_extent = m_.maximum_extent();
if (maximum_extent) if (maximum_extent)
{ {
buffered_query_ext.clip(*maximum_extent); buffered_query_ext.clip(*maximum_extent);

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) 2021 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
@ -28,21 +28,15 @@
#include <mapnik/enumeration.hpp> #include <mapnik/enumeration.hpp>
#include <mapnik/image_filter_types.hpp> #include <mapnik/image_filter_types.hpp>
#include <mapnik/image_compositing.hpp> #include <mapnik/image_compositing.hpp>
#include <mapnik/rule.hpp>
#include <mapnik/warning.hpp>
MAPNIK_DISABLE_WARNING_PUSH
#include <mapnik/warning_ignore.hpp>
#include <boost/optional.hpp>
MAPNIK_DISABLE_WARNING_POP
// stl // stl
#include <vector> #include <vector>
#include <cstddef> #include <cstddef>
#include <optional>
namespace mapnik { namespace mapnik {
class rule;
enum class filter_mode_enum { FILTER_ALL, FILTER_FIRST, filter_mode_enum_MAX }; enum class filter_mode_enum { FILTER_ALL, FILTER_FIRST, filter_mode_enum_MAX };
DEFINE_ENUM(filter_mode_e, filter_mode_enum); DEFINE_ENUM(filter_mode_e, filter_mode_enum);
@ -58,7 +52,7 @@ class MAPNIK_DECL feature_type_style
std::vector<filter::filter_type> filters_; std::vector<filter::filter_type> filters_;
std::vector<filter::filter_type> direct_filters_; std::vector<filter::filter_type> direct_filters_;
// comp-op // comp-op
boost::optional<composite_mode_e> comp_op_; std::optional<composite_mode_e> comp_op_;
float opacity_; float opacity_;
bool image_filters_inflate_; bool image_filters_inflate_;
friend void swap(feature_type_style& lhs, feature_type_style& rhs); friend void swap(feature_type_style& lhs, feature_type_style& rhs);
@ -89,7 +83,7 @@ class MAPNIK_DECL feature_type_style
std::vector<filter::filter_type>& direct_image_filters(); std::vector<filter::filter_type>& direct_image_filters();
// compositing // compositing
void set_comp_op(composite_mode_e comp_op); void set_comp_op(composite_mode_e comp_op);
boost::optional<composite_mode_e> comp_op() const; std::optional<composite_mode_e> comp_op() const;
void set_opacity(float opacity); void set_opacity(float opacity);
float get_opacity() const; float get_opacity() const;
void set_image_filters_inflate(bool inflate); void set_image_filters_inflate(bool inflate);

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) 2021 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
@ -41,22 +41,21 @@ struct MAPNIK_DECL Featureset : private util::noncopyable
virtual ~Featureset() {} virtual ~Featureset() {}
}; };
struct MAPNIK_DECL invalid_featureset final : Featureset struct MAPNIK_DECL empty_featureset : Featureset
{ {
feature_ptr next() { return feature_ptr(); } feature_ptr next() { return feature_ptr(); }
~invalid_featureset() {}
}; };
using featureset_ptr = std::shared_ptr<Featureset>; using featureset_ptr = std::shared_ptr<Featureset>;
inline featureset_ptr make_invalid_featureset() inline featureset_ptr make_empty_featureset()
{ {
return std::make_shared<invalid_featureset>(); return std::make_shared<empty_featureset>();
} }
inline bool is_valid(featureset_ptr const& ptr) inline bool is_empty(featureset_ptr const& ptr)
{ {
return (dynamic_cast<invalid_featureset*>(ptr.get()) == nullptr) ? true : false; return (dynamic_cast<empty_featureset*>(ptr.get()) != nullptr) ? true : false;
} }
} // namespace mapnik } // namespace mapnik

View file

@ -0,0 +1,43 @@
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2024 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef MAPNIK_FILESYSTEM_HPP
#define MAPNIK_FILESYSTEM_HPP
#ifdef USE_BOOST_FILESYSTEM
#include <boost/filesystem/operations.hpp> // for absolute, exists, etc
#include <boost/filesystem/path.hpp> // for path, operator/
#else
#include <filesystem>
#endif
namespace mapnik {
#ifdef USE_BOOST_FILESYSTEM
namespace fs = boost::filesystem;
using error_code = boost::system::error_code;
#else
namespace fs = std::filesystem;
using error_code = std::error_code;
#endif
} // namespace mapnik
#endif // MAPNIK_FILESYSTEM_HPP

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) 2021 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

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) 2021 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
@ -35,11 +35,7 @@
#include <map> #include <map>
#include <utility> // pair #include <utility> // pair
#include <vector> #include <vector>
#include <optional>
namespace boost {
template<class T>
class optional;
}
namespace mapnik { namespace mapnik {
@ -117,7 +113,7 @@ class MAPNIK_DECL face_manager
face_ptr get_face(std::string const& name); face_ptr get_face(std::string const& name);
face_set_ptr get_face_set(std::string const& name); face_set_ptr get_face_set(std::string const& name);
face_set_ptr get_face_set(font_set const& fset); face_set_ptr get_face_set(font_set const& fset);
face_set_ptr get_face_set(std::string const& name, boost::optional<font_set> fset); face_set_ptr get_face_set(std::string const& name, std::optional<font_set> fset);
stroker_ptr get_stroker() const { return stroker_; } stroker_ptr get_stroker() const { return stroker_; }
private: private:

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) 2021 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

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