diff --git a/.gitignore b/.gitignore index bbf225e80..9b10ae824 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,15 @@ .DS_Store +*.gcov +*.gcda +*.gcno *~ *.o *.pyc *.os *.so +*.so.* *.a +*.swp *.dylib plugins/input/*.input plugins/input/templates/*.input @@ -13,6 +18,9 @@ bindings/python/mapnik/paths.py config.cache config.log config.py +mapnik-settings.env +mason_packages/ +.mason/ .sconf_temp/ .sconsign.dblite demo/viewer/viewer.ini @@ -43,4 +51,6 @@ demo/viewer/release/ demo/viewer/ui_about.h demo/viewer/ui_info.h demo/viewer/ui_layer_info.h -tests/cpp_tests/*-bin +test/standalone/*-bin +test/unit/run +test/visual/run diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..8ca2e9845 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "test/data"] + path = test/data + url = https://github.com/mapnik/test-data.git +[submodule "test/data-visual"] + path = test/data-visual + url = https://github.com/mapnik/test-data-visual.git diff --git a/.travis.yml b/.travis.yml index 6aec37237..c0e2afb14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,30 +2,85 @@ language: cpp sudo: false +git: + depth: 10 + submodules: true + +env: + global: + - secure: "N3a5nzzsgpuu45k8qWdYsHNxrSnqeAGLTOYpfYoAH7B94vuf7pa7XV1tQjXbxrnx2D6ryTdtUtyRKwy7zXbwXxGt4DpczWEo8f6DUd6+obAp3kdnXABg2Sj4oA7KMs0F0CmoADy0jdUZD5YyOJHu64LCIIgzEQ9q49PFMNbU3IE=" + - secure: "iQYPNpMtejcgYeUkWZGIWz1msIco5qydJrhZTSCQOYahAQerdT7q5WZEpEo3G6IWOGgO1eo7GFuY8DvqQjw1+jC9b9mhkRNdo3LhGTKS9Gsbl5Q27k0rjlaFZmmQHrfPlQJwhfAIp+KLugHtQw5bCoLh+95E3j0F0DayF1tuJ3s=" addons: - postgresql: "9.3" + postgresql: "9.4" + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.5 + packages: + - clang-3.5 + +cache: + directories: + - $HOME/.ccache matrix: include: - - os: osx - compiler: clang - env: JOBS=12 - os: linux compiler: clang - env: JOBS=12 + env: JOBS=8 MASON_PUBLISH=true - os: linux compiler: gcc env: JOBS=6 + - os: osx + compiler: clang + env: JOBS=8 MASON_PUBLISH=true + - os: osx + compiler: clang + env: JOBS=8 COVERAGE=true + +before_install: + - export COVERAGE=${COVERAGE:-false} + - export MASON_PUBLISH=${MASON_PUBLISH:-false} + - if [[ ${TRAVIS_BRANCH} != 'master' ]]; then export MASON_PUBLISH=false; fi + - if [[ ${TRAVIS_PULL_REQUEST} != 'false' ]]; then export MASON_PUBLISH=false; fi install: - - if [[ $(uname -s) == 'Linux' ]]; then psql -U postgres -c 'create database template_postgis;' -U postgres; psql -U postgres -c 'create extension postgis;' -d template_postgis -U postgres; fi; + - if [[ $(uname -s) == 'Linux' ]]; then + psql -U postgres -c 'create database template_postgis;' -U postgres; + psql -U postgres -c 'create extension postgis;' -d template_postgis -U postgres; + export CXX="ccache clang++-3.5 -Qunused-arguments"; + export CC="ccache clang-3.5 -Qunused-arguments"; + export PYTHONPATH=$(pwd)/mason_packages/.link/lib/python2.7/site-packages; + else + export PYTHONPATH=$(pwd)/mason_packages/.link/lib/python/site-packages; + fi + - if [[ ${COVERAGE} == true ]]; then + PYTHONUSERBASE=$(pwd)/mason_packages/.link pip install --user cpp-coveralls; + fi script: - source bootstrap.sh - - wget https://gist.githubusercontent.com/springmeyer/0833fa43794838889139/raw/build_pycairo.sh && chmod +x build_pycairo.sh && ./build_pycairo.sh - - export PYTHONPATH=$(pwd)/mason_packages/.link/lib/python2.7/site-packages:${PYTHONPATH} - - ./configure + - if [[ ${COVERAGE} == true ]]; then + ./configure CUSTOM_LDFLAGS='--coverage' CUSTOM_CXXFLAGS='--coverage' CUSTOM_CFLAGS='--coverage' DEBUG=True; + elif [[ ${MASON_PUBLISH} == true ]]; then + export MASON_NAME=mapnik; + export MASON_VERSION=latest; + export MASON_LIB_FILE=lib/libmapnik-wkt.a; + source ./.mason/mason.sh; + ./configure PREFIX=${MASON_PREFIX} PATH_REPLACE='' MAPNIK_BUNDLED_SHARE_DIRECTORY=True RUNTIME_LINK='static'; + else + ./configure; + fi - make - - git clone --depth=1 https://github.com/mapbox/mapnik-test-data tests/data/mapnik-test-data - make test - - make bench + - if [[ ${COVERAGE} == true ]]; then + ./mason_packages/.link/bin/cpp-coveralls --build-root . --gcov-options '\-lp' --exclude mason_packages --exclude .sconf_temp --exclude benchmark --exclude deps --exclude scons --exclude test --exclude demo --exclude docs --exclude fonts --exclude utils > /dev/null; + fi + - if [[ ${COVERAGE} != true ]]; then + make bench; + fi + - if [[ ${MASON_PUBLISH} == true ]]; then + ./mason_latest.sh build; + ./mason_latest.sh link; + ./mason_latest.sh publish; + fi diff --git a/AUTHORS.md b/AUTHORS.md index e670af393..75589bfbc 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -52,6 +52,7 @@ Mapnik is written by Artem Pavlenko with contributions from: * Igor Podolskiy * Reid Priedhorsky * Brian Quinion +* Even Rouault * Marcin Rudowski * Sandro Santilli * Christopher Schmidt diff --git a/CHANGELOG.md b/CHANGELOG.md index 49849e340..4acdcb927 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,42 +8,112 @@ For a complete change history, see the git log. ## 3.0.0 -- Added new and experimental `dot` symbolizer for fast rendering of points -- Improved support for International Text (now uses harfbuzz library for text shaping) -- Uses latest c++11 features for better performance (especially map loading) -- Expressions everywhere: all symbolizer properties can now be data driven expressions (with the exception of `face-name` and `fontset-name` on the `TextSymbolizer`). -- New functions supported in expressions: `exp`, `sin`, `cos`, `tan`, `atan`, `abs`. -- New constants supported in expressions: `PI`, `DEG_TO_RAD`, `RAD_TO_DEG` -- Pattern symbolizers now support SVG input and applying transformations on them dynamically -- Experimental / interface may change: `@variables` can be passed to renderer and evaluated in expressions -- Supports being built with clang++ using `-fvisibility=hidden -flto` for smaller binaries -- Supports being built with Visual Studio 2014 CTP #3 -- Shield icons are now pixel snapped for crisp rendering -- `MarkersSymbolizer` now supports `avoid-edges`, `offset`, `geometry-transform`, `simplify` for `line` placement and two new `placement` options called `vertex-last` and `vertex-first` to place a single marker at the end or beginning of a path. Also `clip` is now respected when rendering markers on a LineString -geometry. -- `TextSymbolizer` now supports `smooth`, `simplify`, `halo-opacity`, `halo-comp-op`, and `halo-transform` -- `ShieldSymbolizer` now supports `smooth`, `simplify`, `halo-opacity`, `halo-comp-op`, and `halo-transform` -- New GroupSymbolizer for applying multiple symbolizers in a single layout - -Released ... +Released: June 30th, 2015 (Packaged from ...) -Summary: TODO +#### Summary -- PostGIS: Added support for rendering 3D and 4D geometries (previously silently skipped) (#44) +The 3.0 release is a major milestone for Mapnik and includes many performance and design improvements. The is the first release to provide text shaping using the harfbuzz library. This harfbuzz support unlocks improved rendering and layer for many new languages, particularly SE Asian scripts. The internal storage for working with images and geometries has been made more flexible, faster, and strongly typed. The python bindings that were previously bundled with Mapnik have now been moved to and are versioned independently. + +#### Notice + + - Mapnik 3.0.0 requires a compiler capable of `std=c++11`. + - It is highly recommended you use the `clang++` compiler on both OS X and Linux since it has robust c++11 support lower memory requirements. + +##### Major Changes + +- Improved support for International Text (now uses harfbuzz library for text shaping) + +- Uses latest C++11 features for better performance (especially map loading) + +- Expressions everywhere: all symbolizer properties can now be data driven expressions (with the exception of `face-name` and `fontset-name` on the `TextSymbolizer`). + +- Rewritten geometry storage based on `std::vector` (#2739) + - Separate storage of polygon exterior rings and interior rings to allow for more robust clipping of parts. + - Enforces consistent winding order per OGC spec (exterior rings are CCW, interior CW) + - Reduced memory consumption for layers with many points + - Ability to adapt Mapnik geometries to boost::geometry operations (in a zero-copy way) + - Ability to have i/o grammars for json/wkt work on geometries rather than paths for better efficiency and simpler code + +- Added new and experimental `dot` symbolizer for fast rendering of points + +- New functions supported in expressions: `exp`, `sin`, `cos`, `tan`, `atan`, `abs`. + +- New constants supported in expressions: `PI`, `DEG_TO_RAD`, `RAD_TO_DEG` + +- Added support for a variety of different grayscale images: + - `mapnik.imageType.null` + - `mapnik.imageType.rgba8` + - `mapnik.imageType.gray8` + - `mapnik.imageType.gray8s` + - `mapnik.imageType.gray16` + - `mapnik.imageType.gray16s` + - `mapnik.imageType.gray32` + - `mapnik.imageType.gray32s` + - `mapnik.imageType.gray32f` + - `mapnik.imageType.gray64` + - `mapnik.imageType.gray64s` + - `mapnik.imageType.gray64f` + +- Pattern symbolizers now support SVG input and applying transformations on them dynamically + +- Experimental / interface may change: `@variables` can be passed to renderer and evaluated in expressions + +- Supports being built with clang++ using `-fvisibility=hidden -flto` for smaller binaries + +- Supports being built with Visual Studio 2014 CTP #3 + +- Shield icons are now pixel snapped for crisp rendering + +- `MarkersSymbolizer` now supports `avoid-edges`, `offset`, `geometry-transform`, `simplify` for `line` placement and two new `placement` options called `vertex-last` and `vertex-first` to place a single marker at the end or beginning of a path. Also `clip` is now respected when rendering markers on a LineString +geometry. + +- `TextSymbolizer` now supports `smooth`, `simplify`, `halo-opacity`, `halo-comp-op`, and `halo-transform` + +- `ShieldSymbolizer` now supports `smooth`, `simplify`, `halo-opacity`, `halo-comp-op`, and `halo-transform` + +- The `text-transform` property of `TextSymbolizer` now supports `reverse` value to flip direction of text. + +- The `TextSymbolizer` now supports `font-feature-settings` for advanced control over Opentype font rendering (https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings) + +- New GroupSymbolizer for applying multiple symbolizers in a single layout - AGG renderer: fixed geometry offsetting to work after smoothing to produce more consistent results (#2202) - AGG renderer: increased `vertex_dist_epsilon` to ensure nearly coincident points are discarded more readily (#2196) -- GDAL plugin: Added back support for user driven `nodata` on rgb(a) images (#2023) +- GDAL plugin + - Now keeps datasets open for the lifetime of the datasource (rather than per featureset) + - Added back support for user driven `nodata` on rgb(a) images (#2023) + - Allowed nodata to override alpha band if set on rgba images (#2023) + - Added `nodata_tolerance` option to set nearby pixels transparent (has similar effect to the `nearblack` program) (#2023) + - At process exit Mapnik core no longer calls `dlclose` on gdal.input (#2716) -- GDAL plugin: Allowed nodata to override alpha band if set on rgba images (#2023) +- TopoJSON plugin + - Now supporting optional `bbox` property on layer + - Fixed support for reporting correct `feature.id()` + - Now supports `inline` string for passing data from memory + - Faster parsing via static initialization of grammars + - Fix crash on invalid arc index -- GDAL plugin: Added `nodata_tolerance` option to set nearby pixels transparent (has similar effect to the `nearblack` program) (#2023) +- GeoJSON plugin + - Now supporting optional `bbox` property on layer + - Fixed support for reporting correct `feature.id()` + - Now supports `inline` string for passing data from memory + - Faster parsing via static initialization of grammars -- Added support for web fonts: .woff format (#2113) +- SQLite plugin + - Fixed support for handling all column types + +- CSV Plugin + - Added the ability to pass an `extent` in options + +- PostGIS plugin + - Added Async support to - https://github.com/mapnik/mapnik/wiki/PostGIS-Async + - Added support for rendering 3D and 4D geometries (previously silently skipped) (#44) + +- Added support for web fonts: `.woff` format (#2113) - Added missing support for `geometry-transform` in `line-pattern` and `polygon-pattern` symbolizers (#2065) @@ -51,11 +121,9 @@ Summary: TODO - Upgraded unifont to `unifont-6.3.20131020` -- CSV Plugin: added the ability to pass an `extent` in options - - Fixed crash when rendering to cairo context from python (#2031) -- Moved `label-position-tolerance` from unsigned type to double +- Moved `label-position-tolerance` from `unsigned` type to `double` - Added support for more seamless blurring by rendering to a larger internal image to avoid edge effects (#1478) @@ -67,8 +135,6 @@ Summary: TODO - Added `color-to-alpha` `image-filter` to allow for applying alpha in proportion to color similiarity (#2023) -- Added Async support to PostGIS plugin - https://github.com/mapnik/mapnik/wiki/PostGIS-Async - - Fixed alpha handling bug with `comp-op:dst-over` (#1995) - Fixed alpha handling bug with building-fill-opacity (#2011) @@ -133,6 +199,9 @@ are not set. (#1966) - Added `scale-hsla` image-filter that allows scaling colors in HSL color space. RGB is converted to HSL (hue-saturation-lightness) and then each value (and the original alpha value) is stretched based on the specified scaling values. An example syntax is `scale-hsla(0,1,0,1,0,1,0,1)` which means no change because the full range will be kept (0 for lowest, 1 for highest). Other examples are: 1) `scale-hsla(0,0,0,1,0,1,0,1)` which would force all colors to be red in hue in the same way `scale-hsla(1,1,0,1,0,1,0,1)` would, 2) `scale-hsla(0,1,1,1,0,1,0,1)` which would cause all colors to become fully saturated, 3) `scale-hsla(0,1,1,1,0,1,.5,1)` which would force no colors to be any more transparent than half, and 4) `scale-hsla(0,1,1,1,0,1,0,.5)` which would force all colors to be at least half transparent. (#1954) +- The `shapeindex` tool now works correctly with point 3d geometry types + + ## 2.2.0 Released June 3rd, 2013 diff --git a/INSTALL.md b/INSTALL.md index f2787e671..b88abd2a4 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,21 +1,27 @@ # Mapnik Installation -Mapnik is cross platform and runs on Linux, Mac OSX, Solaris, *BSD, and Windows. +Mapnik runs on Linux, OS X, Windows, and BSD systems. To configure and build Mapnik do: ```bash - $ ./configure - $ make +./configure +make ``` To trigger parallel compilation you can pass a JOBS value to make: ```bash - $ JOBS=4 make +JOBS=4 make ``` -(Note that compiling Mapnik needs several GBytes of RAM. If you use parallel compiliation it needs more.) +Mapnik needs > 2 GB of RAM to build. If you use parallel compilation it needs more. + +If you are on a system with less memory make sure you only build with one JOB: + +```bash +JOBS=1 make +``` To use a Python interpreter that is not named `python` for your build, do something like the following instead: @@ -29,15 +35,16 @@ NOTE: the above will not work on windows, rather see https://github.com/mapnik/m Then to run the tests locally (without needing to install): - make test-local + git submodule update --init + make test Install like: - sudo make install + make install If you need to uninstall do: - sudo make uninstall + make uninstall For more details see the `Building` Section below. @@ -62,7 +69,6 @@ Mapnik Core depends on: - These libraries are used: - filesystem - system - - thread (for python bindings only) - regex (optionally built with icu regex support) - program_options (optionally for mapnik command line programs) * libicuuc >= 4.0 (ideally >= 4.2) - International Components for Unicode @@ -79,19 +85,10 @@ Mapnik Core optionally depends on: * libwebp - WEBP graphics (Default enabled, if found) * libproj - PROJ.4 projection library (Default enabled, if found) -Mapnik Python bindings depend on: - - * Python 2.5-2.7 or >= 3.2 - * Boost python - * simplejson module if using <= 2.5 - -Note: Python 3.x is supported, see: https://github.com/mapnik/mapnik/wiki/Python3k - Additional optional dependencies: * Cairo >= 1.6.0 - Graphics library for output formats like PDF, PS, and SVG - pkg-config - Required for building with cairo support - - pycairo - Python bindings for cairo * PostgreSQL (for PostGIS plugin support) - libpq - PostreSQL libraries - pg_config - PostgreSQL installation capabilities @@ -160,17 +157,7 @@ For more details on usage see: You can run the Mapnik tests locally (without installing) like: - make test-local # see the Makefile for how this works - -Or you can install and test like: - - make install && make test - -Many of the tests are written in python and you can run them individually like: - - make install - python tests/python_tests/shapefile_test.py - + make test ## Learning Mapnik @@ -197,4 +184,4 @@ tutorials on how to programmatically use Mapnik. ### Contributers -Read docs/contributing.markdown for resources for getting involved with Mapnik development. +Read docs/contributing.md for resources for getting involved with Mapnik development. diff --git a/Makefile b/Makefile index e5503fee9..ef02f71f7 100755 --- a/Makefile +++ b/Makefile @@ -12,23 +12,30 @@ all: mapnik install: $(PYTHON) scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 install -mapnik: - # we first build memory intensive files with -j2 - $(PYTHON) scons/scons.py -j2 \ +python: + if [ ! -d ./bindings/python ]; then git clone git@github.com:mapnik/python-mapnik.git --recursive ./bindings/python; else (cd bindings/python && git pull && git submodule update --init); fi; + make + python bindings/python/test/visual.py -q + +src/json/libmapnik-json.a: + # we first build memory intensive files with -j1 + $(PYTHON) scons/scons.py -j1 \ --config=cache --implicit-cache --max-drift=1 \ + src/renderer_common/process_group_symbolizer.os \ src/json/libmapnik-json.a \ src/wkt/libmapnik-wkt.a \ src/css_color_grammar.os \ src/expression_grammar.os \ src/transform_expression_grammar.os \ src/image_filter_types.os \ - src/renderer_common/process_group_symbolizer.os \ src/agg/process_markers_symbolizer.os \ src/agg/process_group_symbolizer.os \ src/grid/process_markers_symbolizer.os \ src/grid/process_group_symbolizer.os \ src/cairo/process_markers_symbolizer.os \ src/cairo/process_group_symbolizer.os \ + +mapnik: src/json/libmapnik-json.a # then install the rest with -j$(JOBS) $(PYTHON) scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 @@ -40,12 +47,10 @@ clean: @if test -e ".sconf_temp/"; then rm -r ".sconf_temp/"; fi @find ./ -name "*.pyc" -exec rm {} \; @find ./ -name "*.os" -exec rm {} \; - @find ./ -name "*.dylib" -exec rm {} \; - @find ./ -name "*.so" -exec rm {} \; + @find ./src/ -name "*.dylib" -exec rm {} \; + @find ./src/ -name "*.so" -exec rm {} \; @find ./ -name "*.o" -exec rm {} \; - @find ./ -name "*.a" -exec rm {} \; - @find ./ -name "*.pyc" -exec rm {} \; - @if test -e "bindings/python/mapnik/paths.py"; then rm "bindings/python/mapnik/paths.py"; fi + @find ./src/ -name "*.a" -exec rm {} \; distclean: if test -e "config.py"; then mv "config.py" "config.py.backup"; fi @@ -58,22 +63,13 @@ rebuild: uninstall: @$(PYTHON) scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 uninstall -test: - ./run_tests +test/data: + git submodule update --init -test-local: - make test +test: ./test/data + @./test/run -test-visual: - bash -c "source ./localize.sh && python tests/visual_tests/test.py -q" - -test-python: - bash -c "source ./localize.sh && python tests/run_tests.py -q" - -test-cpp: - ./tests/cpp_tests/run - -check: test-local +check: test bench: ./benchmark/run @@ -88,10 +84,16 @@ pep8: @pep8 -r --select=W391 -q --filename=*.py `pwd`/tests/ | xargs gsed -i -e :a -e '/^\n*$$/{$$d;N;ba' -e '}' @pep8 -r --select=W391 -q --filename=*.py `pwd`/tests/ | xargs ged -i '/./,/^$$/!d' +# note: pass --gen-suppressions=yes to create new suppression entries grind: - @for FILE in tests/cpp_tests/*-bin; do \ - valgrind --leak-check=full --log-fd=1 $${FILE} | grep definitely; \ + @source localize.sh && \ + valgrind --suppressions=./test/unit/valgrind.supp --leak-check=full --log-fd=1 ./test/visual/run | grep definitely; + @source localize.sh && \ + for FILE in test/standalone/*-bin; do \ + valgrind --suppressions=./test/unit/valgrind.supp --leak-check=full --log-fd=1 $${FILE} | grep definitely; \ done + @source localize.sh && \ + valgrind --suppressions=./test/unit/valgrind.supp --leak-check=full --log-fd=1 ./test/unit/run | grep definitely; render: @for FILE in tests/data/good_maps/*xml; do \ diff --git a/SConstruct b/SConstruct index 851e1a504..c72d1223c 100644 --- a/SConstruct +++ b/SConstruct @@ -39,13 +39,11 @@ severities = ['debug', 'warn', 'error', 'none'] ICU_INCLUDES_DEFAULT='/usr/include' ICU_LIBS_DEFAULT='/usr/' -DEFAULT_CC = "gcc" -DEFAULT_CXX = "g++" +DEFAULT_CC = "cc" +DEFAULT_CXX = "c++" DEFAULT_CXX11_CXXFLAGS = " -std=c++11" DEFAULT_CXX11_LINKFLAGS = "" if sys.platform == 'darwin': - DEFAULT_CC = "clang" - DEFAULT_CXX = "clang++" # homebrew default ICU_INCLUDES_DEFAULT='/usr/local/opt/icu4c/include/' ICU_LIBS_DEFAULT='/usr/local/opt/icu4c/' @@ -66,17 +64,20 @@ BOOST_SEARCH_PREFIXES = ['/usr/local','/opt/local','/sw','/usr',] BOOST_MIN_VERSION = '1.47' #CAIRO_MIN_VERSION = '1.8.0' +HARFBUZZ_MIN_VERSION = (0, 9, 34) +HARFBUZZ_MIN_VERSION_STRING = "%s.%s.%s" % HARFBUZZ_MIN_VERSION + + DEFAULT_LINK_PRIORITY = ['internal','other','frameworks','user','system'] pretty_dep_names = { - 'ociei':'Oracle database library | configure with OCCI_LIBS & OCCI_INCLUDES | more info: https://github.com/mapnik/mapnik/wiki/OCCI', + 'clntsh':'Oracle database library | configure with OCCI_LIBS & OCCI_INCLUDES | more info: https://github.com/mapnik/mapnik/wiki/OCCI', 'gdal':'GDAL C++ library | configured using gdal-config program | try setting GDAL_CONFIG SCons option | more info: https://github.com/mapnik/mapnik/wiki/GDAL', 'ogr':'OGR-enabled GDAL C++ Library | configured using gdal-config program | try setting GDAL_CONFIG SCons option | more info: https://github.com/mapnik/mapnik/wiki/OGR', 'cairo':'Cairo C library | configured using pkg-config | try setting PKG_CONFIG_PATH SCons option', - 'pycairo':'Python bindings to Cairo library | configured using pkg-config | try setting PKG_CONFIG_PATH SCons option', 'proj':'Proj.4 C Projections library | configure with PROJ_LIBS & PROJ_INCLUDES | more info: http://trac.osgeo.org/proj/', - 'pg':'Postgres C Library required for PostGIS plugin | configure with pg_config program | more info: https://github.com/mapnik/mapnik/wiki/PostGIS', + 'pg':'Postgres C Library required for PostGIS plugin | configure with pg_config program or configure with PG_LIBS & PG_INCLUDES | more info: https://github.com/mapnik/mapnik/wiki/PostGIS', 'sqlite3':'SQLite3 C Library | configure with SQLITE_LIBS & SQLITE_INCLUDES | more info: https://github.com/mapnik/mapnik/wiki/SQLite', 'jpeg':'JPEG C library | configure with JPEG_LIBS & JPEG_INCLUDES', 'tiff':'TIFF C library | configure with TIFF_LIBS & TIFF_INCLUDES', @@ -84,10 +85,12 @@ pretty_dep_names = { 'webp':'WEBP C library | configure with WEBP_LIBS & WEBP_INCLUDES', 'icuuc':'ICU C++ library | configure with ICU_LIBS & ICU_INCLUDES or use ICU_LIB_NAME to specify custom lib name | more info: http://site.icu-project.org/', 'harfbuzz':'HarfBuzz text shaping library | configure with HB_LIBS & HB_INCLUDES', + 'harfbuzz-min-version':'HarfBuzz >= %s (required for font-feature-settings support)' % HARFBUZZ_MIN_VERSION_STRING, 'z':'Z compression library | more info: http://www.zlib.net/', 'm':'Basic math library, part of C++ stlib', 'pkg-config':'pkg-config tool | more info: http://pkg-config.freedesktop.org', 'pg_config':'pg_config program | try setting PG_CONFIG SCons option', + 'pq':'libpq library (postgres client) | try setting PG_CONFIG SCons option or configure with PG_LIBS & PG_INCLUDES', 'xml2-config':'xml2-config program | try setting XML2_CONFIG SCons option or avoid the need for xml2-config command by configuring with XML2_LIBS & XML2_INCLUDES', 'libxml2':'libxml2 library | try setting XML2_CONFIG SCons option to point to location of xml2-config program or configure with XML2_LIBS & XML2_INCLUDES', 'gdal-config':'gdal-config program | try setting GDAL_CONFIG SCons option', @@ -108,7 +111,7 @@ PLUGINS = { # plugins with external dependencies 'gdal': {'default':True,'path':None,'inc':'gdal_priv.h','lib':'gdal','lang':'C++'}, 'ogr': {'default':True,'path':None,'inc':'ogrsf_frmts.h','lib':'gdal','lang':'C++'}, # configured with custom paths, hence 'path': PREFIX/INCLUDES/LIBS - 'occi': {'default':False,'path':'OCCI','inc':'occi.h','lib':'ociei','lang':'C++'}, + 'occi': {'default':False,'path':'OCCI','inc':'occi.h','lib':'clntsh','lang':'C++'}, 'sqlite': {'default':True,'path':'SQLITE','inc':'sqlite3.h','lib':'sqlite3','lang':'C'}, 'rasterlite': {'default':False,'path':'RASTERLITE','inc':['sqlite3.h','rasterlite.h'],'lib':'rasterlite','lang':'C'}, @@ -121,8 +124,7 @@ PLUGINS = { # plugins with external dependencies 'raster': {'default':True,'path':None,'inc':None,'lib':None,'lang':'C++'}, 'geojson': {'default':True,'path':None,'inc':None,'lib':None,'lang':'C++'}, 'geobuf': {'default':True,'path':None,'inc':None,'lib':None,'lang':'C++'}, - 'topojson':{'default':True,'path':None,'inc':None,'lib':None,'lang':'C++'}, - 'python': {'default':False,'path':None,'inc':None,'lib':None,'lang':'C++'}, + 'topojson':{'default':True,'path':None,'inc':None,'lib':None,'lang':'C++'} } @@ -138,6 +140,9 @@ def init_environment(env): env = Environment(ENV=os.environ) init_environment(env) +def fix_path(path): + return os.path.abspath(path) + def color_print(color,text,newline=True): # 1 - red # 2 - green @@ -301,7 +306,7 @@ opts.AddVariables( ('WARNING_CXXFLAGS', 'Compiler flags you can set to reduce warning levels which are placed after -Wall.', ''), # SCons build behavior options - ('HOST', 'Set the target host for cross compiling"', ''), + ('HOST', 'Set the target host for cross compiling', ''), ('CONFIG', "The path to the python file in which to save user configuration options. Currently : '%s'" % SCONS_LOCAL_CONFIG,SCONS_LOCAL_CONFIG), BoolVariable('USE_CONFIG', "Use SCons user '%s' file (will also write variables after successful configuration)", 'True'), # http://www.scons.org/wiki/GoFastButton @@ -313,12 +318,12 @@ opts.AddVariables( # Install Variables ('PREFIX', 'The install path "prefix"', '/usr/local'), ('LIBDIR_SCHEMA', 'The library sub-directory appended to the "prefix", sometimes lib64 on 64bit linux systems', LIBDIR_SCHEMA_DEFAULT), - ('PYTHON_PREFIX','Custom install path "prefix" for python bindings (default of no prefix)',''), ('DESTDIR', 'The root directory to install into. Useful mainly for binary package building', '/'), ('PATH', 'A custom path (or multiple paths divided by ":") to append to the $PATH env to prioritize usage of command line programs (if multiple are present on the system)', ''), ('PATH_REMOVE', 'A path prefix to exclude from all known command and compile paths (create multiple excludes separated by :)', ''), ('PATH_REPLACE', 'Two path prefixes (divided with a :) to search/replace from all known command and compile paths', ''), ('MAPNIK_NAME', 'Name of library', 'mapnik'), + BoolVariable('MAPNIK_BUNDLED_SHARE_DIRECTORY', 'For portable packaging: instruct mapnik-config to report relative paths to bundled GDAL_DATA, PROJ_LIB, and ICU_DATA','False'), # Boost variables # default is '/usr/include', see FindBoost method below @@ -328,7 +333,6 @@ opts.AddVariables( ('BOOST_TOOLKIT','Specify boost toolkit, e.g., gcc41.','',False), ('BOOST_ABI', 'Specify boost ABI, e.g., d.','',False), ('BOOST_VERSION','Specify boost version, e.g., 1_35.','',False), - ('BOOST_PYTHON_LIB','Specify library name to specific Boost Python lib (e.g. "boost_python-py26")','boost_python'), # Variables for required dependencies ('FREETYPE_CONFIG', 'The path to the freetype-config executable.', 'freetype-config'), @@ -353,6 +357,8 @@ opts.AddVariables( BoolVariable('PROJ', 'Build Mapnik with proj4 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_LIBS', 'Search path for PROJ.4 library files', '/usr/' + LIBDIR_SCHEMA_DEFAULT, PathVariable.PathAccept), + ('PG_INCLUDES', 'Search path for libpq (postgres client) include files', ''), + ('PG_LIBS', 'Search path for libpq (postgres client) library files', ''), ('FREETYPE_INCLUDES', 'Search path for Freetype include files', ''), ('FREETYPE_LIBS', 'Search path for Freetype library files', ''), ('XML2_INCLUDES', 'Search path for libxml2 include files', ''), @@ -394,12 +400,8 @@ opts.AddVariables( ('SYSTEM_FONTS','Provide location for python bindings to register fonts (if provided then the bundled DejaVu fonts are not installed)',''), ('LIB_DIR_NAME','Name to use for the subfolder beside libmapnik where fonts and plugins are installed','mapnik'), PathVariable('PYTHON','Full path to Python executable used to build bindings', sys.executable), - BoolVariable('FRAMEWORK_PYTHON', 'Link against Framework Python on Mac OS X', 'True'), - BoolVariable('PYTHON_DYNAMIC_LOOKUP', 'On OSX, do not directly link python lib, but rather dynamically lookup symbols', 'True'), - ('FRAMEWORK_SEARCH_PATH','Custom framework search path on Mac OS X', ''), BoolVariable('FULL_LIB_PATH', 'Embed the full and absolute path to libmapnik when linking ("install_name" on OS X/rpath on Linux)', 'True'), BoolVariable('ENABLE_SONAME', 'Embed a soname in libmapnik on Linux', 'True'), - ListVariable('BINDINGS','Language bindings to build','all',['python']), EnumVariable('THREADING','Set threading support','multi', ['multi','single']), EnumVariable('XMLPARSER','Set xml parser','libxml2', ['libxml2','ptree']), BoolVariable('DEMO', 'Compile demo c++ application', 'True'), @@ -408,7 +410,6 @@ opts.AddVariables( BoolVariable('SVG2PNG', 'Compile and install a utility to generate render an svg file to a png on the command line', 'False'), BoolVariable('NIK2IMG', 'Compile and install a utility to generate render a map to an image', 'True'), BoolVariable('COLOR_PRINT', 'Print build status information in color', 'True'), - BoolVariable('SAMPLE_INPUT_PLUGINS', 'Compile and install sample plugins', 'False'), BoolVariable('BIGINT', 'Compile support for 64-bit integers in mapnik::value', 'True'), ) @@ -443,18 +444,12 @@ pickle_store = [# Scons internal variables 'BOOST_APPEND', 'LIBDIR_SCHEMA', 'REQUESTED_PLUGINS', - 'PYTHON_VERSION', - 'PYTHON_INCLUDES', - 'PYTHON_INSTALL_LOCATION', - 'PYTHON_SYS_PREFIX', 'COLOR_PRINT', 'HAS_CAIRO', 'MAPNIK_HAS_DLFCN', 'HAS_PYCAIRO', 'PYCAIRO_PATHS', 'HAS_LIBXML2', - 'PYTHON_IS_64BIT', - 'SAMPLE_INPUT_PLUGINS', 'PKG_CONFIG_PATH', 'PATH', 'PATH_REMOVE', @@ -466,6 +461,7 @@ pickle_store = [# Scons internal variables 'MAPNIK_INPUT_PLUGINS_DEST', 'MAPNIK_FONTS', 'MAPNIK_FONTS_DEST', + 'MAPNIK_BUNDLED_SHARE_DIRECTORY', 'MAPNIK_LIB_BASE', 'MAPNIK_LIB_BASE_DEST', 'EXTRA_FREETYPE_LIBS', @@ -674,8 +670,8 @@ def parse_pg_config(context, config): if ret: lib_path = call('%s --libdir' % env[config]) inc_path = call('%s --includedir' % env[config]) - env.AppendUnique(CPPPATH = os.path.realpath(inc_path)) - env.AppendUnique(LIBPATH = os.path.realpath(lib_path)) + env.AppendUnique(CPPPATH = fix_path(inc_path)) + env.AppendUnique(LIBPATH = fix_path(lib_path)) lpq = env['PLUGINS']['postgis']['lib'] env.Append(LIBS = lpq) else: @@ -776,8 +772,8 @@ def FindBoost(context, prefixes, thread_flag): env['BOOST_APPEND'] = '-'.join(append_params) msg += '\nFound boost lib name extension: %s' % env['BOOST_APPEND'] - env.AppendUnique(CPPPATH = os.path.realpath(env['BOOST_INCLUDES'])) - env.AppendUnique(LIBPATH = os.path.realpath(env['BOOST_LIBS'])) + env.AppendUnique(CPPPATH = fix_path(env['BOOST_INCLUDES'])) + env.AppendUnique(LIBPATH = fix_path(env['BOOST_LIBS'])) if env['COLOR_PRINT']: msg = "\033[94m%s\033[0m" % (msg) ret = context.Result(msg) @@ -874,6 +870,24 @@ return 0; context.Result(ret[0]) return ret[1].strip() +def CheckBoostScopedEnum(context, silent=False): + if not silent: + context.Message('Checking whether Boost was compiled with C++11 scoped enums ... ') + ret = context.TryLink(""" +#include + +int main() +{ + boost::filesystem::path a, b; + boost::filesystem::copy_file(a, b); + return 0; +} +""", '.cpp') + if silent: + context.did_show_result=1 + context.Result(ret) + return ret + def icu_at_least_four_two(context): ret = context.TryRun(""" @@ -903,6 +917,35 @@ int main() color_print(1,'\nFound insufficient icu version... %s' % result) return False +def harfbuzz_version(context): + ret = context.TryRun(""" + +#include "harfbuzz/hb.h" +#include + +int main() +{ + std::cout << HB_VERSION_ATLEAST(%s, %s, %s) << ";" << HB_VERSION_STRING; + return 0; +} + +""" % HARFBUZZ_MIN_VERSION, '.cpp') + # hack to avoid printed output + context.Message('Checking for HarfBuzz version >= %s... ' % HARFBUZZ_MIN_VERSION_STRING) + context.did_show_result=1 + result = ret[1].strip() + if not result: + context.Result('error, could not get version from hb.h') + return False + + items = result.split(';') + if items[0] == '1': + color_print(4,'found: HarfBuzz %s' % items[1]) + return True + + color_print(1,'\nHarfbuzz >= %s required but found ... %s' % (HARFBUZZ_MIN_VERSION_STRING,items[1])) + return False + def boost_regex_has_icu(context): if env['RUNTIME_LINK'] == 'static': # re-order icu libs to ensure linux linker is happy @@ -1023,9 +1066,11 @@ conf_tests = { 'prioritize_paths' : prioritize_paths, 'get_pkg_lib' : get_pkg_lib, 'rollback_option' : rollback_option, 'icu_at_least_four_two' : icu_at_least_four_two, + 'harfbuzz_version' : harfbuzz_version, 'boost_regex_has_icu' : boost_regex_has_icu, 'sqlite_has_rtree' : sqlite_has_rtree, 'supports_cxx11' : supports_cxx11, + 'CheckBoostScopedEnum' : CheckBoostScopedEnum, } def GetMapnikLibVersion(): @@ -1106,7 +1151,6 @@ if not preconfigured: env['PLUGINS'] = PLUGINS env['EXTRA_FREETYPE_LIBS'] = [] env['SQLITE_LINKFLAGS'] = [] - env['PYTHON_INCLUDES'] = [] # previously a leading / was expected for LIB_DIR_NAME # now strip it to ensure expected behavior if env['LIB_DIR_NAME'].startswith(os.path.sep): @@ -1127,7 +1171,7 @@ if not preconfigured: # install prefix is a pre-pended base location to # re-route the install and only intended for package building # we normalize to ensure no trailing slash and proper pre-pending to the absolute prefix - install_prefix = os.path.normpath(os.path.realpath(env['DESTDIR'])) + os.path.realpath(env['PREFIX']) + install_prefix = os.path.normpath(fix_path(env['DESTDIR'])) + fix_path(env['PREFIX']) env['INSTALL_PREFIX'] = strip_first(install_prefix,'//','/') # all values from above based on install_prefix # if env['DESTDIR'] == '/' these should be unchanged @@ -1145,11 +1189,11 @@ if not preconfigured: env['MAPNIK_LIB_NAME'] = '${SHLIBPREFIX}${MAPNIK_NAME}${SHLIBSUFFIX}' if env['PKG_CONFIG_PATH']: - env['ENV']['PKG_CONFIG_PATH'] = os.path.realpath(env['PKG_CONFIG_PATH']) + env['ENV']['PKG_CONFIG_PATH'] = fix_path(env['PKG_CONFIG_PATH']) # otherwise this variable == os.environ["PKG_CONFIG_PATH"] if env['PATH']: - env['ENV']['PATH'] = os.path.realpath(env['PATH']) + ':' + env['ENV']['PATH'] + env['ENV']['PATH'] = fix_path(env['PATH']) + ':' + env['ENV']['PATH'] if env['SYSTEM_FONTS']: if not os.path.isdir(env['SYSTEM_FONTS']): @@ -1198,8 +1242,8 @@ if not preconfigured: for required in ('ICU', 'SQLITE', 'HB'): inc_path = env['%s_INCLUDES' % required] lib_path = env['%s_LIBS' % required] - env.AppendUnique(CPPPATH = os.path.realpath(inc_path)) - env.AppendUnique(LIBPATH = os.path.realpath(lib_path)) + env.AppendUnique(CPPPATH = fix_path(inc_path)) + env.AppendUnique(LIBPATH = fix_path(lib_path)) REQUIRED_LIBSHEADERS = [ ['z', 'zlib.h', True,'C'], @@ -1208,13 +1252,13 @@ if not preconfigured: ] if env.get('FREETYPE_LIBS') or env.get('FREETYPE_INCLUDES'): - REQUIRED_LIBSHEADERS.append(['freetype','ft2build.h',True,'C']) + REQUIRED_LIBSHEADERS.insert(0,['freetype','ft2build.h',True,'C']) if env.get('FREETYPE_INCLUDES'): inc_path = env['FREETYPE_INCLUDES'] - env.AppendUnique(CPPPATH = os.path.realpath(inc_path)) + env.AppendUnique(CPPPATH = fix_path(inc_path)) if env.get('FREETYPE_LIBS'): lib_path = env['FREETYPE_LIBS'] - env.AppendUnique(LIBPATH = os.path.realpath(lib_path)) + env.AppendUnique(LIBPATH = fix_path(lib_path)) elif conf.parse_config('FREETYPE_CONFIG'): # check if freetype links to bz2 if env['RUNTIME_LINK'] == 'static': @@ -1231,22 +1275,23 @@ if not preconfigured: # libxml2 should be optional but is currently not # https://github.com/mapnik/mapnik/issues/913 if env.get('XML2_LIBS') or env.get('XML2_INCLUDES'): - REQUIRED_LIBSHEADERS.append(['libxml2','libxml/parser.h',True,'C']) + REQUIRED_LIBSHEADERS.insert(0,['libxml2','libxml/parser.h',True,'C']) if env.get('XML2_INCLUDES'): inc_path = env['XML2_INCLUDES'] - env.AppendUnique(CPPPATH = os.path.realpath(inc_path)) + env.AppendUnique(CPPPATH = fix_path(inc_path)) if env.get('XML2_LIBS'): lib_path = env['XML2_LIBS'] - env.AppendUnique(LIBPATH = os.path.realpath(lib_path)) + env.AppendUnique(LIBPATH = fix_path(lib_path)) elif conf.parse_config('XML2_CONFIG',checks='--cflags'): env['HAS_LIBXML2'] = True else: env['MISSING_DEPS'].append('libxml2') - if conf.CheckHasDlfcn(): - env.Append(CPPDEFINES = '-DMAPNIK_HAS_DLCFN') - else: - env['SKIPPED_DEPS'].extend(['dlfcn']) + if not env['HOST']: + if conf.CheckHasDlfcn(): + env.Append(CPPDEFINES = '-DMAPNIK_HAS_DLCFN') + else: + env['SKIPPED_DEPS'].extend(['dlfcn']) OPTIONAL_LIBSHEADERS = [] @@ -1254,8 +1299,8 @@ if not preconfigured: OPTIONAL_LIBSHEADERS.append(['jpeg', ['stdio.h', 'jpeglib.h'], False,'C','-DHAVE_JPEG']) inc_path = env['%s_INCLUDES' % 'JPEG'] lib_path = env['%s_LIBS' % 'JPEG'] - env.AppendUnique(CPPPATH = os.path.realpath(inc_path)) - env.AppendUnique(LIBPATH = os.path.realpath(lib_path)) + env.AppendUnique(CPPPATH = fix_path(inc_path)) + env.AppendUnique(LIBPATH = fix_path(lib_path)) else: env['SKIPPED_DEPS'].extend(['jpeg']) @@ -1263,8 +1308,8 @@ if not preconfigured: OPTIONAL_LIBSHEADERS.append(['proj', 'proj_api.h', False,'C','-DMAPNIK_USE_PROJ4']) inc_path = env['%s_INCLUDES' % 'PROJ'] lib_path = env['%s_LIBS' % 'PROJ'] - env.AppendUnique(CPPPATH = os.path.realpath(inc_path)) - env.AppendUnique(LIBPATH = os.path.realpath(lib_path)) + env.AppendUnique(CPPPATH = fix_path(inc_path)) + env.AppendUnique(LIBPATH = fix_path(lib_path)) else: env['SKIPPED_DEPS'].extend(['proj']) @@ -1272,8 +1317,8 @@ if not preconfigured: OPTIONAL_LIBSHEADERS.append(['png', 'png.h', False,'C','-DHAVE_PNG']) inc_path = env['%s_INCLUDES' % 'PNG'] lib_path = env['%s_LIBS' % 'PNG'] - env.AppendUnique(CPPPATH = os.path.realpath(inc_path)) - env.AppendUnique(LIBPATH = os.path.realpath(lib_path)) + env.AppendUnique(CPPPATH = fix_path(inc_path)) + env.AppendUnique(LIBPATH = fix_path(lib_path)) else: env['SKIPPED_DEPS'].extend(['png']) @@ -1281,8 +1326,8 @@ if not preconfigured: OPTIONAL_LIBSHEADERS.append(['webp', 'webp/decode.h', False,'C','-DHAVE_WEBP']) inc_path = env['%s_INCLUDES' % 'WEBP'] lib_path = env['%s_LIBS' % 'WEBP'] - env.AppendUnique(CPPPATH = os.path.realpath(inc_path)) - env.AppendUnique(LIBPATH = os.path.realpath(lib_path)) + env.AppendUnique(CPPPATH = fix_path(inc_path)) + env.AppendUnique(LIBPATH = fix_path(lib_path)) else: env['SKIPPED_DEPS'].extend(['webp']) @@ -1290,8 +1335,8 @@ if not preconfigured: OPTIONAL_LIBSHEADERS.append(['tiff', 'tiff.h', False,'C','-DHAVE_TIFF']) inc_path = env['%s_INCLUDES' % 'TIFF'] lib_path = env['%s_LIBS' % 'TIFF'] - env.AppendUnique(CPPPATH = os.path.realpath(inc_path)) - env.AppendUnique(LIBPATH = os.path.realpath(lib_path)) + env.AppendUnique(CPPPATH = fix_path(inc_path)) + env.AppendUnique(LIBPATH = fix_path(lib_path)) else: env['SKIPPED_DEPS'].extend(['tiff']) @@ -1300,7 +1345,7 @@ if not preconfigured: conf.prioritize_paths(silent=True) # test for C++11 support, which is required - if not conf.supports_cxx11(): + if not env['HOST'] and not conf.supports_cxx11(): color_print(1,"C++ compiler does not support C++11 standard (-std=c++11), which is required. Please upgrade your compiler to at least g++ 4.7 (ideally 4.8)") Exit(1) @@ -1313,12 +1358,15 @@ if not preconfigured: else: color_print(4, 'Could not find optional header or shared library for %s' % libname) env['SKIPPED_DEPS'].append(libname) - - if not env['HOST']: - if env['ICU_LIB_NAME'] not in env['MISSING_DEPS']: - if not conf.icu_at_least_four_two(): - # expression_string.cpp and map.cpp use fromUTF* function only available in >= ICU 4.2 - env['MISSING_DEPS'].append(env['ICU_LIB_NAME']) + else: + if libname == env['ICU_LIB_NAME']: + if env['ICU_LIB_NAME'] not in env['MISSING_DEPS']: + if not conf.icu_at_least_four_two(): + # expression_string.cpp and map.cpp use fromUTF* function only available in >= ICU 4.2 + env['MISSING_DEPS'].append(env['ICU_LIB_NAME']) + elif libname == 'harfbuzz': + if not conf.harfbuzz_version(): + env['SKIPPED_DEPS'].append('harfbuzz-min-version') if env['BIGINT']: env.Append(CPPDEFINES = '-DBIGINT') @@ -1382,6 +1430,19 @@ if not preconfigured: color_print(4,'Could not find optional header or shared library for boost %s' % libinfo[0]) env['SKIPPED_DEPS'].append('boost ' + libinfo[0]) + # Boost versions before 1.57 are broken when the system package and + # Mapnik are compiled against different standards. On Ubuntu 14.04 + # using boost 1.54, it breaks scoped enums. It's a bit of a hack to + # just turn it off like this, but seems the only available work- + # around. See https://svn.boost.org/trac/boost/ticket/6779 for more + # details. + boost_version = [int(x) for x in env.get('BOOST_LIB_VERSION_FROM_HEADER').split('_')] + if not conf.CheckBoostScopedEnum(): + if boost_version < [1, 51]: + env.Append(CXXFLAGS = '-DBOOST_NO_SCOPED_ENUMS') + elif boost_version < [1, 57]: + env.Append(CXXFLAGS = '-DBOOST_NO_CXX11_SCOPED_ENUMS') + if not env['HOST'] and env['ICU_LIB_NAME'] not in env['MISSING_DEPS']: # http://lists.boost.org/Archives/boost/2009/03/150076.php # we need libicui18n if using static boost libraries, so it is @@ -1436,7 +1497,22 @@ if not preconfigured: else: details['lib'] = libname elif plugin == 'postgis' or plugin == 'pgraster': - conf.parse_pg_config('PG_CONFIG') + if env.get('PG_LIBS') or env.get('PG_INCLUDES'): + libname = details['lib'] + if env.get('PG_INCLUDES'): + inc_path = env['PG_INCLUDES'] + env.AppendUnique(CPPPATH = fix_path(inc_path)) + if env.get('PG_LIBS'): + lib_path = env['PG_LIBS'] + env.AppendUnique(LIBPATH = fix_path(lib_path)) + if not conf.CheckLibWithHeader(libname, details['inc'], details['lang']): + env['SKIPPED_DEPS'].append(libname) + if libname in env['LIBS']: + env['LIBS'].remove(libname) + else: + details['lib'] = libname + else: + conf.parse_pg_config('PG_CONFIG') elif plugin == 'ogr': if conf.ogr_enabled(): if conf.parse_config('GDAL_CONFIG',checks='--libs'): @@ -1456,8 +1532,8 @@ if not preconfigured: # to the beginning of the path list even if they already exist incpath = env['%s_INCLUDES' % details['path']] libpath = env['%s_LIBS' % details['path']] - env.PrependUnique(CPPPATH = os.path.realpath(incpath),delete_existing=True) - env.PrependUnique(LIBPATH = os.path.realpath(libpath),delete_existing=True) + env.PrependUnique(CPPPATH = fix_path(incpath),delete_existing=True) + env.PrependUnique(LIBPATH = fix_path(libpath),delete_existing=True) if not conf.CheckLibWithHeader(details['lib'], details['inc'], details['lang']): env.Replace(**backup) env['SKIPPED_DEPS'].append(details['lib']) @@ -1505,8 +1581,8 @@ if not preconfigured: if env['PGSQL2SQLITE']: if 'sqlite3' not in env['LIBS']: env.AppendUnique(LIBS='sqlite3') - env.AppendUnique(CPPPATH = os.path.realpath(env['SQLITE_INCLUDES'])) - env.AppendUnique(LIBPATH = os.path.realpath(env['SQLITE_LIBS'])) + env.AppendUnique(CPPPATH = fix_path(env['SQLITE_INCLUDES'])) + env.AppendUnique(LIBPATH = fix_path(env['SQLITE_LIBS'])) if 'pq' not in env['LIBS']: if not conf.parse_pg_config('PG_CONFIG'): env['PGSQL2SQLITE'] = False @@ -1518,7 +1594,6 @@ if not preconfigured: # prepend to make sure we link locally env.Prepend(CPPPATH = '#deps/agg/include') env.Prepend(LIBPATH = '#deps/agg') - env.Prepend(CPPPATH = '#deps/clipper/include') # prepend deps dir for auxillary headers env.Prepend(CPPPATH = '#deps') @@ -1526,11 +1601,11 @@ if not preconfigured: if env['CAIRO_LIBS'] or env['CAIRO_INCLUDES']: c_inc = env['CAIRO_INCLUDES'] if env['CAIRO_LIBS']: - env["CAIRO_LIBPATHS"].append(os.path.realpath(env['CAIRO_LIBS'])) + env["CAIRO_LIBPATHS"].append(fix_path(env['CAIRO_LIBS'])) if not env['CAIRO_INCLUDES']: c_inc = env['CAIRO_LIBS'].replace('lib','',1) if c_inc: - c_inc = os.path.normpath(os.path.realpath(env['CAIRO_INCLUDES'])) + c_inc = os.path.normpath(fix_path(env['CAIRO_INCLUDES'])) if c_inc.endswith('include'): c_inc = os.path.dirname(c_inc) env["CAIRO_CPPPATHS"].extend( @@ -1588,100 +1663,12 @@ if not preconfigured: env['SKIPPED_DEPS'].append('cairo') env['HAS_CAIRO'] = False - if 'python' in env['BINDINGS'] or 'python' in env['REQUESTED_PLUGINS']: - if not os.access(env['PYTHON'], os.X_OK): - color_print(1,"Cannot run python interpreter at '%s', make sure that you have the permissions to execute it." % env['PYTHON']) - Exit(1) - - py3 = 'True' in os.popen('''%s -c "import sys as s;s.stdout.write(str(s.version_info[0] == 3))"''' % env['PYTHON']).read().strip() - - if py3: - sys_prefix = '''%s -c "import sys; print(sys.prefix)"''' % env['PYTHON'] - else: - sys_prefix = '''%s -c "import sys; print sys.prefix"''' % env['PYTHON'] - env['PYTHON_SYS_PREFIX'] = call(sys_prefix) - - if HAS_DISTUTILS: - if py3: - sys_version = '''%s -c "from distutils.sysconfig import get_python_version; print(get_python_version())"''' % env['PYTHON'] - else: - sys_version = '''%s -c "from distutils.sysconfig import get_python_version; print get_python_version()"''' % env['PYTHON'] - env['PYTHON_VERSION'] = call(sys_version) - - if py3: - py_includes = '''%s -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())"''' % env['PYTHON'] - else: - py_includes = '''%s -c "from distutils.sysconfig import get_python_inc; print get_python_inc()"''' % env['PYTHON'] - env['PYTHON_INCLUDES'].append(call(py_includes)) - - # also append platform specific includes - if py3: - py_plat_includes = '''%s -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(plat_specific=True))"''' % env['PYTHON'] - else: - py_plat_includes = '''%s -c "from distutils.sysconfig import get_python_inc; print get_python_inc(plat_specific=True)"''' % env['PYTHON'] - env['PYTHON_INCLUDES'].append(call(py_plat_includes)) - - # Note: we use the plat_specific argument here to make sure to respect the arch-specific site-packages location - if py3: - site_packages = '''%s -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True))"''' % env['PYTHON'] - else: - site_packages = '''%s -c "from distutils.sysconfig import get_python_lib; print get_python_lib(plat_specific=True)"''' % env['PYTHON'] - env['PYTHON_SITE_PACKAGES'] = call(site_packages) - else: - env['PYTHON_SYS_PREFIX'] = os.popen('''%s -c "import sys; print sys.prefix"''' % env['PYTHON']).read().strip() - env['PYTHON_VERSION'] = os.popen('''%s -c "import sys; print sys.version"''' % env['PYTHON']).read()[0:3] - env['PYTHON_INCLUDES'] = [env['PYTHON_SYS_PREFIX'] + '/include/python' + env['PYTHON_VERSION']] - env['PYTHON_SITE_PACKAGES'] = env['DESTDIR'] + os.path.sep + env['PYTHON_SYS_PREFIX'] + os.path.sep + env['LIBDIR_SCHEMA'] + '/python' + env['PYTHON_VERSION'] + '/site-packages/' - - # if user-requested custom prefix fall back to manual concatenation for building subdirectories - if env['PYTHON_PREFIX']: - py_relative_install = env['LIBDIR_SCHEMA'] + '/python' + env['PYTHON_VERSION'] + '/site-packages/' - env['PYTHON_INSTALL_LOCATION'] = env['DESTDIR'] + os.path.sep + env['PYTHON_PREFIX'] + os.path.sep + py_relative_install - else: - env['PYTHON_INSTALL_LOCATION'] = env['DESTDIR'] + os.path.sep + env['PYTHON_SITE_PACKAGES'] - - if py3: - is_64_bit = '''%s -c "import sys; print(sys.maxsize == 9223372036854775807)"''' % env['PYTHON'] - else: - is_64_bit = '''%s -c "import sys; print sys.maxint == 9223372036854775807"''' % env['PYTHON'] - - if is_64_bit: - env['PYTHON_IS_64BIT'] = True - else: - env['PYTHON_IS_64BIT'] = False - - if has_boost_devel and 'python' in env['BINDINGS']: - if py3 and env['BOOST_PYTHON_LIB'] == 'boost_python': - env['BOOST_PYTHON_LIB'] = 'boost_python3%s' % env['BOOST_APPEND'] - elif env['BOOST_PYTHON_LIB'] == 'boost_python': - env['BOOST_PYTHON_LIB'] = 'boost_python%s' % env['BOOST_APPEND'] - if not env['HOST']: - if not conf.CheckHeader(header='boost/python/detail/config.hpp',language='C++'): - color_print(1,'Could not find required header files for boost python') - env['MISSING_DEPS'].append('boost python') - - if env['CAIRO']: - if CHECK_PKG_CONFIG and conf.CheckPKG('pycairo'): - env['HAS_PYCAIRO'] = True - temp_env = env.Clone() - temp_env['CPPPATH'] = [] - temp_env.ParseConfig('pkg-config --cflags pycairo') - if temp_env['CPPPATH']: - env['PYCAIRO_PATHS'] = copy(temp_env['CPPPATH']) - else: - print temp_env['CPPPATH'] - else: - env['SKIPPED_DEPS'].extend(['pycairo']) - else: - color_print(4,'Not building with pycairo support, pass CAIRO=True to enable') - - #### End Config Stage for Required Dependencies #### if env['MISSING_DEPS']: # if required dependencies are missing, print warnings and then let SCons finish without building or saving local config color_print(1,'\nExiting... the following required dependencies were not found:\n - %s' % '\n - '.join([pretty_dep(dep) for dep in env['MISSING_DEPS']])) - color_print(1,"\nSee '%s' for details on possible problems." % (os.path.realpath(SCONS_LOCAL_LOG))) + color_print(1,"\nSee '%s' for details on possible problems." % (fix_path(SCONS_LOCAL_LOG))) if env['SKIPPED_DEPS']: color_print(4,'\nAlso, these OPTIONAL dependencies were not found:\n - %s' % '\n - '.join([pretty_dep(dep) for dep in env['SKIPPED_DEPS']])) color_print(4,"\nSet custom paths to these libraries and header files on the command-line or in a file called '%s'" % SCONS_LOCAL_CONFIG) @@ -1745,11 +1732,6 @@ if not preconfigured: # c++11 support / https://github.com/mapnik/mapnik/issues/1683 # - upgrade to PHOENIX_V3 since that is needed for c++11 compile env.Append(CPPDEFINES = '-DBOOST_SPIRIT_USE_PHOENIX_V3=1') - if 'clang++' in env['CXX']: - # - workaround boost gil channel_algorithm.hpp narrowing error - # TODO - remove when building against >= 1.55 - # https://github.com/mapnik/mapnik/issues/1970 - env.Append(CXXFLAGS = '-Wno-c++11-narrowing') # Enable logging in debug mode (always) and release mode (when specified) if env['DEFAULT_LOG_SEVERITY']: @@ -1789,8 +1771,8 @@ if not preconfigured: env.Append(CPPDEFINES = ndebug_defines) # Common flags for g++/clang++ CXX compiler. - # TODO: clean up code more to make -Wextra -Wsign-compare -Wsign-conversion -Wconversion -Wshadow viable - common_cxx_flags = '-Wall %s %s -ftemplate-depth-300 ' % (env['WARNING_CXXFLAGS'], pthread) + # TODO: clean up code more to make -Wextra -Wsign-compare -Wsign-conversion -Wconversion viable + common_cxx_flags = '-Wall %s %s -ftemplate-depth-300 -Wsign-compare -Wshadow ' % (env['WARNING_CXXFLAGS'], pthread) if 'clang++' in env['CXX']: common_cxx_flags += ' -Wno-unknown-pragmas -Wno-unsequenced ' @@ -1806,29 +1788,6 @@ if not preconfigured: if env['DEBUG_UNDEFINED']: env.Append(CXXFLAGS = '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error -ftrapv -fwrapv') - if 'python' in env['BINDINGS'] or 'python' in env['REQUESTED_PLUGINS']: - majver, minver = env['PYTHON_VERSION'].split('.') - # we don't want the includes it in the main environment... - # as they are later set in the python build.py - # ugly hack needed until we have env specific conf - backup = env.Clone().Dictionary() - for pyinc in env['PYTHON_INCLUDES']: - env.AppendUnique(CPPPATH = os.path.realpath(pyinc)) - - if not conf.CheckHeader(header='Python.h',language='C'): - color_print(1,'Could not find required header files for the Python language (version %s)' % env['PYTHON_VERSION']) - Exit(1) - - if (int(majver), int(minver)) < (2, 2): - color_print(1,"Python version 2.2 or greater required") - Exit(1) - - if 'python' in env['BINDINGS']: - color_print(4,'Bindings Python version... %s' % env['PYTHON_VERSION']) - color_print(4,'Python %s prefix... %s' % (env['PYTHON_VERSION'], env['PYTHON_SYS_PREFIX'])) - color_print(4,'Python bindings will install in... %s' % os.path.normpath(env['PYTHON_INSTALL_LOCATION'])) - env.Replace(**backup) - # if requested, sort LIBPATH and CPPPATH one last time before saving... if env['PRIORITIZE_LINKING']: conf.prioritize_paths(silent=True) @@ -1879,11 +1838,11 @@ if not HELP_REQUESTED: env['create_uninstall_target'] = create_uninstall_target if env['PKG_CONFIG_PATH']: - env['ENV']['PKG_CONFIG_PATH'] = os.path.realpath(env['PKG_CONFIG_PATH']) + env['ENV']['PKG_CONFIG_PATH'] = fix_path(env['PKG_CONFIG_PATH']) # otherwise this variable == os.environ["PKG_CONFIG_PATH"] if env['PATH']: - env['ENV']['PATH'] = os.path.realpath(env['PATH']) + ':' + env['ENV']['PATH'] + env['ENV']['PATH'] = fix_path(env['PATH']) + ':' + env['ENV']['PATH'] if env['PATH_REMOVE']: for p in env['PATH_REMOVE'].split(':'): @@ -2012,40 +1971,20 @@ if not HELP_REQUESTED: else : color_print(1,"WARNING: Cannot find boost_program_options. 'shapeindex' and other command line programs will not be available") - # Build the Python bindings - if 'python' in env['BINDINGS']: - SConscript('bindings/python/build.py') - - # Install the python speed testing scripts if python bindings will be available - SConscript('utils/performance/build.py') - - # Install the mapnik upgrade script - SConscript('utils/upgrade_map_xml/build.py') - # Configure fonts and if requested install the bundled DejaVu fonts SConscript('fonts/build.py') # build C++ tests - SConscript('tests/cpp_tests/build.py') - SConscript('tests/cxx/build.py') + SConscript('test/build.py') if env['BENCHMARK']: SConscript('benchmark/build.py') + if os.path.exists('./bindings/python/build.py'): + SConscript('./bindings/python/build.py') + # install mapnik-config script SConscript('utils/mapnik-config/build.py') # write the viewer.ini file SConscript('demo/viewer/build.py') - - # if requested, build the sample input plugins - if env['SAMPLE_INPUT_PLUGINS']: - SConscript('plugins/input/templates/helloworld/build.py') - else: - if 'install' in COMMAND_LINE_TARGETS: - plugin_path = os.path.join(env['MAPNIK_INPUT_PLUGINS_DEST'],'hello.input') - if os.path.exists(plugin_path): - color_print(4,"Notice: removing out of date plugin: '%s'" % plugin_path) - os.unlink(plugin_path) - if os.path.exists('plugins/input/templates/hello.input'): - os.unlink('plugins/input/templates/hello.input') diff --git a/benchmark/bench_framework.hpp b/benchmark/bench_framework.hpp index 33c5b0f99..52088e4e1 100644 --- a/benchmark/bench_framework.hpp +++ b/benchmark/bench_framework.hpp @@ -4,6 +4,8 @@ // mapnik #include #include +#include +#include "../test/cleanup.hpp" // stl #include @@ -25,8 +27,8 @@ protected: public: test_case(mapnik::parameters const& params) : params_(params), - threads_(*params.get("threads",0)), - iterations_(*params.get("iterations",0)) + threads_(mapnik::safe_cast(*params.get("threads",0))), + iterations_(mapnik::safe_cast(*params.get("iterations",0))) {} std::size_t threads() const { @@ -66,11 +68,14 @@ void handle_args(int argc, char** argv, mapnik::parameters & params) mapnik::parameters params; \ benchmark::handle_args(argc,argv,params); \ test_class test_runner(params); \ - return run(test_runner,name); \ + auto result = run(test_runner,name); \ + testing::run_cleanup(); \ + return result; \ } \ catch (std::exception const& ex) \ { \ std::clog << ex.what() << "\n"; \ + testing::run_cleanup(); \ return -1; \ } \ } \ diff --git a/benchmark/build.py b/benchmark/build.py index 3b5ff20da..8b2049e24 100644 --- a/benchmark/build.py +++ b/benchmark/build.py @@ -8,6 +8,7 @@ test_env = env.Clone() test_env['LIBS'] = [env['MAPNIK_NAME']] test_env.AppendUnique(LIBS=copy(env['LIBMAPNIK_LIBS'])) +test_env.AppendUnique(LIBS='mapnik-wkt') if env['PLATFORM'] == 'Linux': test_env.AppendUnique(LIBS='dl') test_env.AppendUnique(LIBS='rt') @@ -34,7 +35,7 @@ benchmarks = [ #"test_to_double.cpp", #"test_to_int.cpp", #"test_utf_encoding.cpp" - #"test_polygon_clipping.cpp", + "test_polygon_clipping.cpp", #"test_polygon_clipping_rendering.cpp", "test_proj_transform1.cpp", "test_expression_parse.cpp", @@ -42,6 +43,10 @@ benchmarks = [ "test_font_registration.cpp", "test_rendering.cpp", "test_rendering_shared_map.cpp", + "test_offset_converter.cpp", + "test_marker_cache.cpp", + "test_quad_tree.cpp", +# "test_numeric_cast_vs_static_cast.cpp", ] for cpp_test in benchmarks: test_program = test_env_local.Program('out/'+cpp_test.replace('.cpp',''), source=[cpp_test]) diff --git a/benchmark/compare_images.hpp b/benchmark/compare_images.hpp index 60f9f0d1c..8fc6b1986 100644 --- a/benchmark/compare_images.hpp +++ b/benchmark/compare_images.hpp @@ -1,8 +1,7 @@ #ifndef __MAPNIK_COMPARE_IMAGES_HPP__ #define __MAPNIK_COMPARE_IMAGES_HPP__ -#include -#include +#include #include #include @@ -17,27 +16,26 @@ namespace benchmark { { throw mapnik::image_reader_exception("Failed to load: " + dest_fn); } - std::shared_ptr image_ptr1 = std::make_shared(reader1->width(),reader1->height()); - reader1->read(0,0,image_ptr1->data()); std::unique_ptr reader2(mapnik::get_image_reader(src_fn,"png")); if (!reader2.get()) { throw mapnik::image_reader_exception("Failed to load: " + src_fn); } - std::shared_ptr image_ptr2 = std::make_shared(reader2->width(),reader2->height()); - reader2->read(0,0,image_ptr2->data()); - image_data_rgba8 const& dest = image_ptr1->data(); - image_data_rgba8 const& src = image_ptr2->data(); + const image_any desc_any = reader1->read(0,0,reader1->width(), reader1->height()); + const image_any src_any = reader2->read(0,0,reader2->width(), reader2->height()); + + image_rgba8 const& dest = util::get(desc_any); + image_rgba8 const& src = util::get(src_any); unsigned int width = src.width(); unsigned int height = src.height(); if ((width != dest.width()) || height != dest.height()) return false; for (unsigned int y = 0; y < height; ++y) { - const unsigned int* row_from = src.getRow(y); - const unsigned int* row_to = dest.getRow(y); + const unsigned int* row_from = src.get_row(y); + const unsigned int* row_to = dest.get_row(y); for (unsigned int x = 0; x < width; ++x) { if (row_from[x] != row_to[x]) return false; diff --git a/benchmark/data/polygon_clipping_agg.png b/benchmark/data/polygon_clipping_agg.png index 34709aba3..6c38b39f7 100644 Binary files a/benchmark/data/polygon_clipping_agg.png and b/benchmark/data/polygon_clipping_agg.png differ diff --git a/benchmark/data/polygon_clipping_boost.png b/benchmark/data/polygon_clipping_boost.png index 34709aba3..21760b752 100644 Binary files a/benchmark/data/polygon_clipping_boost.png and b/benchmark/data/polygon_clipping_boost.png differ diff --git a/benchmark/data/polygon_clipping_clipper.png b/benchmark/data/polygon_clipping_clipper.png index a52fd50d9..d2e5ed40a 100644 Binary files a/benchmark/data/polygon_clipping_clipper.png and b/benchmark/data/polygon_clipping_clipper.png differ diff --git a/benchmark/run b/benchmark/run index 13e7e49ed..b17f82ad3 100755 --- a/benchmark/run +++ b/benchmark/run @@ -18,9 +18,10 @@ function run { #run test_polygon_clipping 10 1000 #run test_polygon_clipping_rendering 10 100 run test_proj_transform1 10 100 -run test_expression_parse 10 10000 -run test_face_ptr_creation 10 10000 -run test_font_registration 10 1000 +run test_expression_parse 10 1000 +run test_face_ptr_creation 10 1000 +run test_font_registration 10 100 +run test_offset_converter 10 1000 ./benchmark/out/test_rendering \ --name "text rendering" \ @@ -48,3 +49,11 @@ run test_font_registration 10 1000 --height 600 \ --iterations 20 \ --threads 10 + +./benchmark/out/test_quad_tree \ + --iterations 10000 \ + --threads 1 + +./benchmark/out/test_quad_tree \ + --iterations 10000 \ + --threads 10 diff --git a/benchmark/test_font_registration.cpp b/benchmark/test_font_registration.cpp index 749f12232..0fd9f8d29 100644 --- a/benchmark/test_font_registration.cpp +++ b/benchmark/test_font_registration.cpp @@ -24,4 +24,4 @@ public: } }; -BENCHMARK(test,"font registration") \ No newline at end of file +BENCHMARK(test,"font registration") diff --git a/benchmark/test_marker_cache.cpp b/benchmark/test_marker_cache.cpp new file mode 100644 index 000000000..03aed7f27 --- /dev/null +++ b/benchmark/test_marker_cache.cpp @@ -0,0 +1,42 @@ +#include "bench_framework.hpp" +#include + +class test : public benchmark::test_case +{ + std::vector images_; +public: + test(mapnik::parameters const& params) + : test_case(params), + images_{ + "./test/data/images/dummy.jpg", + "./test/data/images/dummy.jpeg", + "./test/data/images/dummy.png", + "./test/data/images/dummy.tif", + "./test/data/images/dummy.tiff", + //"./test/data/images/landusepattern.jpeg", // will fail since it is a png + //"./test/data/images/xcode-CgBI.png", // will fail since its an invalid png + "./test/data/svg/octocat.svg", + "./test/data/svg/place-of-worship-24.svg", + "./test/data/svg/point_sm.svg", + "./test/data/svg/point.svg", + "./test/data/svg/airfield-12.svg" + } {} + bool validate() const + { + return true; + } + bool operator()() const + { + unsigned count = 0; + for (std::size_t i=0;i + +static double STEP_NUM = 0.0000000001; +static std::uint8_t START_NUM = 2; + +class test_static : public benchmark::test_case +{ + double step_; + std::uint8_t start_; +public: + test_static(mapnik::parameters const& params) + : test_case(params), + step_(STEP_NUM), + start_(START_NUM) {} + bool validate() const + { + return true; + } + bool operator()() const + { + double value_ = 0.0; + std::uint8_t x; + for (std::size_t i=0;i(start_) * value_; + if (c >= 256.0) c = 255.0; + if (c < 0.0) c = 0.0; + x = static_cast(c); + value_ += step_; + } + return static_cast(x) < (static_cast(start_) * value_); + } +}; + +using boost::numeric::positive_overflow; +using boost::numeric::negative_overflow; + +class test_numeric : public benchmark::test_case +{ + double step_; + std::uint8_t start_; +public: + test_numeric(mapnik::parameters const& params) + : test_case(params), + step_(STEP_NUM), + start_(START_NUM) {} + bool validate() const + { + return true; + } + bool operator()() const + { + double value_ = 0.0; + std::uint8_t x; + for (std::size_t i=0;i(start_ * value_); + } + catch(negative_overflow&) + { + x = std::numeric_limits::min(); + } + catch(positive_overflow&) + { + x = std::numeric_limits::max(); + } + value_ += step_; + } + return static_cast(x) < (static_cast(start_) * value_); + } +}; + +int main(int argc, char** argv) +{ + mapnik::parameters params; + benchmark::handle_args(argc,argv,params); + { + test_static test_runner(params); + run(test_runner,"static_cast"); + } + { + test_numeric test_runner(params); + run(test_runner,"numeric_cast"); + } + return 0; +} diff --git a/benchmark/test_offset_converter.cpp b/benchmark/test_offset_converter.cpp new file mode 100644 index 000000000..4bd317558 --- /dev/null +++ b/benchmark/test_offset_converter.cpp @@ -0,0 +1,101 @@ +#include "bench_framework.hpp" + +// mapnik +#include +#include +#include +#include + +struct fake_path +{ + using coord_type = std::tuple; + using cont_type = std::vector; + cont_type vertices_; + cont_type::iterator itr_; + + fake_path(std::initializer_list l) + : fake_path(l.begin(), l.size()) { + } + + fake_path(std::vector const &v) + : fake_path(v.begin(), v.size()) { + } + + template + fake_path(Itr itr, size_t sz) { + size_t num_coords = sz >> 1; + vertices_.reserve(num_coords); + + for (size_t i = 0; i < num_coords; ++i) { + double x = *itr++; + double y = *itr++; + unsigned cmd = (i == 0) ? mapnik::SEG_MOVETO : mapnik::SEG_LINETO; + vertices_.push_back(std::make_tuple(x, y, cmd)); + if (i == num_coords - 1) cmd = mapnik::SEG_END; + vertices_.push_back(std::make_tuple(x, y, cmd)); + } + itr_ = vertices_.begin(); + } + + unsigned vertex(double *x, double *y) { + if (itr_ == vertices_.end()) { + return mapnik::SEG_END; + } + *x = std::get<0>(*itr_); + *y = std::get<1>(*itr_); + unsigned cmd = std::get<2>(*itr_); + ++itr_; + return cmd; + } + + void rewind(unsigned) { + itr_ = vertices_.begin(); + } +}; + +class test_offset : public benchmark::test_case +{ +public: + test_offset(mapnik::parameters const& params) + : test_case(params) {} + bool validate() const + { + return true; + } + bool operator()() const + { + std::vector path; + int mysize = 2500; + int x1 = 0; + path.reserve(mysize*2); + for( int i = 0; i < mysize; i++ ) + { + path.push_back( i ); + path.push_back( 0 ); + } + fake_path fpath(path); + for (std::size_t i=0;i off_path(fpath); + off_path.set_offset(10); + unsigned cmd; + double x, y; + while ((cmd = off_path.vertex(&x, &y)) != mapnik::SEG_END) + { + x1++; + } + } + return x1 > 0; + } +}; + + +int main(int argc, char** argv) +{ + mapnik::parameters params; + benchmark::handle_args(argc,argv,params); + { + test_offset test_runner(params); + run(test_runner,"offset_test"); + } + return 0; +} diff --git a/benchmark/test_png_encoding1.cpp b/benchmark/test_png_encoding1.cpp index 9c1005ef7..55d3f18af 100644 --- a/benchmark/test_png_encoding1.cpp +++ b/benchmark/test_png_encoding1.cpp @@ -1,10 +1,9 @@ #include "bench_framework.hpp" #include -#include class test : public benchmark::test_case { - mapnik::image_data_rgba8 im_; + mapnik::image_rgba8 im_; public: test(mapnik::parameters const& params) : test_case(params), diff --git a/benchmark/test_png_encoding2.cpp b/benchmark/test_png_encoding2.cpp index da55bf29e..640050c0d 100644 --- a/benchmark/test_png_encoding2.cpp +++ b/benchmark/test_png_encoding2.cpp @@ -3,7 +3,7 @@ class test : public benchmark::test_case { - std::shared_ptr im_; + std::shared_ptr im_; public: test(mapnik::parameters const& params) : test_case(params) { @@ -13,14 +13,14 @@ public: { throw mapnik::image_reader_exception("Failed to load: " + filename); } - im_ = std::make_shared(reader->width(),reader->height()); - reader->read(0,0,im_->data()); + im_ = std::make_shared(reader->width(),reader->height()); + reader->read(0,0,*im_); } bool validate() const { std::string expected("./benchmark/data/multicolor-hextree-expected.png"); std::string actual("./benchmark/data/multicolor-hextree-actual.png"); - mapnik::save_to_file(im_->data(),actual, "png8:m=h:z=1"); + mapnik::save_to_file(*im_,actual, "png8:m=h:z=1"); return benchmark::compare_images(actual,expected); } bool operator()() const @@ -28,7 +28,7 @@ public: std::string out; for (std::size_t i=0;idata(),"png8:m=h:z=1"); + out = mapnik::save_to_string(*im_,"png8:m=h:z=1"); } } return true; diff --git a/benchmark/test_polygon_clipping.cpp b/benchmark/test_polygon_clipping.cpp index 9b6184b0c..25eacea76 100644 --- a/benchmark/test_polygon_clipping.cpp +++ b/benchmark/test_polygon_clipping.cpp @@ -1,23 +1,24 @@ #include "bench_framework.hpp" #include "compare_images.hpp" -#include "agg_conv_clip_polygon.h" -#include #include #include #include -#include #include -#include -#include #include #include #include -#include +#include +#include +#include +#include +#include +#include #include +#include +#include // agg #include "agg_conv_clip_polygon.h" // clipper -#include "agg_conv_clipper.h" #include "agg_path_storage.h" // rendering #include "agg_basics.h" @@ -29,33 +30,37 @@ // stl #include +#include +#include -void render(mapnik::geometry_type & geom, +void render(mapnik::geometry::multi_polygon const& geom, mapnik::box2d const& extent, std::string const& name) { - using path_type = mapnik::transform_path_adapter; + using path_type = mapnik::transform_path_adapter>; using ren_base = agg::renderer_base; using renderer = agg::renderer_scanline_aa_solid; - mapnik::image_32 im(256,256); - im.set_background(mapnik::color("white")); - mapnik::box2d padded_extent = extent; + mapnik::image_rgba8 im(256,256); + mapnik::fill(im, mapnik::color("white")); + mapnik::box2d padded_extent(155,134,665,466);//extent; padded_extent.pad(10); mapnik::view_transform tr(im.width(),im.height(),padded_extent,0,0); - agg::rendering_buffer buf(im.raw_data(),im.width(),im.height(), im.width() * 4); + agg::rendering_buffer buf(im.bytes(),im.width(),im.height(), im.row_size()); agg::pixfmt_rgba32_plain pixf(buf); ren_base renb(pixf); renderer ren(renb); + mapnik::proj_transform prj_trans(mapnik::projection("+init=epsg:4326"),mapnik::projection("+init=epsg:4326")); ren.color(agg::rgba8(127,127,127,255)); agg::rasterizer_scanline_aa<> ras; - mapnik::proj_transform prj_trans(mapnik::projection("+init=epsg:4326"),mapnik::projection("+init=epsg:4326")); - geom.rewind(0); - path_type path(tr,geom,prj_trans); - ras.add_path(path); + for (auto const& poly : geom) + { + mapnik::geometry::polygon_vertex_adapter va(poly); + path_type path(tr,va,prj_trans); + ras.add_path(path); + } agg::scanline_u8 sl; agg::render_scanlines(ras, sl, ren); - mapnik::save_to_file(im.data(),name); - geom.rewind(0); + mapnik::save_to_file(im,name); } class test1 : public benchmark::test_case @@ -64,7 +69,7 @@ class test1 : public benchmark::test_case mapnik::box2d extent_; std::string expected_; public: - using conv_clip = agg::conv_clip_polygon; + using conv_clip = agg::conv_clip_polygon>; test1(mapnik::parameters const& params, std::string const& wkt_in, mapnik::box2d const& extent) @@ -74,153 +79,133 @@ public: expected_("./benchmark/data/polygon_clipping_agg") {} bool validate() const { - std::string expected_wkt("Polygon((181 286.666667,233 454,315 340,421 446,463 324,559 466,631 321.320755,631 234.386861,528 178,394 229,329 138,212 134,183 228,200 264,181 238.244444),(313 190,440 256,470 248,510 305,533 237,613 263,553 397,455 262,405 378,343 287,249 334,229 191,313 190,313 190))"); - boost::ptr_vector paths; - if (!mapnik::from_wkt(wkt_in_, paths)) + mapnik::geometry::geometry geom; + if (!mapnik::from_wkt(wkt_in_, geom)) { throw std::runtime_error("Failed to parse WKT"); } - if (paths.size() != 1) + if (mapnik::geometry::is_empty(geom)) { - std::clog << "paths.size() != 1\n"; + std::clog << "empty geom!\n"; return false; } - mapnik::geometry_type & geom = paths[0]; - conv_clip clipped(geom); + if (!geom.is>()) + { + std::clog << "not a polygon!\n"; + return false; + } + mapnik::geometry::polygon const& poly = mapnik::util::get>(geom); + mapnik::geometry::polygon_vertex_adapter va(poly); + + + conv_clip clipped(va); clipped.clip_box( extent_.minx(), extent_.miny(), extent_.maxx(), extent_.maxy()); + + + clipped.rewind(0); + mapnik::geometry::polygon poly2; + mapnik::geometry::linear_ring ring; + // exterior ring unsigned cmd; - double x,y; - mapnik::geometry_type geom2(mapnik::geometry_type::types::Polygon); - while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END) { - geom2.push_vertex(x,y,(mapnik::CommandType)cmd); + double x, y, x0, y0; + while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END) + { + if (cmd == mapnik::SEG_MOVETO) + { + x0 = x; y0 = y; + } + + if (cmd == mapnik::SEG_CLOSE) + { + ring.add_coord(x0, y0); + break; + } + ring.add_coord(x,y); } + poly2.set_exterior_ring(std::move(ring)); + // interior rings + ring.clear(); + while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END) + { + if (cmd == mapnik::SEG_MOVETO) + { + x0 = x; y0 = y; + } + else if (cmd == mapnik::SEG_CLOSE) + { + ring.add_coord(x0,y0); + poly2.add_hole(std::move(ring)); + ring.clear(); + continue; + } + ring.add_coord(x,y); + } + std::string expect = expected_+".png"; std::string actual = expected_+"_actual.png"; - if (!mapnik::util::exists(expect)) + mapnik::geometry::multi_polygon mp; + mp.emplace_back(poly2); + auto env = mapnik::geometry::envelope(mp); + if (!mapnik::util::exists(expect) || (std::getenv("UPDATE") != nullptr)) { std::clog << "generating expected image: " << expect << "\n"; - render(geom2,geom.envelope(),expect); + render(mp,env,expect); } - render(geom2,geom.envelope(),actual); + render(mp,env,actual); return benchmark::compare_images(actual,expect); } bool operator()() const { - boost::ptr_vector paths; - if (!mapnik::from_wkt(wkt_in_, paths)) + mapnik::geometry::geometry geom; + if (!mapnik::from_wkt(wkt_in_, geom)) { throw std::runtime_error("Failed to parse WKT"); } + if (mapnik::geometry::is_empty(geom)) + { + std::clog << "empty geom!\n"; + return false; + } + if (!geom.is>()) + { + std::clog << "not a polygon!\n"; + return false; + } + bool valid = true; for (unsigned i=0;i const& poly = mapnik::util::get>(geom); + mapnik::geometry::polygon_vertex_adapter va(poly); + conv_clip clipped(va); + clipped.clip_box( + extent_.minx(), + extent_.miny(), + extent_.maxx(), + extent_.maxy()); + unsigned cmd; + double x,y; + // NOTE: this rewind is critical otherwise + // agg_conv_adapter_vpgen will give garbage + // values for the first vertex + clipped.rewind(0); + while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END) { + count++; + } + unsigned expected_count = 30; + if (count != expected_count) { + std::clog << "test1: clipping failed: processed " << count << " verticies but expected " << expected_count << "\n"; + valid = false; } } - return true; + return valid; } }; -class test2 : public benchmark::test_case -{ - std::string wkt_in_; - mapnik::box2d extent_; - std::string expected_; -public: - using poly_clipper = agg::conv_clipper; - test2(mapnik::parameters const& params, - std::string const& wkt_in, - mapnik::box2d const& extent) - : test_case(params), - wkt_in_(wkt_in), - extent_(extent), - expected_("./benchmark/data/polygon_clipping_clipper") {} - bool validate() const - { - std::string expected_wkt("Polygon((212 134,329 138,394 229,528 178,631 234.4,631 321.3,559 466,463 324,421 446,315 340,233 454,181 286.7,181 238.2,200 264,183 228),(313 190,229 191,249 334,343 287,405 378,455 262,553 397,613 263,533 237,510 305,470 248,440 256))"); - boost::ptr_vector paths; - if (!mapnik::from_wkt(wkt_in_, paths)) - { - throw std::runtime_error("Failed to parse WKT"); - } - agg::path_storage ps; - ps.move_to(extent_.minx(), extent_.miny()); - ps.line_to(extent_.minx(), extent_.maxy()); - ps.line_to(extent_.maxx(), extent_.maxy()); - ps.line_to(extent_.maxx(), extent_.miny()); - ps.close_polygon(); - if (paths.size() != 1) - { - std::clog << "paths.size() != 1\n"; - return false; - } - mapnik::geometry_type & geom = paths[0]; - poly_clipper clipped(geom,ps, - agg::clipper_and, - agg::clipper_non_zero, - agg::clipper_non_zero, - 1); - clipped.rewind(0); - unsigned cmd; - double x,y; - mapnik::geometry_type geom2(mapnik::geometry_type::types::Polygon); - while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END) { - geom2.push_vertex(x,y,(mapnik::CommandType)cmd); - } - std::string expect = expected_+".png"; - std::string actual = expected_+"_actual.png"; - if (!mapnik::util::exists(expect)) - { - std::clog << "generating expected image: " << expect << "\n"; - render(geom2,geom.envelope(),expect); - } - render(geom2,geom.envelope(),actual); - return benchmark::compare_images(actual,expect); - } - bool operator()() const - { - boost::ptr_vector paths; - if (!mapnik::from_wkt(wkt_in_, paths)) - { - throw std::runtime_error("Failed to parse WKT"); - } - agg::path_storage ps; - ps.move_to(extent_.minx(), extent_.miny()); - ps.line_to(extent_.minx(), extent_.maxy()); - ps.line_to(extent_.maxx(), extent_.maxy()); - ps.line_to(extent_.maxx(), extent_.miny()); - ps.close_polygon(); - for (unsigned i=0;i extent_; std::string expected_; public: - using poly_clipper = mapnik::polygon_clipper; test3(mapnik::parameters const& params, std::string const& wkt_in, mapnik::box2d const& extent) @@ -238,56 +222,278 @@ public: expected_("./benchmark/data/polygon_clipping_boost") {} bool validate() const { - std::string expected_wkt("Polygon((181 286.666667,233 454,315 340,421 446,463 324,559 466,631 321.320755,631 234.386861,528 178,394 229,329 138,212 134,183 228,200 264,181 238.244444,181 286.666667),(313 190,440 256,470 248,510 305,533 237,613 263,553 397,455 262,405 378,343 287,249 334,229 191,313 190))"); - boost::ptr_vector paths; - if (!mapnik::from_wkt(wkt_in_, paths)) + mapnik::geometry::geometry geom; + if (!mapnik::from_wkt(wkt_in_, geom)) { throw std::runtime_error("Failed to parse WKT"); } - if (paths.size() != 1) + if (mapnik::geometry::is_empty(geom)) { - std::clog << "paths.size() != 1\n"; + std::clog << "empty geom!\n"; return false; } - mapnik::geometry_type & geom = paths[0]; - poly_clipper clipped(extent_, geom); - unsigned cmd; - double x,y; - mapnik::geometry_type geom2(mapnik::geometry_type::types::Polygon); - while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END) { - geom2.push_vertex(x,y,(mapnik::CommandType)cmd); + if (!geom.is >()) + { + std::clog << "not a polygon!\n"; + return false; } + mapnik::geometry::polygon & poly = mapnik::util::get >(geom); + mapnik::geometry::correct(poly); + + std::deque > result; + boost::geometry::intersection(extent_,poly,result); + std::string expect = expected_+".png"; std::string actual = expected_+"_actual.png"; - if (!mapnik::util::exists(expect)) + mapnik::geometry::multi_polygon mp; + for (auto const& _geom: result) + { + //std::clog << boost::geometry::dsv(geom) << "\n"; + mp.emplace_back(_geom); + } + mapnik::geometry::geometry geom2(mp); + auto env = mapnik::geometry::envelope(geom2); + if (!mapnik::util::exists(expect) || (std::getenv("UPDATE") != nullptr)) { std::clog << "generating expected image: " << expect << "\n"; - render(geom2,geom.envelope(),expect); + render(mp,env,expect); } - render(geom2,geom.envelope(),actual); + render(mp,env,actual); return benchmark::compare_images(actual,expect); } bool operator()() const { - boost::ptr_vector paths; - if (!mapnik::from_wkt(wkt_in_, paths)) + mapnik::geometry::geometry geom; + if (!mapnik::from_wkt(wkt_in_, geom)) { throw std::runtime_error("Failed to parse WKT"); } + if (mapnik::geometry::is_empty(geom)) + { + std::clog << "empty geom!\n"; + return false; + } + if (!geom.is >()) + { + std::clog << "not a polygon!\n"; + return false; + } + mapnik::geometry::polygon & poly = mapnik::util::get >(geom); + mapnik::geometry::correct(poly); + + bool valid = true; for (unsigned i=0;i > result; + boost::geometry::intersection(extent_,poly,result); + unsigned count = 0; + for (auto const& _geom : result) { - poly_clipper clipped(extent_, geom); + mapnik::geometry::polygon_vertex_adapter va(_geom); unsigned cmd; double x,y; - while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END) {} + while ((cmd = va.vertex(&x, &y)) != mapnik::SEG_END) { + ++count; + } + unsigned expected_count = 29; + if (count != expected_count) { + std::clog << "test3: clipping failed: processed " << count << " verticies but expected " << expected_count << "\n"; + valid = false; + } } } - return true; + return valid; } }; +/* +Commented out section because clipper moved out of mapnik core. +inline void process_polynode_branch(ClipperLib::PolyNode* polynode, + mapnik::geometry::multi_polygon & mp) +{ + mapnik::geometry::polygon polygon; + mapnik::geometry::linear_ring outer; + for (auto const& pt : polynode->Contour) + { + outer.emplace_back(static_cast(pt.x),static_cast(pt.y)); + } + if (outer.front() != outer.back()) + { + outer.emplace_back(outer.front().x, outer.front().y); + } + polygon.set_exterior_ring(std::move(outer)); + for (auto * ring : polynode->Childs) + { + mapnik::geometry::linear_ring inner; + for (auto const& pt : ring->Contour) + { + inner.emplace_back(static_cast(pt.x),static_cast(pt.y)); + } + if (inner.front() != inner.back()) + { + inner.emplace_back(inner.front().x, inner.front().y); + } + polygon.add_hole(std::move(inner)); + } + mp.emplace_back(std::move(polygon)); + for (auto * ring : polynode->Childs) + { + for (auto * sub_ring : ring->Childs) + { + process_polynode_branch(sub_ring, mp); + } + } +} + +class test4 : public benchmark::test_case +{ + std::string wkt_in_; + mapnik::box2d extent_; + std::string expected_; +public: + test4(mapnik::parameters const& params, + std::string const& wkt_in, + mapnik::box2d const& extent) + : test_case(params), + wkt_in_(wkt_in), + extent_(extent), + expected_("./benchmark/data/polygon_clipping_clipper") {} + bool validate() const + { + mapnik::geometry::geometry geom; + if (!mapnik::from_wkt(wkt_in_, geom)) + { + throw std::runtime_error("Failed to parse WKT"); + } + if (mapnik::geometry::is_empty(geom)) + { + std::clog << "empty geom!\n"; + return false; + } + if (!geom.is >()) + { + std::clog << "not a polygon!\n"; + return false; + } + mapnik::geometry::polygon & poly = mapnik::util::get >(geom); + mapnik::geometry::correct(poly); + ClipperLib::Clipper clipper; + + mapnik::geometry::line_string path; + for (auto const& pt : poly.exterior_ring) + { + double x = pt.x; + double y = pt.y; + path.emplace_back(static_cast(x),static_cast(y)); + } + double area = ClipperLib::Area(path); + if (area > 0) + { + std::reverse(path.begin(), path.end()); + } + if (!clipper.AddPath(path, ClipperLib::ptSubject, true)) + { + std::clog << "ptSubject ext failed!\n"; + } + for (auto const& ring : poly.interior_rings) + { + path.clear(); + for (auto const& pt : ring) + { + double x = pt.x; + double y = pt.y; + path.emplace_back(static_cast(x),static_cast(y)); + } + area = ClipperLib::Area(path); + if (area < 0) + { + std::reverse(path.begin(), path.end()); + } + if (!clipper.AddPath(path, ClipperLib::ptSubject, true)) + { + std::clog << "ptSubject ext failed!\n"; + } + } + std::cerr << "path size=" << path.size() << std::endl; + mapnik::geometry::line_string clip_box; + clip_box.emplace_back(static_cast(extent_.minx()),static_cast(extent_.miny())); + clip_box.emplace_back(static_cast(extent_.maxx()),static_cast(extent_.miny())); + clip_box.emplace_back(static_cast(extent_.maxx()),static_cast(extent_.maxy())); + clip_box.emplace_back(static_cast(extent_.minx()),static_cast(extent_.maxy())); + clip_box.emplace_back(static_cast(extent_.minx()),static_cast(extent_.miny())); + + if (!clipper.AddPath( clip_box, ClipperLib::ptClip, true )) + { + std::clog << "ptClip failed!\n"; + } + + ClipperLib::PolyTree polygons; + clipper.Execute(ClipperLib::ctIntersection, polygons);// ClipperLib::pftNonZero); + clipper.Clear(); + mapnik::geometry::multi_polygon mp; + for (auto * polynode : polygons.Childs) + { + process_polynode_branch(polynode, mp); + } + std::string expect = expected_+".png"; + std::string actual = expected_+"_actual.png"; + //mapnik::geometry::geometry geom2(mp); + auto env = mapnik::geometry::envelope(mp); + if (!mapnik::util::exists(expect) || (std::getenv("UPDATE") != nullptr)) + { + std::clog << "generating expected image: " << expect << "\n"; + render(mp,env,expect); + } + render(mp,env,actual); + return benchmark::compare_images(actual,expect); + } + bool operator()() const + { + mapnik::geometry::geometry geom; + if (!mapnik::from_wkt(wkt_in_, geom)) + { + throw std::runtime_error("Failed to parse WKT"); + } + if (mapnik::geometry::is_empty(geom)) + { + std::clog << "empty geom!\n"; + return false; + } + if (!geom.is >()) + { + std::clog << "not a polygon!\n"; + return false; + } + mapnik::geometry::polygon & poly = mapnik::util::get >(geom); + mapnik::geometry::correct(poly); + + bool valid = true; + for (unsigned i=0;i > result; + boost::geometry::intersection(extent_,poly,result); + + unsigned count = 0; + for (auto const& geom : result) + { + mapnik::geometry::polygon_vertex_adapter va(geom); + unsigned cmd; + double x,y; + while ((cmd = va.vertex(&x, &y)) != mapnik::SEG_END) { + ++count; + } + unsigned expected_count = 29; + if (count != expected_count) { + std::clog << "test3: clipping failed: processed " << count << " verticies but expected " << expected_count << "\n"; + valid = false; + } + } + } + return valid; + } +}; +*/ + int main(int argc, char** argv) { mapnik::parameters params; @@ -310,14 +516,15 @@ int main(int argc, char** argv) test1 test_runner(params,wkt_in,clipping_box); run(test_runner,"clipping polygon with agg"); } - { - test2 test_runner(params,wkt_in,clipping_box); - run(test_runner,"clipping polygon with clipper"); - } { test3 test_runner(params,wkt_in,clipping_box); run(test_runner,"clipping polygon with boost"); } - + /* + { + test4 test_runner(params,wkt_in,clipping_box); + run(test_runner,"clipping polygon with clipper_tree"); + } + */ return 0; } diff --git a/benchmark/test_polygon_clipping_rendering.cpp b/benchmark/test_polygon_clipping_rendering.cpp index f4ba0f44b..88f20d5e0 100644 --- a/benchmark/test_polygon_clipping_rendering.cpp +++ b/benchmark/test_polygon_clipping_rendering.cpp @@ -1,7 +1,6 @@ #include "bench_framework.hpp" #include #include -#include #include #include @@ -22,8 +21,8 @@ public: mapnik::Map m(256,256); mapnik::load_map(m,xml_); m.zoom_to_box(extent_); - mapnik::image_32 im(m.width(),m.height()); - mapnik::agg_renderer ren(m,im); + mapnik::image_rgba8 im(m.width(),m.height()); + mapnik::agg_renderer ren(m,im); ren.apply(); //mapnik::save_to_file(im.data(),"test.png"); return true; @@ -35,8 +34,8 @@ public: m.zoom_to_box(extent_); for (unsigned i=0;i ren(m,im); + mapnik::image_rgba8 im(m.width(),m.height()); + mapnik::agg_renderer ren(m,im); ren.apply(); } return true; diff --git a/benchmark/test_proj_transform1.cpp b/benchmark/test_proj_transform1.cpp index 38fcf8b14..b98a49758 100644 --- a/benchmark/test_proj_transform1.cpp +++ b/benchmark/test_proj_transform1.cpp @@ -38,15 +38,16 @@ public: } bool operator()() const { - for (std::size_t i=0;i box(i,j,i,j); + mapnik::box2d box(j,k,j,k); if (!tr.forward(box)) throw std::runtime_error("could not transform coords"); } } diff --git a/benchmark/test_quad_tree.cpp b/benchmark/test_quad_tree.cpp new file mode 100644 index 000000000..e3aabac7c --- /dev/null +++ b/benchmark/test_quad_tree.cpp @@ -0,0 +1,54 @@ +#include "bench_framework.hpp" +#include +#include + +using quad_tree_type = mapnik::quad_tree; + +class test : public benchmark::test_case +{ +public: + test(mapnik::parameters const& params) + : test_case(params) {} + + bool validate() const + { + return true; + } + + bool operator()() const + { + std::random_device rd; + std::default_random_engine engine(rd()); + std::uniform_int_distribution uniform_dist(0, 2048); + quad_tree_type tree(mapnik::box2d(0,0,2048,2048)); + //populate + for (size_t i = 0; i < iterations_; ++i) + { + int cx = uniform_dist(engine); + int cy = uniform_dist(engine); + int sx = 0.2 * uniform_dist(engine); + int sy = 0.2 * uniform_dist(engine); + mapnik::box2d box(cx - sx,cy - sy, cx + sx, cy + sy); + tree.insert(i, box); + } + // bounding box query + std::size_t count=0; + for (size_t i = 0; i < iterations_; ++i) + { + int cx = uniform_dist(engine); + int cy = uniform_dist(engine); + int sx = 0.4 * uniform_dist(engine); + int sy = 0.4 * uniform_dist(engine); + mapnik::box2d box(cx - sx,cy - sy, cx + sx, cy + sy); + auto itr = tree.query_in_box(box); + auto end = tree.query_end(); + for ( ;itr != end; ++itr) + { + ++count; + } + } + return true; + } +}; + +BENCHMARK(test,"quad_tree creation") diff --git a/benchmark/test_rendering.cpp b/benchmark/test_rendering.cpp index ffaa100df..30e80be77 100644 --- a/benchmark/test_rendering.cpp +++ b/benchmark/test_rendering.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include @@ -55,12 +54,12 @@ public: } else { m.zoom_all(); } - mapnik::image_32 im(m.width(),m.height()); - mapnik::agg_renderer ren(m,im,scale_factor_); + mapnik::image_rgba8 im(m.width(),m.height()); + mapnik::agg_renderer ren(m,im,scale_factor_); ren.apply(); if (!preview_.empty()) { std::clog << "preview available at " << preview_ << "\n"; - mapnik::save_to_file(im.data(),preview_); + mapnik::save_to_file(im,preview_); } return true; } @@ -78,8 +77,8 @@ public: } for (unsigned i=0;i ren(m,im,scale_factor_); + mapnik::image_rgba8 im(m.width(),m.height()); + mapnik::agg_renderer ren(m,im,scale_factor_); ren.apply(); } return true; diff --git a/benchmark/test_rendering_shared_map.cpp b/benchmark/test_rendering_shared_map.cpp index c5d5b08f8..0b5705374 100644 --- a/benchmark/test_rendering_shared_map.cpp +++ b/benchmark/test_rendering_shared_map.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include @@ -50,7 +49,7 @@ class test : public benchmark::test_case std::shared_ptr m_; double scale_factor_; std::string preview_; - mutable mapnik::image_32 im_; + mutable mapnik::image_rgba8 im_; public: test(mapnik::parameters const& params) : test_case(params), @@ -94,14 +93,14 @@ public: mapnik::projection map_proj(m_->srs(),true); double scale_denom = mapnik::scale_denominator(m_req.scale(),map_proj.is_geographic()); scale_denom *= scale_factor_; - mapnik::agg_renderer ren(*m_,m_req,variables,im_,scale_factor_); + mapnik::agg_renderer ren(*m_,m_req,variables,im_,scale_factor_); ren.start_map_processing(*m_); std::vector const& layers = m_->layers(); process_layers(ren,m_req,map_proj,layers,scale_denom); ren.end_map_processing(*m_); if (!preview_.empty()) { std::clog << "preview available at " << preview_ << "\n"; - mapnik::save_to_file(im_.data(),preview_); + mapnik::save_to_file(im_,preview_); } return true; } @@ -114,24 +113,24 @@ public: for (unsigned i=0;iwidth(),m_->height()); + mapnik::image_rgba8 im(m_->width(),m_->height()); mapnik::attributes variables; m_req.set_buffer_size(m_->buffer_size()); mapnik::projection map_proj(m_->srs(),true); double scale_denom = mapnik::scale_denominator(m_req.scale(),map_proj.is_geographic()); scale_denom *= scale_factor_; - mapnik::agg_renderer ren(*m_,m_req,variables,im,scale_factor_); + mapnik::agg_renderer ren(*m_,m_req,variables,im,scale_factor_); ren.start_map_processing(*m_); std::vector const& layers = m_->layers(); process_layers(ren,m_req,map_proj,layers,scale_denom); ren.end_map_processing(*m_); bool diff = false; - mapnik::image_data_rgba8 const& dest = im.data(); - mapnik::image_data_rgba8 const& src = im_.data(); + mapnik::image_rgba8 const& dest = im; + mapnik::image_rgba8 const& src = im_; for (unsigned int y = 0; y < height_; ++y) { - const unsigned int* row_from = src.getRow(y); - const unsigned int* row_to = dest.getRow(y); + const unsigned int* row_from = src.get_row(y); + const unsigned int* row_to = dest.get_row(y); for (unsigned int x = 0; x < width_; ++x) { if (row_from[x] != row_to[x]) diff = true; @@ -160,7 +159,7 @@ int main(int argc, char** argv) mapnik::datasource_cache::instance().register_datasources("./plugins/input/"); { test test_runner(params); - run(test_runner,*name); + run(test_runner,*name); } } catch (std::exception const& ex) diff --git a/bindings/python/build.py b/bindings/python/build.py deleted file mode 100644 index db92a51f3..000000000 --- a/bindings/python/build.py +++ /dev/null @@ -1,212 +0,0 @@ -# -# This file is part of Mapnik (c++ mapping toolkit) -# -# Copyright (C) 2014 Artem Pavlenko -# -# Mapnik 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 -# -# - -import glob -import os -from subprocess import Popen, PIPE - - -Import('env') - -def call(cmd, silent=True): - stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() - if not stderr: - return stdin.strip() - elif not silent: - print stderr - -def run_2to3(*args,**kwargs): - call('2to3 -w %s' % os.path.dirname(kwargs['target'][0].path)) - -def is_py3(): - return 'True' in os.popen('''%s -c "import sys as s;s.stdout.write(str(s.version_info[0] == 3))"''' % env['PYTHON']).read().strip() - - -prefix = env['PREFIX'] -target_path = os.path.normpath(env['PYTHON_INSTALL_LOCATION'] + os.path.sep + env['MAPNIK_NAME']) -target_path_deprecated = os.path.normpath(env['PYTHON_INSTALL_LOCATION'] + os.path.sep + 'mapnik2') - -py_env = env.Clone() - -py_env.Append(CPPPATH = env['PYTHON_INCLUDES']) - -py_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES']) - -py_env['LIBS'] = [env['MAPNIK_NAME'],env['BOOST_PYTHON_LIB']] - -link_all_libs = env['LINKING'] == 'static' or env['RUNTIME_LINK'] == 'static' or (env['PLATFORM'] == 'Darwin' and not env['PYTHON_DYNAMIC_LOOKUP']) - -# even though boost_thread is no longer used in mapnik core -# we need to link in for boost_python to avoid missing symbol: _ZN5boost6detail12get_tss_dataEPKv / boost::detail::get_tss_data -py_env.AppendUnique(LIBS = 'boost_thread%s' % env['BOOST_APPEND']) - -if link_all_libs: - py_env.AppendUnique(LIBS=env['LIBMAPNIK_LIBS']) - -# note: on linux -lrt must be linked after thread to avoid: undefined symbol: clock_gettime -if env['RUNTIME_LINK'] == 'static' and env['PLATFORM'] == 'Linux': - py_env.AppendUnique(LIBS='rt') - -# TODO - do solaris/fedora need direct linking too? -if env['PLATFORM'] == 'Darwin': - ##### Python linking on OS X is tricky ### - # Confounding problems are: - # 1) likelyhood of multiple python installs of the same major.minor version - # because apple supplies python built-in and many users may have installed - # further versions using macports - # 2) boost python directly links to a python version - # 3) the below will directly link _mapnik.so to a python version - # 4) _mapnik.so must link to the same python lib as boost_python.dylib otherwise - # python will Abort with a Version Mismatch error. - # See https://github.com/mapnik/mapnik/issues/453 for the seeds of a better approach - # for now we offer control over method of direct linking... - # The default below is to link against the python dylib in the form of - #/path/to/Python.framework/Python instead of -lpython - - # http://developer.apple.com/mac/library/DOCUMENTATION/Darwin/Reference/ManPages/man1/ld.1.html - - if env['PYTHON_DYNAMIC_LOOKUP']: - python_link_flag = '-undefined dynamic_lookup' - elif env['FRAMEWORK_PYTHON']: - if env['FRAMEWORK_SEARCH_PATH']: - # if the user has supplied a custom root path to search for - # a given Python framework, then use that to direct the linker - python_link_flag = '-F%s -framework Python -Z' % env['FRAMEWORK_SEARCH_PATH'] - else: - # otherwise be as explicit as possible for linking to the same Framework - # as the executable we are building with (or is pointed to by the PYTHON variable) - # otherwise we may accidentally link against either: - # /System/Library/Frameworks/Python.framework/Python/Versions/ - # or - # /Library/Frameworks/Python.framework/Python/Versions/ - # See: https://github.com/mapnik/mapnik/issues/380 - link_prefix = env['PYTHON_SYS_PREFIX'] - if '.framework' in link_prefix: - python_link_flag = '-F%s -framework Python -Z' % os.path.dirname(link_prefix.split('.')[0]) - elif '/System' in link_prefix: - python_link_flag = '-F/System/Library/Frameworks/ -framework Python -Z' - else: - # should we fall back to -lpython here? - python_link_flag = '-F/ -framework Python' - # if we are not linking to a framework then use the *nix standard approach - else: - # TODO - do we need to pass -L/? - python_link_flag = '-lpython%s' % env['PYTHON_VERSION'] - -elif env['PLATFORM'] == 'SunOS': - # make sure to explicitly link mapnik.so against - # libmapnik in its installed location - python_link_flag = '-R%s' % env['MAPNIK_LIB_BASE'] -else: - # all other platforms we don't directly link python - python_link_flag = '' - -paths = ''' -"""Configuration paths of Mapnik fonts and input plugins (auto-generated by SCons).""" - -from os.path import normpath,join,dirname - -mapniklibpath = '%s' -mapniklibpath = normpath(join(dirname(__file__),mapniklibpath)) -''' - -paths += "inputpluginspath = join(mapniklibpath,'input')\n" - -if env['SYSTEM_FONTS']: - paths += "fontscollectionpath = normpath('%s')\n" % env['SYSTEM_FONTS'] -else: - paths += "fontscollectionpath = join(mapniklibpath,'fonts')\n" - -paths += "__all__ = [mapniklibpath,inputpluginspath,fontscollectionpath]\n" - -if not os.path.exists(env['MAPNIK_NAME']): - os.mkdir(env['MAPNIK_NAME']) - -file('mapnik/paths.py','w').write(paths % (env['MAPNIK_LIB_DIR'])) - -# force open perms temporarily so that `sudo scons install` -# does not later break simple non-install non-sudo rebuild -try: - os.chmod('mapnik/paths.py',0666) -except: pass - -# install the shared object beside the module directory -sources = glob.glob('*.cpp') - -if 'install' in COMMAND_LINE_TARGETS: - # install the core mapnik python files, including '__init__.py' - init_files = glob.glob('mapnik/*.py') - if 'mapnik/paths.py' in init_files: - init_files.remove('mapnik/paths.py') - init_module = env.Install(target_path, init_files) - env.Alias(target='install', source=init_module) - # install mapnik2 module which redirects to mapnik and issues DeprecatedWarning - init_mapnik2 = env.Install(target_path_deprecated, 'mapnik2/__init__.py') - env.Alias(target='install', source=init_mapnik2) - - # fix perms and install the custom generated 'paths.py' - targetp = os.path.join(target_path,'paths.py') - env.Alias("install", targetp) - # use env.Command rather than env.Install - # to enable setting proper perms on `paths.py` - env.Command( targetp, 'mapnik/paths.py', - [ - Copy("$TARGET","$SOURCE"), - Chmod("$TARGET", 0644), - ]) - -if 'uninstall' not in COMMAND_LINE_TARGETS: - if env['HAS_CAIRO']: - py_env.Append(CPPPATH = env['CAIRO_CPPPATHS']) - py_env.Append(CPPDEFINES = '-DHAVE_CAIRO') - if link_all_libs: - py_env.Append(LIBS=env['CAIRO_ALL_LIBS']) - - if env['HAS_PYCAIRO']: - py_env.Append(CPPDEFINES = '-DHAVE_PYCAIRO') - py_env.Append(CPPPATH = env['PYCAIRO_PATHS']) - -py_env.Append(LINKFLAGS=python_link_flag) -py_env.AppendUnique(LIBS='mapnik-json') -py_env.AppendUnique(LIBS='mapnik-wkt') - -_mapnik = py_env.LoadableModule('mapnik/_mapnik', sources, LDMODULEPREFIX='', LDMODULESUFFIX='.so') - -Depends(_mapnik, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME'])) -Depends(_mapnik, env.subst('../../src/json/libmapnik-json${LIBSUFFIX}')) -Depends(_mapnik, env.subst('../../src/wkt/libmapnik-wkt${LIBSUFFIX}')) - -if env['PLATFORM'] == 'SunOS' and env['PYTHON_IS_64BIT']: - # http://mail.python.org/pipermail/python-dev/2006-August/068528.html - cxx_module_path = os.path.join(target_path,'64') -else: - cxx_module_path = target_path - -if 'uninstall' not in COMMAND_LINE_TARGETS: - pymapniklib = env.Install(cxx_module_path,_mapnik) - py_env.Alias(target='install',source=pymapniklib) - if 'install' in COMMAND_LINE_TARGETS: - if is_py3(): - env.AddPostAction(pymapniklib, run_2to3) - - -env['create_uninstall_target'](env, target_path) -env['create_uninstall_target'](env, target_path_deprecated) diff --git a/bindings/python/mapnik/__init__.py b/bindings/python/mapnik/__init__.py deleted file mode 100644 index c39768574..000000000 --- a/bindings/python/mapnik/__init__.py +++ /dev/null @@ -1,1073 +0,0 @@ -# -# This file is part of Mapnik (C++/Python mapping toolkit) -# Copyright (C) 2014 Artem Pavlenko -# -# Mapnik is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - -"""Mapnik Python module. - -Boost Python bindings to the Mapnik C++ shared library. - -Several things happen when you do: - - >>> import mapnik - - 1) Mapnik C++ objects are imported via the '__init__.py' from the '_mapnik.so' shared object - (_mapnik.pyd on win) which references libmapnik.so (linux), libmapnik.dylib (mac), or - mapnik.dll (win32). - - 2) The paths to the input plugins and font directories are imported from the 'paths.py' - file which was constructed and installed during SCons installation. - - 3) All available input plugins and TrueType fonts are automatically registered. - - 4) Boost Python metaclass injectors are used in the '__init__.py' to extend several - objects adding extra convenience when accessed via Python. - -""" - -import itertools -import os -import warnings -try: - import json -except ImportError: - import simplejson as json - -def bootstrap_env(): - """ - If an optional settings file exists, inherit its - environment settings before loading the mapnik library. - - This feature is intended for customized packages of mapnik. - - The settings file should be a python file with an 'env' variable - that declares a dictionary of key:value pairs to push into the - global process environment, if not already set, like: - - env = {'ICU_DATA':'/usr/local/share/icu/'} - """ - if os.path.exists(os.path.join(os.path.dirname(__file__),'mapnik_settings.py')): - from mapnik_settings import env - process_keys = os.environ.keys() - for key, value in env.items(): - if key not in process_keys: - os.environ[key] = value - -bootstrap_env() - -from _mapnik import * - -import printing -printing.renderer = render - -# The base Boost.Python class -BoostPythonMetaclass = Coord.__class__ - -class _MapnikMetaclass(BoostPythonMetaclass): - def __init__(self, name, bases, dict): - for b in bases: - if type(b) not in (self, type): - for k,v in list(dict.items()): - if hasattr(b, k): - setattr(b, '_c_'+k, getattr(b, k)) - setattr(b,k,v) - return type.__init__(self, name, bases, dict) - -# metaclass injector compatible with both python 2 and 3 -# http://mikewatkins.ca/2008/11/29/python-2-and-3-metaclasses/ -_injector = _MapnikMetaclass('_injector', (object, ), {}) - -def Filter(*args,**kwargs): - warnings.warn("'Filter' is deprecated and will be removed in Mapnik 3.x, use 'Expression' instead", - DeprecationWarning, 2) - return Expression(*args, **kwargs) - -class Envelope(Box2d): - def __init__(self, *args, **kwargs): - warnings.warn("'Envelope' is deprecated and will be removed in Mapnik 3.x, use 'Box2d' instead", - DeprecationWarning, 2) - Box2d.__init__(self, *args, **kwargs) - -class _Coord(Coord,_injector): - """ - Represents a point with two coordinates (either lon/lat or x/y). - - Following operators are defined for Coord: - - Addition and subtraction of Coord objects: - - >>> Coord(10, 10) + Coord(20, 20) - Coord(30.0, 30.0) - >>> Coord(10, 10) - Coord(20, 20) - Coord(-10.0, -10.0) - - Addition, subtraction, multiplication and division between - a Coord and a float: - - >>> Coord(10, 10) + 1 - Coord(11.0, 11.0) - >>> Coord(10, 10) - 1 - Coord(-9.0, -9.0) - >>> Coord(10, 10) * 2 - Coord(20.0, 20.0) - >>> Coord(10, 10) / 2 - Coord(5.0, 5.0) - - Equality of coords (as pairwise equality of components): - >>> Coord(10, 10) is Coord(10, 10) - False - >>> Coord(10, 10) == Coord(10, 10) - True - """ - def __repr__(self): - return 'Coord(%s,%s)' % (self.x, self.y) - - def forward(self, projection): - """ - Projects the point from the geographic coordinate - space into the cartesian space. The x component is - considered to be longitude, the y component the - latitude. - - Returns the easting (x) and northing (y) as a - coordinate pair. - - Example: Project the geographic coordinates of the - city center of Stuttgart into the local - map projection (GK Zone 3/DHDN, EPSG 31467) - >>> p = Projection('+init=epsg:31467') - >>> Coord(9.1, 48.7).forward(p) - Coord(3507360.12813,5395719.2749) - """ - return forward_(self, projection) - - def inverse(self, projection): - """ - Projects the point from the cartesian space - into the geographic space. The x component is - considered to be the easting, the y component - to be the northing. - - Returns the longitude (x) and latitude (y) as a - coordinate pair. - - Example: Project the cartesian coordinates of the - city center of Stuttgart in the local - map projection (GK Zone 3/DHDN, EPSG 31467) - into geographic coordinates: - >>> p = Projection('+init=epsg:31467') - >>> Coord(3507360.12813,5395719.2749).inverse(p) - Coord(9.1, 48.7) - """ - return inverse_(self, projection) - -class _Box2d(Box2d,_injector): - """ - Represents a spatial envelope (i.e. bounding box). - - - Following operators are defined for Box2d: - - Addition: - e1 + e2 is equvalent to e1.expand_to_include(e2) but yields - a new envelope instead of modifying e1 - - Subtraction: - Currently e1 - e2 returns e1. - - Multiplication and division with floats: - Multiplication and division change the width and height of the envelope - by the given factor without modifying its center.. - - That is, e1 * x is equivalent to: - e1.width(x * e1.width()) - e1.height(x * e1.height()), - except that a new envelope is created instead of modifying e1. - - e1 / x is equivalent to e1 * (1.0/x). - - Equality: two envelopes are equal if their corner points are equal. - """ - - def __repr__(self): - return 'Box2d(%s,%s,%s,%s)' % \ - (self.minx,self.miny,self.maxx,self.maxy) - - def forward(self, projection): - """ - Projects the envelope from the geographic space - into the cartesian space by projecting its corner - points. - - See also: - Coord.forward(self, projection) - """ - return forward_(self, projection) - - def inverse(self, projection): - """ - Projects the envelope from the cartesian space - into the geographic space by projecting its corner - points. - - See also: - Coord.inverse(self, projection). - """ - return inverse_(self, projection) - -class _Projection(Projection,_injector): - - def __repr__(self): - return "Projection('%s')" % self.params() - - def forward(self,obj): - """ - Projects the given object (Box2d or Coord) - from the geographic space into the cartesian space. - - See also: - Box2d.forward(self, projection), - Coord.forward(self, projection). - """ - return forward_(obj,self) - - def inverse(self,obj): - """ - Projects the given object (Box2d or Coord) - from the cartesian space into the geographic space. - - See also: - Box2d.inverse(self, projection), - Coord.inverse(self, projection). - """ - return inverse_(obj,self) - -class _Feature(Feature,_injector): - __geo_interface__ = property(lambda self: json.loads(self.to_geojson())) - -class _Path(Path,_injector): - __geo_interface__ = property(lambda self: json.loads(self.to_geojson())) - -class _Datasource(Datasource,_injector): - - def all_features(self,fields=None,variables={}): - query = Query(self.envelope()) - query.set_variables(variables); - attributes = fields or self.fields() - for fld in attributes: - query.add_property_name(fld) - return self.features(query).features - - def featureset(self,fields=None,variables={}): - query = Query(self.envelope()) - query.set_variables(variables); - attributes = fields or self.fields() - for fld in attributes: - query.add_property_name(fld) - return self.features(query) - -class _Color(Color,_injector): - def __repr__(self): - return "Color(R=%d,G=%d,B=%d,A=%d)" % (self.r,self.g,self.b,self.a) - -class _SymbolizerBase(SymbolizerBase,_injector): - # back compatibility - @property - def filename(self): - return self['file'] - - @filename.setter - def filename(self, val): - self['file'] = val - -def _add_symbol_method_to_symbolizers(vars=globals()): - - def symbol_for_subcls(self): - return self - - def symbol_for_cls(self): - return getattr(self,self.type())() - - for name, obj in vars.items(): - if name.endswith('Symbolizer') and not name.startswith('_'): - if name == 'Symbolizer': - symbol = symbol_for_cls - else: - symbol = symbol_for_subcls - type('dummy', (obj,_injector), {'symbol': symbol}) -_add_symbol_method_to_symbolizers() - -def Datasource(**keywords): - """Wrapper around CreateDatasource. - - Create a Mapnik Datasource using a dictionary of parameters. - - Keywords must include: - - type='plugin_name' # e.g. type='gdal' - - See the convenience factory methods of each input plugin for - details on additional required keyword arguments. - - """ - - return CreateDatasource(keywords) - -# convenience factory methods - -def Shapefile(**keywords): - """Create a Shapefile Datasource. - - Required keyword arguments: - file -- path to shapefile without extension - - Optional keyword arguments: - base -- path prefix (default None) - encoding -- file encoding (default 'utf-8') - - >>> from mapnik import Shapefile, Layer - >>> shp = Shapefile(base='/home/mapnik/data',file='world_borders') - >>> lyr = Layer('Shapefile Layer') - >>> lyr.datasource = shp - - """ - keywords['type'] = 'shape' - return CreateDatasource(keywords) - -def CSV(**keywords): - """Create a CSV Datasource. - - Required keyword arguments: - file -- path to csv - - Optional keyword arguments: - inline -- inline CSV string (if provided 'file' argument will be ignored and non-needed) - base -- path prefix (default None) - encoding -- file encoding (default 'utf-8') - row_limit -- integer limit of rows to return (default: 0) - strict -- throw an error if an invalid row is encountered - escape -- The escape character to use for parsing data - quote -- The quote character to use for parsing data - separator -- The separator character to use for parsing data - headers -- A comma separated list of header names that can be set to add headers to data that lacks them - filesize_max -- The maximum filesize in MB that will be accepted - - >>> from mapnik import CSV - >>> csv = CSV(file='test.csv') - - >>> from mapnik import CSV - >>> csv = CSV(inline='''wkt,Name\n"POINT (120.15 48.47)","Winthrop, WA"''') - - For more information see https://github.com/mapnik/mapnik/wiki/CSV-Plugin - - """ - keywords['type'] = 'csv' - return CreateDatasource(keywords) - -def GeoJSON(**keywords): - """Create a GeoJSON Datasource. - - Required keyword arguments: - file -- path to json - - Optional keyword arguments: - encoding -- file encoding (default 'utf-8') - base -- path prefix (default None) - - >>> from mapnik import GeoJSON - >>> geojson = GeoJSON(file='test.json') - - """ - keywords['type'] = 'geojson' - return CreateDatasource(keywords) - -def PostGIS(**keywords): - """Create a PostGIS Datasource. - - Required keyword arguments: - dbname -- database name to connect to - table -- table name or subselect query - - *Note: if using subselects for the 'table' value consider also - passing the 'geometry_field' and 'srid' and 'extent_from_subquery' - options and/or specifying the 'geometry_table' option. - - Optional db connection keyword arguments: - user -- database user to connect as (default: see postgres docs) - password -- password for database user (default: see postgres docs) - host -- portgres hostname (default: see postgres docs) - port -- postgres port (default: see postgres docs) - initial_size -- integer size of connection pool (default: 1) - max_size -- integer max of connection pool (default: 10) - persist_connection -- keep connection open (default: True) - - Optional table-level keyword arguments: - extent -- manually specified data extent (comma delimited string, default: None) - estimate_extent -- boolean, direct PostGIS to use the faster, less accurate `estimate_extent` over `extent` (default: False) - extent_from_subquery -- boolean, direct Mapnik to query Postgis for the extent of the raw 'table' value (default: uses 'geometry_table') - geometry_table -- specify geometry table to use to look up metadata (default: automatically parsed from 'table' value) - geometry_field -- specify geometry field to use (default: first entry in geometry_columns) - srid -- specify srid to use (default: auto-detected from geometry_field) - row_limit -- integer limit of rows to return (default: 0) - cursor_size -- integer size of binary cursor to use (default: 0, no binary cursor is used) - - >>> from mapnik import PostGIS, Layer - >>> params = dict(dbname=env['MAPNIK_NAME'],table='osm',user='postgres',password='gis') - >>> params['estimate_extent'] = False - >>> params['extent'] = '-20037508,-19929239,20037508,19929239' - >>> postgis = PostGIS(**params) - >>> lyr = Layer('PostGIS Layer') - >>> lyr.datasource = postgis - - """ - keywords['type'] = 'postgis' - return CreateDatasource(keywords) - -def PgRaster(**keywords): - """Create a PgRaster Datasource. - - Required keyword arguments: - dbname -- database name to connect to - table -- table name or subselect query - - *Note: if using subselects for the 'table' value consider also - passing the 'raster_field' and 'srid' and 'extent_from_subquery' - options and/or specifying the 'raster_table' option. - - Optional db connection keyword arguments: - user -- database user to connect as (default: see postgres docs) - password -- password for database user (default: see postgres docs) - host -- portgres hostname (default: see postgres docs) - port -- postgres port (default: see postgres docs) - initial_size -- integer size of connection pool (default: 1) - max_size -- integer max of connection pool (default: 10) - persist_connection -- keep connection open (default: True) - - Optional table-level keyword arguments: - extent -- manually specified data extent (comma delimited string, default: None) - estimate_extent -- boolean, direct PostGIS to use the faster, less accurate `estimate_extent` over `extent` (default: False) - extent_from_subquery -- boolean, direct Mapnik to query Postgis for the extent of the raw 'table' value (default: uses 'geometry_table') - raster_table -- specify geometry table to use to look up metadata (default: automatically parsed from 'table' value) - raster_field -- specify geometry field to use (default: first entry in raster_columns) - srid -- specify srid to use (default: auto-detected from geometry_field) - row_limit -- integer limit of rows to return (default: 0) - cursor_size -- integer size of binary cursor to use (default: 0, no binary cursor is used) - use_overviews -- boolean, use overviews when available (default: false) - prescale_rasters -- boolean, scale rasters on the db side (default: false) - clip_rasters -- boolean, clip rasters on the db side (default: false) - band -- integer, if non-zero interprets the given band (1-based offset) as a data raster (default: 0) - - >>> from mapnik import PgRaster, Layer - >>> params = dict(dbname='mapnik',table='osm',user='postgres',password='gis') - >>> params['estimate_extent'] = False - >>> params['extent'] = '-20037508,-19929239,20037508,19929239' - >>> pgraster = PgRaster(**params) - >>> lyr = Layer('PgRaster Layer') - >>> lyr.datasource = pgraster - - """ - keywords['type'] = 'pgraster' - return CreateDatasource(keywords) - -def Raster(**keywords): - """Create a Raster (Tiff) Datasource. - - Required keyword arguments: - file -- path to stripped or tiled tiff - lox -- lowest (min) x/longitude of tiff extent - loy -- lowest (min) y/latitude of tiff extent - hix -- highest (max) x/longitude of tiff extent - hiy -- highest (max) y/latitude of tiff extent - - Hint: lox,loy,hix,hiy make a Mapnik Box2d - - Optional keyword arguments: - base -- path prefix (default None) - multi -- whether the image is in tiles on disk (default False) - - Multi-tiled keyword arguments: - x_width -- virtual image number of tiles in X direction (required) - y_width -- virtual image number of tiles in Y direction (required) - tile_size -- if an image is in tiles, how large are the tiles (default 256) - tile_stride -- if an image is in tiles, what's the increment between rows/cols (default 1) - - >>> from mapnik import Raster, Layer - >>> raster = Raster(base='/home/mapnik/data',file='elevation.tif',lox=-122.8,loy=48.5,hix=-122.7,hiy=48.6) - >>> lyr = Layer('Tiff Layer') - >>> lyr.datasource = raster - - """ - keywords['type'] = 'raster' - return CreateDatasource(keywords) - -def Gdal(**keywords): - """Create a GDAL Raster Datasource. - - Required keyword arguments: - file -- path to GDAL supported dataset - - Optional keyword arguments: - base -- path prefix (default None) - shared -- boolean, open GdalDataset in shared mode (default: False) - bbox -- tuple (minx, miny, maxx, maxy). If specified, overrides the bbox detected by GDAL. - - >>> from mapnik import Gdal, Layer - >>> dataset = Gdal(base='/home/mapnik/data',file='elevation.tif') - >>> lyr = Layer('GDAL Layer from TIFF file') - >>> lyr.datasource = dataset - - """ - keywords['type'] = 'gdal' - if 'bbox' in keywords: - if isinstance(keywords['bbox'], (tuple, list)): - keywords['bbox'] = ','.join([str(item) for item in keywords['bbox']]) - return CreateDatasource(keywords) - -def Occi(**keywords): - """Create a Oracle Spatial (10g) Vector Datasource. - - Required keyword arguments: - user -- database user to connect as - password -- password for database user - host -- oracle host to connect to (does not refer to SID in tsnames.ora) - table -- table name or subselect query - - Optional keyword arguments: - initial_size -- integer size of connection pool (default 1) - max_size -- integer max of connection pool (default 10) - extent -- manually specified data extent (comma delimited string, default None) - estimate_extent -- boolean, direct Oracle to use the faster, less accurate estimate_extent() over extent() (default False) - encoding -- file encoding (default 'utf-8') - geometry_field -- specify geometry field (default 'GEOLOC') - use_spatial_index -- boolean, force the use of the spatial index (default True) - - >>> from mapnik import Occi, Layer - >>> params = dict(host='myoracle',user='scott',password='tiger',table='test') - >>> params['estimate_extent'] = False - >>> params['extent'] = '-20037508,-19929239,20037508,19929239' - >>> oracle = Occi(**params) - >>> lyr = Layer('Oracle Spatial Layer') - >>> lyr.datasource = oracle - """ - keywords['type'] = 'occi' - return CreateDatasource(keywords) - -def Ogr(**keywords): - """Create a OGR Vector Datasource. - - Required keyword arguments: - file -- path to OGR supported dataset - layer -- name of layer to use within datasource (optional if layer_by_index or layer_by_sql is used) - - Optional keyword arguments: - layer_by_index -- choose layer by index number instead of by layer name or sql. - layer_by_sql -- choose layer by sql query number instead of by layer name or index. - base -- path prefix (default None) - encoding -- file encoding (default 'utf-8') - - >>> from mapnik import Ogr, Layer - >>> datasource = Ogr(base='/home/mapnik/data',file='rivers.geojson',layer='OGRGeoJSON') - >>> lyr = Layer('OGR Layer from GeoJSON file') - >>> lyr.datasource = datasource - - """ - keywords['type'] = 'ogr' - return CreateDatasource(keywords) - -def SQLite(**keywords): - """Create a SQLite Datasource. - - Required keyword arguments: - file -- path to SQLite database file - table -- table name or subselect query - - Optional keyword arguments: - base -- path prefix (default None) - encoding -- file encoding (default 'utf-8') - extent -- manually specified data extent (comma delimited string, default None) - metadata -- name of auxillary table containing record for table with xmin, ymin, xmax, ymax, and f_table_name - geometry_field -- name of geometry field (default 'the_geom') - key_field -- name of primary key field (default 'OGC_FID') - row_offset -- specify a custom integer row offset (default 0) - row_limit -- specify a custom integer row limit (default 0) - wkb_format -- specify a wkb type of 'spatialite' (default None) - use_spatial_index -- boolean, instruct sqlite plugin to use Rtree spatial index (default True) - - >>> from mapnik import SQLite, Layer - >>> sqlite = SQLite(base='/home/mapnik/data',file='osm.db',table='osm',extent='-20037508,-19929239,20037508,19929239') - >>> lyr = Layer('SQLite Layer') - >>> lyr.datasource = sqlite - - """ - keywords['type'] = 'sqlite' - return CreateDatasource(keywords) - -def Rasterlite(**keywords): - """Create a Rasterlite Datasource. - - Required keyword arguments: - file -- path to Rasterlite database file - table -- table name or subselect query - - Optional keyword arguments: - base -- path prefix (default None) - extent -- manually specified data extent (comma delimited string, default None) - - >>> from mapnik import Rasterlite, Layer - >>> rasterlite = Rasterlite(base='/home/mapnik/data',file='osm.db',table='osm',extent='-20037508,-19929239,20037508,19929239') - >>> lyr = Layer('Rasterlite Layer') - >>> lyr.datasource = rasterlite - - """ - keywords['type'] = 'rasterlite' - return CreateDatasource(keywords) - -def Osm(**keywords): - """Create a Osm Datasource. - - Required keyword arguments: - file -- path to OSM file - - Optional keyword arguments: - encoding -- file encoding (default 'utf-8') - url -- url to fetch data (default None) - bbox -- data bounding box for fetching data (default None) - - >>> from mapnik import Osm, Layer - >>> datasource = Osm(file='test.osm') - >>> lyr = Layer('Osm Layer') - >>> lyr.datasource = datasource - - """ - # note: parser only supports libxml2 so not exposing option - # parser -- xml parser to use (default libxml2) - keywords['type'] = 'osm' - return CreateDatasource(keywords) - -def Python(**keywords): - """Create a Python Datasource. - - >>> from mapnik import Python, PythonDatasource - >>> datasource = Python('PythonDataSource') - >>> lyr = Layer('Python datasource') - >>> lyr.datasource = datasource - """ - keywords['type'] = 'python' - return CreateDatasource(keywords) - -def MemoryDatasource(**keywords): - """Create a Memory Datasource. - - Optional keyword arguments: - (TODO) - """ - params = Parameters() - params.append(Parameter('type','memory')) - return MemoryDatasourceBase(params) - -class PythonDatasource(object): - """A base class for a Python data source. - - Optional arguments: - envelope -- a mapnik.Box2d (minx, miny, maxx, maxy) envelope of the data source, default (-180,-90,180,90) - geometry_type -- one of the DataGeometryType enumeration values, default Point - data_type -- one of the DataType enumerations, default Vector - """ - def __init__(self, envelope=None, geometry_type=None, data_type=None): - self.envelope = envelope or Box2d(-180, -90, 180, 90) - self.geometry_type = geometry_type or DataGeometryType.Point - self.data_type = data_type or DataType.Vector - - def features(self, query): - """Return an iterable which yields instances of Feature for features within the passed query. - - Required arguments: - query -- a Query instance specifying the region for which features should be returned - """ - return None - - def features_at_point(self, point): - """Rarely uses. Return an iterable which yields instances of Feature for the specified point.""" - return None - - @classmethod - def wkb_features(cls, keys, features): - """A convenience function to wrap an iterator yielding pairs of WKB format geometry and dictionaries of - key-value pairs into mapnik features. Return this from PythonDatasource.features() passing it a sequence of keys - to appear in the output and an iterator yielding features. - - For example. One might have a features() method in a derived class like the following: - - def features(self, query): - # ... create WKB features feat1 and feat2 - - return mapnik.PythonDatasource.wkb_features( - keys = ( 'name', 'author' ), - features = [ - (feat1, { 'name': 'feat1', 'author': 'alice' }), - (feat2, { 'name': 'feat2', 'author': 'bob' }), - ] - ) - - """ - ctx = Context() - [ctx.push(x) for x in keys] - - def make_it(feat, idx): - f = Feature(ctx, idx) - geom, attrs = feat - f.add_geometries_from_wkb(geom) - for k, v in attrs.iteritems(): - f[k] = v - return f - - return itertools.imap(make_it, features, itertools.count(1)) - - @classmethod - def wkt_features(cls, keys, features): - """A convenience function to wrap an iterator yielding pairs of WKT format geometry and dictionaries of - key-value pairs into mapnik features. Return this from PythonDatasource.features() passing it a sequence of keys - to appear in the output and an iterator yielding features. - - For example. One might have a features() method in a derived class like the following: - - def features(self, query): - # ... create WKT features feat1 and feat2 - - return mapnik.PythonDatasource.wkt_features( - keys = ( 'name', 'author' ), - features = [ - (feat1, { 'name': 'feat1', 'author': 'alice' }), - (feat2, { 'name': 'feat2', 'author': 'bob' }), - ] - ) - - """ - ctx = Context() - [ctx.push(x) for x in keys] - - def make_it(feat, idx): - f = Feature(ctx, idx) - geom, attrs = feat - f.add_geometries_from_wkt(geom) - for k, v in attrs.iteritems(): - f[k] = v - return f - - return itertools.imap(make_it, features, itertools.count(1)) - -class _TextSymbolizer(TextSymbolizer,_injector): - @property - def name(self): - if isinstance(self.properties.format_tree, FormattingText): - return self.properties.format_tree.text - else: - # There is no single expression which could be returned as name - raise RuntimeError("TextSymbolizer uses complex formatting features, but old compatibility interface is used to access it. Use self.properties.format_tree instead.") - - @name.setter - def name(self, name): - self.properties.format_tree = FormattingText(name) - - @property - def text_size(self): - return self.format.text_size - - @text_size.setter - def text_size(self, text_size): - self.format.text_size = text_size - - @property - def face_name(self): - return self.format.face_name - - @face_name.setter - def face_name(self, face_name): - self.format.face_name = face_name - - - @property - def fontset(self): - return self.format.fontset - - @fontset.setter - def fontset(self, fontset): - self.format.fontset = fontset - - - @property - def character_spacing(self): - return self.format.character_spacing - - @character_spacing.setter - def character_spacing(self, character_spacing): - self.format.character_spacing = character_spacing - - - @property - def line_spacing(self): - return self.format.line_spacing - - @line_spacing.setter - def line_spacing(self, line_spacing): - self.format.line_spacing = line_spacing - - - @property - def text_opacity(self): - return self.format.text_opacity - - @text_opacity.setter - def text_opacity(self, text_opacity): - self.format.text_opacity = text_opacity - - - @property - def wrap_before(self): - return self.format.wrap_before - - @wrap_before.setter - def wrap_before(self, wrap_before): - self.format.wrap_before = wrap_before - - - @property - def text_transform(self): - return self.format.text_transform - - @text_transform.setter - def text_transform(self, text_transform): - self.format.text_transform = text_transform - - - @property - def fill(self): - return self.format.fill - - @fill.setter - def fill(self, fill): - self.format.fill = fill - - - @property - def halo_fill(self): - return self.format.halo_fill - - @halo_fill.setter - def halo_fill(self, halo_fill): - self.format.halo_fill = halo_fill - - - - @property - def halo_radius(self): - return self.format.halo_radius - - @halo_radius.setter - def halo_radius(self, halo_radius): - self.format.halo_radius = halo_radius - - - @property - def label_placement(self): - return self.properties.label_placement - - @label_placement.setter - def label_placement(self, label_placement): - self.properties.label_placement = label_placement - - - - @property - def horizontal_alignment(self): - return self.properties.horizontal_alignment - - @horizontal_alignment.setter - def horizontal_alignment(self, horizontal_alignment): - self.properties.horizontal_alignment = horizontal_alignment - - - - @property - def justify_alignment(self): - return self.properties.justify_alignment - - @justify_alignment.setter - def justify_alignment(self, justify_alignment): - self.properties.justify_alignment = justify_alignment - - - - @property - def vertical_alignment(self): - return self.properties.vertical_alignment - - @vertical_alignment.setter - def vertical_alignment(self, vertical_alignment): - self.properties.vertical_alignment = vertical_alignment - - - - @property - def orientation(self): - return self.properties.orientation - - @orientation.setter - def orientation(self, orientation): - self.properties.orientation = orientation - - - - @property - def displacement(self): - return self.properties.displacement - - @displacement.setter - def displacement(self, displacement): - self.properties.displacement = displacement - - - - @property - def label_spacing(self): - return self.properties.label_spacing - - @label_spacing.setter - def label_spacing(self, label_spacing): - self.properties.label_spacing = label_spacing - - - - @property - def label_position_tolerance(self): - return self.properties.label_position_tolerance - - @label_position_tolerance.setter - def label_position_tolerance(self, label_position_tolerance): - self.properties.label_position_tolerance = label_position_tolerance - - - - @property - def avoid_edges(self): - return self.properties.avoid_edges - - @avoid_edges.setter - def avoid_edges(self, avoid_edges): - self.properties.avoid_edges = avoid_edges - - - - @property - def minimum_distance(self): - return self.properties.minimum_distance - - @minimum_distance.setter - def minimum_distance(self, minimum_distance): - self.properties.minimum_distance = minimum_distance - - - - @property - def minimum_padding(self): - return self.properties.minimum_padding - - @minimum_padding.setter - def minimum_padding(self, minimum_padding): - self.properties.minimum_padding = minimum_padding - - - - @property - def minimum_path_length(self): - return self.properties.minimum_path_length - - @minimum_path_length.setter - def minimum_path_length(self, minimum_path_length): - self.properties.minimum_path_length = minimum_path_length - - - - @property - def maximum_angle_char_delta(self): - return self.properties.maximum_angle_char_delta - - @maximum_angle_char_delta.setter - def maximum_angle_char_delta(self, maximum_angle_char_delta): - self.properties.maximum_angle_char_delta = maximum_angle_char_delta - - - @property - def allow_overlap(self): - return self.properties.allow_overlap - - @allow_overlap.setter - def allow_overlap(self, allow_overlap): - self.properties.allow_overlap = allow_overlap - - - - @property - def text_ratio(self): - return self.properties.text_ratio - - @text_ratio.setter - def text_ratio(self, text_ratio): - self.properties.text_ratio = text_ratio - - - - @property - def wrap_width(self): - return self.properties.wrap_width - - @wrap_width.setter - def wrap_width(self, wrap_width): - self.properties.wrap_width = wrap_width - - -def mapnik_version_from_string(version_string): - """Return the Mapnik version from a string.""" - n = version_string.split('.') - return (int(n[0]) * 100000) + (int(n[1]) * 100) + (int(n[2])); - -def register_plugins(path=None): - """Register plugins located by specified path""" - if not path: - if os.environ.has_key('MAPNIK_INPUT_PLUGINS_DIRECTORY'): - path = os.environ.get('MAPNIK_INPUT_PLUGINS_DIRECTORY') - else: - from paths import inputpluginspath - path = inputpluginspath - DatasourceCache.register_datasources(path) - -def register_fonts(path=None,valid_extensions=['.ttf','.otf','.ttc','.pfa','.pfb','.ttc','.dfont','.woff']): - """Recursively register fonts using path argument as base directory""" - if not path: - if os.environ.has_key('MAPNIK_FONT_DIRECTORY'): - path = os.environ.get('MAPNIK_FONT_DIRECTORY') - else: - from paths import fontscollectionpath - path = fontscollectionpath - for dirpath, _, filenames in os.walk(path): - for filename in filenames: - if os.path.splitext(filename.lower())[1] in valid_extensions: - FontEngine.instance().register_font(os.path.join(dirpath, filename)) - -# auto-register known plugins and fonts -register_plugins() -register_fonts() diff --git a/bindings/python/mapnik/printing.py b/bindings/python/mapnik/printing.py deleted file mode 100644 index 87101eae9..000000000 --- a/bindings/python/mapnik/printing.py +++ /dev/null @@ -1,1027 +0,0 @@ -# -*- coding: utf-8 -*- - -"""Mapnik classes to assist in creating printable maps - -basic usage is along the lines of - -import mapnik - -page = mapnik.printing.PDFPrinter() -m = mapnik.Map(100,100) -mapnik.load_map(m, "my_xml_map_description", True) -m.zoom_all() -page.render_map(m,"my_output_file.pdf") - -see the documentation of mapnik.printing.PDFPrinter() for options - -""" -from __future__ import absolute_import - -from . import render, Map, Box2d, Layer, Feature, Projection, Coord, Style, Geometry2d -import math -import os -import tempfile - -try: - import cairo - HAS_PYCAIRO_MODULE = True -except ImportError: - HAS_PYCAIRO_MODULE = False - -try: - import pangocairo - import pango - HAS_PANGOCAIRO_MODULE = True -except ImportError: - HAS_PANGOCAIRO_MODULE = False - -try: - import pyPdf - HAS_PYPDF = True -except ImportError: - HAS_PYPDF = False - -class centering: - """Style of centering to use with the map, the default is constrained - - none: map will be placed flush with the margin/box in the top left corner - constrained: map will be centered on the most constrained axis (for a portrait page - and a square map this will be horizontally) - unconstrained: map will be centered on the unconstrained axis - vertical: - horizontal: - both: - """ - none=0 - constrained=1 - unconstrained=2 - vertical=3 - horizontal=4 - both=5 - -"""Some predefined page sizes custom sizes can also be passed -a tuple of the page width and height in meters""" -pagesizes = { - "a0": (0.841000,1.189000), - "a0l": (1.189000,0.841000), - "b0": (1.000000,1.414000), - "b0l": (1.414000,1.000000), - "c0": (0.917000,1.297000), - "c0l": (1.297000,0.917000), - "a1": (0.594000,0.841000), - "a1l": (0.841000,0.594000), - "b1": (0.707000,1.000000), - "b1l": (1.000000,0.707000), - "c1": (0.648000,0.917000), - "c1l": (0.917000,0.648000), - "a2": (0.420000,0.594000), - "a2l": (0.594000,0.420000), - "b2": (0.500000,0.707000), - "b2l": (0.707000,0.500000), - "c2": (0.458000,0.648000), - "c2l": (0.648000,0.458000), - "a3": (0.297000,0.420000), - "a3l": (0.420000,0.297000), - "b3": (0.353000,0.500000), - "b3l": (0.500000,0.353000), - "c3": (0.324000,0.458000), - "c3l": (0.458000,0.324000), - "a4": (0.210000,0.297000), - "a4l": (0.297000,0.210000), - "b4": (0.250000,0.353000), - "b4l": (0.353000,0.250000), - "c4": (0.229000,0.324000), - "c4l": (0.324000,0.229000), - "a5": (0.148000,0.210000), - "a5l": (0.210000,0.148000), - "b5": (0.176000,0.250000), - "b5l": (0.250000,0.176000), - "c5": (0.162000,0.229000), - "c5l": (0.229000,0.162000), - "a6": (0.105000,0.148000), - "a6l": (0.148000,0.105000), - "b6": (0.125000,0.176000), - "b6l": (0.176000,0.125000), - "c6": (0.114000,0.162000), - "c6l": (0.162000,0.114000), - "a7": (0.074000,0.105000), - "a7l": (0.105000,0.074000), - "b7": (0.088000,0.125000), - "b7l": (0.125000,0.088000), - "c7": (0.081000,0.114000), - "c7l": (0.114000,0.081000), - "a8": (0.052000,0.074000), - "a8l": (0.074000,0.052000), - "b8": (0.062000,0.088000), - "b8l": (0.088000,0.062000), - "c8": (0.057000,0.081000), - "c8l": (0.081000,0.057000), - "a9": (0.037000,0.052000), - "a9l": (0.052000,0.037000), - "b9": (0.044000,0.062000), - "b9l": (0.062000,0.044000), - "c9": (0.040000,0.057000), - "c9l": (0.057000,0.040000), - "a10": (0.026000,0.037000), - "a10l": (0.037000,0.026000), - "b10": (0.031000,0.044000), - "b10l": (0.044000,0.031000), - "c10": (0.028000,0.040000), - "c10l": (0.040000,0.028000), - "letter": (0.216,0.279), - "letterl": (0.279,0.216), - "legal": (0.216,0.356), - "legall": (0.356,0.216), -} -"""size of a pt in meters""" -pt_size=0.0254/72.0 - -def m2pt(x): - """convert distance from meters to points""" - return x/pt_size - -def pt2m(x): - """convert distance from points to meters""" - return x*pt_size - -def m2in(x): - """convert distance from meters to inches""" - return x/0.0254 - -def m2px(x,resolution): - """convert distance from meters to pixels at the given resolution in DPI/PPI""" - return m2in(x)*resolution - -class resolutions: - """some predefined resolutions in DPI""" - dpi72=72 - dpi150=150 - dpi300=300 - dpi600=600 - -def any_scale(scale): - """Scale helper function that allows any scale""" - return scale - -def sequence_scale(scale,scale_sequence): - """Default scale helper, this rounds scale to a 'sensible' value""" - factor = math.floor(math.log10(scale)) - norm = scale/(10**factor) - - for s in scale_sequence: - if norm <= s: - return s*10**factor - return scale_sequence[0]*10**(factor+1) - -def default_scale(scale): - """Default scale helper, this rounds scale to a 'sensible' value""" - return sequence_scale(scale, (1,1.25,1.5,1.75,2,2.5,3,4,5,6,7.5,8,9,10)) - -def deg_min_sec_scale(scale): - for x in (1.0/3600, - 2.0/3600, - 5.0/3600, - 10.0/3600, - 30.0/3600, - 1.0/60, - 2.0/60, - 5.0/60, - 10.0/60, - 30.0/60, - 1, - 2, - 5, - 10, - 30, - 60 - ): - if scale < x: - return x - else: - return x - -def format_deg_min_sec(value): - deg = math.floor(value) - min = math.floor((value-deg)/(1.0/60)) - sec = int((value - deg*1.0/60)/1.0/3600) - return "%d°%d'%d\"" % (deg,min,sec) - -def round_grid_generator(first,last,step): - val = (math.floor(first / step) + 1) * step - yield val - while val < last: - val += step - yield val - - -def convert_pdf_pages_to_layers(filename,output_name=None,layer_names=(),reverse_all_but_last=True): - """ - opens the given multipage PDF and converts each page to be a layer in a single page PDF - layer_names should be a sequence of the user visible names of the layers, if not given - or if shorter than num pages generic names will be given to the unnamed layers - - if output_name is not provided a temporary file will be used for the conversion which - will then be copied back over the source file. - - requires pyPdf >= 1.13 to be available""" - - - if not HAS_PYPDF: - raise Exception("pyPdf Not available") - - infile = file(filename, 'rb') - if output_name: - outfile = file(output_name, 'wb') - else: - (outfd,outfilename) = tempfile.mkstemp(dir=os.path.dirname(filename)) - outfile = os.fdopen(outfd,'wb') - - i = pyPdf.PdfFileReader(infile) - o = pyPdf.PdfFileWriter() - - template_page_size = i.pages[0].mediaBox - op = o.addBlankPage(width=template_page_size.getWidth(),height=template_page_size.getHeight()) - - contentkey = pyPdf.generic.NameObject('/Contents') - resourcekey = pyPdf.generic.NameObject('/Resources') - propertieskey = pyPdf.generic.NameObject('/Properties') - op[contentkey] = pyPdf.generic.ArrayObject() - op[resourcekey] = pyPdf.generic.DictionaryObject() - properties = pyPdf.generic.DictionaryObject() - ocgs = pyPdf.generic.ArrayObject() - - for (i, p) in enumerate(i.pages): - # first start an OCG for the layer - ocgname = pyPdf.generic.NameObject('/oc%d' % i) - ocgstart = pyPdf.generic.DecodedStreamObject() - ocgstart._data = "/OC %s BDC\n" % ocgname - ocgend = pyPdf.generic.DecodedStreamObject() - ocgend._data = "EMC\n" - if isinstance(p['/Contents'],pyPdf.generic.ArrayObject): - p[pyPdf.generic.NameObject('/Contents')].insert(0,ocgstart) - p[pyPdf.generic.NameObject('/Contents')].append(ocgend) - else: - p[pyPdf.generic.NameObject('/Contents')] = pyPdf.generic.ArrayObject((ocgstart,p['/Contents'],ocgend)) - - op.mergePage(p) - - ocg = pyPdf.generic.DictionaryObject() - ocg[pyPdf.generic.NameObject('/Type')] = pyPdf.generic.NameObject('/OCG') - if len(layer_names) > i: - ocg[pyPdf.generic.NameObject('/Name')] = pyPdf.generic.TextStringObject(layer_names[i]) - else: - ocg[pyPdf.generic.NameObject('/Name')] = pyPdf.generic.TextStringObject('Layer %d' % (i+1)) - indirect_ocg = o._addObject(ocg) - properties[ocgname] = indirect_ocg - ocgs.append(indirect_ocg) - - op[resourcekey][propertieskey] = o._addObject(properties) - - ocproperties = pyPdf.generic.DictionaryObject() - ocproperties[pyPdf.generic.NameObject('/OCGs')] = ocgs - defaultview = pyPdf.generic.DictionaryObject() - defaultview[pyPdf.generic.NameObject('/Name')] = pyPdf.generic.TextStringObject('Default') - defaultview[pyPdf.generic.NameObject('/BaseState ')] = pyPdf.generic.NameObject('/ON ') - defaultview[pyPdf.generic.NameObject('/ON')] = ocgs - if reverse_all_but_last: - defaultview[pyPdf.generic.NameObject('/Order')] = pyPdf.generic.ArrayObject(reversed(ocgs[:-1])) - defaultview[pyPdf.generic.NameObject('/Order')].append(ocgs[-1]) - else: - defaultview[pyPdf.generic.NameObject('/Order')] = pyPdf.generic.ArrayObject(reversed(ocgs)) - defaultview[pyPdf.generic.NameObject('/OFF')] = pyPdf.generic.ArrayObject() - - ocproperties[pyPdf.generic.NameObject('/D')] = o._addObject(defaultview) - - o._root.getObject()[pyPdf.generic.NameObject('/OCProperties')] = o._addObject(ocproperties) - - o.write(outfile) - - outfile.close() - infile.close() - - if not output_name: - os.rename(outfilename, filename) - -class PDFPrinter: - """Main class for creating PDF print outs, basically contruct an instance - with appropriate options and then call render_map with your mapnik map - """ - def __init__(self, - pagesize=pagesizes["a4"], - margin=0.005, - box=None, - percent_box=None, - scale=default_scale, - resolution=resolutions.dpi72, - preserve_aspect=True, - centering=centering.constrained, - is_latlon=False, - use_ocg_layers=False): - """Creates a cairo surface and context to render a PDF with. - - pagesize: tuple of page size in meters, see predefined sizes in pagessizes dict (default a4) - margin: page margin in meters (default 0.01) - box: box within the page to render the map into (will not render over margin). This should be - a Mapnik Box2d object. Default is the full page within the margin - percent_box: as per box, but specified as a percent (0->1) of the full page size. If both box - and percent_box are specified percent_box will be used. - scale: scale helper to use when rounding the map scale. This should be a function that - takes a single float and returns a float which is at least as large as the value - passed in. This is a 1:x scale. - resolution: the resolution to render non vector elements at (in DPI), defaults to 72 DPI - preserve_aspect: whether to preserve map aspect ratio. This defaults to True and it - is recommended you do not change it unless you know what you are doing - scales and so on will not work if this is False. - centering: Centering rules for maps where the scale rounding has reduced the map size. - This should be a value from the centering class. The default is to center on the - maps constrained axis, typically this will be horizontal for portrait pages and - vertical for landscape pages. - is_latlon: Is the map in lat lon degrees. If true magic anti meridian logic is enabled - use_ocg_layers: Create OCG layers in the PDF, requires pyPdf >= 1.13 - """ - self._pagesize = pagesize - self._margin = margin - self._box = box - self._scale = scale - self._resolution = resolution - self._preserve_aspect = preserve_aspect - self._centering = centering - self._is_latlon = is_latlon - self._use_ocg_layers = use_ocg_layers - - self._s = None - self._layer_names = [] - self._filename = None - - self.map_box = None - self.scale = None - - # don't both to round the scale if they are not preserving the aspect ratio - if not preserve_aspect: - self._scale = any_scale - - if percent_box: - self._box = Box2d(percent_box[0]*pagesize[0],percent_box[1]*pagesize[1], - percent_box[2]*pagesize[0],percent_box[3]*pagesize[1]) - - if not HAS_PYCAIRO_MODULE: - raise Exception("PDF rendering only available when pycairo is available") - - self.font_name = "DejaVu Sans" - - def finish(self): - if self._s: - self._s.finish() - self._s = None - - if self._use_ocg_layers: - convert_pdf_pages_to_layers(self._filename,layer_names=self._layer_names + ["Legend and Information"],reverse_all_but_last=True) - - def add_geospatial_pdf_header(self,m,filename,epsg=None,wkt=None): - """ Postprocessing step to add geospatial PDF information to PDF file as per - PDF standard 1.7 extension level 3 (also in draft PDF v2 standard at time of writing) - - one of either the epsg code or wkt text for the projection must be provided - - Should be called *after* the page has had .finish() called""" - if HAS_PYPDF and (epsg or wkt): - infile=file(filename,'rb') - (outfd,outfilename) = tempfile.mkstemp(dir=os.path.dirname(filename)) - outfile = os.fdopen(outfd,'wb') - - i=pyPdf.PdfFileReader(infile) - o=pyPdf.PdfFileWriter() - - # preserve OCProperties at document root if we have one - if i.trailer['/Root'].has_key(pyPdf.generic.NameObject('/OCProperties')): - o._root.getObject()[pyPdf.generic.NameObject('/OCProperties')] = i.trailer['/Root'].getObject()[pyPdf.generic.NameObject('/OCProperties')] - - for p in i.pages: - gcs = pyPdf.generic.DictionaryObject() - gcs[pyPdf.generic.NameObject('/Type')]=pyPdf.generic.NameObject('/PROJCS') - if epsg: - gcs[pyPdf.generic.NameObject('/EPSG')]=pyPdf.generic.NumberObject(int(epsg)) - if wkt: - gcs[pyPdf.generic.NameObject('/WKT')]=pyPdf.generic.TextStringObject(wkt) - - measure = pyPdf.generic.DictionaryObject() - measure[pyPdf.generic.NameObject('/Type')]=pyPdf.generic.NameObject('/Measure') - measure[pyPdf.generic.NameObject('/Subtype')]=pyPdf.generic.NameObject('/GEO') - measure[pyPdf.generic.NameObject('/GCS')]=gcs - bounds=pyPdf.generic.ArrayObject() - for x in (0.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0): - bounds.append(pyPdf.generic.FloatObject(str(x))) - measure[pyPdf.generic.NameObject('/Bounds')]=bounds - measure[pyPdf.generic.NameObject('/LPTS')]=bounds - gpts=pyPdf.generic.ArrayObject() - - proj=Projection(m.srs) - env=m.envelope() - for x in ((env.minx, env.miny), (env.minx, env.maxy), (env.maxx, env.maxy), (env.maxx, env.miny)): - latlon_corner=proj.inverse(Coord(*x)) - # these are in lat,lon order according to the standard - gpts.append(pyPdf.generic.FloatObject(str(latlon_corner.y))) - gpts.append(pyPdf.generic.FloatObject(str(latlon_corner.x))) - measure[pyPdf.generic.NameObject('/GPTS')]=gpts - - vp=pyPdf.generic.DictionaryObject() - vp[pyPdf.generic.NameObject('/Type')]=pyPdf.generic.NameObject('/Viewport') - bbox=pyPdf.generic.ArrayObject() - - for x in self.map_box: - bbox.append(pyPdf.generic.FloatObject(str(x))) - vp[pyPdf.generic.NameObject('/BBox')]=bbox - vp[pyPdf.generic.NameObject('/Measure')]=measure - - vpa = pyPdf.generic.ArrayObject() - vpa.append(vp) - p[pyPdf.generic.NameObject('/VP')]=vpa - o.addPage(p) - - o.write(outfile) - infile=None - outfile.close() - os.rename(outfilename,filename) - - - def get_context(self): - """allow access so that extra 'bits' can be rendered to the page directly""" - return cairo.Context(self._s) - - def get_width(self): - return self._pagesize[0] - - def get_height(self): - return self._pagesize[1] - - def get_margin(self): - return self._margin - - def write_text(self,ctx,text,box_width=None,size=10, fill_color=(0.0, 0.0, 0.0), alignment=None): - if HAS_PANGOCAIRO_MODULE: - (attr,t,accel) = pango.parse_markup(text) - pctx = pangocairo.CairoContext(ctx) - l = pctx.create_layout() - l.set_attributes(attr) - fd = pango.FontDescription("%s %d" % (self.font_name,size)) - l.set_font_description(fd) - if box_width: - l.set_width(int(box_width*pango.SCALE)) - if alignment: - l.set_alignment(alignment) - pctx.update_layout(l) - l.set_text(t) - pctx.set_source_rgb(*fill_color) - pctx.show_layout(l) - return l.get_pixel_extents()[0] - - else: - ctx.rel_move_to(0,size) - ctx.select_font_face(self.font_name, cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL) - ctx.set_font_size(size) - ctx.show_text(text) - ctx.rel_move_to(0,size) - return (0,0,len(text)*size,size) - - def _get_context(self): - if HAS_PANGOCAIRO_MODULE: - return - elif HAS_PYCAIRO_MODULE: - return cairo.Context(self._s) - return None - - def _get_render_area(self): - """return a bounding box with the area of the page we are allowed to render out map to - in page coordinates (i.e. meters) - """ - # take off our page margins - render_area = Box2d(self._margin,self._margin,self._pagesize[0]-self._margin,self._pagesize[1]-self._margin) - - #then if user specified a box to render get intersection with that - if self._box: - return render_area.intersect(self._box) - - return render_area - - def _get_render_area_size(self): - """Get the width and height (in meters) of the area we can render the map to, returned as a tuple""" - render_area = self._get_render_area() - return (render_area.width(),render_area.height()) - - def _is_h_contrained(self,m): - """Test if the map size is constrained on the horizontal or vertical axes""" - available_area = self._get_render_area_size() - map_aspect = m.envelope().width()/m.envelope().height() - page_aspect = available_area[0]/available_area[1] - - return map_aspect > page_aspect - - def _get_meta_info_corner(self,render_size,m): - """Get the corner (in page coordinates) of a possibly - sensible place to render metadata such as a legend or scale""" - (x,y) = self._get_render_corner(render_size,m) - if self._is_h_contrained(m): - y += render_size[1]+0.005 - x = self._margin - else: - x += render_size[0]+0.005 - y = self._margin - - return (x,y) - - def _get_render_corner(self,render_size,m): - """Get the corner of the box we should render our map into""" - available_area = self._get_render_area() - - x=available_area[0] - y=available_area[1] - - h_is_contrained = self._is_h_contrained(m) - - if (self._centering == centering.both or - self._centering == centering.horizontal or - (self._centering == centering.constrained and h_is_contrained) or - (self._centering == centering.unconstrained and not h_is_contrained)): - x+=(available_area.width()-render_size[0])/2 - - if (self._centering == centering.both or - self._centering == centering.vertical or - (self._centering == centering.constrained and not h_is_contrained) or - (self._centering == centering.unconstrained and h_is_contrained)): - y+=(available_area.height()-render_size[1])/2 - return (x,y) - - def _get_map_pixel_size(self, width_page_m, height_page_m): - """for a given map size in paper coordinates return a tuple of the map 'pixel' size we - should create at the defined resolution""" - return (int(m2px(width_page_m,self._resolution)), int(m2px(height_page_m,self._resolution))) - - def render_map(self,m, filename): - """Render the given map to filename""" - - # store this for later so we can post process the PDF - self._filename = filename - - # work out the best scale to render out map at given the available space - (eff_width,eff_height) = self._get_render_area_size() - map_aspect = m.envelope().width()/m.envelope().height() - page_aspect = eff_width/eff_height - - scalex=m.envelope().width()/eff_width - scaley=m.envelope().height()/eff_height - - scale=max(scalex,scaley) - - rounded_mapscale=self._scale(scale) - scalefactor = scale/rounded_mapscale - mapw=eff_width*scalefactor - maph=eff_height*scalefactor - if self._preserve_aspect: - if map_aspect > page_aspect: - maph=mapw*(1/map_aspect) - else: - mapw=maph*map_aspect - - # set the map size so that raster elements render at the correct resolution - m.resize(*self._get_map_pixel_size(mapw,maph)) - # calculate the translation for the map starting point - (tx,ty) = self._get_render_corner((mapw,maph),m) - - # create our cairo surface and context and then render the map into it - self._s = cairo.PDFSurface(filename, m2pt(self._pagesize[0]),m2pt(self._pagesize[1])) - ctx=cairo.Context(self._s) - - for l in m.layers: - # extract the layer names for naming layers if we use OCG - self._layer_names.append(l.name) - - layer_map = Map(m.width,m.height,m.srs) - layer_map.layers.append(l) - for s in l.styles: - layer_map.append_style(s,m.find_style(s)) - layer_map.zoom_to_box(m.envelope()) - - def render_map(): - ctx.save() - ctx.translate(m2pt(tx),m2pt(ty)) - #cairo defaults to 72dpi - ctx.scale(72.0/self._resolution,72.0/self._resolution) - render(layer_map, ctx) - ctx.restore() - - # antimeridian - render_map() - if self._is_latlon and (m.envelope().minx < -180 or m.envelope().maxx > 180): - old_env = m.envelope() - if m.envelope().minx < -180: - delta = 360 - else: - delta = -360 - m.zoom_to_box(Box2d(old_env.minx+delta,old_env.miny,old_env.maxx+delta,old_env.maxy)) - render_map() - # restore the original env - m.zoom_to_box(old_env) - - if self._use_ocg_layers: - self._s.show_page() - - self.scale = rounded_mapscale - self.map_box = Box2d(tx,ty,tx+mapw,ty+maph) - - def render_on_map_lat_lon_grid(self,m,dec_degrees=True): - # don't render lat_lon grid if we are already in latlon - if self._is_latlon: - return - p2=Projection(m.srs) - - latlon_bounds = p2.inverse(m.envelope()) - if p2.inverse(m.envelope().center()).x > latlon_bounds.maxx: - latlon_bounds = Box2d(latlon_bounds.maxx,latlon_bounds.miny,latlon_bounds.minx+360,latlon_bounds.maxy) - - if p2.inverse(m.envelope().center()).y > latlon_bounds.maxy: - latlon_bounds = Box2d(latlon_bounds.miny,latlon_bounds.maxy,latlon_bounds.maxx,latlon_bounds.miny+360) - - latlon_mapwidth = latlon_bounds.width() - # render an extra 20% so we generally won't miss the ends of lines - latlon_buffer = 0.2*latlon_mapwidth - if dec_degrees: - latlon_divsize = default_scale(latlon_mapwidth/7.0) - else: - latlon_divsize = deg_min_sec_scale(latlon_mapwidth/7.0) - latlon_interpsize = latlon_mapwidth/m.width - - self._render_lat_lon_axis(m,p2,latlon_bounds.minx,latlon_bounds.maxx,latlon_bounds.miny,latlon_bounds.maxy,latlon_buffer,latlon_interpsize,latlon_divsize,dec_degrees,True) - self._render_lat_lon_axis(m,p2,latlon_bounds.miny,latlon_bounds.maxy,latlon_bounds.minx,latlon_bounds.maxx,latlon_buffer,latlon_interpsize,latlon_divsize,dec_degrees,False) - - def _render_lat_lon_axis(self,m,p2,x1,x2,y1,y2,latlon_buffer,latlon_interpsize,latlon_divsize,dec_degrees,is_x_axis): - ctx=cairo.Context(self._s) - ctx.set_source_rgb(1,0,0) - ctx.set_line_width(1) - latlon_labelsize = 6 - - ctx.translate(m2pt(self.map_box.minx),m2pt(self.map_box.miny)) - ctx.rectangle(0,0,m2pt(self.map_box.width()),m2pt(self.map_box.height())) - ctx.clip() - - ctx.select_font_face("DejaVu", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL) - ctx.set_font_size(latlon_labelsize) - - box_top = self.map_box.height() - if not is_x_axis: - ctx.translate(m2pt(self.map_box.width()/2),m2pt(self.map_box.height()/2)) - ctx.rotate(-math.pi/2) - ctx.translate(-m2pt(self.map_box.height()/2),-m2pt(self.map_box.width()/2)) - box_top = self.map_box.width() - - for xvalue in round_grid_generator(x1 - latlon_buffer,x2 + latlon_buffer,latlon_divsize): - yvalue = y1 - latlon_buffer - start_cross = None - end_cross = None - while yvalue < y2+latlon_buffer: - if is_x_axis: - start = m.view_transform().forward(p2.forward(Coord(xvalue,yvalue))) - else: - temp = m.view_transform().forward(p2.forward(Coord(yvalue,xvalue))) - start = Coord(m2pt(self.map_box.height())-temp.y,temp.x) - yvalue += latlon_interpsize - if is_x_axis: - end = m.view_transform().forward(p2.forward(Coord(xvalue,yvalue))) - else: - temp = m.view_transform().forward(p2.forward(Coord(yvalue,xvalue))) - end = Coord(m2pt(self.map_box.height())-temp.y,temp.x) - - ctx.move_to(start.x,start.y) - ctx.line_to(end.x,end.y) - ctx.stroke() - - if cmp(start.y, 0) != cmp(end.y,0): - start_cross = end.x - if cmp(start.y,m2pt(self.map_box.height())) != cmp(end.y, m2pt(self.map_box.height())): - end_cross = end.x - - if dec_degrees: - line_text = "%g" % (xvalue) - else: - line_text = format_deg_min_sec(xvalue) - if start_cross: - ctx.move_to(start_cross+2,latlon_labelsize) - ctx.show_text(line_text) - if end_cross: - ctx.move_to(end_cross+2,m2pt(box_top)-2) - ctx.show_text(line_text) - - def render_on_map_scale(self,m): - (div_size,page_div_size) = self._get_sensible_scalebar_size(m) - - first_value_x = (math.floor(m.envelope().minx / div_size) + 1) * div_size - first_value_x_percent = (first_value_x-m.envelope().minx)/m.envelope().width() - self._render_scale_axis(first_value_x,first_value_x_percent,self.map_box.minx,self.map_box.maxx,page_div_size,div_size,self.map_box.miny,self.map_box.maxy,True) - - first_value_y = (math.floor(m.envelope().miny / div_size) + 1) * div_size - first_value_y_percent = (first_value_y-m.envelope().miny)/m.envelope().height() - self._render_scale_axis(first_value_y,first_value_y_percent,self.map_box.miny,self.map_box.maxy,page_div_size,div_size,self.map_box.minx,self.map_box.maxx,False) - - if self._use_ocg_layers: - self._s.show_page() - self._layer_names.append("Coordinate Grid Overlay") - - def _get_sensible_scalebar_size(self,m,width=-1): - # aim for about 8 divisions across the map - # also make sure we can fit the bar with in page area width if specified - div_size = sequence_scale(m.envelope().width()/8, [1,2,5]) - page_div_size = self.map_box.width()*div_size/m.envelope().width() - while width > 0 and page_div_size > width: - div_size /=2 - page_div_size /= 2 - return (div_size,page_div_size) - - def _render_box(self,ctx,x,y,w,h,text=None,stroke_color=(0,0,0),fill_color=(0,0,0)): - ctx.set_line_width(1) - ctx.set_source_rgb(*fill_color) - ctx.rectangle(x,y,w,h) - ctx.fill() - - ctx.set_source_rgb(*stroke_color) - ctx.rectangle(x,y,w,h) - ctx.stroke() - - if text: - ctx.move_to(x+1,y) - self.write_text(ctx,text,fill_color=[1-z for z in fill_color],size=h-2) - - def _render_scale_axis(self,first,first_percent,start,end,page_div_size,div_size,boundary_start,boundary_end,is_x_axis): - prev = start - text = None - fill=(0,0,0) - border_size=8 - value = first_percent * (end-start) + start - label_value = first-div_size - if self._is_latlon and label_value < -180: - label_value += 360 - - ctx=cairo.Context(self._s) - - if not is_x_axis: - ctx.translate(m2pt(self.map_box.center().x),m2pt(self.map_box.center().y)) - ctx.rotate(-math.pi/2) - ctx.translate(-m2pt(self.map_box.center().y),-m2pt(self.map_box.center().x)) - - while value < end: - ctx.move_to(m2pt(value),m2pt(boundary_start)) - ctx.line_to(m2pt(value),m2pt(boundary_end)) - ctx.set_source_rgb(0.5,0.5,0.5) - ctx.set_line_width(1) - ctx.stroke() - - for bar in (m2pt(boundary_start)-border_size,m2pt(boundary_end)): - self._render_box(ctx,m2pt(prev),bar,m2pt(value-prev),border_size,text,fill_color=fill) - - prev = value - value+=page_div_size - fill = [1-z for z in fill] - label_value += div_size - if self._is_latlon and label_value > 180: - label_value -= 360 - text = "%d" % label_value - else: - for bar in (m2pt(boundary_start)-border_size,m2pt(boundary_end)): - self._render_box(ctx,m2pt(prev),bar,m2pt(end-prev),border_size,fill_color=fill) - - - def render_scale(self,m,ctx=None,width=0.05): - """ m: map to render scale for - ctx: A cairo context to render the scale to. If this is None (the default) then - automatically create a context and choose the best location for the scale bar. - width: Width of area available to render scale bar in (in m) - - will return the size of the rendered scale block in pts - """ - - (w,h) = (0,0) - - # don't render scale if we are lat lon - # dont report scale if we have warped the aspect ratio - if self._preserve_aspect and not self._is_latlon: - bar_size=8.0 - box_count=3 - if ctx is None: - ctx=cairo.Context(self._s) - (tx,ty) = self._get_meta_info_corner((self.map_box.width(),self.map_box.height()),m) - ctx.translate(tx,ty) - - (div_size,page_div_size) = self._get_sensible_scalebar_size(m, width/box_count) - - - div_unit = "m" - if div_size > 1000: - div_size /= 1000 - div_unit = "km" - - text = "0%s" % div_unit - ctx.save() - if width > 0: - ctx.translate(m2pt(width-box_count*page_div_size)/2,0) - for ii in range(box_count): - fill=(ii%2,)*3 - self._render_box(ctx, m2pt(ii*page_div_size), h, m2pt(page_div_size), bar_size, text, fill_color=fill) - fill = [1-z for z in fill] - text = "%g%s" % ((ii+1)*div_size,div_unit) - #else: - # self._render_box(ctx, m2pt(box_count*page_div_size), h, m2pt(page_div_size), bar_size, text, fill_color=(1,1,1), stroke_color=(1,1,1)) - w = (box_count)*page_div_size - h += bar_size - ctx.restore() - - if width > 0: - box_width=m2pt(width) - else: - box_width = None - - font_size=6 - ctx.move_to(0,h) - if HAS_PANGOCAIRO_MODULE: - alignment = pango.ALIGN_CENTER - else: - alignment = None - - text_ext=self.write_text(ctx,"Scale 1:%d" % self.scale,box_width=box_width,size=font_size, alignment=alignment) - h+=text_ext[3]+2 - - return (w,h) - - def render_legend(self,m, page_break=False, ctx=None, collumns=1,width=None, height=None, item_per_rule=False, attribution={}, legend_item_box_size=(0.015,0.0075)): - """ m: map to render legend for - ctx: A cairo context to render the legend to. If this is None (the default) then - automatically create a context and choose the best location for the legend. - width: Width of area available to render legend in (in m) - page_break: move to next page if legen over flows this one - collumns: number of collumns available in legend box - attribution: additional text that will be rendered in gray under the layer name. keyed by layer name - legend_item_box_size: two tuple with width and height of legend item box size in meters - - will return the size of the rendered block in pts - """ - - (w,h) = (0,0) - if self._s: - if ctx is None: - ctx=cairo.Context(self._s) - (tx,ty) = self._get_meta_info_corner((self.map_box.width(),self.map_box.height()),m) - ctx.translate(m2pt(tx),m2pt(ty)) - width = self._pagesize[0]-2*tx - height = self._pagesize[1]-self._margin-ty - - x=0 - y=0 - if width: - cwidth = width/collumns - w=m2pt(width) - else: - cwidth = None - current_collumn = 0 - - processed_layers = [] - for l in reversed(m.layers): - have_layer_header = False - added_styles={} - layer_title = l.name - if layer_title in processed_layers: - continue - processed_layers.append(layer_title) - - # check through the features to find which combinations of styles are active - # for each unique combination add a legend entry - for f in l.datasource.all_features(): - if f.num_geometries() > 0: - active_rules = [] - rule_text = "" - for s in l.styles: - st = m.find_style(s) - for r in st.rules: - # we need to do the scale test here as well so we don't - # add unused scale rules to the legend description - if ((not r.filter) or r.filter.evaluate(f) == '1') and \ - r.min_scale <= m.scale_denominator() and m.scale_denominator() < r.max_scale: - active_rules.append((s,r.name)) - if r.filter and str(r.filter) != "true": - if len(rule_text) > 0: - rule_text += " AND " - if r.name: - rule_text += r.name - else: - rule_text += str(r.filter) - active_rules = tuple(active_rules) - if added_styles.has_key(active_rules): - continue - - added_styles[active_rules] = (f,rule_text) - if not item_per_rule: - break - else: - added_styles[l] = (None,None) - - legend_items = added_styles.keys() - legend_items.sort() - for li in legend_items: - if True: - (f,rule_text) = added_styles[li] - - - legend_map_size = (int(m2pt(legend_item_box_size[0])),int(m2pt(legend_item_box_size[1]))) - lemap=Map(legend_map_size[0],legend_map_size[1],srs=m.srs) - if m.background: - lemap.background = m.background - # the buffer is needed to ensure that text labels that overflow the edge of the - # map still render for the legend - lemap.buffer_size=1000 - for s in l.styles: - sty=m.find_style(s) - lestyle = Style() - for r in sty.rules: - for sym in r.symbols: - try: - sym.avoid_edges=False - except: - print "**** Cant set avoid edges for rule", r.name - if r.min_scale <= m.scale_denominator() and m.scale_denominator() < r.max_scale: - lerule = r - lerule.min_scale = 0 - lerule.max_scale = float("inf") - lestyle.rules.append(lerule) - lemap.append_style(s,lestyle) - - ds = MemoryDatasource() - if f is None: - ds=l.datasource - layer_srs = l.srs - elif f.envelope().width() == 0: - ds.add_feature(Feature(f.id(),Geometry2d.from_wkt("POINT(0 0)"),**f.attributes)) - lemap.zoom_to_box(Box2d(-1,-1,1,1)) - layer_srs = m.srs - else: - ds.add_feature(f) - layer_srs = l.srs - - lelayer = Layer("LegendLayer",layer_srs) - lelayer.datasource = ds - for s in l.styles: - lelayer.styles.append(s) - lemap.layers.append(lelayer) - - if f is None or f.envelope().width() != 0: - lemap.zoom_all() - lemap.zoom(1.1) - - item_size = legend_map_size[1] - if not have_layer_header: - item_size += 8 - - if y+item_size > m2pt(height): - current_collumn += 1 - y=0 - if current_collumn >= collumns: - if page_break: - self._s.show_page() - x=0 - current_collumn = 0 - else: - break - - if not have_layer_header and item_per_rule: - ctx.move_to(x+m2pt(current_collumn*cwidth),y) - e=self.write_text(ctx, l.name, m2pt(cwidth), 8) - y+=e[3]+2 - have_layer_header = True - ctx.save() - ctx.translate(x+m2pt(current_collumn*cwidth),y) - #extra save around map render as it sets up a clip box and doesn't clear it - ctx.save() - render(lemap, ctx) - ctx.restore() - - ctx.rectangle(0,0,*legend_map_size) - ctx.set_source_rgb(0.5,0.5,0.5) - ctx.set_line_width(1) - ctx.stroke() - ctx.restore() - - ctx.move_to(x+legend_map_size[0]+m2pt(current_collumn*cwidth)+2,y) - legend_entry_size = legend_map_size[1] - legend_text_size = 0 - if not item_per_rule: - rule_text = layer_title - if rule_text: - e=self.write_text(ctx, rule_text, m2pt(cwidth-legend_item_box_size[0]-0.005), 6) - legend_text_size += e[3] - ctx.rel_move_to(0,e[3]) - if attribution.has_key(layer_title): - e=self.write_text(ctx, attribution[layer_title], m2pt(cwidth-legend_item_box_size[0]-0.005), 6, fill_color=(0.5,0.5,0.5)) - legend_text_size += e[3] - - if legend_text_size > legend_entry_size: - legend_entry_size=legend_text_size - - y+=legend_entry_size +2 - if y > h: - h = y - return (w,h) diff --git a/bindings/python/mapnik2/__init__.py b/bindings/python/mapnik2/__init__.py deleted file mode 100644 index 57b461ae0..000000000 --- a/bindings/python/mapnik2/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# -# This file is part of Mapnik (C++/Python mapping toolkit) -# Copyright (C) 2014 Artem Pavlenko -# -# Mapnik is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - -# mapnik2 module (Deprecated) - -import warnings -from mapnik import * -warnings.simplefilter("default") -msg=""" mapnik2 module has been deprecated, - please use 'import mapnik' """ -warnings.warn(msg, DeprecationWarning) diff --git a/bindings/python/mapnik_color.cpp b/bindings/python/mapnik_color.cpp deleted file mode 100644 index fc642f449..000000000 --- a/bindings/python/mapnik_color.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include -#include "boost_std_shared_shim.hpp" - -// boost -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#pragma GCC diagnostic pop - -//mapnik -#include - - -using mapnik::color; - -struct color_pickle_suite : boost::python::pickle_suite -{ - static boost::python::tuple - getinitargs(const color& c) - { - using namespace boost::python; - return boost::python::make_tuple(c.red(),c.green(),c.blue(),c.alpha()); - } -}; - -void export_color () -{ - using namespace boost::python; - class_("Color", init( - ( arg("r"), arg("g"), arg("b"), arg("a") ), - "Creates a new color from its RGB components\n" - "and an alpha value.\n" - "All values between 0 and 255.\n") - ) - .def(init( - ( arg("r"), arg("g"), arg("b") ), - "Creates a new color from its RGB components.\n" - "All values between 0 and 255.\n") - ) - .def(init( - ( arg("color_string") ), - "Creates a new color from its CSS string representation.\n" - "The string may be a CSS color name (e.g. 'blue')\n" - "or a hex color string (e.g. '#0000ff').\n") - ) - .add_property("r", - &color::red, - &color::set_red, - "Gets or sets the red component.\n" - "The value is between 0 and 255.\n") - .add_property("g", - &color::green, - &color::set_green, - "Gets or sets the green component.\n" - "The value is between 0 and 255.\n") - .add_property("b", - &color::blue, - &color::set_blue, - "Gets or sets the blue component.\n" - "The value is between 0 and 255.\n") - .add_property("a", - &color::alpha, - &color::set_alpha, - "Gets or sets the alpha component.\n" - "The value is between 0 and 255.\n") - .def(self == self) - .def(self != self) - .def_pickle(color_pickle_suite()) - .def("__str__",&color::to_string) - .def("packed",&color::rgba) - .def("to_hex_string",&color::to_hex_string, - "Returns the hexadecimal representation of this color.\n" - "\n" - "Example:\n" - ">>> c = Color('blue')\n" - ">>> c.to_hex_string()\n" - "'#0000ff'\n") - ; -} diff --git a/bindings/python/mapnik_coord.cpp b/bindings/python/mapnik_coord.cpp deleted file mode 100644 index 40a41b739..000000000 --- a/bindings/python/mapnik_coord.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ -#include -#include "boost_std_shared_shim.hpp" - -// boost -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#pragma GCC diagnostic pop - - -// mapnik -#include - -using mapnik::coord; - -struct coord_pickle_suite : boost::python::pickle_suite -{ - static boost::python::tuple - getinitargs(const coord& c) - { - using namespace boost::python; - return boost::python::make_tuple(c.x,c.y); - } -}; - -void export_coord() -{ - using namespace boost::python; - class_ >("Coord",init( - // class docstring is in mapnik/__init__.py, class _Coord - (arg("x"), arg("y")), - "Constructs a new point with the given coordinates.\n") - ) - .def_pickle(coord_pickle_suite()) - .def_readwrite("x", &coord::x, - "Gets or sets the x/lon coordinate of the point.\n") - .def_readwrite("y", &coord::y, - "Gets or sets the y/lat coordinate of the point.\n") - .def(self == self) // __eq__ - .def(self + self) // __add__ - .def(self + float()) - .def(float() + self) - .def(self - self) // __sub__ - .def(self - float()) - .def(self * float()) //__mult__ - .def(float() * self) - .def(self / float()) // __div__ - ; -} diff --git a/bindings/python/mapnik_datasource.cpp b/bindings/python/mapnik_datasource.cpp deleted file mode 100644 index 56347d822..000000000 --- a/bindings/python/mapnik_datasource.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#include -#pragma GCC diagnostic pop - -// stl -#include - -// mapnik -#include -#include -#include -#include -#include - - -using mapnik::datasource; -using mapnik::memory_datasource; -using mapnik::layer_descriptor; -using mapnik::attribute_descriptor; -using mapnik::parameters; - -namespace -{ -//user-friendly wrapper that uses Python dictionary -using namespace boost::python; -std::shared_ptr create_datasource(dict const& d) -{ - mapnik::parameters params; - boost::python::list keys=d.keys(); - for (int i=0; i < len(keys); ++i) - { - std::string key = extract(keys[i]); - object obj = d[key]; - if (PyUnicode_Check(obj.ptr())) - { - PyObject* temp = PyUnicode_AsUTF8String(obj.ptr()); - if (temp) - { -#if PY_VERSION_HEX >= 0x03000000 - char* c_str = PyBytes_AsString(temp); -#else - char* c_str = PyString_AsString(temp); -#endif - params[key] = std::string(c_str); - Py_DecRef(temp); - } - continue; - } - - extract ex0(obj); - extract ex1(obj); - extract ex2(obj); - if (ex0.check()) - { - params[key] = ex0(); - } - else if (ex1.check()) - { - params[key] = ex1(); - } - else if (ex2.check()) - { - params[key] = ex2(); - } - } - - return mapnik::datasource_cache::instance().create(params); -} - -boost::python::dict describe(std::shared_ptr const& ds) -{ - boost::python::dict description; - mapnik::layer_descriptor ld = ds->get_descriptor(); - description["type"] = ds->type(); - description["name"] = ld.get_name(); - description["geometry_type"] = ds->get_geometry_type(); - description["encoding"] = ld.get_encoding(); - for (auto const& param : ld.get_extra_parameters()) { - description[param.first] = param.second; - } - return description; -} - -boost::python::list fields(std::shared_ptr const& ds) -{ - boost::python::list flds; - if (ds) - { - layer_descriptor ld = ds->get_descriptor(); - std::vector const& desc_ar = ld.get_descriptors(); - std::vector::const_iterator it = desc_ar.begin(); - std::vector::const_iterator end = desc_ar.end(); - for (; it != end; ++it) - { - flds.append(it->get_name()); - } - } - return flds; -} -boost::python::list field_types(std::shared_ptr const& ds) -{ - boost::python::list fld_types; - if (ds) - { - layer_descriptor ld = ds->get_descriptor(); - std::vector const& desc_ar = ld.get_descriptors(); - std::vector::const_iterator it = desc_ar.begin(); - std::vector::const_iterator end = desc_ar.end(); - for (; it != end; ++it) - { - unsigned type = it->get_type(); - if (type == mapnik::Integer) - // this crashes, so send back strings instead - //fld_types.append(boost::python::object(boost::python::handle<>(&PyInt_Type))); - fld_types.append(boost::python::str("int")); - else if (type == mapnik::Float) - fld_types.append(boost::python::str("float")); - else if (type == mapnik::Double) - fld_types.append(boost::python::str("float")); - else if (type == mapnik::String) - fld_types.append(boost::python::str("str")); - else if (type == mapnik::Boolean) - fld_types.append(boost::python::str("bool")); - else if (type == mapnik::Geometry) - fld_types.append(boost::python::str("geometry")); - else if (type == mapnik::Object) - fld_types.append(boost::python::str("object")); - else - fld_types.append(boost::python::str("unknown")); - } - } - return fld_types; -}} - -mapnik::parameters const& (mapnik::datasource::*params_const)() const = &mapnik::datasource::params; - - -void export_datasource() -{ - using namespace boost::python; - - enum_("DataType") - .value("Vector",mapnik::datasource::Vector) - .value("Raster",mapnik::datasource::Raster) - ; - - enum_("DataGeometryType") - .value("Point",mapnik::datasource::Point) - .value("LineString",mapnik::datasource::LineString) - .value("Polygon",mapnik::datasource::Polygon) - .value("Collection",mapnik::datasource::Collection) - ; - - class_, - boost::noncopyable>("Datasource",no_init) - .def("type",&datasource::type) - .def("geometry_type",&datasource::get_geometry_type) - .def("describe",&describe) - .def("envelope",&datasource::envelope) - .def("features",&datasource::features) - .def("fields",&fields) - .def("field_types",&field_types) - .def("features_at_point",&datasource::features_at_point, (arg("coord"),arg("tolerance")=0)) - .def("params",make_function(params_const,return_value_policy()), - "The configuration parameters of the data source. " - "These vary depending on the type of data source.") - .def(self == self) - ; - - def("CreateDatasource",&create_datasource); - - class_, std::shared_ptr, - boost::noncopyable>("MemoryDatasourceBase", init()) - .def("add_feature",&memory_datasource::push, - "Adds a Feature:\n" - ">>> ms = MemoryDatasource()\n" - ">>> feature = Feature(1)\n" - ">>> ms.add_feature(Feature(1))\n") - .def("num_features",&memory_datasource::size) - ; - - implicitly_convertible,std::shared_ptr >(); -} diff --git a/bindings/python/mapnik_datasource_cache.cpp b/bindings/python/mapnik_datasource_cache.cpp deleted file mode 100644 index 41d49df46..000000000 --- a/bindings/python/mapnik_datasource_cache.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" -#include -#include -#pragma GCC diagnostic pop - -#include -#include -#include -#include - -namespace { - -using namespace boost::python; - -std::shared_ptr create_datasource(const dict& d) -{ - mapnik::parameters params; - boost::python::list keys=d.keys(); - for (int i=0; i(keys[i]); - object obj = d[key]; - extract ex0(obj); - extract ex1(obj); - extract ex2(obj); - - if (ex0.check()) - { - params[key] = ex0(); - } - else if (ex1.check()) - { - params[key] = ex1(); - } - else if (ex2.check()) - { - params[key] = ex2(); - } - } - - return mapnik::datasource_cache::instance().create(params); -} - -void register_datasources(std::string const& path) -{ - mapnik::datasource_cache::instance().register_datasources(path); -} - -std::vector plugin_names() -{ - return mapnik::datasource_cache::instance().plugin_names(); -} - -std::string plugin_directories() -{ - return mapnik::datasource_cache::instance().plugin_directories(); -} - -} - -void export_datasource_cache() -{ - using mapnik::datasource_cache; - class_("DatasourceCache",no_init) - .def("create",&create_datasource) - .staticmethod("create") - .def("register_datasources",®ister_datasources) - .staticmethod("register_datasources") - .def("plugin_names",&plugin_names) - .staticmethod("plugin_names") - .def("plugin_directories",&plugin_directories) - .staticmethod("plugin_directories") - ; -} diff --git a/bindings/python/mapnik_enumeration.hpp b/bindings/python/mapnik_enumeration.hpp deleted file mode 100644 index 19d1b5f42..000000000 --- a/bindings/python/mapnik_enumeration.hpp +++ /dev/null @@ -1,88 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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_PYTHON_BINDING_ENUMERATION_INCLUDED -#define MAPNIK_PYTHON_BINDING_ENUMERATION_INCLUDED - -#include // for registered -#include // for enum_ -#include // for implicitly_convertible -#include - -namespace mapnik { - -template -class enumeration_ : - public boost::python::enum_ -{ - // some short cuts - using base_type = boost::python::enum_; - using native_type = typename EnumWrapper::native_type; -public: - enumeration_() : - base_type( EnumWrapper::get_name().c_str() ) - { - init(); - } - enumeration_(const char * python_alias) : - base_type( python_alias ) - { - init(); - } - enumeration_(const char * python_alias, const char * doc) : - base_type( python_alias, doc ) - { - init(); - } - -private: - struct converter - { - static PyObject* convert(EnumWrapper const& v) - { - // Redirect conversion to a static method of our base class's - // base class. A free template converter will not work because - // the base_type::base typedef is protected. - // Lets hope MSVC agrees that this is legal C++ - using namespace boost::python::converter; - return base_type::base::to_python( - registered::converters.m_class_object - , static_cast( v )); - - } - }; - - void init() { - boost::python::implicitly_convertible(); - boost::python::to_python_converter(); - - for (unsigned i = 0; i < EnumWrapper::MAX; ++i) - { - // Register the strings already defined for this enum. - base_type::value( EnumWrapper::get_string( i ), native_type( i ) ); - } - } - -}; - -} // end of namespace mapnik - -#endif // MAPNIK_PYTHON_BINDING_ENUMERATION_INCLUDED diff --git a/bindings/python/mapnik_envelope.cpp b/bindings/python/mapnik_envelope.cpp deleted file mode 100644 index 239d1f9f6..000000000 --- a/bindings/python/mapnik_envelope.cpp +++ /dev/null @@ -1,301 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include - -using mapnik::coord; -using mapnik::box2d; - -struct envelope_pickle_suite : boost::python::pickle_suite -{ - static boost::python::tuple - getinitargs(const box2d& e) - { - using namespace boost::python; - return boost::python::make_tuple(e.minx(),e.miny(),e.maxx(),e.maxy()); - } -}; - -box2d from_string(std::string const& s) -{ - box2d bbox; - bool success = bbox.from_string(s); - if (success) - { - return bbox; - } - else - { - std::stringstream ss; - ss << "Could not parse bbox from string: '" << s << "'"; - throw mapnik::value_error(ss.str()); - } -} - -//define overloads here -void (box2d::*width_p1)(double) = &box2d::width; -double (box2d::*width_p2)() const = &box2d::width; - -void (box2d::*height_p1)(double) = &box2d::height; -double (box2d::*height_p2)() const = &box2d::height; - -void (box2d::*expand_to_include_p1)(double,double) = &box2d::expand_to_include; -void (box2d::*expand_to_include_p2)(coord const& ) = &box2d::expand_to_include; -void (box2d::*expand_to_include_p3)(box2d const& ) = &box2d::expand_to_include; - -bool (box2d::*contains_p1)(double,double) const = &box2d::contains; -bool (box2d::*contains_p2)(coord const&) const = &box2d::contains; -bool (box2d::*contains_p3)(box2d const&) const = &box2d::contains; - -//intersects -bool (box2d::*intersects_p1)(double,double) const = &box2d::intersects; -bool (box2d::*intersects_p2)(coord const&) const = &box2d::intersects; -bool (box2d::*intersects_p3)(box2d const&) const = &box2d::intersects; - -// intersect -box2d (box2d::*intersect)(box2d const&) const = &box2d::intersect; - -// re_center -void (box2d::*re_center_p1)(double,double) = &box2d::re_center; -void (box2d::*re_center_p2)(coord const& ) = &box2d::re_center; - -// clip -void (box2d::*clip)(box2d const&) = &box2d::clip; - -// pad -void (box2d::*pad)(double) = &box2d::pad; - -// deepcopy -box2d box2d_deepcopy(box2d & obj, boost::python::dict const&) -{ - // FIXME::ignore memo for now - box2d result(obj); - return result; -} - -void export_envelope() -{ - using namespace boost::python; - class_ >("Box2d", - // class docstring is in mapnik/__init__.py, class _Coord - init( - (arg("minx"),arg("miny"),arg("maxx"),arg("maxy")), - "Constructs a new envelope from the coordinates\n" - "of its lower left and upper right corner points.\n")) - .def(init<>("Equivalent to Box2d(0, 0, -1, -1).\n")) - .def(init&, const coord&>( - (arg("ll"),arg("ur")), - "Equivalent to Box2d(ll.x, ll.y, ur.x, ur.y).\n")) - .def("from_string",from_string) - .staticmethod("from_string") - .add_property("minx", &box2d::minx, - "X coordinate for the lower left corner") - .add_property("miny", &box2d::miny, - "Y coordinate for the lower left corner") - .add_property("maxx", &box2d::maxx, - "X coordinate for the upper right corner") - .add_property("maxy", &box2d::maxy, - "Y coordinate for the upper right corner") - .def("center", &box2d::center, - "Returns the coordinates of the center of the bounding box.\n" - "\n" - "Example:\n" - ">>> e = Box2d(0, 0, 100, 100)\n" - ">>> e.center()\n" - "Coord(50, 50)\n") - .def("center", re_center_p1, - (arg("x"), arg("y")), - "Moves the envelope so that the given coordinates become its new center.\n" - "The width and the height are preserved.\n" - "\n " - "Example:\n" - ">>> e = Box2d(0, 0, 100, 100)\n" - ">>> e.center(60, 60)\n" - ">>> e.center()\n" - "Coord(60.0,60.0)\n" - ">>> (e.width(), e.height())\n" - "(100.0, 100.0)\n" - ">>> e\n" - "Box2d(10.0, 10.0, 110.0, 110.0)\n" - ) - .def("center", re_center_p2, - (arg("Coord")), - "Moves the envelope so that the given coordinates become its new center.\n" - "The width and the height are preserved.\n" - "\n " - "Example:\n" - ">>> e = Box2d(0, 0, 100, 100)\n" - ">>> e.center(Coord60, 60)\n" - ">>> e.center()\n" - "Coord(60.0,60.0)\n" - ">>> (e.width(), e.height())\n" - "(100.0, 100.0)\n" - ">>> e\n" - "Box2d(10.0, 10.0, 110.0, 110.0)\n" - ) - .def("clip", clip, - (arg("other")), - "Clip the envelope based on the bounds of another envelope.\n" - "\n " - "Example:\n" - ">>> e = Box2d(0, 0, 100, 100)\n" - ">>> c = Box2d(-50, -50, 50, 50)\n" - ">>> e.clip(c)\n" - ">>> e\n" - "Box2d(0.0,0.0,50.0,50.0\n" - ) - .def("pad", pad, - (arg("padding")), - "Pad the envelope based on a padding value.\n" - "\n " - "Example:\n" - ">>> e = Box2d(0, 0, 100, 100)\n" - ">>> e.pad(10)\n" - ">>> e\n" - "Box2d(-10.0,-10.0,110.0,110.0\n" - ) - .def("width", width_p1, - (arg("new_width")), - "Sets the width to new_width of the envelope preserving its center.\n" - "\n " - "Example:\n" - ">>> e = Box2d(0, 0, 100, 100)\n" - ">>> e.width(120)\n" - ">>> e.center()\n" - "Coord(50.0,50.0)\n" - ">>> e\n" - "Box2d(-10.0, 0.0, 110.0, 100.0)\n" - ) - .def("width", width_p2, - "Returns the width of this envelope.\n" - ) - .def("height", height_p1, - (arg("new_height")), - "Sets the height to new_height of the envelope preserving its center.\n" - "\n " - "Example:\n" - ">>> e = Box2d(0, 0, 100, 100)\n" - ">>> e.height(120)\n" - ">>> e.center()\n" - "Coord(50.0,50.0)\n" - ">>> e\n" - "Box2d(0.0, -10.0, 100.0, 110.0)\n" - ) - .def("height", height_p2, - "Returns the height of this envelope.\n" - ) - .def("expand_to_include",expand_to_include_p1, - (arg("x"),arg("y")), - "Expands this envelope to include the point given by x and y.\n" - "\n" - "Example:\n", - ">>> e = Box2d(0, 0, 100, 100)\n" - ">>> e.expand_to_include(110, 110)\n" - ">>> e\n" - "Box2d(0.0, 00.0, 110.0, 110.0)\n" - ) - .def("expand_to_include",expand_to_include_p2, - (arg("p")), - "Equivalent to expand_to_include(p.x, p.y)\n" - ) - .def("expand_to_include",expand_to_include_p3, - (arg("other")), - "Equivalent to:\n" - " expand_to_include(other.minx, other.miny)\n" - " expand_to_include(other.maxx, other.maxy)\n" - ) - .def("contains",contains_p1, - (arg("x"),arg("y")), - "Returns True iff this envelope contains the point\n" - "given by x and y.\n" - ) - .def("contains",contains_p2, - (arg("p")), - "Equivalent to contains(p.x, p.y)\n" - ) - .def("contains",contains_p3, - (arg("other")), - "Equivalent to:\n" - " contains(other.minx, other.miny) and contains(other.maxx, other.maxy)\n" - ) - .def("intersects",intersects_p1, - (arg("x"),arg("y")), - "Returns True iff this envelope intersects the point\n" - "given by x and y.\n" - "\n" - "Note: For points, intersection is equivalent\n" - "to containment, i.e. the following holds:\n" - " e.contains(x, y) == e.intersects(x, y)\n" - ) - .def("intersects",intersects_p2, - (arg("p")), - "Equivalent to contains(p.x, p.y)\n") - .def("intersects",intersects_p3, - (arg("other")), - "Returns True iff this envelope intersects the other envelope,\n" - "This relationship is symmetric." - "\n" - "Example:\n" - ">>> e1 = Box2d(0, 0, 100, 100)\n" - ">>> e2 = Box2d(50, 50, 150, 150)\n" - ">>> e1.intersects(e2)\n" - "True\n" - ">>> e1.contains(e2)\n" - "False\n" - ) - .def("intersect",intersect, - (arg("other")), - "Returns the overlap of this envelope and the other envelope\n" - "as a new envelope.\n" - "\n" - "Example:\n" - ">>> e1 = Box2d(0, 0, 100, 100)\n" - ">>> e2 = Box2d(50, 50, 150, 150)\n" - ">>> e1.intersect(e2)\n" - "Box2d(50.0, 50.0, 100.0, 100.0)\n" - ) - .def(self == self) // __eq__ - .def(self != self) // __neq__ - .def(self + self) // __add__ - .def(self * float()) // __mult__ - .def(float() * self) - .def(self / float()) // __div__ - .def("__getitem__",&box2d::operator[]) - .def("valid",&box2d::valid) - .def_pickle(envelope_pickle_suite()) - .def("__deepcopy__", &box2d_deepcopy) - ; - -} diff --git a/bindings/python/mapnik_expression.cpp b/bindings/python/mapnik_expression.cpp deleted file mode 100644 index 9bb10cf74..000000000 --- a/bindings/python/mapnik_expression.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include -#include "python_to_value.hpp" - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include -#include -#include -#include -#include - -using mapnik::expression_ptr; -using mapnik::parse_expression; -using mapnik::to_expression_string; -using mapnik::path_expression_ptr; - - -// expression -expression_ptr parse_expression_(std::string const& wkt) -{ - return parse_expression(wkt); -} - -std::string expression_to_string_(mapnik::expr_node const& expr) -{ - return mapnik::to_expression_string(expr); -} - -mapnik::value expression_evaluate_(mapnik::expr_node const& expr, mapnik::feature_impl const& f, boost::python::dict const& d) -{ - // will be auto-converted to proper python type by `mapnik_value_to_python` - return mapnik::util::apply_visitor(mapnik::evaluate(f,mapnik::dict2attr(d)),expr); -} - -bool expression_evaluate_to_bool_(mapnik::expr_node const& expr, mapnik::feature_impl const& f, boost::python::dict const& d) -{ - return mapnik::util::apply_visitor(mapnik::evaluate(f,mapnik::dict2attr(d)),expr).to_bool(); -} - -// path expression -path_expression_ptr parse_path_(std::string const& path) -{ - return mapnik::parse_path(path); -} - -std::string path_to_string_(mapnik::path_expression const& expr) -{ - return mapnik::path_processor_type::to_string(expr); -} - -std::string path_evaluate_(mapnik::path_expression const& expr, mapnik::feature_impl const& f) -{ - return mapnik::path_processor_type::evaluate(expr, f); -} - -void export_expression() -{ - using namespace boost::python; - class_("Expression", - "TODO" - "",no_init) - .def("evaluate", &expression_evaluate_,(arg("feature"),arg("variables")=boost::python::dict())) - .def("to_bool", &expression_evaluate_to_bool_,(arg("feature"),arg("variables")=boost::python::dict())) - .def("__str__",&expression_to_string_); - ; - - def("Expression",&parse_expression_,(arg("expr")),"Expression string"); - - class_("PathExpression", - "TODO" - "",no_init) - .def("evaluate", &path_evaluate_) // note: "pass" is a reserved word in Python - .def("__str__",&path_to_string_); - ; - - def("PathExpression",&parse_path_,(arg("expr")),"PathExpression string"); -} diff --git a/bindings/python/mapnik_feature.cpp b/bindings/python/mapnik_feature.cpp deleted file mode 100644 index a62c9c8de..000000000 --- a/bindings/python/mapnik_feature.cpp +++ /dev/null @@ -1,255 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#include -#include -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// stl -#include - -namespace { - -using mapnik::geometry_utils; -using mapnik::context_type; -using mapnik::context_ptr; -using mapnik::feature_kv_iterator; - -mapnik::geometry_type const& (mapnik::feature_impl::*get_geometry_by_const_ref)(std::size_t) const = &mapnik::feature_impl::get_geometry; -mapnik::geometry_container const& (mapnik::feature_impl::*get_paths_by_const_ref)() const = &mapnik::feature_impl::paths; - -void feature_add_geometries_from_wkb(mapnik::feature_impl & feature, std::string wkb) -{ - bool result = geometry_utils::from_wkb(feature.paths(), wkb.c_str(), wkb.size()); - if (!result) throw std::runtime_error("Failed to parse WKB"); -} - -void feature_add_geometries_from_wkt(mapnik::feature_impl & feature, std::string const& wkt) -{ - bool result = mapnik::from_wkt(wkt, feature.paths()); - if (!result) throw std::runtime_error("Failed to parse WKT"); -} - -mapnik::feature_ptr from_geojson_impl(std::string const& json, mapnik::context_ptr const& ctx) -{ - mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx,1)); - if (!mapnik::json::from_geojson(json,*feature)) - { - throw std::runtime_error("Failed to parse geojson feature"); - } - return feature; -} - -std::string feature_to_geojson(mapnik::feature_impl const& feature) -{ - std::string json; - if (!mapnik::json::to_geojson(json,feature)) - { - throw std::runtime_error("Failed to generate GeoJSON"); - } - return json; -} - -mapnik::value __getitem__(mapnik::feature_impl const& feature, std::string const& name) -{ - return feature.get(name); -} - -mapnik::value __getitem2__(mapnik::feature_impl const& feature, std::size_t index) -{ - return feature.get(index); -} - -void __setitem__(mapnik::feature_impl & feature, std::string const& name, mapnik::value const& val) -{ - feature.put_new(name,val); -} - -boost::python::dict attributes(mapnik::feature_impl const& f) -{ - boost::python::dict attributes; - feature_kv_iterator itr = f.begin(); - feature_kv_iterator end = f.end(); - - for ( ;itr!=end; ++itr) - { - attributes[std::get<0>(*itr)] = std::get<1>(*itr); - } - - return attributes; -} - -} // end anonymous namespace - -struct unicode_string_from_python_str -{ - unicode_string_from_python_str() - { - boost::python::converter::registry::push_back( - &convertible, - &construct, - boost::python::type_id()); - } - - static void* convertible(PyObject* obj_ptr) - { - if (!( -#if PY_VERSION_HEX >= 0x03000000 - PyBytes_Check(obj_ptr) -#else - PyString_Check(obj_ptr) -#endif - || PyUnicode_Check(obj_ptr))) - return 0; - return obj_ptr; - } - - static void construct( - PyObject* obj_ptr, - boost::python::converter::rvalue_from_python_stage1_data* data) - { - char * value=0; - if (PyUnicode_Check(obj_ptr)) { - PyObject *encoded = PyUnicode_AsEncodedString(obj_ptr, "utf8", "replace"); - if (encoded) { -#if PY_VERSION_HEX >= 0x03000000 - value = PyBytes_AsString(encoded); -#else - value = PyString_AsString(encoded); -#endif - Py_DecRef(encoded); - } - } else { -#if PY_VERSION_HEX >= 0x03000000 - value = PyBytes_AsString(obj_ptr); -#else - value = PyString_AsString(obj_ptr); -#endif - } - if (value == 0) boost::python::throw_error_already_set(); - void* storage = ( - (boost::python::converter::rvalue_from_python_storage*) - data)->storage.bytes; - new (storage) mapnik::value_unicode_string(value); - data->convertible = storage; - } -}; - - -struct value_null_from_python -{ - value_null_from_python() - { - boost::python::converter::registry::push_back( - &convertible, - &construct, - boost::python::type_id()); - } - - static void* convertible(PyObject* obj_ptr) - { - if (obj_ptr == Py_None) return obj_ptr; - return 0; - } - - static void construct( - PyObject* obj_ptr, - boost::python::converter::rvalue_from_python_stage1_data* data) - { - if (obj_ptr != Py_None) boost::python::throw_error_already_set(); - void* storage = ( - (boost::python::converter::rvalue_from_python_storage*) - data)->storage.bytes; - new (storage) mapnik::value_null(); - data->convertible = storage; - } -}; - -void export_feature() -{ - using namespace boost::python; - - // Python to mapnik::value converters - // NOTE: order matters here. For example value_null must be listed before - // bool otherwise Py_None will be interpreted as bool (false) - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - - // http://misspent.wordpress.com/2009/09/27/how-to-write-boost-python-converters/ - unicode_string_from_python_str(); - value_null_from_python(); - - class_ - ("Context",init<>("Default ctor.")) - .def("push", &context_type::push) - ; - - class_, - boost::noncopyable>("Feature",init("Default ctor.")) - .def("id",&mapnik::feature_impl::id) - .def("add_geometries_from_wkb", &feature_add_geometries_from_wkb) - .def("add_geometries_from_wkt", &feature_add_geometries_from_wkt) - .def("add_geometry", &mapnik::feature_impl::add_geometry) - .def("num_geometries",&mapnik::feature_impl::num_geometries) - .def("get_geometry", make_function(get_geometry_by_const_ref,return_value_policy())) - .def("geometries",make_function(get_paths_by_const_ref,return_value_policy())) - .def("envelope", &mapnik::feature_impl::envelope) - .def("has_key", &mapnik::feature_impl::has_key) - .add_property("attributes",&attributes) - .def("__setitem__",&__setitem__) - .def("__contains__",&__getitem__) - .def("__getitem__",&__getitem__) - .def("__getitem__",&__getitem2__) - .def("__len__", &mapnik::feature_impl::size) - .def("context",&mapnik::feature_impl::context) - .def("to_geojson",&feature_to_geojson) - .def("from_geojson",from_geojson_impl) - .staticmethod("from_geojson") - ; -} diff --git a/bindings/python/mapnik_featureset.cpp b/bindings/python/mapnik_featureset.cpp deleted file mode 100644 index f043369e5..000000000 --- a/bindings/python/mapnik_featureset.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include - -namespace { -using namespace boost::python; - -inline list features(mapnik::featureset_ptr const& itr) -{ - list l; - while (true) - { - mapnik::feature_ptr fp = itr->next(); - if (!fp) - { - break; - } - l.append(fp); - } - return l; -} - -inline object pass_through(object const& o) { return o; } - -inline mapnik::feature_ptr next(mapnik::featureset_ptr const& itr) -{ - mapnik::feature_ptr f = itr->next(); - if (!f) - { - PyErr_SetString(PyExc_StopIteration, "No more features."); - boost::python::throw_error_already_set(); - } - - return f; -} - -} - -void export_featureset() -{ - using namespace boost::python; - class_, - boost::noncopyable>("Featureset",no_init) - .def("__iter__",pass_through) - .def("next",next) - .add_property("features",features, - "The list of features.\n" - "\n" - "Usage:\n" - ">>> m.query_map_point(0, 10, 10)\n" - "\n" - ">>> fs = m.query_map_point(0, 10, 10)\n" - ">>> for f in fs.features:\n" - ">>> print f\n" - "\n" - ) - ; -} diff --git a/bindings/python/mapnik_font_engine.cpp b/bindings/python/mapnik_font_engine.cpp deleted file mode 100644 index 327348849..000000000 --- a/bindings/python/mapnik_font_engine.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#pragma GCC diagnostic pop - -#include -#include - -void export_font_engine() -{ - using mapnik::freetype_engine; - using mapnik::singleton; - using mapnik::CreateStatic; - using namespace boost::python; - class_,boost::noncopyable>("Singleton",no_init) - .def("instance",&singleton::instance, - return_value_policy()) - .staticmethod("instance") - ; - - class_ >, - boost::noncopyable>("FontEngine",no_init) - .def("register_font",&freetype_engine::register_font) - .def("register_fonts",&freetype_engine::register_fonts) - .def("face_names",&freetype_engine::face_names) - .staticmethod("register_font") - .staticmethod("register_fonts") - .staticmethod("face_names") - ; -} diff --git a/bindings/python/mapnik_fontset.cpp b/bindings/python/mapnik_fontset.cpp deleted file mode 100644 index 15f570e41..000000000 --- a/bindings/python/mapnik_fontset.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#pragma GCC diagnostic pop - -//mapnik -#include - - -using mapnik::font_set; - -void export_fontset () -{ - using namespace boost::python; - class_("FontSet", init("default fontset constructor") - ) - .add_property("name", - make_function(&font_set::get_name,return_value_policy()), - &font_set::set_name, - "Get/Set the name of the FontSet.\n" - ) - .def("add_face_name",&font_set::add_face_name, - (arg("name")), - "Add a face-name to the fontset.\n" - "\n" - "Example:\n" - ">>> fs = Fontset('book-fonts')\n" - ">>> fs.add_face_name('DejaVu Sans Book')\n") - .add_property("names",make_function - (&font_set::get_face_names, - return_value_policy()), - "List of face names belonging to a FontSet.\n" - ) - ; -} diff --git a/bindings/python/mapnik_geometry.cpp b/bindings/python/mapnik_geometry.cpp deleted file mode 100644 index fb0e6da83..000000000 --- a/bindings/python/mapnik_geometry.cpp +++ /dev/null @@ -1,281 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#include -#include -#include -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include // from_wkt -#include -#include // from_geojson -#include -#include -#include -#include - -// stl -#include - -namespace { - -mapnik::geometry_type const& getitem_impl(mapnik::geometry_container & p, int key) -{ - if (key >=0 && key < static_cast(p.size())) - return p[key]; - PyErr_SetString(PyExc_IndexError, "Index is out of range"); - throw boost::python::error_already_set(); -} - -void add_wkt_impl(mapnik::geometry_container& p, std::string const& wkt) -{ - if (!mapnik::from_wkt(wkt , p)) - throw std::runtime_error("Failed to parse WKT"); -} - -void add_wkb_impl(mapnik::geometry_container& p, std::string const& wkb) -{ - if (!mapnik::geometry_utils::from_wkb(p, wkb.c_str(), wkb.size())) - throw std::runtime_error("Failed to parse WKB"); -} - -void add_geojson_impl(mapnik::geometry_container& paths, std::string const& json) -{ - if (!mapnik::json::from_geojson(json, paths)) - throw std::runtime_error("Failed to parse geojson geometry"); -} - -std::shared_ptr from_wkt_impl(std::string const& wkt) -{ - std::shared_ptr paths = std::make_shared(); - if (!mapnik::from_wkt(wkt, *paths)) - throw std::runtime_error("Failed to parse WKT"); - return paths; -} - -std::shared_ptr from_wkb_impl(std::string const& wkb) -{ - std::shared_ptr paths = std::make_shared(); - if (!mapnik::geometry_utils::from_wkb(*paths, wkb.c_str(), wkb.size())) - throw std::runtime_error("Failed to parse WKB"); - return paths; -} - -std::shared_ptr from_geojson_impl(std::string const& json) -{ - std::shared_ptr paths = std::make_shared(); - if (!mapnik::json::from_geojson(json, *paths)) - throw std::runtime_error("Failed to parse geojson geometry"); - return paths; -} - -mapnik::box2d envelope_impl(mapnik::geometry_container & p) -{ - mapnik::box2d b; - bool first = true; - for (mapnik::geometry_type const& geom : p) - { - if (first) - { - b = geom.envelope(); - first=false; - } - else - { - b.expand_to_include(geom.envelope()); - } - } - return b; -} - -} - -inline std::string boost_version() -{ - std::ostringstream s; - s << BOOST_VERSION/100000 << "." << BOOST_VERSION/100 % 1000 << "." << BOOST_VERSION % 100; - return s.str(); -} - -PyObject* to_wkb(mapnik::geometry_type const& geom, mapnik::util::wkbByteOrder byte_order) -{ - mapnik::util::wkb_buffer_ptr wkb = mapnik::util::to_wkb(geom,byte_order); - if (wkb) - { - return -#if PY_VERSION_HEX >= 0x03000000 - ::PyBytes_FromStringAndSize -#else - ::PyString_FromStringAndSize -#endif - ((const char*)wkb->buffer(),wkb->size()); - } - else - { - Py_RETURN_NONE; - } -} - -PyObject* to_wkb2( mapnik::geometry_container const& p, mapnik::util::wkbByteOrder byte_order) -{ - mapnik::util::wkb_buffer_ptr wkb = mapnik::util::to_wkb(p,byte_order); - if (wkb) - { - return -#if PY_VERSION_HEX >= 0x03000000 - ::PyBytes_FromStringAndSize -#else - ::PyString_FromStringAndSize -#endif - ((const char*)wkb->buffer(),wkb->size()); - } - else - { - Py_RETURN_NONE; - } -} - -std::string to_wkt(mapnik::geometry_type const& geom) -{ - std::string wkt; - if (!mapnik::util::to_wkt(wkt,geom)) - { - throw std::runtime_error("Generate WKT failed"); - } - return wkt; -} - -std::string to_wkt2(mapnik::geometry_container const& geom) -{ - std::string wkt; - if (!mapnik::util::to_wkt(wkt,geom)) - { - throw std::runtime_error("Generate WKT failed"); - } - return wkt; -} - -std::string to_geojson(mapnik::geometry_type const& geom) -{ - std::string wkt; - if (!mapnik::util::to_geojson(wkt,geom)) - { - throw std::runtime_error("Generate JSON failed"); - } - return wkt; -} - -std::string to_geojson2(mapnik::geometry_container const& geom) -{ - std::string wkt; - if (!mapnik::util::to_geojson(wkt,geom)) - { - throw std::runtime_error("Generate JSON failed"); - } - return wkt; -} - -std::string to_svg(mapnik::geometry_type const& geom) -{ - std::string svg; - if (!mapnik::util::to_svg(svg,geom)) - { - throw std::runtime_error("Generate SVG failed"); - } - return svg; -} - -/* -// https://github.com/mapnik/mapnik/issues/1437 -std::string to_svg2( mapnik::geometry_container const& geom) -{ - std::string svg; // Use Python String directly ? - bool result = mapnik::util::to_svg(svg,geom); - if (!result) - { - throw std::runtime_error("Generate WKT failed"); - } - return svg; -}*/ - - -void export_geometry() -{ - using namespace boost::python; - - enum_("GeometryType") - .value("Point",mapnik::geometry_type::types::Point) - .value("LineString",mapnik::geometry_type::types::LineString) - .value("Polygon",mapnik::geometry_type::types::Polygon) - ; - - enum_("wkbByteOrder") - .value("XDR",mapnik::util::wkbXDR) - .value("NDR",mapnik::util::wkbNDR) - ; - - using mapnik::geometry_type; - class_, boost::noncopyable>("Geometry2d",no_init) - .def("envelope",&mapnik::geometry_type::envelope) - // .def("__str__",&mapnik::geometry_type::to_string) - .def("type",&mapnik::geometry_type::type) - .def("to_wkb",&to_wkb) - .def("to_wkt",&to_wkt) - .def("to_geojson",&to_geojson) - .def("to_svg",&to_svg) - // TODO add other geometry_type methods - ; - - class_, boost::noncopyable>("Path") - .def("__getitem__", getitem_impl,return_value_policy()) - .def("__len__", &mapnik::geometry_container::size) - .def("envelope",envelope_impl) - .def("add_wkt",add_wkt_impl) - .def("add_wkb",add_wkb_impl) - .def("add_geojson",add_geojson_impl) - .def("to_wkt",&to_wkt2) - //.def("to_svg",&to_svg2) - .def("to_wkb",&to_wkb2) - .def("from_wkt",from_wkt_impl) - .def("from_wkb",from_wkb_impl) - .def("from_geojson",from_geojson_impl) - .def("to_geojson",&to_geojson2) - .staticmethod("from_wkt") - .staticmethod("from_wkb") - .staticmethod("from_geojson") - ; - -} diff --git a/bindings/python/mapnik_grid.cpp b/bindings/python/mapnik_grid.cpp deleted file mode 100644 index 40275fd2c..000000000 --- a/bindings/python/mapnik_grid.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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 - * - *****************************************************************************/ - -#if defined(GRID_RENDERER) - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include "python_grid_utils.hpp" - -using namespace boost::python; - -// help compiler see template definitions -static dict (*encode)( mapnik::grid const&, std::string const& , bool, unsigned int) = mapnik::grid_encode; - -bool painted(mapnik::grid const& grid) -{ - return grid.painted(); -} - -mapnik::grid::value_type get_pixel(mapnik::grid const& grid, int x, int y) -{ - if (x < static_cast(grid.width()) && y < static_cast(grid.height())) - { - mapnik::grid::data_type const & data = grid.data(); - return data(x,y); - } - PyErr_SetString(PyExc_IndexError, "invalid x,y for grid dimensions"); - boost::python::throw_error_already_set(); - return 0; -} - -void export_grid() -{ - class_ >( - "Grid", - "This class represents a feature hitgrid.", - init( - ( boost::python::arg("width"), boost::python::arg("height"),boost::python::arg("key")="__id__", boost::python::arg("resolution")=1 ), - "Create a mapnik.Grid object\n" - )) - .def("painted",&painted) - .def("width",&mapnik::grid::width) - .def("height",&mapnik::grid::height) - .def("view",&mapnik::grid::get_view) - .def("get_pixel",&get_pixel) - .def("clear",&mapnik::grid::clear) - .def("encode",encode, - ( boost::python::arg("encoding")="utf", boost::python::arg("features")=true,boost::python::arg("resolution")=4 ), - "Encode the grid as as optimized json\n" - ) - .add_property("key", - make_function(&mapnik::grid::get_key,return_value_policy()), - &mapnik::grid::set_key, - "Get/Set key to be used as unique indentifier for features\n" - "The value should either be __id__ to refer to the feature.id()\n" - "or some globally unique integer or string attribute field\n" - ) - ; - -} - -#endif diff --git a/bindings/python/mapnik_grid_view.cpp b/bindings/python/mapnik_grid_view.cpp deleted file mode 100644 index 99e3b5e2d..000000000 --- a/bindings/python/mapnik_grid_view.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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 - * - *****************************************************************************/ - -#if defined(GRID_RENDERER) - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include -#include "python_grid_utils.hpp" - -using namespace boost::python; - -// help compiler see template definitions -static dict (*encode)( mapnik::grid_view const&, std::string const& , bool, unsigned int) = mapnik::grid_encode; - -void export_grid_view() -{ - class_ >("GridView", - "This class represents a feature hitgrid subset.",no_init) - .def("width",&mapnik::grid_view::width) - .def("height",&mapnik::grid_view::height) - .def("encode",encode, - ( boost::python::arg("encoding")="utf",boost::python::arg("add_features")=true,boost::python::arg("resolution")=4 ), - "Encode the grid as as optimized json\n" - ) - ; -} - -#endif diff --git a/bindings/python/mapnik_image.cpp b/bindings/python/mapnik_image.cpp deleted file mode 100644 index c6f30e905..000000000 --- a/bindings/python/mapnik_image.cpp +++ /dev/null @@ -1,314 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include -#include -#include - -// cairo -#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO) -#include -#include -#include -#include -#endif - -using mapnik::image_32; -using mapnik::image_reader; -using mapnik::get_image_reader; -using mapnik::type_from_filename; -using mapnik::save_to_file; - -using namespace boost::python; - -// output 'raw' pixels -PyObject* tostring1( image_32 const& im) -{ - int size = im.width() * im.height() * 4; - return -#if PY_VERSION_HEX >= 0x03000000 - ::PyBytes_FromStringAndSize -#else - ::PyString_FromStringAndSize -#endif - ((const char*)im.raw_data(),size); -} - -// encode (png,jpeg) -PyObject* tostring2(image_32 const & im, std::string const& format) -{ - std::string s = mapnik::save_to_string(im.data(), format); - return -#if PY_VERSION_HEX >= 0x03000000 - ::PyBytes_FromStringAndSize -#else - ::PyString_FromStringAndSize -#endif - (s.data(),s.size()); -} - -PyObject* tostring3(image_32 const & im, std::string const& format, mapnik::rgba_palette const& pal) -{ - std::string s = mapnik::save_to_string(im.data(), format, pal); - return -#if PY_VERSION_HEX >= 0x03000000 - ::PyBytes_FromStringAndSize -#else - ::PyString_FromStringAndSize -#endif - (s.data(),s.size()); -} - - -void save_to_file1(mapnik::image_32 const& im, std::string const& filename) -{ - save_to_file(im.data(),filename); -} - -void save_to_file2(mapnik::image_32 const& im, std::string const& filename, std::string const& type) -{ - save_to_file(im.data(),filename,type); -} - -void save_to_file3(mapnik::image_32 const& im, std::string const& filename, std::string const& type, mapnik::rgba_palette const& pal) -{ - save_to_file(im.data(),filename,type,pal); -} - -bool painted(mapnik::image_32 const& im) -{ - return im.painted(); -} - -bool is_solid(mapnik::image_32 const& im) -{ - if (im.width() > 0 && im.height() > 0) - { - mapnik::image_data_rgba8 const & data = im.data(); - mapnik::image_data_rgba8::pixel_type const* first_row = data.getRow(0); - mapnik::image_data_rgba8::pixel_type const first_pixel = first_row[0]; - for (unsigned y = 0; y < im.height(); ++y) - { - mapnik::image_data_rgba8::pixel_type const * row = data.getRow(y); - for (unsigned x = 0; x < im.width(); ++x) - { - if (first_pixel != row[x]) - { - return false; - } - } - } - } - return true; -} - -unsigned get_pixel(mapnik::image_32 const& im, int x, int y) -{ - if (x < static_cast(im.width()) && y < static_cast(im.height())) - { - mapnik::image_data_rgba8 const & data = im.data(); - return data(x,y); - } - PyErr_SetString(PyExc_IndexError, "invalid x,y for image dimensions"); - boost::python::throw_error_already_set(); - return 0; -} - -void set_pixel(mapnik::image_32 & im, unsigned x, unsigned y, mapnik::color const& c) -{ - im.setPixel(x, y, c.rgba()); -} - -std::shared_ptr open_from_file(std::string const& filename) -{ - boost::optional type = type_from_filename(filename); - if (type) - { - std::unique_ptr reader(get_image_reader(filename,*type)); - if (reader.get()) - { - - std::shared_ptr image_ptr = std::make_shared(reader->width(),reader->height()); - reader->read(0,0,image_ptr->data()); - return image_ptr; - } - throw mapnik::image_reader_exception("Failed to load: " + filename); - } - throw mapnik::image_reader_exception("Unsupported image format:" + filename); -} - -std::shared_ptr fromstring(std::string const& str) -{ - std::unique_ptr reader(get_image_reader(str.c_str(),str.size())); - if (reader.get()) - { - std::shared_ptr image_ptr = std::make_shared(reader->width(),reader->height()); - reader->read(0,0,image_ptr->data()); - return image_ptr; - } - throw mapnik::image_reader_exception("Failed to load image from buffer" ); -} - -std::shared_ptr frombuffer(PyObject * obj) -{ - void const* buffer=0; - Py_ssize_t buffer_len; - if (PyObject_AsReadBuffer(obj, &buffer, &buffer_len) == 0) - { - std::unique_ptr reader(get_image_reader(reinterpret_cast(buffer),buffer_len)); - if (reader.get()) - { - std::shared_ptr image_ptr = std::make_shared(reader->width(),reader->height()); - reader->read(0,0,image_ptr->data()); - return image_ptr; - } - } - throw mapnik::image_reader_exception("Failed to load image from buffer" ); -} - - -void blend (image_32 & im, unsigned x, unsigned y, image_32 const& im2, float opacity) -{ - im.set_rectangle_alpha2(im2.data(),x,y,opacity); -} - -void composite(image_32 & dst, image_32 & src, mapnik::composite_mode_e mode, float opacity) -{ - mapnik::composite(dst.data(),src.data(),mode,opacity,0,0,false); -} - -#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO) -std::shared_ptr from_cairo(PycairoSurface* py_surface) -{ - mapnik::cairo_surface_ptr surface(cairo_surface_reference(py_surface->surface), mapnik::cairo_surface_closer()); - std::shared_ptr image_ptr = std::make_shared(cairo_image_surface_get_width(&*surface), cairo_image_surface_get_height(&*surface)); - cairo_image_to_rgba8(image_ptr->data(), surface); - return image_ptr; -} -#endif - -void export_image() -{ - using namespace boost::python; - // NOTE: must match list in include/mapnik/image_compositing.hpp - enum_("CompositeOp") - .value("clear", mapnik::clear) - .value("src", mapnik::src) - .value("dst", mapnik::dst) - .value("src_over", mapnik::src_over) - .value("dst_over", mapnik::dst_over) - .value("src_in", mapnik::src_in) - .value("dst_in", mapnik::dst_in) - .value("src_out", mapnik::src_out) - .value("dst_out", mapnik::dst_out) - .value("src_atop", mapnik::src_atop) - .value("dst_atop", mapnik::dst_atop) - .value("xor", mapnik::_xor) - .value("plus", mapnik::plus) - .value("minus", mapnik::minus) - .value("multiply", mapnik::multiply) - .value("screen", mapnik::screen) - .value("overlay", mapnik::overlay) - .value("darken", mapnik::darken) - .value("lighten", mapnik::lighten) - .value("color_dodge", mapnik::color_dodge) - .value("color_burn", mapnik::color_burn) - .value("hard_light", mapnik::hard_light) - .value("soft_light", mapnik::soft_light) - .value("difference", mapnik::difference) - .value("exclusion", mapnik::exclusion) - .value("contrast", mapnik::contrast) - .value("invert", mapnik::invert) - .value("grain_merge", mapnik::grain_merge) - .value("grain_extract", mapnik::grain_extract) - .value("hue", mapnik::hue) - .value("saturation", mapnik::saturation) - .value("color", mapnik::_color) - .value("value", mapnik::_value) - .value("linear_dodge", mapnik::linear_dodge) - .value("linear_burn", mapnik::linear_burn) - .value("divide", mapnik::divide) - ; - - class_ >("Image","This class represents a 32 bit RGBA image.",init()) - .def("width",&image_32::width) - .def("height",&image_32::height) - .def("view",&image_32::get_view) - .def("painted",&painted) - .def("is_solid",&is_solid) - .add_property("background",make_function - (&image_32::get_background,return_value_policy()), - &image_32::set_background, "The background color of the image.") - .def("set_grayscale_to_alpha",&image_32::set_grayscale_to_alpha, "Set the grayscale values to the alpha channel of the Image") - .def("set_color_to_alpha",&image_32::set_color_to_alpha, "Set a given color to the alpha channel of the Image") - .def("set_alpha",&image_32::set_alpha, "Set the overall alpha channel of the Image") - .def("blend",&blend) - .def("composite",&composite, - ( arg("self"), - arg("image"), - arg("mode")=mapnik::src_over, - arg("opacity")=1.0f - )) - .def("premultiplied",&image_32::premultiplied) - .def("premultiply",&image_32::premultiply) - .def("demultiply",&image_32::demultiply) - .def("set_pixel",&set_pixel) - .def("get_pixel",&get_pixel) - .def("clear",&image_32::clear) - //TODO(haoyu) The method name 'tostring' might be confusing since they actually return bytes in Python 3 - - .def("tostring",&tostring1) - .def("tostring",&tostring2) - .def("tostring",&tostring3) - .def("save", &save_to_file1) - .def("save", &save_to_file2) - .def("save", &save_to_file3) - .def("open",open_from_file) - .staticmethod("open") - .def("frombuffer",&frombuffer) - .staticmethod("frombuffer") - .def("fromstring",&fromstring) - .staticmethod("fromstring") -#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO) - .def("from_cairo",&from_cairo) - .staticmethod("from_cairo") -#endif - ; - -} diff --git a/bindings/python/mapnik_image_view.cpp b/bindings/python/mapnik_image_view.cpp deleted file mode 100644 index e08129f7f..000000000 --- a/bindings/python/mapnik_image_view.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include -#include -#include -#include - -using mapnik::image_data_rgba8; -using mapnik::image_view; -using mapnik::save_to_file; - -// output 'raw' pixels -PyObject* view_tostring1(image_view const& view) -{ - std::ostringstream ss(std::ios::out|std::ios::binary); - for (unsigned i=0;i(view.getRow(i)), - view.width() * sizeof(image_view::pixel_type)); - } - return -#if PY_VERSION_HEX >= 0x03000000 - ::PyBytes_FromStringAndSize -#else - ::PyString_FromStringAndSize -#endif - ((const char*)ss.str().c_str(),ss.str().size()); -} - -// encode (png,jpeg) -PyObject* view_tostring2(image_view const & view, std::string const& format) -{ - std::string s = save_to_string(view, format); - return -#if PY_VERSION_HEX >= 0x03000000 - ::PyBytes_FromStringAndSize -#else - ::PyString_FromStringAndSize -#endif - (s.data(),s.size()); -} - -PyObject* view_tostring3(image_view const & view, std::string const& format, mapnik::rgba_palette const& pal) -{ - std::string s = save_to_string(view, format, pal); - return -#if PY_VERSION_HEX >= 0x03000000 - ::PyBytes_FromStringAndSize -#else - ::PyString_FromStringAndSize -#endif - (s.data(),s.size()); -} - -bool is_solid(image_view const& view) -{ - if (view.width() > 0 && view.height() > 0) - { - mapnik::image_view::pixel_type const* first_row = view.getRow(0); - mapnik::image_view::pixel_type const first_pixel = first_row[0]; - for (unsigned y = 0; y < view.height(); ++y) - { - mapnik::image_view::pixel_type const * row = view.getRow(y); - for (unsigned x = 0; x < view.width(); ++x) - { - if (first_pixel != row[x]) - { - return false; - } - } - } - } - return true; -} - -void save_view1(image_view const& view, - std::string const& filename) -{ - save_to_file(view,filename); -} - -void save_view2(image_view const& view, - std::string const& filename, - std::string const& type) -{ - save_to_file(view,filename,type); -} - -void save_view3(image_view const& view, - std::string const& filename, - std::string const& type, - mapnik::rgba_palette const& pal) -{ - save_to_file(view,filename,type,pal); -} - - -void export_image_view() -{ - using namespace boost::python; - class_ >("ImageView","A view into an image.",no_init) - .def("width",&image_view::width) - .def("height",&image_view::height) - .def("is_solid",&is_solid) - .def("tostring",&view_tostring1) - .def("tostring",&view_tostring2) - .def("tostring",&view_tostring3) - .def("save",&save_view1) - .def("save",&save_view2) - .def("save",&save_view3) - ; -} diff --git a/bindings/python/mapnik_label_collision_detector.cpp b/bindings/python/mapnik_label_collision_detector.cpp deleted file mode 100644 index eb16ea87d..000000000 --- a/bindings/python/mapnik_label_collision_detector.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#include -#pragma GCC diagnostic pop - -#include -#include - -#include - -using mapnik::label_collision_detector4; -using mapnik::box2d; -using mapnik::Map; - -namespace -{ - -std::shared_ptr -create_label_collision_detector_from_extent(box2d const &extent) -{ - return std::make_shared(extent); -} - -std::shared_ptr -create_label_collision_detector_from_map(Map const &m) -{ - double buffer = m.buffer_size(); - box2d extent(-buffer, -buffer, m.width() + buffer, m.height() + buffer); - return std::make_shared(extent); -} - -boost::python::list -make_label_boxes(std::shared_ptr det) -{ - boost::python::list boxes; - - for (label_collision_detector4::query_iterator jtr = det->begin(); - jtr != det->end(); ++jtr) - { - boxes.append >(jtr->box); - } - - return boxes; -} - -} - -void export_label_collision_detector() -{ - using namespace boost::python; - - // for overload resolution - void (label_collision_detector4::*insert_box)(box2d const &) = &label_collision_detector4::insert; - - class_, boost::noncopyable> - ("LabelCollisionDetector", - "Object to detect collisions between labels, used in the rendering process.", - no_init) - - .def("__init__", make_constructor(create_label_collision_detector_from_extent), - "Creates an empty collision detection object with a given extent. Note " - "that the constructor from Map objects is a sensible default and usually " - "what you want to do.\n" - "\n" - "Example:\n" - ">>> m = Map(size_x, size_y)\n" - ">>> buf_sz = m.buffer_size\n" - ">>> extent = mapnik.Box2d(-buf_sz, -buf_sz, m.width + buf_sz, m.height + buf_sz)\n" - ">>> detector = mapnik.LabelCollisionDetector(extent)") - - .def("__init__", make_constructor(create_label_collision_detector_from_map), - "Creates an empty collision detection object matching the given Map object. " - "The created detector will have the same size, including the buffer, as the " - "map object. This is usually what you want to do.\n" - "\n" - "Example:\n" - ">>> m = Map(size_x, size_y)\n" - ">>> detector = mapnik.LabelCollisionDetector(m)") - - .def("extent", &label_collision_detector4::extent, return_value_policy(), - "Returns the total extent (bounding box) of all labels inside the detector.\n" - "\n" - "Example:\n" - ">>> detector.extent()\n" - "Box2d(573.252589209,494.789179821,584.261023823,496.83610261)") - - .def("boxes", &make_label_boxes, - "Returns a list of all the label boxes inside the detector.") - - .def("insert", insert_box, - "Insert a 2d box into the collision detector. This can be used to ensure that " - "some space is left clear on the map for later overdrawing, for example by " - "non-Mapnik processes.\n" - "\n" - "Example:\n" - ">>> m = Map(size_x, size_y)\n" - ">>> detector = mapnik.LabelCollisionDetector(m)" - ">>> detector.insert(mapnik.Box2d(196, 254, 291, 389))") - ; -} diff --git a/bindings/python/mapnik_layer.cpp b/bindings/python/mapnik_layer.cpp deleted file mode 100644 index 405755bad..000000000 --- a/bindings/python/mapnik_layer.cpp +++ /dev/null @@ -1,388 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include - -using mapnik::layer; -using mapnik::parameters; -using mapnik::datasource_cache; - - -struct layer_pickle_suite : boost::python::pickle_suite -{ - static boost::python::tuple - getinitargs(const layer& l) - { - return boost::python::make_tuple(l.name(),l.srs()); - } - - static boost::python::tuple - getstate(const layer& l) - { - boost::python::list s; - std::vector const& style_names = l.styles(); - for (unsigned i = 0; i < style_names.size(); ++i) - { - s.append(style_names[i]); - } - return boost::python::make_tuple(l.clear_label_cache(),l.min_zoom(),l.max_zoom(),l.queryable(),l.datasource()->params(),l.cache_features(),s); - } - - static void - setstate (layer& l, boost::python::tuple state) - { - using namespace boost::python; - if (len(state) != 9) - { - PyErr_SetObject(PyExc_ValueError, - ("expected 9-item tuple in call to __setstate__; got %s" - % state).ptr() - ); - throw_error_already_set(); - } - - l.set_clear_label_cache(extract(state[0])); - - l.set_min_zoom(extract(state[1])); - - l.set_max_zoom(extract(state[2])); - - l.set_queryable(extract(state[3])); - - mapnik::parameters params = extract(state[4]); - l.set_datasource(datasource_cache::instance().create(params)); - - boost::python::list s = extract(state[5]); - for (int i=0;i(s[i])); - } - - l.set_cache_features(extract(state[6])); - } -}; - -std::vector & (mapnik::layer::*_styles_)() = &mapnik::layer::styles; - -void set_maximum_extent(mapnik::layer & l, boost::optional > const& box) -{ - if (box) - { - l.set_maximum_extent(*box); - } - else - { - l.reset_maximum_extent(); - } -} - -void set_buffer_size(mapnik::layer & l, boost::optional const& buffer_size) -{ - if (buffer_size) - { - l.set_buffer_size(*buffer_size); - } - else - { - l.reset_buffer_size(); - } -} - -PyObject * get_buffer_size(mapnik::layer & l) -{ - boost::optional buffer_size = l.buffer_size(); - if (buffer_size) - { -#if PY_VERSION_HEX >= 0x03000000 - return PyLong_FromLong(*buffer_size); -#else - return PyInt_FromLong(*buffer_size); -#endif - } - else - { - Py_RETURN_NONE; - } -} - -void export_layer() -{ - using namespace boost::python; - class_ >("Names") - .def(vector_indexing_suite,true >()) - ; - - class_("Layer", "A Mapnik map layer.", init >( - "Create a Layer with a named string and, optionally, an srs string.\n" - "\n" - "The srs can be either a Proj.4 epsg code ('+init=epsg:') or\n" - "of a Proj.4 literal ('+proj=').\n" - "If no srs is specified it will default to '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'\n" - "\n" - "Usage:\n" - ">>> from mapnik import Layer\n" - ">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n" - ">>> lyr\n" - "\n" - )) - - .def_pickle(layer_pickle_suite()) - - .def("envelope",&layer::envelope, - "Return the geographic envelope/bounding box." - "\n" - "Determined based on the layer datasource.\n" - "\n" - "Usage:\n" - ">>> from mapnik import Layer\n" - ">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n" - ">>> lyr.envelope()\n" - "box2d(-1.0,-1.0,0.0,0.0) # default until a datasource is loaded\n" - ) - - .def("visible", &layer::visible, - "Return True if this layer's data is active and visible at a given scale.\n" - "\n" - "Otherwise returns False.\n" - "Accepts a scale value as an integer or float input.\n" - "Will return False if:\n" - "\tscale >= minzoom - 1e-6\n" - "\tor:\n" - "\tscale < maxzoom + 1e-6\n" - "\n" - "Usage:\n" - ">>> from mapnik import Layer\n" - ">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n" - ">>> lyr.visible(1.0/1000000)\n" - "True\n" - ">>> lyr.active = False\n" - ">>> lyr.visible(1.0/1000000)\n" - "False\n" - ) - - .add_property("active", - &layer::active, - &layer::set_active, - "Get/Set whether this layer is active and will be rendered (same as status property).\n" - "\n" - "Usage:\n" - ">>> from mapnik import Layer\n" - ">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n" - ">>> lyr.active\n" - "True # Active by default\n" - ">>> lyr.active = False # set False to disable layer rendering\n" - ">>> lyr.active\n" - "False\n" - ) - - .add_property("status", - &layer::active, - &layer::set_active, - "Get/Set whether this layer is active and will be rendered.\n" - "\n" - "Usage:\n" - ">>> from mapnik import Layer\n" - ">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n" - ">>> lyr.status\n" - "True # Active by default\n" - ">>> lyr.status = False # set False to disable layer rendering\n" - ">>> lyr.status\n" - "False\n" - ) - - .add_property("clear_label_cache", - &layer::clear_label_cache, - &layer::set_clear_label_cache, - "Get/Set whether to clear the label collision detector cache for this layer during rendering\n" - "\n" - "Usage:\n" - ">>> lyr.clear_label_cache\n" - "False # False by default, meaning label positions from other layers will impact placement \n" - ">>> lyr.clear_label_cache = True # set to True to clear the label collision detector cache\n" - ) - - .add_property("cache_features", - &layer::cache_features, - &layer::set_cache_features, - "Get/Set whether features should be cached during rendering if used between multiple styles\n" - "\n" - "Usage:\n" - ">>> lyr.cache_features\n" - "False # False by default\n" - ">>> lyr.cache_features = True # set to True to enable feature caching\n" - ) - - .add_property("datasource", - &layer::datasource, - &layer::set_datasource, - "The datasource attached to this layer.\n" - "\n" - "Usage:\n" - ">>> from mapnik import Layer, Datasource\n" - ">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n" - ">>> lyr.datasource = Datasource(type='shape',file='world_borders')\n" - ">>> lyr.datasource\n" - "\n" - ) - - .add_property("buffer_size", - &get_buffer_size, - &set_buffer_size, - "Get/Set the size of buffer around layer in pixels.\n" - "\n" - "Usage:\n" - ">>> print(l.buffer_size)\n" - "None # None by default\n" - ">>> l.buffer_size = 2\n" - ">>> l.buffer_size\n" - "2\n" - ) - - .add_property("maximum_extent",make_function - (&layer::maximum_extent,return_value_policy()), - &set_maximum_extent, - "The maximum extent of the map.\n" - "\n" - "Usage:\n" - ">>> m.maximum_extent = Box2d(-180,-90,180,90)\n" - ) - - .add_property("maxzoom", - &layer::max_zoom, - &layer::set_max_zoom, - "Get/Set the maximum zoom lever of the layer.\n" - "\n" - "Usage:\n" - ">>> from mapnik import Layer\n" - ">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n" - ">>> lyr.maxzoom\n" - "1.7976931348623157e+308 # default is the numerical maximum\n" - ">>> lyr.maxzoom = 1.0/1000000\n" - ">>> lyr.maxzoom\n" - "9.9999999999999995e-07\n" - ) - - .add_property("minzoom", - &layer::min_zoom, - &layer::set_min_zoom, - "Get/Set the minimum zoom lever of the layer.\n" - "\n" - "Usage:\n" - ">>> from mapnik import Layer\n" - ">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n" - ">>> lyr.minzoom # default is 0\n" - "0.0\n" - ">>> lyr.minzoom = 1.0/1000000\n" - ">>> lyr.minzoom\n" - "9.9999999999999995e-07\n" - ) - - .add_property("name", - make_function(&layer::name, return_value_policy()), - &layer::set_name, - "Get/Set the name of the layer.\n" - "\n" - "Usage:\n" - ">>> from mapnik import Layer\n" - ">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n" - ">>> lyr.name\n" - "'My Layer'\n" - ">>> lyr.name = 'New Name'\n" - ">>> lyr.name\n" - "'New Name'\n" - ) - - .add_property("queryable", - &layer::queryable, - &layer::set_queryable, - "Get/Set whether this layer is queryable.\n" - "\n" - "Usage:\n" - ">>> from mapnik import layer\n" - ">>> lyr = layer('My layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n" - ">>> lyr.queryable\n" - "False # Not queryable by default\n" - ">>> lyr.queryable = True\n" - ">>> lyr.queryable\n" - "True\n" - ) - - .add_property("srs", - make_function(&layer::srs,return_value_policy()), - &layer::set_srs, - "Get/Set the SRS of the layer.\n" - "\n" - "Usage:\n" - ">>> from mapnik import layer\n" - ">>> lyr = layer('My layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n" - ">>> lyr.srs\n" - "'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' # The default srs if not initialized with custom srs\n" - ">>> # set to google mercator with Proj.4 literal\n" - "... \n" - ">>> lyr.srs = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over'\n" - ) - - .add_property("group_by", - make_function(&layer::group_by,return_value_policy()), - &layer::set_group_by, - "Get/Set the optional layer group name.\n" - "\n" - "More details at https://github.com/mapnik/mapnik/wiki/Grouped-rendering:\n" - ) - - .add_property("styles", - make_function(_styles_,return_value_policy()), - "The styles list attached to this layer.\n" - "\n" - "Usage:\n" - ">>> from mapnik import layer\n" - ">>> lyr = layer('My layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n" - ">>> lyr.styles\n" - "\n" - ">>> len(lyr.styles)\n" - "0\n # no styles until you append them\n" - "lyr.styles.append('My Style') # mapnik uses named styles for flexibility\n" - ">>> len(lyr.styles)\n" - "1\n" - ">>> lyr.styles[0]\n" - "'My Style'\n" - ) - // comparison - .def(self == self) - ; -} diff --git a/bindings/python/mapnik_logger.cpp b/bindings/python/mapnik_logger.cpp deleted file mode 100644 index 7c9591211..000000000 --- a/bindings/python/mapnik_logger.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#pragma GCC diagnostic pop - -#include -#include -#include "mapnik_enumeration.hpp" - -void export_logger() -{ - using mapnik::logger; - using mapnik::singleton; - using mapnik::CreateStatic; - using namespace boost::python; - - class_,boost::noncopyable>("Singleton",no_init) - .def("instance",&singleton::instance, - return_value_policy()) - .staticmethod("instance") - ; - - enum_("severity_type") - .value("Debug", logger::debug) - .value("Warn", logger::warn) - .value("Error", logger::error) - .value("None", logger::none) - ; - - class_ >, - boost::noncopyable>("logger",no_init) - .def("get_severity", &logger::get_severity) - .def("set_severity", &logger::set_severity) - .def("get_object_severity", &logger::get_object_severity) - .def("set_object_severity", &logger::set_object_severity) - .def("clear_object_severity", &logger::clear_object_severity) - .def("get_format", &logger::get_format) - .def("set_format", &logger::set_format) - .def("str", &logger::str) - .def("use_file", &logger::use_file) - .def("use_console", &logger::use_console) - .staticmethod("get_severity") - .staticmethod("set_severity") - .staticmethod("get_object_severity") - .staticmethod("set_object_severity") - .staticmethod("clear_object_severity") - .staticmethod("get_format") - .staticmethod("set_format") - .staticmethod("str") - .staticmethod("use_file") - .staticmethod("use_console") - ; -} diff --git a/bindings/python/mapnik_map.cpp b/bindings/python/mapnik_map.cpp deleted file mode 100644 index 15ecc67fd..000000000 --- a/bindings/python/mapnik_map.cpp +++ /dev/null @@ -1,543 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#include -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include -#include -#include -#include -#include "mapnik_enumeration.hpp" - -using mapnik::color; -using mapnik::coord; -using mapnik::box2d; -using mapnik::layer; -using mapnik::Map; - -std::vector& (Map::*layers_nonconst)() = &Map::layers; -std::vector const& (Map::*layers_const)() const = &Map::layers; -mapnik::parameters& (Map::*params_nonconst)() = &Map::get_extra_parameters; - -void insert_style(mapnik::Map & m, std::string const& name, mapnik::feature_type_style const& style) -{ - m.insert_style(name,style); -} - -void insert_fontset(mapnik::Map & m, std::string const& name, mapnik::font_set const& fontset) -{ - m.insert_fontset(name,fontset); -} - -mapnik::feature_type_style find_style(mapnik::Map const& m, std::string const& name) -{ - boost::optional style = m.find_style(name); - if (!style) - { - PyErr_SetString(PyExc_KeyError, "Invalid style name"); - boost::python::throw_error_already_set(); - } - return *style; -} - -mapnik::font_set find_fontset(mapnik::Map const& m, std::string const& name) -{ - boost::optional fontset = m.find_fontset(name); - if (!fontset) - { - PyErr_SetString(PyExc_KeyError, "Invalid font_set name"); - boost::python::throw_error_already_set(); - } - return *fontset; -} - -// TODO - we likely should allow indexing by negative number from python -// for now, protect against negative values and kindly throw -mapnik::featureset_ptr query_point(mapnik::Map const& m, int index, double x, double y) -{ - if (index < 0){ - PyErr_SetString(PyExc_IndexError, "Please provide a layer index >= 0"); - boost::python::throw_error_already_set(); - } - unsigned idx = index; - return m.query_point(idx, x, y); -} - -mapnik::featureset_ptr query_map_point(mapnik::Map const& m, int index, double x, double y) -{ - if (index < 0){ - PyErr_SetString(PyExc_IndexError, "Please provide a layer index >= 0"); - boost::python::throw_error_already_set(); - } - unsigned idx = index; - return m.query_map_point(idx, x, y); -} - -void set_maximum_extent(mapnik::Map & m, boost::optional > const& box) -{ - if (box) - { - m.set_maximum_extent(*box); - } - else - { - m.reset_maximum_extent(); - } -} - -struct extract_style -{ - using result_type = boost::python::tuple; - result_type operator() (std::map::value_type const& val) const - { - return boost::python::make_tuple(val.first,val.second); - } -}; - -using style_extract_iterator = boost::transform_iterator; -using style_range = std::pair; - -style_range _styles_ (mapnik::Map const& m) -{ - return style_range( - boost::make_transform_iterator(m.begin_styles(), extract_style()), - boost::make_transform_iterator(m.end_styles(), extract_style())); -} - -void export_map() -{ - using namespace boost::python; - - // aspect ratio fix modes - mapnik::enumeration_("aspect_fix_mode") - .value("GROW_BBOX", mapnik::Map::GROW_BBOX) - .value("GROW_CANVAS",mapnik::Map::GROW_CANVAS) - .value("SHRINK_BBOX",mapnik::Map::SHRINK_BBOX) - .value("SHRINK_CANVAS",mapnik::Map::SHRINK_CANVAS) - .value("ADJUST_BBOX_WIDTH",mapnik::Map::ADJUST_BBOX_WIDTH) - .value("ADJUST_BBOX_HEIGHT",mapnik::Map::ADJUST_BBOX_HEIGHT) - .value("ADJUST_CANVAS_WIDTH",mapnik::Map::ADJUST_CANVAS_WIDTH) - .value("ADJUST_CANVAS_HEIGHT", mapnik::Map::ADJUST_CANVAS_HEIGHT) - .value("RESPECT", mapnik::Map::RESPECT) - ; - - class_ >("Layers") - .def(vector_indexing_suite >()) - ; - - class_("StyleRange") - .def("__iter__", - boost::python::range(&style_range::first, &style_range::second)) - ; - - class_("Map","The map object.",init >( - ( arg("width"),arg("height"),arg("srs") ), - "Create a Map with a width and height as integers and, optionally,\n" - "an srs string either with a Proj.4 epsg code ('+init=epsg:')\n" - "or with a Proj.4 literal ('+proj=').\n" - "If no srs is specified the map will default to '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map\n" - ">>> m = Map(600,400)\n" - ">>> m\n" - "\n" - ">>> m.srs\n" - "'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'\n" - )) - - .def("append_style",insert_style, - (arg("style_name"),arg("style_object")), - "Insert a Mapnik Style onto the map by appending it.\n" - "\n" - "Usage:\n" - ">>> sty\n" - "\n" - ">>> m.append_style('Style Name', sty)\n" - "True # style object added to map by name\n" - ">>> m.append_style('Style Name', sty)\n" - "False # you can only append styles with unique names\n" - ) - - .def("append_fontset",insert_fontset, - (arg("fontset")), - "Add a FontSet to the map." - ) - - .def("buffered_envelope", - &Map::get_buffered_extent, - "Get the Box2d() of the Map given\n" - "the Map.buffer_size.\n" - "\n" - "Usage:\n" - ">>> m = Map(600,400)\n" - ">>> m.envelope()\n" - "Box2d(-1.0,-1.0,0.0,0.0)\n" - ">>> m.buffered_envelope()\n" - "Box2d(-1.0,-1.0,0.0,0.0)\n" - ">>> m.buffer_size = 1\n" - ">>> m.buffered_envelope()\n" - "Box2d(-1.02222222222,-1.02222222222,0.0222222222222,0.0222222222222)\n" - ) - - .def("envelope", - make_function(&Map::get_current_extent, - return_value_policy()), - "Return the Map Box2d object\n" - "and print the string representation\n" - "of the current extent of the map.\n" - "\n" - "Usage:\n" - ">>> m.envelope()\n" - "Box2d(-0.185833333333,-0.96,0.189166666667,-0.71)\n" - ">>> dir(m.envelope())\n" - "...'center', 'contains', 'expand_to_include', 'forward',\n" - "...'height', 'intersect', 'intersects', 'inverse', 'maxx',\n" - "...'maxy', 'minx', 'miny', 'width'\n" - ) - - .def("find_fontset",find_fontset, - (arg("name")), - "Find a fontset by name." - ) - - .def("find_style", - find_style, - (arg("name")), - "Query the Map for a style by name and return\n" - "a style object if found or raise KeyError\n" - "style if not found.\n" - "\n" - "Usage:\n" - ">>> m.find_style('Style Name')\n" - "\n" - ) - - .add_property("styles", _styles_) - - .def("pan",&Map::pan, - (arg("x"),arg("y")), - "Set the Map center at a given x,y location\n" - "as integers in the coordinates of the pixmap or map surface.\n" - "\n" - "Usage:\n" - ">>> m = Map(600,400)\n" - ">>> m.envelope().center()\n" - "Coord(-0.5,-0.5) # default Map center\n" - ">>> m.pan(-1,-1)\n" - ">>> m.envelope().center()\n" - "Coord(0.00166666666667,-0.835)\n" - ) - - .def("pan_and_zoom",&Map::pan_and_zoom, - (arg("x"),arg("y"),arg("factor")), - "Set the Map center at a given x,y location\n" - "and zoom factor as a float.\n" - "\n" - "Usage:\n" - ">>> m = Map(600,400)\n" - ">>> m.envelope().center()\n" - "Coord(-0.5,-0.5) # default Map center\n" - ">>> m.scale()\n" - "-0.0016666666666666668\n" - ">>> m.pan_and_zoom(-1,-1,0.25)\n" - ">>> m.scale()\n" - "0.00062500000000000001\n" - ) - - .def("query_map_point",query_map_point, - (arg("layer_idx"),arg("pixel_x"),arg("pixel_y")), - "Query a Map Layer (by layer index) for features \n" - "intersecting the given x,y location in the pixel\n" - "coordinates of the rendered map image.\n" - "Layer index starts at 0 (first layer in map).\n" - "Will return a Mapnik Featureset if successful\n" - "otherwise will return None.\n" - "\n" - "Usage:\n" - ">>> featureset = m.query_map_point(0,200,200)\n" - ">>> featureset\n" - "\n" - ">>> featureset.features\n" - ">>> []\n" - ) - - .def("query_point",query_point, - (arg("layer idx"),arg("x"),arg("y")), - "Query a Map Layer (by layer index) for features \n" - "intersecting the given x,y location in the coordinates\n" - "of map projection.\n" - "Layer index starts at 0 (first layer in map).\n" - "Will return a Mapnik Featureset if successful\n" - "otherwise will return None.\n" - "\n" - "Usage:\n" - ">>> featureset = m.query_point(0,-122,48)\n" - ">>> featureset\n" - "\n" - ">>> featureset.features\n" - ">>> []\n" - ) - - .def("remove_all",&Map::remove_all, - "Remove all Mapnik Styles and layers from the Map.\n" - "\n" - "Usage:\n" - ">>> m.remove_all()\n" - ) - - .def("remove_style",&Map::remove_style, - (arg("style_name")), - "Remove a Mapnik Style from the map.\n" - "\n" - "Usage:\n" - ">>> m.remove_style('Style Name')\n" - ) - - .def("resize",&Map::resize, - (arg("width"),arg("height")), - "Resize a Mapnik Map.\n" - "\n" - "Usage:\n" - ">>> m.resize(64,64)\n" - ) - - .def("scale", &Map::scale, - "Return the Map Scale.\n" - "Usage:\n" - "\n" - ">>> m.scale()\n" - ) - - .def("scale_denominator", &Map::scale_denominator, - "Return the Map Scale Denominator.\n" - "Usage:\n" - "\n" - ">>> m.scale_denominator()\n" - ) - - .def("view_transform",&Map::transform, - "Return the map ViewTransform object\n" - "which is used internally to convert between\n" - "geographic coordinates and screen coordinates.\n" - "\n" - "Usage:\n" - ">>> m.view_transform()\n" - ) - - .def("zoom",&Map::zoom, - (arg("factor")), - "Zoom in or out by a given factor.\n" - "positive number larger than 1, zooms out\n" - "positive number smaller than 1, zooms in\n" - "\n" - "Usage:\n" - "\n" - ">>> m.zoom(0.25)\n" - ) - - .def("zoom_all",&Map::zoom_all, - "Set the geographical extent of the map\n" - "to the combined extents of all active layers.\n" - "\n" - "Usage:\n" - ">>> m.zoom_all()\n" - ) - - .def("zoom_to_box",&Map::zoom_to_box, - (arg("Boxd2")), - "Set the geographical extent of the map\n" - "by specifying a Mapnik Box2d.\n" - "\n" - "Usage:\n" - ">>> extext = Box2d(-180.0, -90.0, 180.0, 90.0)\n" - ">>> m.zoom_to_box(extent)\n" - ) - - .add_property("parameters",make_function(params_nonconst,return_value_policy()),"TODO") - - .add_property("aspect_fix_mode", - &Map::get_aspect_fix_mode, - &Map::set_aspect_fix_mode, - // TODO - how to add arg info to properties? - //(arg("aspect_fix_mode")), - "Get/Set aspect fix mode.\n" - "Usage:\n" - "\n" - ">>> m.aspect_fix_mode = aspect_fix_mode.GROW_BBOX\n" - ) - - .add_property("background",make_function - (&Map::background,return_value_policy()), - &Map::set_background, - "The background color of the map (same as background_color property).\n" - "\n" - "Usage:\n" - ">>> m.background = Color('steelblue')\n" - ) - - .add_property("background_color",make_function - (&Map::background,return_value_policy()), - &Map::set_background, - "The background color of the map.\n" - "\n" - "Usage:\n" - ">>> m.background_color = Color('steelblue')\n" - ) - - .add_property("background_image",make_function - (&Map::background_image,return_value_policy()), - &Map::set_background_image, - "The optional background image of the map.\n" - "\n" - "Usage:\n" - ">>> m.background_image = '/path/to/image.png'\n" - ) - - .add_property("background_image_comp_op",&Map::background_image_comp_op, - &Map::set_background_image_comp_op, - "The background image compositing operation.\n" - "\n" - "Usage:\n" - ">>> m.background_image_comp_op = mapnik.CompositeOp.src_over\n" - ) - - .add_property("background_image_opacity",&Map::background_image_opacity, - &Map::set_background_image_opacity, - "The background image opacity.\n" - "\n" - "Usage:\n" - ">>> m.background_image_opacity = 1.0\n" - ) - - .add_property("base", - make_function(&Map::base_path,return_value_policy()), - &Map::set_base_path, - "The base path of the map where any files using relative \n" - "paths will be interpreted as relative to.\n" - "\n" - "Usage:\n" - ">>> m.base_path = '.'\n" - ) - - .add_property("buffer_size", - &Map::buffer_size, - &Map::set_buffer_size, - "Get/Set the size of buffer around map in pixels.\n" - "\n" - "Usage:\n" - ">>> m.buffer_size\n" - "0 # zero by default\n" - ">>> m.buffer_size = 2\n" - ">>> m.buffer_size\n" - "2\n" - ) - - .add_property("height", - &Map::height, - &Map::set_height, - "Get/Set the height of the map in pixels.\n" - "Minimum settable size is 16 pixels.\n" - "\n" - "Usage:\n" - ">>> m.height\n" - "400\n" - ">>> m.height = 600\n" - ">>> m.height\n" - "600\n" - ) - - .add_property("layers",make_function - (layers_nonconst,return_value_policy()), - "The list of map layers.\n" - "\n" - "Usage:\n" - ">>> m.layers\n" - "" - ">>> m.layers[0]\n" - "\n" - ) - - .add_property("maximum_extent",make_function - (&Map::maximum_extent,return_value_policy()), - &set_maximum_extent, - "The maximum extent of the map.\n" - "\n" - "Usage:\n" - ">>> m.maximum_extent = Box2d(-180,-90,180,90)\n" - ) - - .add_property("srs", - make_function(&Map::srs,return_value_policy()), - &Map::set_srs, - "Spatial reference in Proj.4 format.\n" - "Either an epsg code or proj literal.\n" - "For example, a proj literal:\n" - "\t'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'\n" - "and a proj epsg code:\n" - "\t'+init=epsg:4326'\n" - "\n" - "Note: using epsg codes requires the installation of\n" - "the Proj.4 'epsg' data file normally found in '/usr/local/share/proj'\n" - "\n" - "Usage:\n" - ">>> m.srs\n" - "'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' # The default srs if not initialized with custom srs\n" - ">>> # set to google mercator with Proj.4 literal\n" - "... \n" - ">>> m.srs = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over'\n" - ) - - .add_property("width", - &Map::width, - &Map::set_width, - "Get/Set the width of the map in pixels.\n" - "Minimum settable size is 16 pixels.\n" - "\n" - "Usage:\n" - ">>> m.width\n" - "600\n" - ">>> m.width = 800\n" - ">>> m.width\n" - "800\n" - ) - // comparison - .def(self == self) - ; -} diff --git a/bindings/python/mapnik_palette.cpp b/bindings/python/mapnik_palette.cpp deleted file mode 100644 index 12cf2fdec..000000000 --- a/bindings/python/mapnik_palette.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#pragma GCC diagnostic pop - -//mapnik -#include - -// stl -#include - -static std::shared_ptr make_palette( std::string const& palette, std::string const& format ) -{ - mapnik::rgba_palette::palette_type type = mapnik::rgba_palette::PALETTE_RGBA; - if (format == "rgb") - type = mapnik::rgba_palette::PALETTE_RGB; - else if (format == "act") - type = mapnik::rgba_palette::PALETTE_ACT; - else - throw std::runtime_error("invalid type passed for mapnik.Palette: must be either rgba, rgb, or act"); - return std::make_shared(palette, type); -} - -void export_palette () -{ - using namespace boost::python; - - class_, - boost::noncopyable >("Palette",no_init) - //, init( - // ( arg("palette"), arg("type")), - // "Creates a new color palette from a file\n" - // ) - .def( "__init__", boost::python::make_constructor(make_palette)) - .def("to_string", &mapnik::rgba_palette::to_string, - "Returns the palette as a string.\n" - ) - ; -} diff --git a/bindings/python/mapnik_parameters.cpp b/bindings/python/mapnik_parameters.cpp deleted file mode 100644 index 21504d3ba..000000000 --- a/bindings/python/mapnik_parameters.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include -#include -#include -// stl -#include - -using mapnik::parameter; -using mapnik::parameters; - -struct parameter_pickle_suite : boost::python::pickle_suite -{ - static boost::python::tuple - getinitargs(const parameter& p) - { - using namespace boost::python; - return boost::python::make_tuple(p.first,p.second); - } -}; - -struct parameters_pickle_suite : boost::python::pickle_suite -{ - static boost::python::tuple - getstate(const parameters& p) - { - using namespace boost::python; - dict d; - parameters::const_iterator pos=p.begin(); - while(pos!=p.end()) - { - d[pos->first] = pos->second; - ++pos; - } - return boost::python::make_tuple(d); - } - - static void setstate(parameters& p, boost::python::tuple state) - { - using namespace boost::python; - if (len(state) != 1) - { - PyErr_SetObject(PyExc_ValueError, - ("expected 1-item tuple in call to __setstate__; got %s" - % state).ptr() - ); - throw_error_already_set(); - } - - dict d = extract(state[0]); - boost::python::list keys = d.keys(); - for (int i=0; i(keys[i]); - object obj = d[key]; - extract ex0(obj); - extract ex1(obj); - extract ex2(obj); - extract ex3(obj); - - // TODO - this is never hit - we need proper python string -> std::string to get invoked here - if (ex0.check()) - { - p[key] = ex0(); - } - else if (ex1.check()) - { - p[key] = ex1(); - } - else if (ex2.check()) - { - p[key] = ex2(); - } - else if (ex3.check()) - { - std::string buffer; - mapnik::to_utf8(ex3(),buffer); - p[key] = buffer; - } - else - { - MAPNIK_LOG_DEBUG(bindings) << "parameters_pickle_suite: Could not unpickle key=" << key; - } - } - } -}; - - -mapnik::value_holder get_params_by_key1(mapnik::parameters const& p, std::string const& key) -{ - parameters::const_iterator pos = p.find(key); - if (pos != p.end()) - { - // will be auto-converted to proper python type by `mapnik_params_to_python` - return pos->second; - } - return mapnik::value_null(); -} - -mapnik::value_holder get_params_by_key2(mapnik::parameters const& p, std::string const& key) -{ - parameters::const_iterator pos = p.find(key); - if (pos == p.end()) - { - PyErr_SetString(PyExc_KeyError, key.c_str()); - boost::python::throw_error_already_set(); - } - // will be auto-converted to proper python type by `mapnik_params_to_python` - return pos->second; -} - -mapnik::parameter get_params_by_index(mapnik::parameters const& p, int index) -{ - if (index < 0 || static_cast(index) > p.size()) - { - PyErr_SetString(PyExc_IndexError, "Index is out of range"); - throw boost::python::error_already_set(); - } - - parameters::const_iterator itr = p.begin(); - std::advance(itr, index); - if (itr != p.end()) - { - return *itr; - } - PyErr_SetString(PyExc_IndexError, "Index is out of range"); - throw boost::python::error_already_set(); -} - -unsigned get_params_size(mapnik::parameters const& p) -{ - return p.size(); -} - -void add_parameter(mapnik::parameters & p, mapnik::parameter const& param) -{ - p[param.first] = param.second; -} - -mapnik::value_holder get_param(mapnik::parameter const& p, int index) -{ - if (index == 0) - { - return p.first; - } - else if (index == 1) - { - return p.second; - } - else - { - PyErr_SetString(PyExc_IndexError, "Index is out of range"); - throw boost::python::error_already_set(); - } -} - -std::shared_ptr create_parameter(mapnik::value_unicode_string const& key, mapnik::value_holder const& value) -{ - std::string key_utf8; - mapnik::to_utf8(key, key_utf8); - return std::make_shared(key_utf8,value); -} - -bool contains(mapnik::parameters const& p, std::string const& key) -{ - parameters::const_iterator pos = p.find(key); - return pos != p.end(); -} - -// needed for Python_Unicode to std::string (utf8) conversion - -std::shared_ptr create_parameter_from_string(mapnik::value_unicode_string const& key, mapnik::value_unicode_string const& ustr) -{ - std::string key_utf8; - std::string ustr_utf8; - mapnik::to_utf8(key, key_utf8); - mapnik::to_utf8(ustr,ustr_utf8); - return std::make_shared(key_utf8, ustr_utf8); -} - -void export_parameters() -{ - using namespace boost::python; - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - - class_ >("Parameter",no_init) - .def("__init__", make_constructor(create_parameter), - "Create a mapnik.Parameter from a pair of values, the first being a string\n" - "and the second being either a string, and integer, or a float") - .def("__init__", make_constructor(create_parameter_from_string), - "Create a mapnik.Parameter from a pair of values, the first being a string\n" - "and the second being either a string, and integer, or a float") - - .def_pickle(parameter_pickle_suite()) - .def("__getitem__",get_param) - ; - - class_("Parameters",init<>()) - .def_pickle(parameters_pickle_suite()) - .def("get",get_params_by_key1) - .def("__getitem__",get_params_by_key2) - .def("__getitem__",get_params_by_index) - .def("__len__",get_params_size) - .def("__contains__",contains) - .def("append",add_parameter) - .def("iteritems",iterator()) - ; -} diff --git a/bindings/python/mapnik_proj_transform.cpp b/bindings/python/mapnik_proj_transform.cpp deleted file mode 100644 index 393d2b860..000000000 --- a/bindings/python/mapnik_proj_transform.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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 - * - *****************************************************************************/ - -#include - - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include -#include - -// stl -#include - - -using mapnik::proj_transform; -using mapnik::projection; - -struct proj_transform_pickle_suite : boost::python::pickle_suite -{ - static boost::python::tuple - getinitargs(const proj_transform& p) - { - using namespace boost::python; - return boost::python::make_tuple(p.source(),p.dest()); - } -}; - -namespace { - -mapnik::coord2d forward_transform_c(mapnik::proj_transform& t, mapnik::coord2d const& c) -{ - double x = c.x; - double y = c.y; - double z = 0.0; - if (!t.forward(x,y,z)) { - std::ostringstream s; - s << "Failed to forward project " - << "from " << t.source().params() << " to: " << t.dest().params(); - throw std::runtime_error(s.str()); - } - return mapnik::coord2d(x,y); -} - -mapnik::coord2d backward_transform_c(mapnik::proj_transform& t, mapnik::coord2d const& c) -{ - double x = c.x; - double y = c.y; - double z = 0.0; - if (!t.backward(x,y,z)) { - std::ostringstream s; - s << "Failed to back project " - << "from " << t.dest().params() << " to: " << t.source().params(); - throw std::runtime_error(s.str()); - } - return mapnik::coord2d(x,y); -} - -mapnik::box2d forward_transform_env(mapnik::proj_transform& t, mapnik::box2d const & box) -{ - mapnik::box2d new_box = box; - if (!t.forward(new_box)) { - std::ostringstream s; - s << "Failed to forward project " - << "from " << t.source().params() << " to: " << t.dest().params(); - throw std::runtime_error(s.str()); - } - return new_box; -} - -mapnik::box2d backward_transform_env(mapnik::proj_transform& t, mapnik::box2d const & box) -{ - mapnik::box2d new_box = box; - if (!t.backward(new_box)){ - std::ostringstream s; - s << "Failed to back project " - << "from " << t.dest().params() << " to: " << t.source().params(); - throw std::runtime_error(s.str()); - } - return new_box; -} - -mapnik::box2d forward_transform_env_p(mapnik::proj_transform& t, mapnik::box2d const & box, unsigned int points) -{ - mapnik::box2d new_box = box; - if (!t.forward(new_box,points)) { - std::ostringstream s; - s << "Failed to forward project " - << "from " << t.source().params() << " to: " << t.dest().params(); - throw std::runtime_error(s.str()); - } - return new_box; -} - -mapnik::box2d backward_transform_env_p(mapnik::proj_transform& t, mapnik::box2d const & box, unsigned int points) -{ - mapnik::box2d new_box = box; - if (!t.backward(new_box,points)){ - std::ostringstream s; - s << "Failed to back project " - << "from " << t.dest().params() << " to: " << t.source().params(); - throw std::runtime_error(s.str()); - } - return new_box; -} - -} - -void export_proj_transform () -{ - using namespace boost::python; - - class_("ProjTransform", init< projection const&, projection const& >()) - .def_pickle(proj_transform_pickle_suite()) - .def("forward", forward_transform_c) - .def("backward",backward_transform_c) - .def("forward", forward_transform_env) - .def("backward",backward_transform_env) - .def("forward", forward_transform_env_p) - .def("backward",backward_transform_env_p) - ; - -} diff --git a/bindings/python/mapnik_projection.cpp b/bindings/python/mapnik_projection.cpp deleted file mode 100644 index 235fa9b6c..000000000 --- a/bindings/python/mapnik_projection.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include - -using mapnik::projection; - -struct projection_pickle_suite : boost::python::pickle_suite -{ - static boost::python::tuple - getinitargs(const projection& p) - { - using namespace boost::python; - return boost::python::make_tuple(p.params()); - } -}; - -namespace { -mapnik::coord2d forward_pt(mapnik::coord2d const& pt, - mapnik::projection const& prj) -{ - double x = pt.x; - double y = pt.y; - prj.forward(x,y); - return mapnik::coord2d(x,y); -} - -mapnik::coord2d inverse_pt(mapnik::coord2d const& pt, - mapnik::projection const& prj) -{ - double x = pt.x; - double y = pt.y; - prj.inverse(x,y); - return mapnik::coord2d(x,y); -} - -mapnik::box2d forward_env(mapnik::box2d const & box, - mapnik::projection const& prj) -{ - double minx = box.minx(); - double miny = box.miny(); - double maxx = box.maxx(); - double maxy = box.maxy(); - prj.forward(minx,miny); - prj.forward(maxx,maxy); - return mapnik::box2d(minx,miny,maxx,maxy); -} - -mapnik::box2d inverse_env(mapnik::box2d const & box, - mapnik::projection const& prj) -{ - double minx = box.minx(); - double miny = box.miny(); - double maxx = box.maxx(); - double maxy = box.maxy(); - prj.inverse(minx,miny); - prj.inverse(maxx,maxy); - return mapnik::box2d(minx,miny,maxx,maxy); -} - -} - -void export_projection () -{ - using namespace boost::python; - - class_("Projection", "Represents a map projection.",init( - (arg("proj4_string")), - "Constructs a new projection from its PROJ.4 string representation.\n" - "\n" - "The constructor will throw a RuntimeError in case the projection\n" - "cannot be initialized.\n" - ) - ) - .def_pickle(projection_pickle_suite()) - .def ("params", make_function(&projection::params, - return_value_policy()), - "Returns the PROJ.4 string for this projection.\n") - .def ("expanded",&projection::expanded, - "normalize PROJ.4 definition by expanding +init= syntax\n") - .add_property ("geographic", &projection::is_geographic, - "This property is True if the projection is a geographic projection\n" - "(i.e. it uses lon/lat coordinates)\n") - ; - - def("forward_",&forward_pt); - def("inverse_",&inverse_pt); - def("forward_",&forward_env); - def("inverse_",&inverse_env); - -} diff --git a/bindings/python/mapnik_python.cpp b/bindings/python/mapnik_python.cpp deleted file mode 100644 index 73fba74f6..000000000 --- a/bindings/python/mapnik_python.cpp +++ /dev/null @@ -1,961 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" -#include "python_to_value.hpp" -#include // for keywords, arg, etc -#include -#include // for def -#include -#include // for none -#include // for dict -#include -#include // for list -#include // for BOOST_PYTHON_MODULE -#include // for get_managed_object -#include -#include -#pragma GCC diagnostic pop - -// stl -#include -#include - -void export_color(); -void export_coord(); -void export_layer(); -void export_parameters(); -void export_envelope(); -void export_query(); -void export_geometry(); -void export_palette(); -void export_image(); -void export_image_view(); -void export_gamma_method(); -void export_scaling_method(); -#if defined(GRID_RENDERER) -void export_grid(); -void export_grid_view(); -#endif -void export_map(); -void export_python(); -void export_expression(); -void export_rule(); -void export_style(); -void export_feature(); -void export_featureset(); -void export_fontset(); -void export_datasource(); -void export_datasource_cache(); -void export_symbolizer(); -void export_markers_symbolizer(); -void export_point_symbolizer(); -void export_line_symbolizer(); -void export_line_pattern_symbolizer(); -void export_polygon_symbolizer(); -void export_building_symbolizer(); -void export_polygon_pattern_symbolizer(); -void export_raster_symbolizer(); -void export_text_placement(); -void export_shield_symbolizer(); -void export_debug_symbolizer(); -void export_group_symbolizer(); -void export_font_engine(); -void export_projection(); -void export_proj_transform(); -void export_view_transform(); -void export_raster_colorizer(); -void export_label_collision_detector(); -void export_logger(); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(GRID_RENDERER) -#include "python_grid_utils.hpp" -#endif -#include "mapnik_value_converter.hpp" -#include "mapnik_enumeration_wrapper_converter.hpp" -#include "mapnik_threads.hpp" -#include "python_optional.hpp" -#include -#if defined(SHAPE_MEMORY_MAPPED_FILE) -#include -#endif - -#if defined(SVG_RENDERER) -#include -#endif - -namespace mapnik { - class font_set; - class layer; - class color; - class label_collision_detector4; -} -void clear_cache() -{ - mapnik::marker_cache::instance().clear(); -#if defined(SHAPE_MEMORY_MAPPED_FILE) - mapnik::mapped_memory_cache::instance().clear(); -#endif -} - -#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO) -#include -#include -#include -#include -#include -static Pycairo_CAPI_t *Pycairo_CAPI; -static void *extract_surface(PyObject* op) -{ - if (PyObject_TypeCheck(op, const_cast(Pycairo_CAPI->Surface_Type))) - { - return op; - } - else - { - return 0; - } -} - -static void *extract_context(PyObject* op) -{ - if (PyObject_TypeCheck(op, const_cast(Pycairo_CAPI->Context_Type))) - { - return op; - } - else - { - return 0; - } -} - -void register_cairo() -{ -#if PY_MAJOR_VERSION >= 3 - Pycairo_CAPI = (Pycairo_CAPI_t*) PyCapsule_Import(const_cast("cairo.CAPI"), 0); -#else - Pycairo_CAPI = (Pycairo_CAPI_t*) PyCObject_Import(const_cast("cairo"), const_cast("CAPI")); -#endif - if (Pycairo_CAPI == nullptr) return; - - boost::python::converter::registry::insert(&extract_surface, boost::python::type_id()); - boost::python::converter::registry::insert(&extract_context, boost::python::type_id()); -} -#endif - -using mapnik::python_thread; -using mapnik::python_unblock_auto_block; -#ifdef MAPNIK_DEBUG -bool python_thread::thread_support = true; -#endif -boost::thread_specific_ptr python_thread::state; - -void render(mapnik::Map const& map, - mapnik::image_32& image, - double scale_factor = 1.0, - unsigned offset_x = 0u, - unsigned offset_y = 0u) -{ - python_unblock_auto_block b; - mapnik::agg_renderer ren(map,image,scale_factor,offset_x, offset_y); - ren.apply(); -} - -void render_with_vars(mapnik::Map const& map, - mapnik::image_32& image, - boost::python::dict const& d, - double scale_factor = 1.0, - unsigned offset_x = 0u, - unsigned offset_y = 0u) -{ - mapnik::attributes vars = mapnik::dict2attr(d); - mapnik::request req(map.width(),map.height(),map.get_current_extent()); - req.set_buffer_size(map.buffer_size()); - python_unblock_auto_block b; - mapnik::agg_renderer ren(map,req,vars,image,scale_factor,offset_x,offset_y); - ren.apply(); -} - -void render_with_detector( - mapnik::Map const& map, - mapnik::image_32 &image, - std::shared_ptr detector, - double scale_factor = 1.0, - unsigned offset_x = 0u, - unsigned offset_y = 0u) -{ - python_unblock_auto_block b; - mapnik::agg_renderer ren(map,image,detector,scale_factor,offset_x,offset_y); - ren.apply(); -} - -void render_layer2(mapnik::Map const& map, - mapnik::image_32& image, - unsigned layer_idx, - double scale_factor, - unsigned offset_x, - unsigned offset_y) -{ - std::vector const& layers = map.layers(); - std::size_t layer_num = layers.size(); - if (layer_idx >= layer_num) { - std::ostringstream s; - s << "Zero-based layer index '" << layer_idx << "' not valid, only '" - << layer_num << "' layers are in map\n"; - throw std::runtime_error(s.str()); - } - - python_unblock_auto_block b; - mapnik::layer const& layer = layers[layer_idx]; - mapnik::agg_renderer ren(map,image,scale_factor,offset_x,offset_y); - std::set names; - ren.apply(layer,names); -} - -#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO) - -void render3(mapnik::Map const& map, - PycairoSurface* py_surface, - double scale_factor = 1.0, - unsigned offset_x = 0, - unsigned offset_y = 0) -{ - python_unblock_auto_block b; - mapnik::cairo_surface_ptr surface(cairo_surface_reference(py_surface->surface), mapnik::cairo_surface_closer()); - mapnik::cairo_renderer ren(map,mapnik::create_context(surface),scale_factor,offset_x,offset_y); - ren.apply(); -} - -void render4(mapnik::Map const& map, PycairoSurface* py_surface) -{ - python_unblock_auto_block b; - mapnik::cairo_surface_ptr surface(cairo_surface_reference(py_surface->surface), mapnik::cairo_surface_closer()); - mapnik::cairo_renderer ren(map,mapnik::create_context(surface)); - ren.apply(); -} - -void render5(mapnik::Map const& map, - PycairoContext* py_context, - double scale_factor = 1.0, - unsigned offset_x = 0, - unsigned offset_y = 0) -{ - python_unblock_auto_block b; - mapnik::cairo_ptr context(cairo_reference(py_context->ctx), mapnik::cairo_closer()); - mapnik::cairo_renderer ren(map,context,scale_factor,offset_x, offset_y); - ren.apply(); -} - -void render6(mapnik::Map const& map, PycairoContext* py_context) -{ - python_unblock_auto_block b; - mapnik::cairo_ptr context(cairo_reference(py_context->ctx), mapnik::cairo_closer()); - mapnik::cairo_renderer ren(map,context); - ren.apply(); -} -void render_with_detector2( - mapnik::Map const& map, - PycairoContext* py_context, - std::shared_ptr detector) -{ - python_unblock_auto_block b; - mapnik::cairo_ptr context(cairo_reference(py_context->ctx), mapnik::cairo_closer()); - mapnik::cairo_renderer ren(map,context,detector); - ren.apply(); -} - -void render_with_detector3( - mapnik::Map const& map, - PycairoContext* py_context, - std::shared_ptr detector, - double scale_factor = 1.0, - unsigned offset_x = 0u, - unsigned offset_y = 0u) -{ - python_unblock_auto_block b; - mapnik::cairo_ptr context(cairo_reference(py_context->ctx), mapnik::cairo_closer()); - mapnik::cairo_renderer ren(map,context,detector,scale_factor,offset_x,offset_y); - ren.apply(); -} - -void render_with_detector4( - mapnik::Map const& map, - PycairoSurface* py_surface, - std::shared_ptr detector) -{ - python_unblock_auto_block b; - mapnik::cairo_surface_ptr surface(cairo_surface_reference(py_surface->surface), mapnik::cairo_surface_closer()); - mapnik::cairo_renderer ren(map, mapnik::create_context(surface), detector); - ren.apply(); -} - -void render_with_detector5( - mapnik::Map const& map, - PycairoSurface* py_surface, - std::shared_ptr detector, - double scale_factor = 1.0, - unsigned offset_x = 0u, - unsigned offset_y = 0u) -{ - python_unblock_auto_block b; - mapnik::cairo_surface_ptr surface(cairo_surface_reference(py_surface->surface), mapnik::cairo_surface_closer()); - mapnik::cairo_renderer ren(map, mapnik::create_context(surface), detector, scale_factor, offset_x, offset_y); - ren.apply(); -} - -#endif - - -void render_tile_to_file(mapnik::Map const& map, - unsigned offset_x, unsigned offset_y, - unsigned width, unsigned height, - std::string const& file, - std::string const& format) -{ - mapnik::image_32 image(width,height); - render(map,image,1.0,offset_x, offset_y); - mapnik::save_to_file(image.data(),file,format); -} - -void render_to_file1(mapnik::Map const& map, - std::string const& filename, - std::string const& format) -{ - if (format == "svg-ng") - { -#if defined(SVG_RENDERER) - std::ofstream file (filename.c_str(), std::ios::out|std::ios::trunc|std::ios::binary); - if (!file) - { - throw mapnik::ImageWriterException("could not open file for writing: " + filename); - } - using iter_type = std::ostream_iterator; - iter_type output_stream_iterator(file); - mapnik::svg_renderer ren(map,output_stream_iterator); - ren.apply(); -#else - throw mapnik::ImageWriterException("SVG backend not available, cannot write to format: " + format); -#endif - } - else if (format == "pdf" || format == "svg" || format =="ps" || format == "ARGB32" || format == "RGB24") - { -#if defined(HAVE_CAIRO) - mapnik::save_to_cairo_file(map,filename,format,1.0); -#else - throw mapnik::ImageWriterException("Cairo backend not available, cannot write to format: " + format); -#endif - } - else - { - mapnik::image_32 image(map.width(),map.height()); - render(map,image,1.0,0,0); - mapnik::save_to_file(image.data(),filename,format); - } -} - -void render_to_file2(mapnik::Map const& map,std::string const& filename) -{ - std::string format = mapnik::guess_type(filename); - if (format == "pdf" || format == "svg" || format =="ps") - { -#if defined(HAVE_CAIRO) - mapnik::save_to_cairo_file(map,filename,format,1.0); -#else - throw mapnik::ImageWriterException("Cairo backend not available, cannot write to format: " + format); -#endif - } - else - { - mapnik::image_32 image(map.width(),map.height()); - render(map,image,1.0,0,0); - mapnik::save_to_file(image.data(),filename); - } -} - -void render_to_file3(mapnik::Map const& map, - std::string const& filename, - std::string const& format, - double scale_factor = 1.0 - ) -{ - if (format == "svg-ng") - { -#if defined(SVG_RENDERER) - std::ofstream file (filename.c_str(), std::ios::out|std::ios::trunc|std::ios::binary); - if (!file) - { - throw mapnik::ImageWriterException("could not open file for writing: " + filename); - } - using iter_type = std::ostream_iterator; - iter_type output_stream_iterator(file); - mapnik::svg_renderer ren(map,output_stream_iterator,scale_factor); - ren.apply(); -#else - throw mapnik::ImageWriterException("SVG backend not available, cannot write to format: " + format); -#endif - } - else if (format == "pdf" || format == "svg" || format =="ps" || format == "ARGB32" || format == "RGB24") - { -#if defined(HAVE_CAIRO) - mapnik::save_to_cairo_file(map,filename,format,scale_factor); -#else - throw mapnik::ImageWriterException("Cairo backend not available, cannot write to format: " + format); -#endif - } - else - { - mapnik::image_32 image(map.width(),map.height()); - render(map,image,scale_factor,0,0); - mapnik::save_to_file(image.data(),filename,format); - } -} - -double scale_denominator(mapnik::Map const& map, bool geographic) -{ - return mapnik::scale_denominator(map.scale(), geographic); -} - -// http://docs.python.org/c-api/exceptions.html#standard-exceptions -void value_error_translator(mapnik::value_error const & ex) -{ - PyErr_SetString(PyExc_ValueError, ex.what()); -} - -void runtime_error_translator(std::runtime_error const & ex) -{ - PyErr_SetString(PyExc_RuntimeError, ex.what()); -} - -void out_of_range_error_translator(std::out_of_range const & ex) -{ - PyErr_SetString(PyExc_IndexError, ex.what()); -} - -void standard_error_translator(std::exception const & ex) -{ - PyErr_SetString(PyExc_RuntimeError, ex.what()); -} - -unsigned mapnik_version() -{ - return MAPNIK_VERSION; -} - -std::string mapnik_version_string() -{ - return MAPNIK_VERSION_STRING; -} - -bool has_proj4() -{ -#if defined(MAPNIK_USE_PROJ4) - return true; -#else - return false; -#endif -} - -bool has_svg_renderer() -{ -#if defined(SVG_RENDERER) - return true; -#else - return false; -#endif -} - -bool has_grid_renderer() -{ -#if defined(GRID_RENDERER) - return true; -#else - return false; -#endif -} - -bool has_jpeg() -{ -#if defined(HAVE_JPEG) - return true; -#else - return false; -#endif -} - -bool has_png() -{ -#if defined(HAVE_PNG) - return true; -#else - return false; -#endif -} - -bool has_tiff() -{ -#if defined(HAVE_TIFF) - return true; -#else - return false; -#endif -} - -bool has_webp() -{ -#if defined(HAVE_WEBP) - return true; -#else - return false; -#endif -} - -// indicator for cairo rendering support inside libmapnik -bool has_cairo() -{ -#if defined(HAVE_CAIRO) - return true; -#else - return false; -#endif -} - -// indicator for pycairo support in the python bindings -bool has_pycairo() -{ -#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO) -#if PY_MAJOR_VERSION >= 3 - Pycairo_CAPI = (Pycairo_CAPI_t*) PyCapsule_Import(const_cast("cairo.CAPI"), 0); -#else - Pycairo_CAPI = (Pycairo_CAPI_t*) PyCObject_Import(const_cast("cairo"), const_cast("CAPI")); -#endif - if (Pycairo_CAPI == nullptr){ - /* - Case where pycairo support has been compiled into - mapnik but at runtime the cairo python module - is unable to be imported and therefore Pycairo surfaces - and contexts cannot be passed to mapnik.render() - */ - return false; - } - return true; -#else - return false; -#endif -} - - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -BOOST_PYTHON_FUNCTION_OVERLOADS(load_map_overloads, load_map, 2, 4) -BOOST_PYTHON_FUNCTION_OVERLOADS(load_map_string_overloads, load_map_string, 2, 4) -BOOST_PYTHON_FUNCTION_OVERLOADS(save_map_overloads, save_map, 2, 3) -BOOST_PYTHON_FUNCTION_OVERLOADS(save_map_to_string_overloads, save_map_to_string, 1, 2) -BOOST_PYTHON_FUNCTION_OVERLOADS(render_overloads, render, 2, 5) -BOOST_PYTHON_FUNCTION_OVERLOADS(render_with_detector_overloads, render_with_detector, 3, 6) -#pragma GCC diagnostic pop - -BOOST_PYTHON_MODULE(_mapnik) -{ - - using namespace boost::python; - - using mapnik::load_map; - using mapnik::load_map_string; - using mapnik::save_map; - using mapnik::save_map_to_string; - - register_exception_translator(&standard_error_translator); - register_exception_translator(&out_of_range_error_translator); - register_exception_translator(&value_error_translator); - register_exception_translator(&runtime_error_translator); -#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO) - register_cairo(); -#endif - export_query(); - export_geometry(); - export_feature(); - export_featureset(); - export_fontset(); - export_datasource(); - export_parameters(); - export_color(); - export_envelope(); - export_palette(); - export_image(); - export_image_view(); - export_gamma_method(); - export_scaling_method(); -#if defined(GRID_RENDERER) - export_grid(); - export_grid_view(); -#endif - export_expression(); - export_rule(); - export_style(); - export_layer(); - export_datasource_cache(); - export_symbolizer(); - export_markers_symbolizer(); - export_point_symbolizer(); - export_line_symbolizer(); - export_line_pattern_symbolizer(); - export_polygon_symbolizer(); - export_building_symbolizer(); - export_polygon_pattern_symbolizer(); - export_raster_symbolizer(); - export_text_placement(); - export_shield_symbolizer(); - export_debug_symbolizer(); - export_group_symbolizer(); - export_font_engine(); - export_projection(); - export_proj_transform(); - export_view_transform(); - export_coord(); - export_map(); - export_raster_colorizer(); - export_label_collision_detector(); - export_logger(); - - def("clear_cache", &clear_cache, - "\n" - "Clear all global caches of markers and mapped memory regions.\n" - "\n" - "Usage:\n" - ">>> from mapnik import clear_cache\n" - ">>> clear_cache()\n" - ); - - def("render_to_file",&render_to_file1, - "\n" - "Render Map to file using explicit image type.\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map, render_to_file, load_map\n" - ">>> m = Map(256,256)\n" - ">>> load_map(m,'mapfile.xml')\n" - ">>> render_to_file(m,'image32bit.png','png')\n" - "\n" - "8 bit (paletted) PNG can be requested with 'png256':\n" - ">>> render_to_file(m,'8bit_image.png','png256')\n" - "\n" - "JPEG quality can be controlled by adding a suffix to\n" - "'jpeg' between 0 and 100 (default is 85):\n" - ">>> render_to_file(m,'top_quality.jpeg','jpeg100')\n" - ">>> render_to_file(m,'medium_quality.jpeg','jpeg50')\n" - ); - - def("render_to_file",&render_to_file2, - "\n" - "Render Map to file (type taken from file extension)\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map, render_to_file, load_map\n" - ">>> m = Map(256,256)\n" - ">>> render_to_file(m,'image.jpeg')\n" - "\n" - ); - - def("render_to_file",&render_to_file3, - "\n" - "Render Map to file using explicit image type and scale factor.\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map, render_to_file, load_map\n" - ">>> m = Map(256,256)\n" - ">>> scale_factor = 4\n" - ">>> render_to_file(m,'image.jpeg',scale_factor)\n" - "\n" - ); - - def("render_tile_to_file",&render_tile_to_file, - "\n" - "TODO\n" - "\n" - ); - - def("render_with_vars",&render_with_vars, - (arg("map"), - arg("image"), - arg("vars"), - arg("scale_factor")=1.0, - arg("offset_x")=0, - arg("offset_y")=0 - ) - ); - - def("render", &render, render_overloads( - "\n" - "Render Map to an AGG image_32 using offsets\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map, Image, render, load_map\n" - ">>> m = Map(256,256)\n" - ">>> load_map(m,'mapfile.xml')\n" - ">>> im = Image(m.width,m.height)\n" - ">>> scale_factor=2.0\n" - ">>> offset = [100,50]\n" - ">>> render(m,im)\n" - ">>> render(m,im,scale_factor)\n" - ">>> render(m,im,scale_factor,offset[0],offset[1])\n" - "\n" - )); - - def("render_with_detector", &render_with_detector, render_with_detector_overloads( - "\n" - "Render Map to an AGG image_32 using a pre-constructed detector.\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map, Image, LabelCollisionDetector, render_with_detector, load_map\n" - ">>> m = Map(256,256)\n" - ">>> load_map(m,'mapfile.xml')\n" - ">>> im = Image(m.width,m.height)\n" - ">>> detector = LabelCollisionDetector(m)\n" - ">>> render_with_detector(m, im, detector)\n" - )); - - def("render_layer", &render_layer2, - (arg("map"), - arg("image"), - arg("layer"), - arg("scale_factor")=1.0, - arg("offset_x")=0, - arg("offset_y")=0 - ) - ); - -#if defined(GRID_RENDERER) - def("render_layer", &mapnik::render_layer_for_grid, - (arg("map"), - arg("grid"), - arg("layer"), - arg("fields")=boost::python::list(), - arg("scale_factor")=1.0, - arg("offset_x")=0, - arg("offset_y")=0 - ) - ); -#endif - -#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO) - def("render",&render3, - "\n" - "Render Map to Cairo Surface using offsets\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map, render, load_map\n" - ">>> from cairo import SVGSurface\n" - ">>> m = Map(256,256)\n" - ">>> load_map(m,'mapfile.xml')\n" - ">>> surface = SVGSurface('image.svg', m.width, m.height)\n" - ">>> render(m,surface,1,1)\n" - "\n" - ); - - def("render",&render4, - "\n" - "Render Map to Cairo Surface\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map, render, load_map\n" - ">>> from cairo import SVGSurface\n" - ">>> m = Map(256,256)\n" - ">>> load_map(m,'mapfile.xml')\n" - ">>> surface = SVGSurface('image.svg', m.width, m.height)\n" - ">>> render(m,surface)\n" - "\n" - ); - - def("render",&render5, - "\n" - "Render Map to Cairo Context using offsets\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map, render, load_map\n" - ">>> from cairo import SVGSurface, Context\n" - ">>> surface = SVGSurface('image.svg', m.width, m.height)\n" - ">>> ctx = Context(surface)\n" - ">>> load_map(m,'mapfile.xml')\n" - ">>> render(m,context,1,1)\n" - "\n" - ); - - def("render",&render6, - "\n" - "Render Map to Cairo Context\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map, render, load_map\n" - ">>> from cairo import SVGSurface, Context\n" - ">>> surface = SVGSurface('image.svg', m.width, m.height)\n" - ">>> ctx = Context(surface)\n" - ">>> load_map(m,'mapfile.xml')\n" - ">>> render(m,context)\n" - "\n" - ); - - def("render_with_detector", &render_with_detector2, - "\n" - "Render Map to Cairo Context using a pre-constructed detector.\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map, LabelCollisionDetector, render_with_detector, load_map\n" - ">>> from cairo import SVGSurface, Context\n" - ">>> surface = SVGSurface('image.svg', m.width, m.height)\n" - ">>> ctx = Context(surface)\n" - ">>> m = Map(256,256)\n" - ">>> load_map(m,'mapfile.xml')\n" - ">>> detector = LabelCollisionDetector(m)\n" - ">>> render_with_detector(m, ctx, detector)\n" - ); - - def("render_with_detector", &render_with_detector3, - "\n" - "Render Map to Cairo Context using a pre-constructed detector, scale and offsets.\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map, LabelCollisionDetector, render_with_detector, load_map\n" - ">>> from cairo import SVGSurface, Context\n" - ">>> surface = SVGSurface('image.svg', m.width, m.height)\n" - ">>> ctx = Context(surface)\n" - ">>> m = Map(256,256)\n" - ">>> load_map(m,'mapfile.xml')\n" - ">>> detector = LabelCollisionDetector(m)\n" - ">>> render_with_detector(m, ctx, detector, 1, 1, 1)\n" - ); - - def("render_with_detector", &render_with_detector4, - "\n" - "Render Map to Cairo Surface using a pre-constructed detector.\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map, LabelCollisionDetector, render_with_detector, load_map\n" - ">>> from cairo import SVGSurface, Context\n" - ">>> surface = SVGSurface('image.svg', m.width, m.height)\n" - ">>> m = Map(256,256)\n" - ">>> load_map(m,'mapfile.xml')\n" - ">>> detector = LabelCollisionDetector(m)\n" - ">>> render_with_detector(m, surface, detector)\n" - ); - - def("render_with_detector", &render_with_detector5, - "\n" - "Render Map to Cairo Surface using a pre-constructed detector, scale and offsets.\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map, LabelCollisionDetector, render_with_detector, load_map\n" - ">>> from cairo import SVGSurface, Context\n" - ">>> surface = SVGSurface('image.svg', m.width, m.height)\n" - ">>> m = Map(256,256)\n" - ">>> load_map(m,'mapfile.xml')\n" - ">>> detector = LabelCollisionDetector(m)\n" - ">>> render_with_detector(m, surface, detector, 1, 1, 1)\n" - ); - -#endif - - def("scale_denominator", &scale_denominator, - (arg("map"),arg("is_geographic")), - "\n" - "Return the Map Scale Denominator.\n" - "Also available as Map.scale_denominator()\n" - "\n" - "Usage:\n" - "\n" - ">>> from mapnik import Map, Projection, scale_denominator, load_map\n" - ">>> m = Map(256,256)\n" - ">>> load_map(m,'mapfile.xml')\n" - ">>> scale_denominator(m,Projection(m.srs).geographic)\n" - "\n" - ); - - def("load_map", &load_map, load_map_overloads()); - - def("load_map_from_string", &load_map_string, load_map_string_overloads()); - - def("save_map", &save_map, save_map_overloads()); -/* - "\n" - "Save Map object to XML file\n" - "\n" - "Usage:\n" - ">>> from mapnik import Map, load_map, save_map\n" - ">>> m = Map(256,256)\n" - ">>> load_map(m,'mapfile_wgs84.xml')\n" - ">>> m.srs\n" - "'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'\n" - ">>> m.srs = '+init=espg:3395'\n" - ">>> save_map(m,'mapfile_mercator.xml')\n" - "\n" - ); -*/ - - def("save_map_to_string", &save_map_to_string, save_map_to_string_overloads()); - def("mapnik_version", &mapnik_version,"Get the Mapnik version number"); - def("mapnik_version_string", &mapnik_version_string,"Get the Mapnik version string"); - def("has_proj4", &has_proj4, "Get proj4 status"); - def("has_jpeg", &has_jpeg, "Get jpeg read/write support status"); - def("has_png", &has_png, "Get png read/write support status"); - def("has_tiff", &has_tiff, "Get tiff read/write support status"); - def("has_webp", &has_webp, "Get webp read/write support status"); - def("has_svg_renderer", &has_svg_renderer, "Get svg_renderer status"); - def("has_grid_renderer", &has_grid_renderer, "Get grid_renderer status"); - def("has_cairo", &has_cairo, "Get cairo library status"); - def("has_pycairo", &has_pycairo, "Get pycairo module status"); - - python_optional(); - python_optional(); - python_optional >(); - python_optional(); - python_optional(); - python_optional(); - python_optional(); - python_optional(); - python_optional(); - python_optional(); - python_optional(); - python_optional(); - register_ptr_to_python(); - register_ptr_to_python(); - to_python_converter(); - to_python_converter(); - to_python_converter(); -} diff --git a/bindings/python/mapnik_query.cpp b/bindings/python/mapnik_query.cpp deleted file mode 100644 index 210182f18..000000000 --- a/bindings/python/mapnik_query.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include "python_to_value.hpp" -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include - -#include -#include - -using mapnik::query; -using mapnik::box2d; - -namespace python = boost::python; - -struct resolution_to_tuple -{ - static PyObject* convert(query::resolution_type const& x) - { - python::object tuple(python::make_tuple(std::get<0>(x), std::get<1>(x))); - return python::incref(tuple.ptr()); - } - - static PyTypeObject const* get_pytype() - { - return &PyTuple_Type; - } -}; - -struct names_to_list -{ - static PyObject* convert(std::set const& names) - { - boost::python::list l; - for ( std::string const& name : names ) - { - l.append(name); - } - return python::incref(l.ptr()); - } - - static PyTypeObject const* get_pytype() - { - return &PyList_Type; - } -}; - -namespace { - - void set_variables(mapnik::query & q, boost::python::dict const& d) - { - mapnik::attributes vars = mapnik::dict2attr(d); - q.set_variables(vars); - } -} - -void export_query() -{ - using namespace boost::python; - - to_python_converter (); - to_python_converter, names_to_list> (); - - class_("Query", "a spatial query data object", - init,query::resolution_type const&,double>() ) - .def(init >()) - .add_property("resolution",make_function(&query::resolution, - return_value_policy())) - .add_property("bbox", make_function(&query::get_bbox, - return_value_policy()) ) - .add_property("property_names", make_function(&query::property_names, - return_value_policy()) ) - .def("add_property_name", &query::add_property_name) - .def("set_variables",&set_variables); -} diff --git a/bindings/python/mapnik_raster_colorizer.cpp b/bindings/python/mapnik_raster_colorizer.cpp deleted file mode 100644 index 413ef84f4..000000000 --- a/bindings/python/mapnik_raster_colorizer.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include - -using mapnik::raster_colorizer; -using mapnik::raster_colorizer_ptr; -using mapnik::symbolizer_base; -using mapnik::colorizer_stop; -using mapnik::colorizer_stops; -using mapnik::colorizer_mode_enum; -using mapnik::color; -using mapnik::COLORIZER_INHERIT; -using mapnik::COLORIZER_LINEAR; -using mapnik::COLORIZER_DISCRETE; -using mapnik::COLORIZER_EXACT; - - -namespace { -void add_stop(raster_colorizer_ptr & rc, colorizer_stop & stop) -{ - rc->add_stop(stop); -} -void add_stop2(raster_colorizer_ptr & rc, float v) { - colorizer_stop stop(v, rc->get_default_mode(), rc->get_default_color()); - rc->add_stop(stop); -} -void add_stop3(raster_colorizer_ptr &rc, float v, color c) { - colorizer_stop stop(v, rc->get_default_mode(), c); - rc->add_stop(stop); -} -void add_stop4(raster_colorizer_ptr &rc, float v, colorizer_mode_enum m) { - colorizer_stop stop(v, m, rc->get_default_color()); - rc->add_stop(stop); -} -void add_stop5(raster_colorizer_ptr &rc, float v, colorizer_mode_enum m, color c) { - colorizer_stop stop(v, m, c); - rc->add_stop(stop); -} -mapnik::color get_color(raster_colorizer_ptr &rc, float value) { - unsigned rgba = rc->get_color(value); - unsigned r = (rgba & 0xff); - unsigned g = (rgba >> 8 ) & 0xff; - unsigned b = (rgba >> 16) & 0xff; - unsigned a = (rgba >> 24) & 0xff; - return mapnik::color(r,g,b,a); -} - -colorizer_stops const& get_stops(raster_colorizer_ptr & rc) -{ - return rc->get_stops(); -} -} - -void export_raster_colorizer() -{ - using namespace boost::python; - - implicitly_convertible(); - - class_("RasterColorizer", - "A Raster Colorizer object.", - init(args("default_mode","default_color")) - ) - .def(init<>()) - .add_property("default_color", - make_function(&raster_colorizer::get_default_color, return_value_policy()), - &raster_colorizer::set_default_color, - "The default color for stops added without a color (mapnik.Color).\n") - .add_property("default_mode", - &raster_colorizer::get_default_mode_enum, - &raster_colorizer::set_default_mode_enum, - "The default mode (mapnik.ColorizerMode).\n" - "\n" - "If a stop is added without a mode, then it will inherit this default mode\n") - .add_property("stops", - make_function(get_stops,return_value_policy()), - "The list of stops this RasterColorizer contains\n") - .add_property("epsilon", - &raster_colorizer::get_epsilon, - &raster_colorizer::set_epsilon, - "Comparison epsilon value for exact mode\n" - "\n" - "When comparing values in exact mode, values need only be within epsilon to match.\n") - - - .def("add_stop", add_stop, - (arg("ColorizerStop")), - "Add a colorizer stop to the raster colorizer.\n" - "\n" - "Usage:\n" - ">>> colorizer = mapnik.RasterColorizer()\n" - ">>> color = mapnik.Color(\"#0044cc\")\n" - ">>> stop = mapnik.ColorizerStop(3, mapnik.COLORIZER_INHERIT, color)\n" - ">>> colorizer.add_stop(stop)\n" - ) - .def("add_stop", add_stop2, - (arg("value")), - "Add a colorizer stop to the raster colorizer, using the default mode and color.\n" - "\n" - "Usage:\n" - ">>> default_color = mapnik.Color(\"#0044cc\")\n" - ">>> colorizer = mapnik.RasterColorizer(mapnik.COLORIZER_LINEAR, default_color)\n" - ">>> colorizer.add_stop(100)\n" - ) - .def("add_stop", add_stop3, - (arg("value")), - "Add a colorizer stop to the raster colorizer, using the default mode.\n" - "\n" - "Usage:\n" - ">>> default_color = mapnik.Color(\"#0044cc\")\n" - ">>> colorizer = mapnik.RasterColorizer(mapnik.COLORIZER_LINEAR, default_color)\n" - ">>> colorizer.add_stop(100, mapnik.Color(\"#123456\"))\n" - ) - .def("add_stop", add_stop4, - (arg("value")), - "Add a colorizer stop to the raster colorizer, using the default color.\n" - "\n" - "Usage:\n" - ">>> default_color = mapnik.Color(\"#0044cc\")\n" - ">>> colorizer = mapnik.RasterColorizer(mapnik.COLORIZER_LINEAR, default_color)\n" - ">>> colorizer.add_stop(100, mapnik.COLORIZER_EXACT)\n" - ) - .def("add_stop", add_stop5, - (arg("value")), - "Add a colorizer stop to the raster colorizer.\n" - "\n" - "Usage:\n" - ">>> default_color = mapnik.Color(\"#0044cc\")\n" - ">>> colorizer = mapnik.RasterColorizer(mapnik.COLORIZER_LINEAR, default_color)\n" - ">>> colorizer.add_stop(100, mapnik.COLORIZER_DISCRETE, mapnik.Color(\"#112233\"))\n" - ) - .def("get_color", get_color, - "Get the color assigned to a certain value in raster data.\n" - "\n" - "Usage:\n" - ">>> colorizer = mapnik.RasterColorizer()\n" - ">>> color = mapnik.Color(\"#0044cc\")\n" - ">>> colorizer.add_stop(0, mapnik.COLORIZER_DISCRETE, mapnik.Color(\"#000000\"))\n" - ">>> colorizer.add_stop(100, mapnik.COLORIZER_DISCRETE, mapnik.Color(\"#0E0A06\"))\n" - ">>> colorizer.get_color(50)\n" - "Color('#070503')\n" - ) - ; - - - - class_("ColorizerStops", - "A RasterColorizer's collection of ordered color stops.\n" - "This class is not meant to be instantiated from python. However, " - "it can be accessed at a RasterColorizer's \"stops\" attribute for " - "introspection purposes", - no_init) - .def(vector_indexing_suite()) - ; - - enum_("ColorizerMode") - .value("COLORIZER_INHERIT", COLORIZER_INHERIT) - .value("COLORIZER_LINEAR", COLORIZER_LINEAR) - .value("COLORIZER_DISCRETE", COLORIZER_DISCRETE) - .value("COLORIZER_EXACT", COLORIZER_EXACT) - .export_values() - ; - - - class_("ColorizerStop",init( - "A Colorizer Stop object.\n" - "Create with a value, ColorizerMode, and Color\n" - "\n" - "Usage:" - ">>> color = mapnik.Color(\"#fff000\")\n" - ">>> stop= mapnik.ColorizerStop(42.42, mapnik.COLORIZER_LINEAR, color)\n" - )) - .add_property("color", - make_function(&colorizer_stop::get_color, return_value_policy()), - &colorizer_stop::set_color, - "The stop color (mapnik.Color).\n") - .add_property("value", - &colorizer_stop::get_value, - &colorizer_stop::set_value, - "The stop value.\n") - .add_property("label", - make_function(&colorizer_stop::get_label, return_value_policy()), - &colorizer_stop::set_label, - "The stop label.\n") - .add_property("mode", - &colorizer_stop::get_mode_enum, - &colorizer_stop::set_mode_enum, - "The stop mode (mapnik.ColorizerMode).\n" - "\n" - "If this is COLORIZER_INHERIT then it will inherit the default mode\n" - " from the RasterColorizer it is added to.\n") - .def(self == self) - .def("__str__",&colorizer_stop::to_string) - ; -} diff --git a/bindings/python/mapnik_rule.cpp b/bindings/python/mapnik_rule.cpp deleted file mode 100644 index f4b5cd856..000000000 --- a/bindings/python/mapnik_rule.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include - -using mapnik::rule; -using mapnik::expr_node; -using mapnik::expression_ptr; -using mapnik::point_symbolizer; -using mapnik::line_symbolizer; -using mapnik::line_pattern_symbolizer; -using mapnik::polygon_symbolizer; -using mapnik::polygon_pattern_symbolizer; -using mapnik::raster_symbolizer; -using mapnik::shield_symbolizer; -using mapnik::text_symbolizer; -using mapnik::building_symbolizer; -using mapnik::markers_symbolizer; -using mapnik::group_symbolizer; -using mapnik::symbolizer; -using mapnik::to_expression_string; - -void export_rule() -{ - using namespace boost::python; - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - - class_("Symbolizers",init<>("TODO")) - .def(vector_indexing_suite()) - ; - - class_("Rule",init<>("default constructor")) - .def(init >()) - .add_property("name",make_function - (&rule::get_name, - return_value_policy()), - &rule::set_name) - .add_property("filter",make_function - (&rule::get_filter,return_value_policy()), - &rule::set_filter) - .add_property("min_scale",&rule::get_min_scale,&rule::set_min_scale) - .add_property("max_scale",&rule::get_max_scale,&rule::set_max_scale) - .def("set_else",&rule::set_else) - .def("has_else",&rule::has_else_filter) - .def("set_also",&rule::set_also) - .def("has_also",&rule::has_also_filter) - .def("active",&rule::active) - .add_property("symbols",make_function - (&rule::get_symbolizers,return_value_policy())) - .add_property("copy_symbols",make_function - (&rule::get_symbolizers,return_value_policy())) - ; -} diff --git a/bindings/python/mapnik_scaling_method.cpp b/bindings/python/mapnik_scaling_method.cpp deleted file mode 100644 index 1a2c62a4e..000000000 --- a/bindings/python/mapnik_scaling_method.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - - -#include - -// boost -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#pragma GCC diagnostic pop - -void export_scaling_method() -{ - using namespace boost::python; - - enum_("scaling_method") - .value("NEAR", mapnik::SCALING_NEAR) - .value("BILINEAR", mapnik::SCALING_BILINEAR) - .value("BICUBIC", mapnik::SCALING_BICUBIC) - .value("SPLINE16", mapnik::SCALING_SPLINE16) - .value("SPLINE36", mapnik::SCALING_SPLINE36) - .value("HANNING", mapnik::SCALING_HANNING) - .value("HAMMING", mapnik::SCALING_HAMMING) - .value("HERMITE", mapnik::SCALING_HERMITE) - .value("KAISER", mapnik::SCALING_KAISER) - .value("QUADRIC", mapnik::SCALING_QUADRIC) - .value("CATROM", mapnik::SCALING_CATROM) - .value("GAUSSIAN", mapnik::SCALING_GAUSSIAN) - .value("BESSEL", mapnik::SCALING_BESSEL) - .value("MITCHELL", mapnik::SCALING_MITCHELL) - .value("SINC", mapnik::SCALING_SINC) - .value("LANCZOS", mapnik::SCALING_LANCZOS) - .value("BLACKMAN", mapnik::SCALING_BLACKMAN) - ; -} diff --git a/bindings/python/mapnik_style.cpp b/bindings/python/mapnik_style.cpp deleted file mode 100644 index 6f7762063..000000000 --- a/bindings/python/mapnik_style.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include "mapnik_enumeration.hpp" -#include -#include // generate_image_filters - -using mapnik::feature_type_style; -using mapnik::rules; -using mapnik::rule; - -std::string get_image_filters(feature_type_style & style) -{ - std::string filters_str; - std::back_insert_iterator sink(filters_str); - generate_image_filters(sink, style.image_filters()); - return filters_str; -} - -void set_image_filters(feature_type_style & style, std::string const& filters) -{ - std::vector new_filters; - bool result = parse_image_filters(filters, new_filters); - if (!result) - { - throw mapnik::value_error("failed to parse image-filters: '" + filters + "'"); - } -#ifdef _WINDOWS - style.image_filters() = new_filters; - // FIXME : https://svn.boost.org/trac/boost/ticket/2839 -#else - style.image_filters() = std::move(new_filters); -#endif -} - -void export_style() -{ - using namespace boost::python; - - mapnik::enumeration_("filter_mode") - .value("ALL",mapnik::FILTER_ALL) - .value("FIRST",mapnik::FILTER_FIRST) - ; - - class_("Rules",init<>("default ctor")) - .def(vector_indexing_suite()) - ; - class_("Style",init<>("default style constructor")) - - .add_property("rules",make_function - (&feature_type_style::get_rules, - return_value_policy()), - "List of rules belonging to a style as rule objects.\n" - "\n" - "Usage:\n" - ">>> for r in m.find_style('style 1').rules:\n" - ">>> print r\n" - "\n" - "\n" - ) - .add_property("filter_mode", - &feature_type_style::get_filter_mode, - &feature_type_style::set_filter_mode, - "Set/get the filter mode of the style") - .add_property("opacity", - &feature_type_style::get_opacity, - &feature_type_style::set_opacity, - "Set/get the opacity of the style") - .add_property("comp_op", - &feature_type_style::comp_op, - &feature_type_style::set_comp_op, - "Set/get the comp-op (composite operation) of the style") - .add_property("image_filters_inflate", - &feature_type_style::image_filters_inflate, - &feature_type_style::image_filters_inflate, - "Set/get the image_filters_inflate property of the style") - .add_property("image_filters", - get_image_filters, - set_image_filters, - "Set/get the comp-op (composite operation) of the style") - ; - -} diff --git a/bindings/python/mapnik_svg.hpp b/bindings/python/mapnik_svg.hpp deleted file mode 100644 index 418ee0511..000000000 --- a/bindings/python/mapnik_svg.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2010 Robert Coup - * - * 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_PYTHON_BINDING_SVG_INCLUDED -#define MAPNIK_PYTHON_BINDING_SVG_INCLUDED - -// mapnik -#include -#include -#include - -namespace mapnik { -using namespace boost::python; - -template -std::string get_svg_transform(T& symbolizer) -{ - return symbolizer.get_image_transform_string(); -} - -template -void set_svg_transform(T& symbolizer, std::string const& transform_wkt) -{ - transform_list_ptr trans_expr = mapnik::parse_transform(transform_wkt); - if (!trans_expr) - { - std::stringstream ss; - ss << "Could not parse transform from '" - << transform_wkt - << "', expected SVG transform attribute"; - throw mapnik::value_error(ss.str()); - } - symbolizer.set_image_transform(trans_expr); -} - -} // end of namespace mapnik - -#endif // MAPNIK_PYTHON_BINDING_SVG_INCLUDED diff --git a/bindings/python/mapnik_symbolizer.cpp b/bindings/python/mapnik_symbolizer.cpp deleted file mode 100644 index ef23bdb98..000000000 --- a/bindings/python/mapnik_symbolizer.cpp +++ /dev/null @@ -1,423 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include -#include -#include -#include -#include -#include "mapnik_enumeration.hpp" -#include "mapnik_svg.hpp" -#include -#include -#include -#include // for known_svg_prefix_ -#include -#include -#include -#include - -// stl -#include - -using mapnik::symbolizer; -using mapnik::point_symbolizer; -using mapnik::line_symbolizer; -using mapnik::line_pattern_symbolizer; -using mapnik::polygon_symbolizer; -using mapnik::polygon_pattern_symbolizer; -using mapnik::raster_symbolizer; -using mapnik::shield_symbolizer; -using mapnik::text_symbolizer; -using mapnik::building_symbolizer; -using mapnik::markers_symbolizer; -using mapnik::debug_symbolizer; -using mapnik::group_symbolizer; -using mapnik::symbolizer_base; -using mapnik::color; -using mapnik::path_processor_type; -using mapnik::path_expression_ptr; -using mapnik::guess_type; -using mapnik::expression_ptr; -using mapnik::parse_path; - - -namespace { -using namespace boost::python; -void __setitem__(mapnik::symbolizer_base & sym, std::string const& name, mapnik::symbolizer_base::value_type const& val) -{ - put(sym, mapnik::get_key(name), val); -} - -std::shared_ptr numeric_wrapper(const object& arg) -{ - std::shared_ptr result; - if (PyBool_Check(arg.ptr())) - { - mapnik::value_bool val = extract(arg); - result.reset(new mapnik::symbolizer_base::value_type(val)); - } - else if (PyFloat_Check(arg.ptr())) - { - mapnik::value_double val = extract(arg); - result.reset(new mapnik::symbolizer_base::value_type(val)); - } - else - { - mapnik::value_integer val = extract(arg); - result.reset(new mapnik::symbolizer_base::value_type(val)); - } - return result; -} - -struct extract_python_object -{ - using result_type = boost::python::object; - - template - auto operator() (T const& val) const -> result_type - { - return result_type(val); // wrap into python object - } -}; - -boost::python::object __getitem__(mapnik::symbolizer_base const& sym, std::string const& name) -{ - using const_iterator = symbolizer_base::cont_type::const_iterator; - mapnik::keys key = mapnik::get_key(name); - const_iterator itr = sym.properties.find(key); - if (itr != sym.properties.end()) - { - return mapnik::util::apply_visitor(extract_python_object(), itr->second); - } - //mapnik::property_meta_type const& meta = mapnik::get_meta(key); - //return mapnik::util::apply_visitor(extract_python_object(), std::get<1>(meta)); - return boost::python::object(); -} - -/* -std::string __str__(mapnik::symbolizer const& sym) -{ - return mapnik::util::apply_visitor(mapnik::symbolizer_to_json(), sym); -} -*/ - -std::string get_symbolizer_type(symbolizer const& sym) -{ - return mapnik::symbolizer_name(sym); // FIXME - do we need this ? -} - -std::size_t hash_impl(symbolizer const& sym) -{ - return mapnik::util::apply_visitor(mapnik::symbolizer_hash_visitor(), sym); -} - -template -std::size_t hash_impl_2(T const& sym) -{ - return mapnik::symbolizer_hash::value(sym); -} - -struct extract_underlying_type_visitor -{ - template - boost::python::object operator() (T const& sym) const - { - return boost::python::object(sym); - } -}; - -boost::python::object extract_underlying_type(symbolizer const& sym) -{ - return mapnik::util::apply_visitor(extract_underlying_type_visitor(), sym); -} - -} - -void export_symbolizer() -{ - using namespace boost::python; - - //implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible, mapnik::symbolizer_base::value_type>(); - - enum_("keys") - .value("gamma", mapnik::keys::gamma) - .value("gamma_method",mapnik::keys::gamma_method) - ; - - class_("Symbolizer",no_init) - .def("type",get_symbolizer_type) - .def("__hash__",hash_impl) - .def("extract", extract_underlying_type) - ; - - class_("NumericWrapper") - .def("__init__", make_constructor(numeric_wrapper)) - ; - - class_("SymbolizerBase",no_init) - .def("__setitem__",&__setitem__) - .def("__setattr__",&__setitem__) - .def("__getitem__",&__getitem__) - .def("__getattr__",&__getitem__) - //.def("__str__", &__str__) - .def(self == self) // __eq__ - ; -} - - -void export_shield_symbolizer() -{ - using namespace boost::python; - class_< shield_symbolizer, bases >("ShieldSymbolizer", - init<>("Default ctor")) - .def("__hash__",hash_impl_2) - ; - -} - -void export_polygon_symbolizer() -{ - using namespace boost::python; - - class_ >("PolygonSymbolizer", - init<>("Default ctor")) - .def("__hash__",hash_impl_2) - ; - -} - -void export_polygon_pattern_symbolizer() -{ - using namespace boost::python; - - mapnik::enumeration_("pattern_alignment") - .value("LOCAL",mapnik::LOCAL_ALIGNMENT) - .value("GLOBAL",mapnik::GLOBAL_ALIGNMENT) - ; - - class_("PolygonPatternSymbolizer", - init<>("Default ctor")) - .def("__hash__",hash_impl_2) - ; -} - -void export_raster_symbolizer() -{ - using namespace boost::python; - - class_ >("RasterSymbolizer", - init<>("Default ctor")) - ; -} - -void export_point_symbolizer() -{ - using namespace boost::python; - - mapnik::enumeration_("point_placement") - .value("CENTROID",mapnik::CENTROID_POINT_PLACEMENT) - .value("INTERIOR",mapnik::INTERIOR_POINT_PLACEMENT) - ; - - class_ >("PointSymbolizer", - init<>("Default Point Symbolizer - 4x4 black square")) - .def("__hash__",hash_impl_2) - ; -} - -void export_markers_symbolizer() -{ - using namespace boost::python; - - mapnik::enumeration_("marker_placement") - .value("POINT_PLACEMENT",mapnik::MARKER_POINT_PLACEMENT) - .value("INTERIOR_PLACEMENT",mapnik::MARKER_INTERIOR_PLACEMENT) - .value("LINE_PLACEMENT",mapnik::MARKER_LINE_PLACEMENT) - ; - - mapnik::enumeration_("marker_multi_policy") - .value("EACH",mapnik::MARKER_EACH_MULTI) - .value("WHOLE",mapnik::MARKER_WHOLE_MULTI) - .value("LARGEST",mapnik::MARKER_LARGEST_MULTI) - ; - - class_ >("MarkersSymbolizer", - init<>("Default Markers Symbolizer - circle")) - .def("__hash__",hash_impl_2) - ; -} - - -void export_line_symbolizer() -{ - using namespace boost::python; - - mapnik::enumeration_("line_rasterizer") - .value("FULL",mapnik::RASTERIZER_FULL) - .value("FAST",mapnik::RASTERIZER_FAST) - ; - - mapnik::enumeration_("stroke_linecap", - "The possible values for a line cap used when drawing\n" - "with a stroke.\n") - .value("BUTT_CAP",mapnik::BUTT_CAP) - .value("SQUARE_CAP",mapnik::SQUARE_CAP) - .value("ROUND_CAP",mapnik::ROUND_CAP) - ; - - mapnik::enumeration_("stroke_linejoin", - "The possible values for the line joining mode\n" - "when drawing with a stroke.\n") - .value("MITER_JOIN",mapnik::MITER_JOIN) - .value("MITER_REVERT_JOIN",mapnik::MITER_REVERT_JOIN) - .value("ROUND_JOIN",mapnik::ROUND_JOIN) - .value("BEVEL_JOIN",mapnik::BEVEL_JOIN) - ; - - - class_ >("LineSymbolizer", - init<>("Default LineSymbolizer - 1px solid black")) - .def("__hash__",hash_impl_2) - ; -} - -void export_line_pattern_symbolizer() -{ - using namespace boost::python; - - class_ >("LinePatternSymbolizer", - init<> ("Default LinePatternSymbolizer")) - .def("__hash__",hash_impl_2) - ; -} - -void export_debug_symbolizer() -{ - using namespace boost::python; - - mapnik::enumeration_("debug_symbolizer_mode") - .value("COLLISION",mapnik::DEBUG_SYM_MODE_COLLISION) - .value("VERTEX",mapnik::DEBUG_SYM_MODE_VERTEX) - ; - - class_ >("DebugSymbolizer", - init<>("Default debug Symbolizer")) - .def("__hash__",hash_impl_2) - ; -} - -void export_building_symbolizer() -{ - using namespace boost::python; - - class_ >("BuildingSymbolizer", - init<>("Default BuildingSymbolizer")) - .def("__hash__",hash_impl_2) - ; - -} - -namespace { - -void group_symbolizer_properties_set_layout_simple(mapnik::group_symbolizer_properties &p, - mapnik::simple_row_layout &s) -{ - p.set_layout(s); -} - -void group_symbolizer_properties_set_layout_pair(mapnik::group_symbolizer_properties &p, - mapnik::pair_layout &s) -{ - p.set_layout(s); -} - -std::shared_ptr group_rule_construct1(mapnik::expression_ptr p) -{ - return std::make_shared(p, mapnik::expression_ptr()); -} - -} // anonymous namespace - -void export_group_symbolizer() -{ - using namespace boost::python; - using mapnik::group_rule; - using mapnik::simple_row_layout; - using mapnik::pair_layout; - using mapnik::group_symbolizer_properties; - - class_ >("GroupRule", - init()) - .def("__init__", boost::python::make_constructor(group_rule_construct1)) - .def("append", &group_rule::append) - .def("set_filter", &group_rule::set_filter) - .def("set_repeat_key", &group_rule::set_repeat_key) - ; - - class_("SimpleRowLayout") - .def("item_margin", &simple_row_layout::get_item_margin) - .def("set_item_margin", &simple_row_layout::set_item_margin) - ; - - class_("PairLayout") - .def("item_margin", &simple_row_layout::get_item_margin) - .def("set_item_margin", &simple_row_layout::set_item_margin) - .def("max_difference", &pair_layout::get_max_difference) - .def("set_max_difference", &pair_layout::set_max_difference) - ; - - class_ >("GroupSymbolizerProperties") - .def("add_rule", &group_symbolizer_properties::add_rule) - .def("set_layout", &group_symbolizer_properties_set_layout_simple) - .def("set_layout", &group_symbolizer_properties_set_layout_pair) - ; - - class_ >("GroupSymbolizer", - init<>("Default GroupSymbolizer")) - .def("__hash__",hash_impl_2) - ; - -} diff --git a/bindings/python/mapnik_text_placement.cpp b/bindings/python/mapnik_text_placement.cpp deleted file mode 100644 index 955f49b7a..000000000 --- a/bindings/python/mapnik_text_placement.cpp +++ /dev/null @@ -1,587 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#include "boost_std_shared_shim.hpp" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#include -#include -#pragma GCC diagnostic pop - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "mapnik_enumeration.hpp" -#include "mapnik_threads.hpp" - -using namespace mapnik; - -/* Notes: - Overriding functions in inherited classes: - boost.python documentation doesn't really tell you how to do it. - But this helps: - http://www.gamedev.net/topic/446225-inheritance-in-boostpython/ - - register_ptr_to_python is required for wrapped classes, but not for unwrapped. - - Functions don't have to be members of the class, but can also be - normal functions taking a ref to the class as first parameter. -*/ - -namespace { - -using namespace boost::python; - -// This class works around a feature in boost python. -// See http://osdir.com/ml/python.c++/2003-11/msg00158.html - -template -class class_with_converter : public boost::python::class_ -{ -public: - using self = class_with_converter; - // Construct with the class name, with or without docstring, and default __init__() function - class_with_converter(char const* name, char const* doc = 0) : boost::python::class_(name, doc) { } - - // Construct with class name, no docstring, and an uncallable __init__ function - class_with_converter(char const* name, boost::python::no_init_t y) : boost::python::class_(name, y) { } - - // Construct with class name, docstring, and an uncallable __init__ function - class_with_converter(char const* name, char const* doc, boost::python::no_init_t y) : boost::python::class_(name, doc, y) { } - - // Construct with class name and init<> function - template class_with_converter(char const* name, boost::python::init_base const& i) - : boost::python::class_(name, i) { } - - // Construct with class name, docstring and init<> function - template - inline class_with_converter(char const* name, char const* doc, boost::python::init_base const& i) - : boost::python::class_(name, doc, i) { } - - template - self& def_readwrite_convert(char const* name, D const& d, char const* /*doc*/=0) - { - this->add_property(name, - boost::python::make_getter(d, boost::python::return_value_policy()), - boost::python::make_setter(d, boost::python::default_call_policies())); - return *this; - } -}; - -/* -boost::python::tuple get_displacement(text_layout_properties const& t) -{ - return boost::python::make_tuple(0.0,0.0);// FIXME t.displacement.x, t.displacement.y); -} - -void set_displacement(text_layout_properties &t, boost::python::tuple arg) -{ - if (len(arg) != 2) - { - PyErr_SetObject(PyExc_ValueError, - ("expected 2-item tuple in call to set_displacement; got %s" - % arg).ptr() - ); - throw_error_already_set(); - } - - //double x = extract(arg[0]); - //double y = extract(arg[1]); - //t.displacement.set(x, y); FIXME -} - - -struct NodeWrap - : formatting::node, wrapper -{ - NodeWrap() - : formatting::node(), wrapper() {} - - void apply(evaluated_format_properties_ptr p, feature_impl const& feature, attributes const& vars, text_layout &output) const - { - python_block_auto_unblock b; - this->get_override("apply")(ptr(&p), ptr(&feature), ptr(&vars), ptr(&output)); - } - - virtual void add_expressions(expression_set &output) const - { - override o = this->get_override("add_expressions"); - if (o) - { - python_block_auto_unblock b; - o(ptr(&output)); - } else - { - formatting::node::add_expressions(output); - } - } - - void default_add_expressions(expression_set &output) const - { - formatting::node::add_expressions(output); - } -}; -*/ -/* -struct TextNodeWrap - : formatting::text_node, wrapper -{ - TextNodeWrap(expression_ptr expr) - : formatting::text_node(expr), wrapper() {} - - TextNodeWrap(std::string expr_text) - : formatting::text_node(expr_text), wrapper() {} - - virtual void apply(evaluated_format_properties_ptr p, feature_impl const& feature, attributes const& vars, text_layout &output) const - { - if(override o = this->get_override("apply")) - { - python_block_auto_unblock b; - o(ptr(&p), ptr(&feature), ptr(&vars), ptr(&output)); - } - else - { - formatting::text_node::apply(p, feature, vars, output); - } - } - - void default_apply(evaluated_format_properties_ptr p, feature_impl const& feature, attributes const& vars, text_layout &output) const - { - formatting::text_node::apply(p, feature, vars, output); - } -}; -*/ -/* -struct FormatNodeWrap - : formatting::format_node, wrapper -{ - virtual void apply(evaluated_format_properties_ptr p, feature_impl const& feature, attributes const& vars, text_layout &output) const - { - if(override o = this->get_override("apply")) - { - python_block_auto_unblock b; - o(ptr(&p), ptr(&feature), ptr(&vars), ptr(&output)); - } - else - { - formatting::format_node::apply(p, feature, vars ,output); - } - } - - void default_apply(evaluated_format_properties_ptr p, feature_impl const& feature, attributes const& vars, text_layout &output) const - { - formatting::format_node::apply(p, feature, vars, output); - } -}; - -struct ExprFormatWrap: formatting::expression_format, wrapper -{ - virtual void apply(evaluated_format_properties_ptr p, feature_impl const& feature, attributes const& vars, text_layout &output) const - { - if(override o = this->get_override("apply")) - { - python_block_auto_unblock b; - o(ptr(&p), ptr(&feature), ptr(&vars), ptr(&output)); - } - else - { - formatting::expression_format::apply(p, feature, vars, output); - } - } - - void default_apply(evaluated_format_properties_ptr p, feature_impl const& feature, attributes const& vars, text_layout &output) const - { - formatting::expression_format::apply(p, feature, vars, output); - } -}; - -struct LayoutNodeWrap: formatting::layout_node, wrapper -{ - virtual void apply(evaluated_format_properties_ptr p, feature_impl const& feature, attributes const& vars, text_layout &output) const - { - if(override o = this->get_override("apply")) - { - python_block_auto_unblock b; - o(ptr(&p), ptr(&feature), ptr(&vars), ptr(&output)); - } - else - { - formatting::layout_node::apply(p, feature, vars, output); - } - } - - void default_apply(evaluated_format_properties_ptr p, feature_impl const& feature, attributes const& vars, text_layout &output) const - { - formatting::layout_node::apply(p, feature, vars, output); - } -}; - -struct ListNodeWrap: formatting::list_node, wrapper -{ - //Default constructor - ListNodeWrap() : formatting::list_node(), wrapper() - { - } - - //Special constructor: Takes a python sequence as its argument - ListNodeWrap(object l) : formatting::list_node(), wrapper() - { - stl_input_iterator begin(l), end; - while (begin != end) - { - children_.push_back(*begin); - ++begin; - } - } - - // TODO: Add constructor taking variable number of arguments. - http://wiki.python.org/moin/boost.python/HowTo#A.22Raw.22_function - - virtual void apply(evaluated_format_properties_ptr p, feature_impl const& feature, attributes const& vars, text_layout &output) const - { - if(override o = this->get_override("apply")) - { - python_block_auto_unblock b; - o(ptr(&p), ptr(&feature), ptr(&vars), ptr(&output)); - } - else - { - formatting::list_node::apply(p, feature, vars, output); - } - } - - void default_apply(evaluated_format_properties_ptr p, feature_impl const& feature, attributes const& vars, text_layout &output) const - { - formatting::list_node::apply(p, feature, vars, output); - } - - inline void IndexError(){ - PyErr_SetString(PyExc_IndexError, "Index out of range"); - throw_error_already_set(); - } - - unsigned get_length() - { - return children_.size(); - } - - formatting::node_ptr get_item(int i) - { - if (i < 0) i+= children_.size(); - if (i < static_cast(children_.size())) return children_[i]; - IndexError(); - return formatting::node_ptr(); //Avoid compiler warning - } - - void set_item(int i, formatting::node_ptr ptr) - { - if (i < 0) i+= children_.size(); - if (i < static_cast(children_.size())) children_[i] = ptr; - IndexError(); - } - - void append(formatting::node_ptr ptr) - { - children_.push_back(ptr); - } -}; -*/ -/* -struct TextPlacementsWrap: text_placements, wrapper -{ - text_placement_info_ptr get_placement_info(double scale_factor_) const - { - python_block_auto_unblock b; - //return this->get_override("get_placement_info")(); - return text_placement_info_ptr(); - } -}; - -struct TextPlacementInfoWrap: text_placement_info, wrapper -{ - TextPlacementInfoWrap(text_placements const* parent, - double scale_factor_) - : text_placement_info(parent, scale_factor_) - { - - } - - bool next() - { - python_block_auto_unblock b; - return this->get_override("next")(); - } -}; - -void insert_expression(expression_set *set, expression_ptr p) -{ - set->insert(p); -} - - -evaluated_format_properties_ptr get_format(text_symbolizer const& sym) -{ - return sym.get_placement_options()->defaults.format; -} - -void set_format(text_symbolizer const& sym, evaluated_format_properties_ptr format) -{ - sym.get_placement_options()->defaults.format = format; -} - -text_symbolizer_properties & get_properties(text_symbolizer const& sym) -{ - return sym.get_placement_options()->defaults; -} - -void set_properties(text_symbolizer const& sym, text_symbolizer_properties & defaults) -{ - sym.get_placement_options()->defaults = defaults; -} -*/ -} - -void export_text_placement() -{ - /* - using namespace boost::python; - - enumeration_("label_placement") - .value("LINE_PLACEMENT",LINE_PLACEMENT) - .value("POINT_PLACEMENT",POINT_PLACEMENT) - .value("VERTEX_PLACEMENT",VERTEX_PLACEMENT) - .value("INTERIOR_PLACEMENT",INTERIOR_PLACEMENT) - ; - enumeration_("vertical_alignment") - .value("TOP",V_TOP) - .value("MIDDLE",V_MIDDLE) - .value("BOTTOM",V_BOTTOM) - .value("AUTO",V_AUTO) - ; - - enumeration_("horizontal_alignment") - .value("LEFT",H_LEFT) - .value("MIDDLE",H_MIDDLE) - .value("RIGHT",H_RIGHT) - .value("AUTO",H_AUTO) - ; - - enumeration_("justify_alignment") - .value("LEFT",J_LEFT) - .value("MIDDLE",J_MIDDLE) - .value("RIGHT",J_RIGHT) - .value("AUTO", J_AUTO) - ; - - enumeration_("text_transform") - .value("NONE",NONE) - .value("UPPERCASE",UPPERCASE) - .value("LOWERCASE",LOWERCASE) - .value("CAPITALIZE",CAPITALIZE) - ; - - enumeration_("halo_rasterizer") - .value("FULL",HALO_RASTERIZER_FULL) - .value("FAST",HALO_RASTERIZER_FAST) - ; - */ - class_("TextSymbolizer", - init<>()) - ; - /* - - class_with_converter - ("TextSymbolizerProperties") - .def_readwrite_convert("label_placement", &text_symbolizer_properties::label_placement) - .def_readwrite_convert("upright", &text_symbolizer_properties::upright) - .def_readwrite("label_spacing", &text_symbolizer_properties::label_spacing) - .def_readwrite("label_position_tolerance", &text_symbolizer_properties::label_position_tolerance) - .def_readwrite("avoid_edges", &text_symbolizer_properties::avoid_edges) - .def_readwrite("margin", &text_symbolizer_properties::margin) - .def_readwrite("repeat_distance", &text_symbolizer_properties::repeat_distance) - .def_readwrite("minimum_distance", &text_symbolizer_properties::minimum_distance) - .def_readwrite("minimum_padding", &text_symbolizer_properties::minimum_padding) - .def_readwrite("minimum_path_length", &text_symbolizer_properties::minimum_path_length) - .def_readwrite("maximum_angle_char_delta", &text_symbolizer_properties::max_char_angle_delta) - .def_readwrite("allow_overlap", &text_symbolizer_properties::allow_overlap) - .def_readwrite("largest_bbox_only", &text_symbolizer_properties::largest_bbox_only) - .def_readwrite("layout_defaults", &text_symbolizer_properties::layout_defaults) - //.def_readwrite("format", &text_symbolizer_properties::format) - .add_property ("format_tree", - &text_symbolizer_properties::format_tree, - &text_symbolizer_properties::set_format_tree); - //from_xml, to_xml operate on mapnik's internal XML tree and don't make sense in python. - // add_expressions isn't useful in python either. The result is only needed by - // attribute_collector (which isn't exposed in python) and - // it just calls add_expressions of the associated formatting tree. - // set_old_style expression is just a compatibility wrapper and doesn't need to be exposed in python. - ; - - class_with_converter - ("TextLayoutProperties") - .def_readwrite_convert("horizontal_alignment", &text_layout_properties::halign) - .def_readwrite_convert("justify_alignment", &text_layout_properties::jalign) - .def_readwrite_convert("vertical_alignment", &text_layout_properties::valign) - .def_readwrite("text_ratio", &text_layout_properties::text_ratio) - .def_readwrite("wrap_width", &text_layout_properties::wrap_width) - .def_readwrite("wrap_before", &text_layout_properties::wrap_before) - .def_readwrite("orientation", &text_layout_properties::orientation) - .def_readwrite("rotate_displacement", &text_layout_properties::rotate_displacement) - .add_property("displacement", &get_displacement, &set_displacement); - - class_with_converter - ("CharProperties") - .def_readwrite_convert("text_transform", &detail::evaluated_format_properties::text_transform) - .def_readwrite_convert("fontset", &detail::evaluated_format_properties::fontset) - .def(init()) //Copy constructor - .def_readwrite("face_name", &detail::evaluated_format_properties::face_name) - .def_readwrite("text_size", &detail::evaluated_format_properties::text_size) - .def_readwrite("character_spacing", &detail::evaluated_format_properties::character_spacing) - .def_readwrite("line_spacing", &detail::evaluated_format_properties::line_spacing) - .def_readwrite("text_opacity", &detail::evaluated_format_properties::text_opacity) - .def_readwrite("fill", &detail::evaluated_format_properties::fill) - .def_readwrite("halo_fill", &detail::evaluated_format_properties::halo_fill) - .def_readwrite("halo_radius", &evaluated_format_properties::halo_radius) - //from_xml, to_xml operate on mapnik's internal XML tree and don't make sense in python. - ; - class_, - boost::noncopyable> - ("TextPlacements") - .def_readwrite("defaults", &text_placements::defaults) - //.def("get_placement_info", pure_virtual(&text_placements::get_placement_info)) - // TODO: add_expressions() - ; - register_ptr_to_python >(); - - class_, - boost::noncopyable> - ("TextPlacementInfo", - init()) - .def("next", pure_virtual(&text_placement_info::next)) - .def_readwrite("properties", &text_placement_info::properties) - .def_readwrite("scale_factor", &text_placement_info::scale_factor) - ; - register_ptr_to_python >(); - - - class_, - boost::noncopyable>("ExpressionSet") - .def("insert", &insert_expression); - ; - - class_, - boost::noncopyable>("FormattingNode") - .def("apply", pure_virtual(&formatting::node::apply)) - .def("add_expressions", pure_virtual(&formatting::node::add_expressions)) - .def("to_xml", pure_virtual(&formatting::node::to_xml)) - ; - - register_ptr_to_python >(); - - class_, - bases,boost::noncopyable>("FormattingText", init()) - .def(init()) - .def("apply", &formatting::text_node::apply)//, &TextNodeWrap::default_apply) - .add_property("text",&formatting::text_node::get_text, &formatting::text_node::set_text) - ; - - register_ptr_to_python >(); - - class_with_converter, - bases, - boost::noncopyable> - ("FormattingFormat") - .def_readwrite_convert("text_size", &formatting::format_node::text_size) - .def_readwrite_convert("face_name", &formatting::format_node::face_name) - .def_readwrite_convert("character_spacing", &formatting::format_node::character_spacing) - .def_readwrite_convert("line_spacing", &formatting::format_node::line_spacing) - .def_readwrite_convert("text_opacity", &formatting::format_node::text_opacity) - .def_readwrite_convert("text_transform", &formatting::format_node::text_transform) - .def_readwrite_convert("fill", &formatting::format_node::fill) - .def_readwrite_convert("halo_fill", &formatting::format_node::halo_fill) - .def_readwrite_convert("halo_radius", &formatting::format_node::halo_radius) - .def("apply", &formatting::format_node::apply, &FormatNodeWrap::default_apply) - .add_property("child", - &formatting::format_node::get_child, - &formatting::format_node::set_child) - ; - register_ptr_to_python >(); - - class_, - bases, - boost::noncopyable> - ("FormattingList", init<>()) - .def(init()) - .def("append", &formatting::list_node::push_back) - .def("apply", &formatting::list_node::apply, &ListNodeWrap::default_apply) - .def("__len__", &ListNodeWrap::get_length) - .def("__getitem__", &ListNodeWrap::get_item) - .def("__setitem__", &ListNodeWrap::set_item) - .def("append", &ListNodeWrap::append) - ; - - register_ptr_to_python >(); - - class_, - bases, - boost::noncopyable> - ("FormattingExpressionFormat") - .def_readwrite("text_size", &formatting::expression_format::text_size) - .def_readwrite("face_name", &formatting::expression_format::face_name) - .def_readwrite("character_spacing", &formatting::expression_format::character_spacing) - .def_readwrite("line_spacing", &formatting::expression_format::line_spacing) - .def_readwrite("text_opacity", &formatting::expression_format::text_opacity) - .def_readwrite("fill", &formatting::expression_format::fill) - .def_readwrite("halo_fill", &formatting::expression_format::halo_fill) - .def_readwrite("halo_radius", &formatting::expression_format::halo_radius) - .def("apply", &formatting::expression_format::apply, &ExprFormatWrap::default_apply) - .add_property("child", - &formatting::expression_format::get_child, - &formatting::expression_format::set_child) - ; - register_ptr_to_python >(); -*/ - //TODO: registry -} diff --git a/bindings/python/mapnik_threads.hpp b/bindings/python/mapnik_threads.hpp deleted file mode 100644 index e48a707e4..000000000 --- a/bindings/python/mapnik_threads.hpp +++ /dev/null @@ -1,109 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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_THREADS_HPP -#define MAPNIK_THREADS_HPP - -#include // for thread_specific_ptr -#include - -namespace mapnik { -class python_thread -{ - /* Docs: - http://docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock - */ -public: - static void unblock() - { -#ifdef MAPNIK_DEBUG - if (state.get()) - { - std::cerr << "ERROR: Python threads are already unblocked. " - "Unblocking again will loose the current state and " - "might crash later. Aborting!\n"; - abort(); //This is a serious error and can't be handled in any other sane way - } -#endif - PyThreadState *_save = 0; //Name defined by python - Py_UNBLOCK_THREADS; - state.reset(_save); -#ifdef MAPNIK_DEBUG - if (!_save) { - thread_support = false; - } -#endif - } - - static void block() - { -#ifdef MAPNIK_DEBUG - if (thread_support && !state.get()) - { - std::cerr << "ERROR: Trying to restore python thread state, " - "but no state is saved. Can't continue and also " - "can't raise an exception because the python " - "interpreter might be non-function. Aborting!\n"; - abort(); - } -#endif - PyThreadState *_save = state.release(); //Name defined by python - Py_BLOCK_THREADS; - } - -private: - static boost::thread_specific_ptr state; -#ifdef MAPNIK_DEBUG - static bool thread_support; -#endif -}; - -class python_block_auto_unblock -{ -public: - python_block_auto_unblock() - { - python_thread::block(); - } - - ~python_block_auto_unblock() - { - python_thread::unblock(); - } -}; - -class python_unblock_auto_block -{ -public: - python_unblock_auto_block() - { - python_thread::unblock(); - } - - ~python_unblock_auto_block() - { - python_thread::block(); - } -}; - -} //namespace - -#endif // MAPNIK_THREADS_HPP diff --git a/bindings/python/mapnik_value_converter.hpp b/bindings/python/mapnik_value_converter.hpp deleted file mode 100644 index 4f152a035..000000000 --- a/bindings/python/mapnik_value_converter.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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_PYTHON_BINDING_VALUE_CONVERTER_INCLUDED -#define MAPNIK_PYTHON_BINDING_VALUE_CONVERTER_INCLUDED - -// mapnik -#include -#include -// boost -#include -#include - -namespace boost { namespace python { - - struct value_converter - { - PyObject * operator() (mapnik::value_integer val) const - { - return ::PyLong_FromLongLong(val); - } - - PyObject * operator() (mapnik::value_double val) const - { - return ::PyFloat_FromDouble(val); - } - - PyObject * operator() (mapnik::value_bool val) const - { - return ::PyBool_FromLong(val); - } - - PyObject * operator() (std::string const& s) const - { - return ::PyUnicode_DecodeUTF8(s.c_str(),implicit_cast(s.length()),0); - } - - PyObject * operator() (mapnik::value_unicode_string const& s) const - { - std::string buffer; - mapnik::to_utf8(s,buffer); - return ::PyUnicode_DecodeUTF8(buffer.c_str(),implicit_cast(buffer.length()),0); - } - - PyObject * operator() (mapnik::value_null const& /*s*/) const - { - Py_RETURN_NONE; - } - }; - - - struct mapnik_value_to_python - { - static PyObject* convert(mapnik::value const& v) - { - return mapnik::util::apply_visitor(value_converter(),v); - } - - }; - - struct mapnik_param_to_python - { - static PyObject* convert(mapnik::value_holder const& v) - { - return mapnik::util::apply_visitor(value_converter(),v); - } - }; - - -}} - -#endif // MAPNIK_PYTHON_BINDING_VALUE_CONVERTER_INCLUDED diff --git a/bindings/python/mapnik_view_transform.cpp b/bindings/python/mapnik_view_transform.cpp deleted file mode 100644 index b6c9a2058..000000000 --- a/bindings/python/mapnik_view_transform.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon - * - * 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 - * - *****************************************************************************/ - -#include - -// boost -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#pragma GCC diagnostic pop - -// mapnik -#include - -using mapnik::view_transform; - -struct view_transform_pickle_suite : boost::python::pickle_suite -{ - static boost::python::tuple - getinitargs(const view_transform& c) - { - using namespace boost::python; - return boost::python::make_tuple(c.width(),c.height(),c.extent()); - } -}; - -namespace { - -mapnik::coord2d forward_point(mapnik::view_transform const& t, mapnik::coord2d const& in) -{ - mapnik::coord2d out(in); - t.forward(out); - return out; -} - -mapnik::coord2d backward_point(mapnik::view_transform const& t, mapnik::coord2d const& in) -{ - mapnik::coord2d out(in); - t.backward(out); - return out; -} - -mapnik::box2d forward_envelope(mapnik::view_transform const& t, mapnik::box2d const& in) -{ - return t.forward(in); -} - -mapnik::box2d backward_envelope(mapnik::view_transform const& t, mapnik::box2d const& in) -{ - return t.backward(in); -} -} - -void export_view_transform() -{ - using namespace boost::python; - using mapnik::box2d; - using mapnik::coord2d; - - class_("ViewTransform",init const& > ( - "Create a ViewTransform with a width and height as integers and extent")) - .def_pickle(view_transform_pickle_suite()) - .def("forward", forward_point) - .def("backward",backward_point) - .def("forward", forward_envelope) - .def("backward",backward_envelope) - .def("scale_x",&view_transform::scale_x) - .def("scale_y",&view_transform::scale_y) - ; -} diff --git a/bindings/python/python_grid_utils.cpp b/bindings/python/python_grid_utils.cpp deleted file mode 100644 index 980737c77..000000000 --- a/bindings/python/python_grid_utils.cpp +++ /dev/null @@ -1,405 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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 - * - *****************************************************************************/ - -#if defined(GRID_RENDERER) - -#include - -// boost -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "python_grid_utils.hpp" - -// stl -#include - -namespace mapnik { - - -template -void grid2utf(T const& grid_type, - boost::python::list& l, - std::vector& key_order) -{ - using keys_type = std::map< typename T::lookup_type, typename T::value_type>; - using keys_iterator = typename keys_type::iterator; - - typename T::data_type const& data = grid_type.data(); - typename T::feature_key_type const& feature_keys = grid_type.get_feature_keys(); - typename T::feature_key_type::const_iterator feature_pos; - - keys_type keys; - // start counting at utf8 codepoint 32, aka space character - std::uint16_t codepoint = 32; - - unsigned array_size = data.width(); - for (unsigned y = 0; y < data.height(); ++y) - { - std::uint16_t idx = 0; - const std::unique_ptr line(new Py_UNICODE[array_size]); - typename T::value_type const* row = data.getRow(y); - for (unsigned x = 0; x < data.width(); ++x) - { - typename T::value_type feature_id = row[x]; - feature_pos = feature_keys.find(feature_id); - if (feature_pos != feature_keys.end()) - { - mapnik::grid::lookup_type val = feature_pos->second; - keys_iterator key_pos = keys.find(val); - if (key_pos == keys.end()) - { - // Create a new entry for this key. Skip the codepoints that - // can't be encoded directly in JSON. - if (codepoint == 34) ++codepoint; // Skip " - else if (codepoint == 92) ++codepoint; // Skip backslash - if (feature_id == mapnik::grid::base_mask) - { - keys[""] = codepoint; - key_order.push_back(""); - } - else - { - keys[val] = codepoint; - key_order.push_back(val); - } - line[idx++] = static_cast(codepoint); - ++codepoint; - } - else - { - line[idx++] = static_cast(key_pos->second); - } - } - // else, shouldn't get here... - } - l.append(boost::python::object( - boost::python::handle<>( - PyUnicode_FromUnicode(line.get(), array_size)))); - } -} - - -template -void grid2utf(T const& grid_type, - boost::python::list& l, - std::vector& key_order, - unsigned int resolution) -{ - using keys_type = std::map< typename T::lookup_type, typename T::value_type>; - using keys_iterator = typename keys_type::iterator; - - typename T::feature_key_type const& feature_keys = grid_type.get_feature_keys(); - typename T::feature_key_type::const_iterator feature_pos; - - keys_type keys; - // start counting at utf8 codepoint 32, aka space character - std::uint16_t codepoint = 32; - - unsigned array_size = std::ceil(grid_type.width()/static_cast(resolution)); - for (unsigned y = 0; y < grid_type.height(); y=y+resolution) - { - std::uint16_t idx = 0; - const std::unique_ptr line(new Py_UNICODE[array_size]); - mapnik::grid::value_type const* row = grid_type.getRow(y); - for (unsigned x = 0; x < grid_type.width(); x=x+resolution) - { - typename T::value_type feature_id = row[x]; - feature_pos = feature_keys.find(feature_id); - if (feature_pos != feature_keys.end()) - { - mapnik::grid::lookup_type val = feature_pos->second; - keys_iterator key_pos = keys.find(val); - if (key_pos == keys.end()) - { - // Create a new entry for this key. Skip the codepoints that - // can't be encoded directly in JSON. - if (codepoint == 34) ++codepoint; // Skip " - else if (codepoint == 92) ++codepoint; // Skip backslash - if (feature_id == mapnik::grid::base_mask) - { - keys[""] = codepoint; - key_order.push_back(""); - } - else - { - keys[val] = codepoint; - key_order.push_back(val); - } - line[idx++] = static_cast(codepoint); - ++codepoint; - } - else - { - line[idx++] = static_cast(key_pos->second); - } - } - // else, shouldn't get here... - } - l.append(boost::python::object( - boost::python::handle<>( - PyUnicode_FromUnicode(line.get(), array_size)))); - } -} - - -template -void grid2utf2(T const& grid_type, - boost::python::list& l, - std::vector& key_order, - unsigned int resolution) -{ - using keys_type = std::map< typename T::lookup_type, typename T::value_type>; - using keys_iterator = typename keys_type::iterator; - - typename T::data_type const& data = grid_type.data(); - typename T::feature_key_type const& feature_keys = grid_type.get_feature_keys(); - typename T::feature_key_type::const_iterator feature_pos; - - keys_type keys; - // start counting at utf8 codepoint 32, aka space character - uint16_t codepoint = 32; - - mapnik::grid::data_type target(data.width()/resolution,data.height()/resolution); - mapnik::scale_grid(target,grid_type.data(),0.0,0.0); - - unsigned array_size = target.width(); - for (unsigned y = 0; y < target.height(); ++y) - { - uint16_t idx = 0; - const std::unique_ptr line(new Py_UNICODE[array_size]); - mapnik::grid::value_type * row = target.getRow(y); - unsigned x; - for (x = 0; x < target.width(); ++x) - { - feature_pos = feature_keys.find(row[x]); - if (feature_pos != feature_keys.end()) - { - mapnik::grid::lookup_type val = feature_pos->second; - keys_iterator key_pos = keys.find(val); - if (key_pos == keys.end()) - { - // Create a new entry for this key. Skip the codepoints that - // can't be encoded directly in JSON. - if (codepoint == 34) ++codepoint; // Skip " - else if (codepoint == 92) ++codepoint; // Skip backslash - keys[val] = codepoint; - key_order.push_back(val); - line[idx++] = static_cast(codepoint); - ++codepoint; - } - else - { - line[idx++] = static_cast(key_pos->second); - } - } - // else, shouldn't get here... - } - l.append(boost::python::object( - boost::python::handle<>( - PyUnicode_FromUnicode(line.get(), array_size)))); - } -} - - -template -void write_features(T const& grid_type, - boost::python::dict& feature_data, - std::vector const& key_order) -{ - typename T::feature_type const& g_features = grid_type.get_grid_features(); - if (g_features.size() <= 0) - { - return; - } - - std::set const& attributes = grid_type.property_names(); - typename T::feature_type::const_iterator feat_end = g_features.end(); - for ( std::string const& key_item :key_order ) - { - if (key_item.empty()) - { - continue; - } - - typename T::feature_type::const_iterator feat_itr = g_features.find(key_item); - if (feat_itr == feat_end) - { - continue; - } - - bool found = false; - boost::python::dict feat; - mapnik::feature_ptr feature = feat_itr->second; - for ( std::string const& attr : attributes ) - { - if (attr == "__id__") - { - feat[attr.c_str()] = feature->id(); - } - else if (feature->has_key(attr)) - { - found = true; - feat[attr.c_str()] = feature->get(attr); - } - } - - if (found) - { - feature_data[feat_itr->first] = feat; - } - } -} - -template -void grid_encode_utf(T const& grid_type, - boost::python::dict & json, - bool add_features, - unsigned int resolution) -{ - // convert buffer to utf and gather key order - boost::python::list l; - std::vector key_order; - - if (resolution != 1) { - // resample on the fly - faster, less accurate - mapnik::grid2utf(grid_type,l,key_order,resolution); - - // resample first - slower, more accurate - //mapnik::grid2utf2(grid_type,l,key_order,resolution); - } - else - { - mapnik::grid2utf(grid_type,l,key_order); - } - - // convert key order to proper python list - boost::python::list keys_a; - for ( typename T::lookup_type const& key_id : key_order ) - { - keys_a.append(key_id); - } - - // gather feature data - boost::python::dict feature_data; - if (add_features) { - mapnik::write_features(grid_type,feature_data,key_order); - } - - json["grid"] = l; - json["keys"] = keys_a; - json["data"] = feature_data; - -} - -template -boost::python::dict grid_encode( T const& grid, std::string const& format, bool add_features, unsigned int resolution) -{ - if (format == "utf") { - boost::python::dict json; - grid_encode_utf(grid,json,add_features,resolution); - return json; - } - else - { - std::stringstream s; - s << "'utf' is currently the only supported encoding format."; - throw mapnik::value_error(s.str()); - } -} - -template boost::python::dict grid_encode( mapnik::grid const& grid, std::string const& format, bool add_features, unsigned int resolution); -template boost::python::dict grid_encode( mapnik::grid_view const& grid, std::string const& format, bool add_features, unsigned int resolution); - -void render_layer_for_grid(mapnik::Map const& map, - mapnik::grid & grid, - unsigned layer_idx, - boost::python::list const& fields, - double scale_factor, - unsigned offset_x, - unsigned offset_y) -{ - std::vector const& layers = map.layers(); - std::size_t layer_num = layers.size(); - if (layer_idx >= layer_num) { - std::ostringstream s; - s << "Zero-based layer index '" << layer_idx << "' not valid, only '" - << layer_num << "' layers are in map\n"; - throw std::runtime_error(s.str()); - } - - // convert python list to std::set - boost::python::ssize_t num_fields = boost::python::len(fields); - for(boost::python::ssize_t i=0; i name(fields[i]); - if (name.check()) - { - grid.add_property_name(name()); - } - else - { - std::stringstream s; - s << "list of field names must be strings"; - throw mapnik::value_error(s.str()); - } - } - - // copy property names - std::set attributes = grid.property_names(); - // todo - make this a static constant - std::string known_id_key = "__id__"; - if (attributes.find(known_id_key) != attributes.end()) - { - attributes.erase(known_id_key); - } - - std::string join_field = grid.get_key(); - if (known_id_key != join_field && - attributes.find(join_field) == attributes.end()) - { - attributes.insert(join_field); - } - - mapnik::grid_renderer ren(map,grid,scale_factor,offset_x,offset_y); - mapnik::layer const& layer = layers[layer_idx]; - ren.apply(layer,attributes); -} - -} - -#endif diff --git a/bindings/python/python_grid_utils.hpp b/bindings/python/python_grid_utils.hpp deleted file mode 100644 index 320b342a8..000000000 --- a/bindings/python/python_grid_utils.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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_PYTHON_BINDING_GRID_UTILS_INCLUDED -#define MAPNIK_PYTHON_BINDING_GRID_UTILS_INCLUDED - -// boost -#include - -// mapnik -#include -#include - -namespace mapnik { - - -template -void grid2utf(T const& grid_type, - boost::python::list& l, - std::vector& key_order); - - -template -void grid2utf(T const& grid_type, - boost::python::list& l, - std::vector& key_order, - unsigned int resolution); - - -template -void grid2utf2(T const& grid_type, - boost::python::list& l, - std::vector& key_order, - unsigned int resolution); - - -template -void write_features(T const& grid_type, - boost::python::dict& feature_data, - std::vector const& key_order); - -template -void grid_encode_utf(T const& grid_type, - boost::python::dict & json, - bool add_features, - unsigned int resolution); - -template -boost::python::dict grid_encode( T const& grid, std::string const& format, bool add_features, unsigned int resolution); - -void render_layer_for_grid(const mapnik::Map& map, - mapnik::grid& grid, - unsigned layer_idx, // TODO - layer by name or index - boost::python::list const& fields, - double scale_factor, - unsigned offset_x, - unsigned offset_y); - -} - -#endif // MAPNIK_PYTHON_BINDING_GRID_UTILS_INCLUDED diff --git a/bindings/python/python_optional.hpp b/bindings/python/python_optional.hpp deleted file mode 100644 index 91585c2ae..000000000 --- a/bindings/python/python_optional.hpp +++ /dev/null @@ -1,198 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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 - * - *****************************************************************************/ - -#include -#include - -#include - -// boost::optional to/from converter from John Wiegley - -template -struct object_from_python -{ - object_from_python() { - boost::python::converter::registry::push_back - (&TfromPy::convertible, &TfromPy::construct, - boost::python::type_id()); - } -}; - -template -struct register_python_conversion -{ - register_python_conversion() { - boost::python::to_python_converter(); - object_from_python(); - } -}; - -template -struct python_optional : public mapnik::util::noncopyable -{ - struct optional_to_python - { - static PyObject * convert(const boost::optional& value) - { - return (value ? boost::python::to_python_value()(*value) : - boost::python::detail::none()); - } - }; - - struct optional_from_python - { - static void * convertible(PyObject * source) - { - using namespace boost::python::converter; - - if (source == Py_None) - return source; - - const registration& converters(registered::converters); - - if (implicit_rvalue_convertible_from_python(source, - converters)) { - rvalue_from_python_stage1_data data = - rvalue_from_python_stage1(source, converters); - return rvalue_from_python_stage2(source, data, converters); - } - return 0; - } - - static void construct(PyObject * source, - boost::python::converter::rvalue_from_python_stage1_data * data) - { - using namespace boost::python::converter; - - void * const storage = ((rvalue_from_python_storage *) - data)->storage.bytes; - - if (data->convertible == source) // == None - new (storage) boost::optional(); // A Boost uninitialized value - else - new (storage) boost::optional(*static_cast(data->convertible)); - - data->convertible = storage; - } - }; - - explicit python_optional() - { - register_python_conversion, - optional_to_python, optional_from_python>(); - } -}; - -// to/from boost::optional -template <> -struct python_optional : public mapnik::util::noncopyable -{ - struct optional_to_python - { - static PyObject * convert(const boost::optional& value) - { - return (value ? PyFloat_FromDouble(*value) : - boost::python::detail::none()); - } - }; - - struct optional_from_python - { - static void * convertible(PyObject * source) - { - using namespace boost::python::converter; - - if (source == Py_None || PyFloat_Check(source)) - return source; - return 0; - } - - static void construct(PyObject * source, - boost::python::converter::rvalue_from_python_stage1_data * data) - { - using namespace boost::python::converter; - void * const storage = ((rvalue_from_python_storage > *) - data)->storage.bytes; - if (source == Py_None) // == None - new (storage) boost::optional(); // A Boost uninitialized value - else - new (storage) boost::optional(PyFloat_AsDouble(source)); - data->convertible = storage; - } - }; - - explicit python_optional() - { - register_python_conversion, - optional_to_python, optional_from_python>(); - } -}; - -// to/from boost::optional -template <> -struct python_optional : public mapnik::util::noncopyable -{ - struct optional_to_python - { - static PyObject * convert(const boost::optional& value) - { - if (value) - { - if (*value) Py_RETURN_TRUE; - else Py_RETURN_FALSE; - } - else return boost::python::detail::none(); - } - }; - struct optional_from_python - { - static void * convertible(PyObject * source) - { - using namespace boost::python::converter; - - if (source == Py_None || PyBool_Check(source)) - return source; - return 0; - } - - static void construct(PyObject * source, - boost::python::converter::rvalue_from_python_stage1_data * data) - { - using namespace boost::python::converter; - void * const storage = ((rvalue_from_python_storage > *) - data)->storage.bytes; - if (source == Py_None) // == None - new (storage) boost::optional(); // A Boost uninitialized value - else - { - new (storage) boost::optional(source == Py_True ? true : false); - } - data->convertible = storage; - } - }; - - explicit python_optional() - { - register_python_conversion, - optional_to_python, optional_from_python>(); - } -}; diff --git a/bindings/python/python_to_value.hpp b/bindings/python/python_to_value.hpp deleted file mode 100644 index 198305cc1..000000000 --- a/bindings/python/python_to_value.hpp +++ /dev/null @@ -1,122 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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_PYTHON_BINDING_PYTHON_TO_VALUE -#define MAPNIK_PYTHON_BINDING_PYTHON_TO_VALUE - -// boost -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" -#include -#pragma GCC diagnostic pop - -// mapnik -#include -#include -#include - -namespace mapnik { - - static mapnik::attributes dict2attr(boost::python::dict const& d) - { - using namespace boost::python; - mapnik::attributes vars; - mapnik::transcoder tr_("utf8"); - boost::python::list keys=d.keys(); - for (int i=0; i < len(keys); ++i) - { - std::string key; - object obj_key = keys[i]; - if (PyUnicode_Check(obj_key.ptr())) - { - PyObject* temp = PyUnicode_AsUTF8String(obj_key.ptr()); - if (temp) - { - #if PY_VERSION_HEX >= 0x03000000 - char* c_str = PyBytes_AsString(temp); - #else - char* c_str = PyString_AsString(temp); - #endif - key = c_str; - Py_DecRef(temp); - } - } - else - { - key = extract(keys[i]); - } - object obj = d[key]; - if (PyUnicode_Check(obj.ptr())) - { - PyObject* temp = PyUnicode_AsUTF8String(obj.ptr()); - if (temp) - { - #if PY_VERSION_HEX >= 0x03000000 - char* c_str = PyBytes_AsString(temp); - #else - char* c_str = PyString_AsString(temp); - #endif - vars[key] = tr_.transcode(c_str); - Py_DecRef(temp); - } - continue; - } - - if (PyBool_Check(obj.ptr())) - { - extract ex(obj); - if (ex.check()) - { - vars[key] = ex(); - } - } - else if (PyFloat_Check(obj.ptr())) - { - extract ex(obj); - if (ex.check()) - { - vars[key] = ex(); - } - } - else - { - extract ex(obj); - if (ex.check()) - { - vars[key] = ex(); - } - else - { - extract ex0(obj); - if (ex0.check()) - { - vars[key] = tr_.transcode(ex0().c_str()); - } - } - } - } - return vars; - } -} - -#endif // MAPNIK_PYTHON_BINDING_PYTHON_TO_VALUE diff --git a/bootstrap.sh b/bootstrap.sh index 601ab6ebd..695613d64 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -6,9 +6,7 @@ todo -- gdal shared lib / avoid dlclose atexit crash -- clang debs to s3 -- docs for base setup: sudo apt-get -y install zlib1g-dev python-dev make git python-dev +- docs for base setup: sudo apt-get -y install zlib1g-dev make git - shrink icu data ' @@ -20,71 +18,85 @@ function setup_mason() { (cd ./.mason && git pull) fi export MASON_DIR=$(pwd)/.mason - if [[ $(uname -s) == 'Linux' ]]; then source ./.mason/scripts/setup_cpp11_toolchain.sh; fi export PATH=$(pwd)/.mason:$PATH export CXX=${CXX:-clang++} export CC=${CC:-clang} } +if [[ $(uname -s) == 'Darwin' ]]; then + FIND_PATTERN="\/Users\/travis\/build\/mapbox\/mason" +else + FIND_PATTERN="\/home\/travis\/build\/mapbox\/mason" +fi + +REPLACE="$(pwd)" +REPLACE=${REPLACE////\\/} + function install() { MASON_PLATFORM_ID=$(mason env MASON_PLATFORM_ID) - if [[ ! -d ./mason_packages/${MASON_PLATFORM_ID}/${1}/ ]]; then + if [[ ! -d ./mason_packages/${MASON_PLATFORM_ID}/${1}/${2} ]]; then mason install $1 $2 mason link $1 $2 + if [[ $3 ]]; then + LA_FILE=$(${MASON_DIR:-~/.mason}/mason prefix $1 $2)/lib/$3.la + if [[ -f ${LA_FILE} ]]; then + perl -i -p -e "s/${FIND_PATTERN}/${REPLACE}/g;" ${LA_FILE} + else + echo "$LA_FILE not found" + fi + fi fi } function install_mason_deps() { - install freetype 2.5.4 - install harfbuzz 2cd5323 - install jpeg_turbo 1.4.0 - install libxml2 2.9.2 - install libpng 1.6.16 - install webp 0.4.2 - install icu 54.1 - install proj 4.8.0 - install libtiff 4.0.4beta - install boost 1.57.0 - install boost_libsystem 1.57.0 - install boost_libthread 1.57.0 - install boost_libfilesystem 1.57.0 - install boost_libprogram_options 1.57.0 - install boost_libregex 1.57.0 - install boost_libpython 1.57.0 - install libpq 9.4.0 - install sqlite 3.8.8.1 - install gdal 1.11.1 - install expat 2.1.0 - install pixman 0.32.6 - install cairo 1.12.18 + install gdal 1.11.2 libgdal & + install boost 1.57.0 & + install boost_libsystem 1.57.0 & + install boost_libthread 1.57.0 & + install boost_libfilesystem 1.57.0 & + install boost_libprogram_options 1.57.0 & + install boost_libregex 1.57.0 & + install boost_libpython 1.57.0 & + install freetype 2.5.5 libfreetype & + install harfbuzz 0.9.40 libharfbuzz & + install jpeg_turbo 1.4.0 libjpeg & + install libxml2 2.9.2 libxml2 & + install libpng 1.6.16 libpng & + install webp 0.4.2 libwebp & + install icu 54.1 & + install proj 4.8.0 libproj & + install libtiff 4.0.4beta libtiff & + install libpq 9.4.0 & + install sqlite 3.8.8.1 libsqlite3 & + install expat 2.1.0 libexpat & + install pixman 0.32.6 libpixman-1 & + install cairo 1.12.18 libcairo & + wait } -function setup_nose() { - if [[ ! -d $(pwd)/nose-1.3.4 ]]; then - wget -q https://pypi.python.org/packages/source/n/nose/nose-1.3.4.tar.gz - tar -xzf nose-1.3.4.tar.gz - fi - export PYTHONPATH=$(pwd)/nose-1.3.4:${PYTHONPATH} -} +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() { - local MASON_LINKED_REL=./mason_packages/.link - export C_INCLUDE_PATH="${MASON_LINKED_REL}/include" - export CPLUS_INCLUDE_PATH="${MASON_LINKED_REL}/include" - export LIBRARY_PATH="${MASON_LINKED_REL}/lib" - export PATH="${MASON_LINKED_REL}/bin":${PATH} + if [[ $(uname -s) == 'Darwin' ]]; then + local PATH_REPLACE="/Users/travis/build/mapbox/mason/mason_packages:./mason_packages" + else + local PATH_REPLACE="/home/travis/build/mapbox/mason/mason_packages:./mason_packages" + fi echo " CXX = '$CXX' CC = '$CC' CUSTOM_CXXFLAGS = '-fvisibility=hidden -fvisibility-inlines-hidden -DU_CHARSET_IS_UTF8=1' -CUSTOM_LDFLAGS = '-L${MASON_LINKED_REL}/lib' 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 = '/Users/travis/build/mapbox/mason/mason_packages:./mason_packages' +PATH_REPLACE = '${PATH_REPLACE}' BOOST_INCLUDES = '${MASON_LINKED_REL}/include' BOOST_LIBS = '${MASON_LINKED_REL}/lib' ICU_INCLUDES = '${MASON_LINKED_REL}/include' @@ -101,6 +113,8 @@ 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' XML2_INCLUDES = '${MASON_LINKED_REL}/include/libxml2' @@ -110,28 +124,26 @@ CAIRO_INCLUDES = '${MASON_LINKED_REL}/include' CAIRO_LIBS = '${MASON_LINKED_REL}/lib' SQLITE_INCLUDES = '${MASON_LINKED_REL}/include' SQLITE_LIBS = '${MASON_LINKED_REL}/lib' -FRAMEWORK_PYTHON = False BENCHMARK = True CPP_TESTS = True PGSQL2SQLITE = True -BINDINGS = 'python' XMLPARSER = 'ptree' SVG2PNG = True SAMPLE_INPUT_PLUGINS = True " > ./config.py } +# NOTE: the `mapnik-settings.env` is used by test/run (which is run by `make test`) function setup_runtime_settings() { - local MASON_LINKED_ABS=$(pwd)/mason_packages/.link - export PROJ_LIB=${MASON_LINKED_ABS}/share/proj/ - export ICU_DATA=${MASON_LINKED_ABS}/share/icu/54.1/ - export GDAL_DATA=${MASON_LINKED_ABS}/share/gdal + echo "export PROJ_LIB=${MASON_LINKED_ABS}/share/proj" > mapnik-settings.env + echo "export ICU_DATA=${MASON_LINKED_ABS}/share/icu/54.1" >> mapnik-settings.env + echo "export GDAL_DATA=${MASON_LINKED_ABS}/share/gdal" >> mapnik-settings.env + source mapnik-settings.env } function main() { setup_mason install_mason_deps - setup_nose make_config setup_runtime_settings echo "Ready, now run:" diff --git a/configure b/configure index 8abbff103..b468f8587 100755 --- a/configure +++ b/configure @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh PYTHON=${PYTHON:-python} diff --git a/demo/c++/build.py b/demo/c++/build.py index 7eb878f0b..c059b05da 100644 --- a/demo/c++/build.py +++ b/demo/c++/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2009 Artem Pavlenko, Dane Springmeyer +# Copyright (C) 2015 Artem Pavlenko, Dane Springmeyer # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os from copy import copy diff --git a/demo/c++/rundemo.cpp b/demo/c++/rundemo.cpp index bb354fdeb..c07bd5c31 100644 --- a/demo/c++/rundemo.cpp +++ b/demo/c++/rundemo.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -37,6 +36,7 @@ #include #include #include +#include #if defined(HAVE_CAIRO) #include @@ -305,26 +305,26 @@ int main ( int, char** ) m.zoom_to_box(box2d(-8024477.28459,5445190.38849,-7381388.20071,5662941.44855)); - image_32 buf(m.width(),m.height()); - agg_renderer ren(m,buf); + image_rgba8 buf(m.width(),m.height()); + agg_renderer ren(m,buf); ren.apply(); std::string msg("These maps have been rendered using AGG in the current directory:\n"); #ifdef HAVE_JPEG - save_to_file(buf.data(),"demo.jpg","jpeg"); + save_to_file(buf,"demo.jpg","jpeg"); msg += "- demo.jpg\n"; #endif #ifdef HAVE_PNG - save_to_file(buf.data(),"demo.png","png"); - save_to_file(buf.data(),"demo256.png","png8"); + save_to_file(buf,"demo.png","png"); + save_to_file(buf,"demo256.png","png8"); msg += "- demo.png\n"; msg += "- demo256.png\n"; #endif #ifdef HAVE_TIFF - save_to_file(buf.data(),"demo.tif","tiff"); + save_to_file(buf,"demo.tif","tiff"); msg += "- demo.tif\n"; #endif #ifdef HAVE_WEBP - save_to_file(buf.data(),"demo.webp","webp"); + save_to_file(buf,"demo.webp","webp"); msg += "- demo.webp\n"; #endif msg += "Have a look!\n"; @@ -353,7 +353,7 @@ int main ( int, char** ) cairo_surface_write_to_png(&*image_surface, "cairo-demo.png"); // but we can also benefit from quantization by converting // to a mapnik image object and then saving that - mapnik::image_data_rgba8 im_data(cairo_image_surface_get_width(&*image_surface), cairo_image_surface_get_height(&*image_surface)); + mapnik::image_rgba8 im_data(cairo_image_surface_get_width(&*image_surface), cairo_image_surface_get_height(&*image_surface)); cairo_image_to_rgba8(im_data, image_surface); save_to_file(im_data, "cairo-demo256.png","png8"); cairo_surface_finish(&*image_surface); diff --git a/demo/viewer/about_dialog.cpp b/demo/viewer/about_dialog.cpp index 468a29898..06f0a966e 100644 --- a/demo/viewer/about_dialog.cpp +++ b/demo/viewer/about_dialog.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/about_dialog.hpp b/demo/viewer/about_dialog.hpp index b555a6d5f..670567112 100644 --- a/demo/viewer/about_dialog.hpp +++ b/demo/viewer/about_dialog.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/build.py b/demo/viewer/build.py index b60a80ba9..cbd35f7ae 100644 --- a/demo/viewer/build.py +++ b/demo/viewer/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,13 +17,13 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# Import ('env') import os import platform -lib_dir = os.path.normpath(env['DESTDIR'] + '/' + env['PREFIX'] + '/' + env['LIBDIR_SCHEMA'] + '/mapnik') +lib_dir = os.path.normpath(env['DESTDIR'] + '/' + env['PREFIX'] + '/' + env['LIBDIR_SCHEMA'] + '/mapnik') fonts = 1 ini_template = ''' diff --git a/demo/viewer/info_dialog.cpp b/demo/viewer/info_dialog.cpp index 37c243d69..304abf8f3 100644 --- a/demo/viewer/info_dialog.cpp +++ b/demo/viewer/info_dialog.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/info_dialog.hpp b/demo/viewer/info_dialog.hpp index 8ac762022..dde4c6661 100644 --- a/demo/viewer/info_dialog.hpp +++ b/demo/viewer/info_dialog.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layer_info_dialog.cpp b/demo/viewer/layer_info_dialog.cpp index 6d176e8f2..23de7e824 100644 --- a/demo/viewer/layer_info_dialog.cpp +++ b/demo/viewer/layer_info_dialog.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layer_info_dialog.hpp b/demo/viewer/layer_info_dialog.hpp index 9cea6e81f..efac7822f 100644 --- a/demo/viewer/layer_info_dialog.hpp +++ b/demo/viewer/layer_info_dialog.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layerdelegate.cpp b/demo/viewer/layerdelegate.cpp index 93b50595c..13a1135e1 100644 --- a/demo/viewer/layerdelegate.cpp +++ b/demo/viewer/layerdelegate.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layerdelegate.hpp b/demo/viewer/layerdelegate.hpp index 53fd8b381..941621d2f 100644 --- a/demo/viewer/layerdelegate.hpp +++ b/demo/viewer/layerdelegate.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layerlistmodel.cpp b/demo/viewer/layerlistmodel.cpp index fccfdfdd7..6a4b0bbfa 100644 --- a/demo/viewer/layerlistmodel.cpp +++ b/demo/viewer/layerlistmodel.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layerlistmodel.hpp b/demo/viewer/layerlistmodel.hpp index cc2b73fb7..ab838c782 100644 --- a/demo/viewer/layerlistmodel.hpp +++ b/demo/viewer/layerlistmodel.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layerwidget.cpp b/demo/viewer/layerwidget.cpp index 93dea25af..58b88a29a 100644 --- a/demo/viewer/layerwidget.cpp +++ b/demo/viewer/layerwidget.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layerwidget.hpp b/demo/viewer/layerwidget.hpp index d19a16a0e..f458ee94f 100644 --- a/demo/viewer/layerwidget.hpp +++ b/demo/viewer/layerwidget.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/main.cpp b/demo/viewer/main.cpp index da915d374..e80619772 100644 --- a/demo/viewer/main.cpp +++ b/demo/viewer/main.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/mainwindow.cpp b/demo/viewer/mainwindow.cpp index 442b99068..bd80bcf3d 100644 --- a/demo/viewer/mainwindow.cpp +++ b/demo/viewer/mainwindow.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/mainwindow.hpp b/demo/viewer/mainwindow.hpp index d0943dc91..260968c8f 100644 --- a/demo/viewer/mainwindow.hpp +++ b/demo/viewer/mainwindow.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/mapwidget.cpp b/demo/viewer/mapwidget.cpp index 59e396893..efcab8968 100644 --- a/demo/viewer/mapwidget.cpp +++ b/demo/viewer/mapwidget.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -42,7 +41,7 @@ #include "mapwidget.hpp" #include "info_dialog.hpp" -using mapnik::image_32; +using mapnik::image_rgba8; using mapnik::Map; using mapnik::layer; using mapnik::box2d; @@ -178,47 +177,51 @@ void MapWidget::mousePressEvent(QMouseEvent* e) if (fs) { - feature_ptr feat = fs->next(); - if (feat) - { + feature_ptr feat = fs->next(); + if (feat) + { - feature_kv_iterator itr(*feat,true); - feature_kv_iterator end(*feat); +// FIXME +#if 0 + feature_kv_iterator itr(*feat,true); + feature_kv_iterator end(*feat); - for ( ;itr!=end; ++itr) - { - info.push_back(QPair(QString(std::get<0>(*itr).c_str()), - std::get<1>(*itr).to_string().c_str())); - } + for ( ;itr!=end; ++itr) + { + info.push_back(QPair(QString(std::get<0>(*itr).c_str()), + std::get<1>(*itr).to_string().c_str())); + } - using path_type = mapnik::transform_path_adapter; + using path_type = mapnik::transform_path_adapter; - for (unsigned i=0; inum_geometries();++i) - { - mapnik::geometry_type & geom = feat->get_geometry(i); - path_type path(t,geom,prj_trans); - if (geom.size() > 0) - { - QPainterPath qpath; - double x,y; - path.vertex(&x,&y); - qpath.moveTo(x,y); - for (unsigned j = 1; j < geom.size(); ++j) + for (unsigned i=0; inum_geometries();++i) + { + mapnik::geometry_type const& geom = feat->get_geometry(i); + mapnik::vertex_adapter va(geom); + path_type path(t,va,prj_trans); + if (va.size() > 0) { - path.vertex(&x,&y); - qpath.lineTo(x,y); + QPainterPath qpath; + double x,y; + va.vertex(&x,&y); + qpath.moveTo(x,y); + for (unsigned j = 1; j < geom.size(); ++j) + { + va.vertex(&x,&y); + qpath.lineTo(x,y); + } + QPainter painter(&pix_); + QPen pen(QColor(255,0,0,96)); + pen.setWidth(3); + pen.setCapStyle(Qt::RoundCap); + pen.setJoinStyle(Qt::RoundJoin); + painter.setPen(pen); + painter.drawPath(qpath); + update(); } - QPainter painter(&pix_); - QPen pen(QColor(255,0,0,96)); - pen.setWidth(3); - pen.setCapStyle(Qt::RoundCap); - pen.setJoinStyle(Qt::RoundJoin); - painter.setPen(pen); - painter.drawPath(qpath); - update(); - } - } - } + } +#endif + } } if (info.size() > 0) @@ -479,7 +482,7 @@ void MapWidget::zoomToLevel(int level) void MapWidget::export_to_file(unsigned ,unsigned ,std::string const&,std::string const&) { - //image_32 image(width,height); + //image_rgba8 image(width,height); //agg_renderer renderer(map,image); //renderer.apply(); //image.saveToFile(filename,type); @@ -496,14 +499,14 @@ void render_agg(mapnik::Map const& map, double scaling_factor, QPixmap & pix) unsigned width=map.width(); unsigned height=map.height(); - image_32 buf(width,height); - mapnik::agg_renderer ren(map,buf,scaling_factor); + image_rgba8 buf(width,height); + mapnik::agg_renderer ren(map,buf,scaling_factor); try { mapnik::auto_cpu_timer t(std::clog, "rendering took: "); ren.apply(); - QImage image((uchar*)buf.raw_data(),width,height,QImage::Format_ARGB32); + QImage image((uchar*)buf.data(),width,height,QImage::Format_ARGB32); pix = QPixmap::fromImage(image.rgbSwapped()); } //catch (mapnik::config_error & ex) @@ -529,7 +532,7 @@ void render_grid(mapnik::Map const& map, double scaling_factor, QPixmap & pix) void render_cairo(mapnik::Map const& map, double scaling_factor, QPixmap & pix) { - +// FIXME #ifdef HAVE_CAIRO mapnik::cairo_surface_ptr image_surface(cairo_image_surface_create(CAIRO_FORMAT_ARGB32,map.width(),map.height()), mapnik::cairo_surface_closer()); @@ -540,10 +543,9 @@ void render_cairo(mapnik::Map const& map, double scaling_factor, QPixmap & pix) mapnik::cairo_renderer renderer(map, cairo, scaling_factor); renderer.apply(); } - mapnik::image_data_rgba8 data(map.width(), map.height()); + mapnik::image_rgba8 data(map.width(), map.height()); mapnik::cairo_image_to_rgba8(data, image_surface); - image_32 buf(std::move(data)); - QImage image((uchar*)buf.raw_data(),buf.width(),buf.height(),QImage::Format_ARGB32); + QImage image((uchar*)data.bytes(),data.width(),data.height(),QImage::Format_ARGB32); pix = QPixmap::fromImage(image.rgbSwapped()); #endif } diff --git a/demo/viewer/mapwidget.hpp b/demo/viewer/mapwidget.hpp index 2373d584c..cc7964b5e 100644 --- a/demo/viewer/mapwidget.hpp +++ b/demo/viewer/mapwidget.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/styles_model.cpp b/demo/viewer/styles_model.cpp index d8afc2631..d2b2f708e 100644 --- a/demo/viewer/styles_model.cpp +++ b/demo/viewer/styles_model.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -201,10 +201,10 @@ struct symbolizer_icon { // FIXME! /* - std::shared_ptr symbol = sym.get_image(); + std::shared_ptr symbol = sym.get_image(); if (symbol) { - QImage image(symbol->getBytes(), + QImage image(symbol->bytes(), symbol->width(),symbol->height(),QImage::Format_ARGB32); QPixmap pix = QPixmap::fromImage(image.rgbSwapped()); return QIcon(pix); diff --git a/demo/viewer/styles_model.hpp b/demo/viewer/styles_model.hpp index 407ec5974..b6ead4bfc 100644 --- a/demo/viewer/styles_model.hpp +++ b/demo/viewer/styles_model.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/deps/agg/build.py b/deps/agg/build.py index 0f87da174..e6ab9c5ae 100644 --- a/deps/agg/build.py +++ b/deps/agg/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,13 +17,12 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os from glob import glob Import('env') lib_env = env.Clone() -if 'g++' in env['CXX']: - lib_env.Append(CXXFLAGS='-fPIC') +lib_env.Append(CXXFLAGS='-fPIC') lib_env.StaticLibrary('agg', glob('./src/' + '*.cpp'), LIBS=[]) diff --git a/deps/agg/include/agg_color_gray.h b/deps/agg/include/agg_color_gray.h index 2fc01bd71..f2cd0ff9c 100644 --- a/deps/agg/include/agg_color_gray.h +++ b/deps/agg/include/agg_color_gray.h @@ -330,8 +330,8 @@ struct gray8T //-------------------------------------------------------------------- self_type& opacity(double a_) { - if (a_ < 0) a_ = 0; - else if (a_ > 1) a_ = 1; + if (a_ < 0) a = 0; + else if (a_ > 1) a = 1; else a = (value_type)uround(a_ * double(base_mask)); return *this; } diff --git a/deps/agg/include/agg_color_rgba.h b/deps/agg/include/agg_color_rgba.h index 2950467e4..b4e3f76d8 100644 --- a/deps/agg/include/agg_color_rgba.h +++ b/deps/agg/include/agg_color_rgba.h @@ -80,8 +80,8 @@ struct rgba //-------------------------------------------------------------------- rgba& opacity(double a_) { - if (a_ < 0) a_ = 0; - else if (a_ > 1) a_ = 1; + if (a_ < 0) a = 0; + else if (a_ > 1) a = 1; else a = a_; return *this; } @@ -472,8 +472,8 @@ struct rgba8T //-------------------------------------------------------------------- self_type& opacity(double a_) { - if (a_ < 0) a_ = 0; - else if (a_ > 1) a_ = 1; + if (a_ < 0) a = 0; + else if (a_ > 1) a = 1; else a = (value_type)uround(a_ * double(base_mask)); return *this; } @@ -882,8 +882,8 @@ struct rgba16 //-------------------------------------------------------------------- AGG_INLINE self_type& opacity(double a_) { - if (a_ < 0) a_ = 0; - if (a_ > 1) a_ = 1; + if (a_ < 0) a = 0; + if (a_ > 1) a = 1; a = value_type(uround(a_ * double(base_mask))); return *this; } @@ -1238,8 +1238,8 @@ struct rgba32 //-------------------------------------------------------------------- AGG_INLINE self_type& opacity(double a_) { - if (a_ < 0) a_ = 0; - else if (a_ > 1) a_ = 1; + if (a_ < 0) a = 0; + else if (a_ > 1) a = 1; else a = value_type(a_); return *this; } diff --git a/deps/agg/include/agg_conv_clipper.h b/deps/agg/include/agg_conv_clipper.h deleted file mode 100755 index 2bd4c3d1c..000000000 --- a/deps/agg/include/agg_conv_clipper.h +++ /dev/null @@ -1,295 +0,0 @@ -/******************************************************************************* -* * -* Author : Angus Johnson * -* Version : 1.1 * -* Date : 4 April 2011 * -* Website : http://www.angusj.com * -* Copyright : Angus Johnson 2010-2011 * -* * -* License: * -* Use, modification & distribution is subject to Boost Software License Ver 1. * -* http://www.boost.org/LICENSE_1_0.txt * -* * -*******************************************************************************/ - -#ifndef AGG_CONV_CLIPPER_INCLUDED -#define AGG_CONV_CLIPPER_INCLUDED - -#include -#include "agg_basics.h" -#include "agg_array.h" -#include "clipper.hpp" - -namespace agg -{ - enum clipper_op_e { clipper_or, - clipper_and, clipper_xor, clipper_a_minus_b, clipper_b_minus_a }; - enum clipper_PolyFillType {clipper_even_odd, clipper_non_zero, clipper_positive, clipper_negative}; - - template class conv_clipper - { - enum status { status_move_to, status_line_to, status_stop }; - typedef VSA source_a_type; - typedef VSB source_b_type; - typedef conv_clipper self_type; - - private: - source_a_type* m_src_a; - source_b_type* m_src_b; - status m_status; - int m_vertex; - int m_contour; - int m_scaling_factor; - clipper_op_e m_operation; - pod_bvector m_vertex_accumulator; - ClipperLib::Paths m_poly_a; - ClipperLib::Paths m_poly_b; - ClipperLib::Paths m_result; - ClipperLib::Clipper m_clipper; - clipper_PolyFillType m_subjFillType; - clipper_PolyFillType m_clipFillType; - - int Round(double val) - { - if ((val < 0)) return (int)(val - 0.5); else return (int)(val + 0.5); - } - - public: - conv_clipper(source_a_type &a, source_b_type &b, - clipper_op_e op = clipper_or, - clipper_PolyFillType subjFillType = clipper_even_odd, - clipper_PolyFillType clipFillType = clipper_even_odd, - int scaling_factor = 2) : - m_src_a(&a), - m_src_b(&b), - m_status(status_move_to), - m_vertex(-1), - m_contour(-1), - m_operation(op), - m_subjFillType(subjFillType), - m_clipFillType(clipFillType) - { - m_scaling_factor = std::max(std::min(scaling_factor, 6),0); - m_scaling_factor = Round(std::pow((double)10, m_scaling_factor)); - } - - ~conv_clipper() - { - } - - void attach1(VSA &source, clipper_PolyFillType subjFillType = clipper_even_odd) - { m_src_a = &source; m_subjFillType = subjFillType; } - void attach2(VSB &source, clipper_PolyFillType clipFillType = clipper_even_odd) - { m_src_b = &source; m_clipFillType = clipFillType; } - - void operation(clipper_op_e v) { m_operation = v; } - - void rewind(unsigned path_id); - unsigned vertex(double* x, double* y); - - bool next_contour(); - bool next_vertex(double* x, double* y); - void start_extracting(); - void add_vertex_(double &x, double &y); - void end_contour(ClipperLib::Paths &p); - - template void add(VS &src, ClipperLib::Paths &p){ - unsigned cmd; - double x; double y; double start_x; double start_y; - bool starting_first_line; - - start_x = 0.0; - start_y = 0.0; - starting_first_line = true; - p.resize(0); - - cmd = src->vertex( &x , &y ); - while(!is_stop(cmd)) - { - if(is_vertex(cmd)) - { - if(is_move_to(cmd)) - { - if(!starting_first_line ) end_contour(p); - start_x = x; - start_y = y; - } - add_vertex_( x, y ); - starting_first_line = false; - } - else if(is_end_poly(cmd)) - { - if(!starting_first_line && is_closed(cmd)) - add_vertex_( start_x, start_y ); - } - cmd = src->vertex( &x, &y ); - } - end_contour(p); - } - }; - - //------------------------------------------------------------------------ - - template - void conv_clipper::start_extracting() - { - m_status = status_move_to; - m_contour = -1; - m_vertex = -1; - } - //------------------------------------------------------------------------------ - - template - void conv_clipper::rewind(unsigned path_id) - { - m_src_a->rewind( path_id ); - m_src_b->rewind( path_id ); - - add( m_src_a , m_poly_a ); - add( m_src_b , m_poly_b ); - m_result.resize(0); - - ClipperLib::PolyFillType pftSubj, pftClip; - switch (m_subjFillType) - { - case clipper_even_odd: pftSubj = ClipperLib::pftEvenOdd; break; - case clipper_non_zero: pftSubj = ClipperLib::pftNonZero; break; - case clipper_positive: pftSubj = ClipperLib::pftPositive; break; - default: pftSubj = ClipperLib::pftNegative; - } - switch (m_clipFillType) - { - case clipper_even_odd: pftClip = ClipperLib::pftEvenOdd; break; - case clipper_non_zero: pftClip = ClipperLib::pftNonZero; break; - case clipper_positive: pftClip = ClipperLib::pftPositive; break; - default: pftClip = ClipperLib::pftNegative; - } - - m_clipper.Clear(); - switch( m_operation ) { - case clipper_or: - { - m_clipper.AddPaths( m_poly_a , ClipperLib::ptSubject, true ); - m_clipper.AddPaths( m_poly_b , ClipperLib::ptClip, true ); - m_clipper.Execute( ClipperLib::ctUnion , m_result , pftSubj, pftClip); - break; - } - case clipper_and: - { - m_clipper.AddPaths( m_poly_a , ClipperLib::ptSubject, true ); - m_clipper.AddPaths( m_poly_b , ClipperLib::ptClip, true ); - m_clipper.Execute( ClipperLib::ctIntersection , m_result, pftSubj, pftClip ); - break; - } - case clipper_xor: - { - m_clipper.AddPaths( m_poly_a , ClipperLib::ptSubject, true ); - m_clipper.AddPaths( m_poly_b , ClipperLib::ptClip, true ); - m_clipper.Execute( ClipperLib::ctXor , m_result, pftSubj, pftClip ); - break; - } - case clipper_a_minus_b: - { - m_clipper.AddPaths( m_poly_a , ClipperLib::ptSubject, true ); - m_clipper.AddPaths( m_poly_b , ClipperLib::ptClip, true ); - m_clipper.Execute( ClipperLib::ctDifference , m_result, pftSubj, pftClip ); - break; - } - case clipper_b_minus_a: - { - m_clipper.AddPaths( m_poly_b , ClipperLib::ptSubject, true ); - m_clipper.AddPaths( m_poly_a , ClipperLib::ptClip, true ); - m_clipper.Execute( ClipperLib::ctDifference , m_result, pftSubj, pftClip ); - break; - } - } - start_extracting(); - } - //------------------------------------------------------------------------------ - - template - void conv_clipper::end_contour( ClipperLib::Paths &p) - { - unsigned i, len; - - if( m_vertex_accumulator.size() < 3 ) return; - len = p.size(); - p.resize(len+1); - p[len].resize(m_vertex_accumulator.size()); - for( i = 0 ; i < m_vertex_accumulator.size() ; i++ ) - p[len][i] = m_vertex_accumulator[i]; - m_vertex_accumulator.remove_all(); - } - //------------------------------------------------------------------------------ - - template - void conv_clipper::add_vertex_(double &x, double &y) - { - ClipperLib::IntPoint v; - - v.X = Round(x * m_scaling_factor); - v.Y = Round(y * m_scaling_factor); - m_vertex_accumulator.add( v ); - } - //------------------------------------------------------------------------------ - - template - bool conv_clipper::next_contour() - { - m_contour++; - if(m_contour >= (int)m_result.size()) return false; - m_vertex =-1; - return true; -} -//------------------------------------------------------------------------------ - - template - bool conv_clipper::next_vertex(double *x, double *y) - { - m_vertex++; - if(m_vertex >= (int)m_result[m_contour].size()) return false; - *x = (double)m_result[ m_contour ][ m_vertex ].X / m_scaling_factor; - *y = (double)m_result[ m_contour ][ m_vertex ].Y / m_scaling_factor; - return true; - } - //------------------------------------------------------------------------------ - - template - unsigned conv_clipper::vertex(double *x, double *y) -{ - if( m_status == status_move_to ) - { - if( next_contour() ) - { - if( next_vertex( x, y ) ) - { - m_status =status_line_to; - return path_cmd_move_to; - } - else - { - m_status = status_stop; - return path_cmd_end_poly | path_flags_close; - } - } - else - return path_cmd_stop; - } - else - { - if( next_vertex( x, y ) ) - { - return path_cmd_line_to; - } - else - { - m_status = status_move_to; - return path_cmd_end_poly | path_flags_close; - } - } -} -//------------------------------------------------------------------------------ - - -} //namespace agg -#endif //AGG_CONV_CLIPPER_INCLUDED diff --git a/deps/agg/include/agg_conv_offset.h b/deps/agg/include/agg_conv_offset.h new file mode 100644 index 000000000..efecfaae6 --- /dev/null +++ b/deps/agg/include/agg_conv_offset.h @@ -0,0 +1,236 @@ +/******************************************************************************* + * * + * Author : Angus Johnson * + * Version : 1.1 * + * Date : 4 April 2011 * + * Website : http://www.angusj.com * + * Copyright : Angus Johnson 2010-2011 * + * * + * License: * + * Use, modification & distribution is subject to Boost Software License Ver 1. * + * http://www.boost.org/LICENSE_1_0.txt * + * * + *******************************************************************************/ + +// based on adapted agg_conv_clipper.h + +#ifndef AGG_CONV_OFFSET_INCLUDED +#define AGG_CONV_OFFSET_INCLUDED + +#include +#include "agg_basics.h" +#include "agg_array.h" +#include "clipper.hpp" + +namespace agg +{ + +template class conv_offset +{ + enum status { status_move_to, status_line_to, status_stop }; + typedef VSA source_a_type; + typedef conv_offset self_type; + +private: + source_a_type* m_src_a; + double m_offset; + status m_status; + int m_vertex; + int m_contour; + int m_scaling_factor; + pod_bvector m_vertex_accumulator; + ClipperLib::Paths m_poly_a; + ClipperLib::Paths m_result; + ClipperLib::ClipperOffset m_clipper_offset; + + int Round(double val) + { + if ((val < 0)) return (int)(val - 0.5); else return (int)(val + 0.5); + } + +public: + conv_offset(source_a_type &a, double offset = 0.0, + int scaling_factor = 0) + : m_src_a(&a), + m_offset(offset), + m_status(status_move_to), + m_vertex(-1), + m_contour(-1) + { + m_scaling_factor = std::max(std::min(scaling_factor, 6),0); + m_scaling_factor = Round(std::pow((double)10, m_scaling_factor)); + } + + ~conv_offset() + { + } + + void set_offset(double offset) { m_offset = offset;} + unsigned type() const + { + return static_cast(m_src_a->type()); + } + + double get_offset() const + { + return m_offset; + } + + void rewind(unsigned path_id); + unsigned vertex(double* x, double* y); + + bool next_contour(); + bool next_vertex(double* x, double* y); + void start_extracting(); + void add_vertex_(double &x, double &y); + void end_contour(ClipperLib::Paths &p); + + template void add(VS &src, ClipperLib::Paths &p) + { + unsigned cmd; + double x; double y; double start_x; double start_y; + bool starting_first_line; + + start_x = 0.0; + start_y = 0.0; + starting_first_line = true; + p.resize(0); + + cmd = src->vertex( &x , &y ); + while(!is_stop(cmd)) + { + if(is_vertex(cmd)) + { + if(is_move_to(cmd)) + { + if(!starting_first_line ) end_contour(p); + start_x = x; + start_y = y; + } + add_vertex_( x, y ); + starting_first_line = false; + } + else if(is_end_poly(cmd)) + { + if(!starting_first_line && is_closed(cmd)) + add_vertex_( start_x, start_y ); + } + cmd = src->vertex( &x, &y ); + } + end_contour(p); + } +}; + +//------------------------------------------------------------------------ + +template +void conv_offset::start_extracting() +{ + m_status = status_move_to; + m_contour = -1; + m_vertex = -1; +} +//------------------------------------------------------------------------------ + +template +void conv_offset::rewind(unsigned path_id) +{ + m_src_a->rewind( path_id ); + //m_src_b->rewind( path_id ); + + add( m_src_a , m_poly_a ); + //add( m_src_b , m_poly_b ); + m_result.resize(0); + m_clipper_offset.Clear(); + m_clipper_offset.AddPaths(m_poly_a,ClipperLib::jtMiter, ClipperLib::etOpenButt);//ClosedLine);//Polygon); + m_clipper_offset.Execute(m_result, m_offset * m_scaling_factor); + start_extracting(); +} +//------------------------------------------------------------------------------ + +template +void conv_offset::end_contour( ClipperLib::Paths &p) +{ + unsigned i, len; + + if( m_vertex_accumulator.size() < 3 ) return; + len = p.size(); + p.resize(len+1); + p[len].resize(m_vertex_accumulator.size()); + for( i = 0 ; i < m_vertex_accumulator.size() ; i++ ) + p[len][i] = m_vertex_accumulator[i]; + m_vertex_accumulator.remove_all(); +} +//------------------------------------------------------------------------------ + +template +void conv_offset::add_vertex_(double &x, double &y) +{ + ClipperLib::IntPoint v; + + v.X = Round(x * m_scaling_factor); + v.Y = Round(y * m_scaling_factor); + m_vertex_accumulator.add( v ); +} +//------------------------------------------------------------------------------ + +template +bool conv_offset::next_contour() +{ + m_contour++; + if(m_contour >= (int)m_result.size()) return false; + m_vertex =-1; + return true; +} +//------------------------------------------------------------------------------ + +template +bool conv_offset::next_vertex(double *x, double *y) +{ + m_vertex++; + if(m_vertex >= (int)m_result[m_contour].size()) return false; + *x = (double)m_result[ m_contour ][ m_vertex ].X / m_scaling_factor; + *y = (double)m_result[ m_contour ][ m_vertex ].Y / m_scaling_factor; + return true; +} +//------------------------------------------------------------------------------ + +template +unsigned conv_offset::vertex(double *x, double *y) +{ + if( m_status == status_move_to ) + { + if( next_contour() ) + { + if( next_vertex( x, y ) ) + { + m_status =status_line_to; + return path_cmd_move_to; + } + else + { + m_status = status_stop; + return path_cmd_end_poly | path_flags_close; + } + } + else + return path_cmd_stop; + } + else + { + if( next_vertex( x, y ) ) + { + return path_cmd_line_to; + } + else + { + m_status = status_move_to; + return path_cmd_end_poly | path_flags_close; + } + } +} +//------------------------------------------------------------------------------ + + +} //namespace agg +#endif //AGG_CONV_OFFSET_INCLUDED diff --git a/deps/agg/src/agg_image_filters.cpp b/deps/agg/src/agg_image_filters.cpp index 0f6191de9..bc3aa9719 100644 --- a/deps/agg/src/agg_image_filters.cpp +++ b/deps/agg/src/agg_image_filters.cpp @@ -63,7 +63,7 @@ void image_filter_lut::normalize() if(sum == image_filter_scale) break; - double k = double(image_filter_scale) / double(sum); + double k = (sum > 0) ? double(image_filter_scale) / double(sum) : 1; sum = 0; for(j = 0; j < m_diameter; j++) { diff --git a/deps/agg/src/agg_pixfmt_rgba.cpp b/deps/agg/src/agg_pixfmt_rgba.cpp index f07c54032..45e0b19b8 100644 --- a/deps/agg/src/agg_pixfmt_rgba.cpp +++ b/deps/agg/src/agg_pixfmt_rgba.cpp @@ -4,7 +4,11 @@ // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wc++11-narrowing" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/deps/agg/src/agg_trans_single_path.cpp b/deps/agg/src/agg_trans_single_path.cpp index 57a6cb094..9b1d7cb69 100644 --- a/deps/agg/src/agg_trans_single_path.cpp +++ b/deps/agg/src/agg_trans_single_path.cpp @@ -91,9 +91,9 @@ void trans_single_path::finalize_path() for(i = 0; i < m_src_vertices.size(); i++) { vertex_dist& v = m_src_vertices[i]; - double d = v.dist; + double dd = v.dist; v.dist = dist; - dist += d; + dist += dd; } m_kindex = (m_src_vertices.size() - 1) / dist; m_status = ready; diff --git a/deps/agg/src/agg_vcgen_dash.cpp b/deps/agg/src/agg_vcgen_dash.cpp index 311239040..6bfa5db71 100644 --- a/deps/agg/src/agg_vcgen_dash.cpp +++ b/deps/agg/src/agg_vcgen_dash.cpp @@ -169,7 +169,7 @@ unsigned vcgen_dash::vertex(double* x, double* y) { double dash_rest = m_dashes[m_curr_dash] - m_curr_dash_start; - unsigned cmd = (m_curr_dash & 1) ? + unsigned cmd2 = (m_curr_dash & 1) ? path_cmd_move_to : path_cmd_line_to; @@ -217,7 +217,7 @@ unsigned vcgen_dash::vertex(double* x, double* y) } } } - return cmd; + return cmd2; } break; diff --git a/deps/boost/gil/extension/toolbox/hsl.hpp b/deps/boost/gil/extension/toolbox/hsl.hpp index ecbf89749..c77dd7287 100644 --- a/deps/boost/gil/extension/toolbox/hsl.hpp +++ b/deps/boost/gil/extension/toolbox/hsl.hpp @@ -14,7 +14,12 @@ /// \author Christian Henning \n //////////////////////////////////////////////////////////////////////////////////////// +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wc++11-narrowing" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" #include +#pragma GCC diagnostic pop namespace boost { namespace gil { diff --git a/deps/boost/gil/extension/toolbox/hsv.hpp b/deps/boost/gil/extension/toolbox/hsv.hpp index ba12cbd14..5195cc248 100644 --- a/deps/boost/gil/extension/toolbox/hsv.hpp +++ b/deps/boost/gil/extension/toolbox/hsv.hpp @@ -14,7 +14,12 @@ /// \author Christian Henning \n //////////////////////////////////////////////////////////////////////////////////////// +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wc++11-narrowing" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" #include +#pragma GCC diagnostic pop namespace boost { namespace gil { diff --git a/deps/clipper/build.py b/deps/clipper/build.py deleted file mode 100644 index db9938c0e..000000000 --- a/deps/clipper/build.py +++ /dev/null @@ -1,27 +0,0 @@ -# This file is part of Mapnik (c++ mapping toolkit) -# Copyright (C) 2013 Artem Pavlenko -# -# Mapnik is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# - -import os -from glob import glob - -Import('env') -lib_env = env.Clone() -if 'g++' in env['CXX']: - lib_env.Append(CXXFLAGS='-fPIC') -lib_env.StaticLibrary('clipper', ['./src/clipper.cpp',], LIBS=[]) diff --git a/deps/clipper/include/clipper.hpp b/deps/clipper/include/clipper.hpp deleted file mode 100755 index 5495b665a..000000000 --- a/deps/clipper/include/clipper.hpp +++ /dev/null @@ -1,376 +0,0 @@ -/******************************************************************************* -* * -* Author : Angus Johnson * -* Version : 6.0.0 * -* Date : 30 October 2013 * -* Website : http://www.angusj.com * -* Copyright : Angus Johnson 2010-2013 * -* * -* License: * -* Use, modification & distribution is subject to Boost Software License Ver 1. * -* http://www.boost.org/LICENSE_1_0.txt * -* * -* Attributions: * -* The code in this library is an extension of Bala Vatti's clipping algorithm: * -* "A generic solution to polygon clipping" * -* Communications of the ACM, Vol 35, Issue 7 (July 1992) pp 56-63. * -* http://portal.acm.org/citation.cfm?id=129906 * -* * -* Computer graphics and geometric modeling: implementation and algorithms * -* By Max K. Agoston * -* Springer; 1 edition (January 4, 2005) * -* http://books.google.com/books?q=vatti+clipping+agoston * -* * -* See also: * -* "Polygon Offsetting by Computing Winding Numbers" * -* Paper no. DETC2005-85513 pp. 565-575 * -* ASME 2005 International Design Engineering Technical Conferences * -* and Computers and Information in Engineering Conference (IDETC/CIE2005) * -* September 24-28, 2005 , Long Beach, California, USA * -* http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf * -* * -*******************************************************************************/ - -#ifndef clipper_hpp -#define clipper_hpp - -#include -#define CLIPPER_VERSION "6.0.0" - -//use_int32: When enabled 32bit ints are used instead of 64bit ints. This -//improve performance but coordinate values are limited to the range +/- 46340 -//#define use_int32 - -//use_xyz: adds a Z member to IntPoint. Adds a minor cost to perfomance. -//#define use_xyz - -//use_lines: Enables line clipping. Adds a very minor cost to performance. -//#define use_lines - -//When enabled, code developed with earlier versions of Clipper -//(ie prior to ver 6) should compile without changes. -//In a future update, this compatability code will be removed. -#define use_deprecated - -#include -#include -#include -#include -#include -#include -#include - -namespace ClipperLib { - -enum ClipType { ctIntersection, ctUnion, ctDifference, ctXor }; -enum PolyType { ptSubject, ptClip }; -//By far the most widely used winding rules for polygon filling are -//EvenOdd & NonZero (GDI, GDI+, XLib, OpenGL, Cairo, AGG, Quartz, SVG, Gr32) -//Others rules include Positive, Negative and ABS_GTR_EQ_TWO (only in OpenGL) -//see http://glprogramming.com/red/chapter11.html -enum PolyFillType { pftEvenOdd, pftNonZero, pftPositive, pftNegative }; - -#ifdef use_int32 -typedef int cInt; -typedef unsigned int cUInt; -#else -typedef signed long long cInt; -typedef unsigned long long cUInt; -#endif - -struct IntPoint { - cInt X; - cInt Y; -#ifdef use_xyz - cInt Z; - IntPoint(cInt x = 0, cInt y = 0, cInt z = 0): X(x), Y(y), Z(z) {}; -#else - IntPoint(cInt x = 0, cInt y = 0): X(x), Y(y) {}; -#endif - - friend inline bool operator== (const IntPoint& a, const IntPoint& b) - { - return a.X == b.X && a.Y == b.Y; - } - friend inline bool operator!= (const IntPoint& a, const IntPoint& b) - { - return a.X != b.X || a.Y != b.Y; - } -}; -//------------------------------------------------------------------------------ - -typedef std::vector< IntPoint > Path; -typedef std::vector< Path > Paths; - -inline Path& operator <<(Path& poly, const IntPoint& p) {poly.push_back(p); return poly;} -inline Paths& operator <<(Paths& polys, const Path& p) {polys.push_back(p); return polys;} - -std::ostream& operator <<(std::ostream &s, const IntPoint &p); -std::ostream& operator <<(std::ostream &s, const Path &p); -std::ostream& operator <<(std::ostream &s, const Paths &p); - -#ifdef use_deprecated -typedef signed long long long64; //backward compatibility only -typedef Path Polygon; -typedef Paths Polygons; -#endif - -struct DoublePoint -{ - double X; - double Y; - DoublePoint(double x = 0, double y = 0) : X(x), Y(y) {} - DoublePoint(IntPoint ip) : X((double)ip.X), Y((double)ip.Y) {} -}; -//------------------------------------------------------------------------------ - -#ifdef use_xyz -typedef void (*TZFillCallback)(IntPoint& z1, IntPoint& z2, IntPoint& pt); -#endif - -class PolyNode; -typedef std::vector< PolyNode* > PolyNodes; - -class PolyNode -{ -public: - PolyNode(); - Path Contour; - PolyNodes Childs; - PolyNode* Parent; - PolyNode* GetNext() const; - bool IsHole() const; - bool IsOpen() const; - int ChildCount() const; -private: - bool m_IsOpen; - PolyNode* GetNextSiblingUp() const; - unsigned Index; //node index in Parent.Childs - void AddChild(PolyNode& child); - friend class Clipper; //to access Index -}; - -class PolyTree: public PolyNode -{ -public: - ~PolyTree(){Clear();}; - PolyNode* GetFirst() const; - void Clear(); - int Total() const; -private: - PolyNodes AllNodes; - friend class Clipper; //to access AllNodes -}; - -enum InitOptions {ioReverseSolution = 1, ioStrictlySimple = 2, ioPreserveCollinear = 4}; -enum JoinType {jtSquare, jtRound, jtMiter}; -enum EndType {etClosed, etButt, etSquare, etRound}; - -bool Orientation(const Path &poly); -double Area(const Path &poly); - -#ifdef use_deprecated - void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys, - double delta, JoinType jointype = jtSquare, double limit = 0, bool autoFix = true); - void PolyTreeToPolygons(const PolyTree& polytree, Paths& paths); - void ReversePolygon(Path& p); - void ReversePolygons(Paths& p); -#endif - -void OffsetPaths(const Paths &in_polys, Paths &out_polys, - double delta, JoinType jointype, EndType endtype, double limit = 0); - -void SimplifyPolygon(const Path &in_poly, Paths &out_polys, PolyFillType fillType = pftEvenOdd); -void SimplifyPolygons(const Paths &in_polys, Paths &out_polys, PolyFillType fillType = pftEvenOdd); -void SimplifyPolygons(Paths &polys, PolyFillType fillType = pftEvenOdd); - -void CleanPolygon(const Path& in_poly, Path& out_poly, double distance = 1.415); -void CleanPolygon(Path& poly, double distance = 1.415); -void CleanPolygons(const Paths& in_polys, Paths& out_polys, double distance = 1.415); -void CleanPolygons(Paths& polys, double distance = 1.415); - -void MinkowkiSum(const Path& poly, const Path& path, Paths& solution, bool isClosed); -void MinkowkiDiff(const Path& poly, const Path& path, Paths& solution, bool isClosed); - -void PolyTreeToPaths(const PolyTree& polytree, Paths& paths); -void ClosedPathsFromPolyTree(const PolyTree& polytree, Paths& paths); -void OpenPathsFromPolyTree(PolyTree& polytree, Paths& paths); - -void ReversePath(Path& p); -void ReversePaths(Paths& p); - -struct IntRect { cInt left; cInt top; cInt right; cInt bottom; }; - -//enums that are used internally ... -enum EdgeSide { esLeft = 1, esRight = 2}; - -//forward declarations (for stuff used internally) ... -struct TEdge; -struct IntersectNode; -struct LocalMinima; -struct Scanbeam; -struct OutPt; -struct OutRec; -struct Join; - -typedef std::vector < OutRec* > PolyOutList; -typedef std::vector < TEdge* > EdgeList; -typedef std::vector < Join* > JoinList; - -//------------------------------------------------------------------------------ - -//ClipperBase is the ancestor to the Clipper class. It should not be -//instantiated directly. This class simply abstracts the conversion of sets of -//polygon coordinates into edge objects that are stored in a LocalMinima list. -class MAPNIK_DECL ClipperBase -{ -public: - ClipperBase(); - virtual ~ClipperBase(); - bool AddPath(const Path &pg, PolyType PolyTyp, bool Closed); - bool AddPaths(const Paths &ppg, PolyType PolyTyp, bool Closed); - -#ifdef use_deprecated - bool AddPolygon(const Path &pg, PolyType PolyTyp); - bool AddPolygons(const Paths &ppg, PolyType PolyTyp); -#endif - - virtual void Clear(); - IntRect GetBounds(); - bool PreserveCollinear() {return m_PreserveCollinear;}; - void PreserveCollinear(bool value) {m_PreserveCollinear = value;}; -protected: - void DisposeLocalMinimaList(); - TEdge* AddBoundsToLML(TEdge *e, bool IsClosed); - void PopLocalMinima(); - virtual void Reset(); - void InsertLocalMinima(LocalMinima *newLm); - void DoMinimaLML(TEdge* E1, TEdge* E2, bool IsClosed); - TEdge* DescendToMin(TEdge *&E); - void AscendToMax(TEdge *&E, bool Appending, bool IsClosed); - LocalMinima *m_CurrentLM; - LocalMinima *m_MinimaList; - bool m_UseFullRange; - EdgeList m_edges; - bool m_PreserveCollinear; - bool m_HasOpenPaths; -}; -//------------------------------------------------------------------------------ - -class MAPNIK_DECL Clipper : public virtual ClipperBase -{ -public: - Clipper(int initOptions = 0); - ~Clipper(); - bool Execute(ClipType clipType, - Paths &solution, - PolyFillType subjFillType = pftEvenOdd, - PolyFillType clipFillType = pftEvenOdd); - bool Execute(ClipType clipType, - PolyTree &polytree, - PolyFillType subjFillType = pftEvenOdd, - PolyFillType clipFillType = pftEvenOdd); - void Clear(); - bool ReverseSolution() {return m_ReverseOutput;}; - void ReverseSolution(bool value) {m_ReverseOutput = value;}; - bool StrictlySimple() {return m_StrictSimple;}; - void StrictlySimple(bool value) {m_StrictSimple = value;}; - //set the callback function for z value filling on intersections (otherwise Z is 0) -#ifdef use_xyz - void ZFillFunction(TZFillCallback zFillFunc); -#endif -protected: - void Reset(); - virtual bool ExecuteInternal(); -private: - PolyOutList m_PolyOuts; - JoinList m_Joins; - JoinList m_GhostJoins; - ClipType m_ClipType; - std::set< cInt, std::greater > m_Scanbeam; - TEdge *m_ActiveEdges; - TEdge *m_SortedEdges; - IntersectNode *m_IntersectNodes; - bool m_ExecuteLocked; - PolyFillType m_ClipFillType; - PolyFillType m_SubjFillType; - bool m_ReverseOutput; - bool m_UsingPolyTree; - bool m_StrictSimple; -#ifdef use_xyz - TZFillCallback m_ZFill; //custom callback -#endif - void SetWindingCount(TEdge& edge); - bool IsEvenOddFillType(const TEdge& edge) const; - bool IsEvenOddAltFillType(const TEdge& edge) const; - void InsertScanbeam(const cInt Y); - cInt PopScanbeam(); - void InsertLocalMinimaIntoAEL(const cInt botY); - void InsertEdgeIntoAEL(TEdge *edge, TEdge* startEdge); - void AddEdgeToSEL(TEdge *edge); - void CopyAELToSEL(); - void DeleteFromSEL(TEdge *e); - void DeleteFromAEL(TEdge *e); - void UpdateEdgeIntoAEL(TEdge *&e); - void SwapPositionsInSEL(TEdge *edge1, TEdge *edge2); - bool IsContributing(const TEdge& edge) const; - bool IsTopHorz(const cInt XPos); - void SwapPositionsInAEL(TEdge *edge1, TEdge *edge2); - void DoMaxima(TEdge *e); - void PrepareHorzJoins(TEdge* horzEdge, bool isTopOfScanbeam); - void ProcessHorizontals(bool IsTopOfScanbeam); - void ProcessHorizontal(TEdge *horzEdge, bool isTopOfScanbeam); - void AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &pt); - OutPt* AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &pt); - OutRec* GetOutRec(int idx); - void AppendPolygon(TEdge *e1, TEdge *e2); - void IntersectEdges(TEdge *e1, TEdge *e2, - const IntPoint &pt, bool protect = false); - OutRec* CreateOutRec(); - OutPt* AddOutPt(TEdge *e, const IntPoint &pt); - void DisposeAllOutRecs(); - void DisposeOutRec(PolyOutList::size_type index); - bool ProcessIntersections(const cInt botY, const cInt topY); - void InsertIntersectNode(TEdge *e1, TEdge *e2, const IntPoint &pt); - void BuildIntersectList(const cInt botY, const cInt topY); - void ProcessIntersectList(); - void ProcessEdgesAtTopOfScanbeam(const cInt topY); - void BuildResult(Paths& polys); - void BuildResult2(PolyTree& polytree); - void SetHoleState(TEdge *e, OutRec *outrec); - void DisposeIntersectNodes(); - bool FixupIntersectionOrder(); - void FixupOutPolygon(OutRec &outrec); - bool IsHole(TEdge *e); - void FixHoleLinkage(OutRec &outrec); - void AddJoin(OutPt *op1, OutPt *op2, const IntPoint offPt); - void ClearJoins(); - void ClearGhostJoins(); - void AddGhostJoin(OutPt *op, const IntPoint offPt); - bool JoinPoints(const Join *j, OutPt *&p1, OutPt *&p2); - void JoinCommonEdges(); - void DoSimplePolygons(); - void FixupFirstLefts1(OutRec* OldOutRec, OutRec* NewOutRec); - void FixupFirstLefts2(OutRec* OldOutRec, OutRec* NewOutRec); -#ifdef use_xyz - void SetZ(IntPoint& pt, TEdge& e); -#endif -}; -//------------------------------------------------------------------------------ - -class clipperException : public std::exception -{ - public: - clipperException(const char* description): m_descr(description) {} - virtual ~clipperException() throw() {} - virtual const char* what() const throw() {return m_descr.c_str();} - private: - std::string m_descr; -}; -//------------------------------------------------------------------------------ - -} //ClipperLib namespace - -#endif //clipper_hpp - - diff --git a/deps/clipper/src/clipper.cpp b/deps/clipper/src/clipper.cpp deleted file mode 100755 index f1d0fcd86..000000000 --- a/deps/clipper/src/clipper.cpp +++ /dev/null @@ -1,4624 +0,0 @@ -/******************************************************************************* -* * -* Author : Angus Johnson * -* Version : 6.0.0 * -* Date : 30 October 2013 * -* Website : http://www.angusj.com * -* Copyright : Angus Johnson 2010-2013 * -* * -* License: * -* Use, modification & distribution is subject to Boost Software License Ver 1. * -* http://www.boost.org/LICENSE_1_0.txt * -* * -* Attributions: * -* The code in this library is an extension of Bala Vatti's clipping algorithm: * -* "A generic solution to polygon clipping" * -* Communications of the ACM, Vol 35, Issue 7 (July 1992) pp 56-63. * -* http://portal.acm.org/citation.cfm?id=129906 * -* * -* Computer graphics and geometric modeling: implementation and algorithms * -* By Max K. Agoston * -* Springer; 1 edition (January 4, 2005) * -* http://books.google.com/books?q=vatti+clipping+agoston * -* * -* See also: * -* "Polygon Offsetting by Computing Winding Numbers" * -* Paper no. DETC2005-85513 pp. 565-575 * -* ASME 2005 International Design Engineering Technical Conferences * -* and Computers and Information in Engineering Conference (IDETC/CIE2005) * -* September 24-28, 2005 , Long Beach, California, USA * -* http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf * -* * -*******************************************************************************/ - -/******************************************************************************* -* * -* This is a translation of the Delphi Clipper library and the naming style * -* used has retained a Delphi flavour. * -* * -*******************************************************************************/ - -#include "clipper.hpp" -#include -#include -#include -#include -#include -#include -#include -#include - -namespace ClipperLib { - -#ifdef use_int32 - static cInt const loRange = 46340; - static cInt const hiRange = 46340; -#else - static cInt const loRange = 0x3FFFFFFF; - static cInt const hiRange = 0x3FFFFFFFFFFFFFFFLL; - typedef unsigned long long ulong64; -#endif - -static double const pi = 3.141592653589793238; -enum Direction { dRightToLeft, dLeftToRight }; - -static int const Unassigned = -1; //edge not currently 'owning' a solution -static int const Skip = -2; //edge that would otherwise close a path - -#define HORIZONTAL (-1.0E+40) -#define TOLERANCE (1.0e-20) -#define NEAR_ZERO(val) (((val) > -TOLERANCE) && ((val) < TOLERANCE)) - -struct TEdge { - IntPoint Bot; - IntPoint Curr; - IntPoint Top; - IntPoint Delta; - double Dx; - PolyType PolyTyp; - EdgeSide Side; - int WindDelta; //1 or -1 depending on winding direction - int WindCnt; - int WindCnt2; //winding count of the opposite polytype - int OutIdx; - TEdge *Next; - TEdge *Prev; - TEdge *NextInLML; - TEdge *NextInAEL; - TEdge *PrevInAEL; - TEdge *NextInSEL; - TEdge *PrevInSEL; -}; - -struct IntersectNode { - TEdge *Edge1; - TEdge *Edge2; - IntPoint Pt; - IntersectNode *Next; -}; - -struct LocalMinima { - cInt Y; - TEdge *LeftBound; - TEdge *RightBound; - LocalMinima *Next; -}; - -struct OutPt; - -struct OutRec { - int Idx; - bool IsHole; - bool IsOpen; - OutRec *FirstLeft; //see comments in clipper.pas - PolyNode *PolyNd; - OutPt *Pts; - OutPt *BottomPt; -}; - -struct OutPt { - int Idx; - IntPoint Pt; - OutPt *Next; - OutPt *Prev; -}; - -struct Join { - OutPt *OutPt1; - OutPt *OutPt2; - IntPoint OffPt; -}; - -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ - -inline cInt Round(double val) -{ - if ((val < 0)) return static_cast(val - 0.5); - else return static_cast(val + 0.5); -} -//------------------------------------------------------------------------------ - -inline cInt Abs(cInt val) -{ - return val < 0 ? -val : val; -} - -//------------------------------------------------------------------------------ -// PolyTree methods ... -//------------------------------------------------------------------------------ - -void PolyTree::Clear() -{ - for (PolyNodes::size_type i = 0; i < AllNodes.size(); ++i) - delete AllNodes[i]; - AllNodes.resize(0); - Childs.resize(0); -} -//------------------------------------------------------------------------------ - -PolyNode* PolyTree::GetFirst() const -{ - if (!Childs.empty()) - return Childs[0]; - else - return 0; -} -//------------------------------------------------------------------------------ - -int PolyTree::Total() const -{ - return AllNodes.size(); -} - -//------------------------------------------------------------------------------ -// PolyNode methods ... -//------------------------------------------------------------------------------ - -PolyNode::PolyNode(): Childs(), Parent(0), m_IsOpen(false), Index(0) -{ -} -//------------------------------------------------------------------------------ - -int PolyNode::ChildCount() const -{ - return Childs.size(); -} -//------------------------------------------------------------------------------ - -void PolyNode::AddChild(PolyNode& child) -{ - unsigned cnt = Childs.size(); - Childs.push_back(&child); - child.Parent = this; - child.Index = cnt; -} -//------------------------------------------------------------------------------ - -PolyNode* PolyNode::GetNext() const -{ - if (!Childs.empty()) - return Childs[0]; - else - return GetNextSiblingUp(); -} -//------------------------------------------------------------------------------ - -PolyNode* PolyNode::GetNextSiblingUp() const -{ - if (!Parent) //protects against PolyTree.GetNextSiblingUp() - return 0; - else if (Index == Parent->Childs.size() - 1) - return Parent->GetNextSiblingUp(); - else - return Parent->Childs[Index + 1]; -} -//------------------------------------------------------------------------------ - -bool PolyNode::IsHole() const -{ - bool result = true; - PolyNode* node = Parent; - while (node) - { - result = !result; - node = node->Parent; - } - return result; -} -//------------------------------------------------------------------------------ - -bool PolyNode::IsOpen() const -{ - return m_IsOpen; -} -//------------------------------------------------------------------------------ - -#ifndef use_int32 - -//------------------------------------------------------------------------------ -// Int128 class (enables safe math on signed 64bit integers) -// eg Int128 val1((cInt)9223372036854775807); //ie 2^63 -1 -// Int128 val2((cInt)9223372036854775807); -// Int128 val3 = val1 * val2; -// val3.AsString => "85070591730234615847396907784232501249" (8.5e+37) -//------------------------------------------------------------------------------ - -class Int128 -{ - public: - - cUInt lo; - cInt hi; - - Int128(cInt _lo = 0) - { - lo = (cUInt)_lo; - if (_lo < 0) hi = -1; else hi = 0; - } - - - Int128(const Int128 &val): lo(val.lo), hi(val.hi){} - - Int128(const cInt& _hi, const ulong64& _lo): lo(_lo), hi(_hi){} - - Int128& operator = (const cInt &val) - { - lo = (ulong64)val; - if (val < 0) hi = -1; else hi = 0; - return *this; - } - - bool operator == (const Int128 &val) const - {return (hi == val.hi && lo == val.lo);} - - bool operator != (const Int128 &val) const - { return !(*this == val);} - - bool operator > (const Int128 &val) const - { - if (hi != val.hi) - return hi > val.hi; - else - return lo > val.lo; - } - - bool operator < (const Int128 &val) const - { - if (hi != val.hi) - return hi < val.hi; - else - return lo < val.lo; - } - - bool operator >= (const Int128 &val) const - { return !(*this < val);} - - bool operator <= (const Int128 &val) const - { return !(*this > val);} - - Int128& operator += (const Int128 &rhs) - { - hi += rhs.hi; - lo += rhs.lo; - if (lo < rhs.lo) hi++; - return *this; - } - - Int128 operator + (const Int128 &rhs) const - { - Int128 result(*this); - result+= rhs; - return result; - } - - Int128& operator -= (const Int128 &rhs) - { - *this += -rhs; - return *this; - } - - Int128 operator - (const Int128 &rhs) const - { - Int128 result(*this); - result -= rhs; - return result; - } - - Int128 operator-() const //unary negation - { - if (lo == 0) - return Int128(-hi,0); - else - return Int128(~hi,~lo +1); - } - - Int128 operator/ (const Int128 &rhs) const - { - if (rhs.lo == 0 && rhs.hi == 0) - throw "Int128 operator/: divide by zero"; - - bool negate = (rhs.hi < 0) != (hi < 0); - Int128 dividend = *this; - Int128 divisor = rhs; - if (dividend.hi < 0) dividend = -dividend; - if (divisor.hi < 0) divisor = -divisor; - - if (divisor < dividend) - { - Int128 result = Int128(0); - Int128 cntr = Int128(1); - while (divisor.hi >= 0 && !(divisor > dividend)) - { - divisor.hi <<= 1; - if ((cInt)divisor.lo < 0) divisor.hi++; - divisor.lo <<= 1; - - cntr.hi <<= 1; - if ((cInt)cntr.lo < 0) cntr.hi++; - cntr.lo <<= 1; - } - divisor.lo >>= 1; - if ((divisor.hi & 1) == 1) - divisor.lo |= 0x8000000000000000LL; - divisor.hi = (ulong64)divisor.hi >> 1; - - cntr.lo >>= 1; - if ((cntr.hi & 1) == 1) - cntr.lo |= 0x8000000000000000LL; - cntr.hi >>= 1; - - while (cntr.hi != 0 || cntr.lo != 0) - { - if (!(dividend < divisor)) - { - dividend -= divisor; - result.hi |= cntr.hi; - result.lo |= cntr.lo; - } - divisor.lo >>= 1; - if ((divisor.hi & 1) == 1) - divisor.lo |= 0x8000000000000000LL; - divisor.hi >>= 1; - - cntr.lo >>= 1; - if ((cntr.hi & 1) == 1) - cntr.lo |= 0x8000000000000000LL; - cntr.hi >>= 1; - } - if (negate) result = -result; - return result; - } - else if (rhs.hi == this->hi && rhs.lo == this->lo) - return Int128(1); - else - return Int128(0); - } - - double AsDouble() const - { - const double shift64 = 18446744073709551616.0; //2^64 - if (hi < 0) - { - if (lo == 0) return (double)hi * shift64; - else return -(double)(~lo + ~hi * shift64); - } - else - return (double)(lo + hi * shift64); - } - -}; -//------------------------------------------------------------------------------ - -Int128 Int128Mul (cInt lhs, cInt rhs) -{ - bool negate = (lhs < 0) != (rhs < 0); - - if (lhs < 0) lhs = -lhs; - ulong64 int1Hi = ulong64(lhs) >> 32; - ulong64 int1Lo = ulong64(lhs & 0xFFFFFFFF); - - if (rhs < 0) rhs = -rhs; - ulong64 int2Hi = ulong64(rhs) >> 32; - ulong64 int2Lo = ulong64(rhs & 0xFFFFFFFF); - - //nb: see comments in clipper.pas - ulong64 a = int1Hi * int2Hi; - ulong64 b = int1Lo * int2Lo; - ulong64 c = int1Hi * int2Lo + int1Lo * int2Hi; - - Int128 tmp; - tmp.hi = cInt(a + (c >> 32)); - tmp.lo = cInt(c << 32); - tmp.lo += cInt(b); - if (tmp.lo < b) tmp.hi++; - if (negate) tmp = -tmp; - return tmp; -}; -#endif - -//------------------------------------------------------------------------------ -// Miscellaneous global functions -//------------------------------------------------------------------------------ - -bool Orientation(const Path &poly) -{ - return Area(poly) >= 0; -} -//------------------------------------------------------------------------------ - -double Area(const Path &poly) -{ - int highI = (int)poly.size() -1; - if (highI < 2) return 0; - - double a; - a = ((double)poly[highI].X + poly[0].X) * ((double)poly[0].Y - poly[highI].Y); - for (int i = 1; i <= highI; ++i) - a += ((double)poly[i - 1].X + poly[i].X) * ((double)poly[i].Y - poly[i - 1].Y); - return a / 2; -} -//------------------------------------------------------------------------------ - -double Area(const OutRec &outRec) -{ - OutPt *op = outRec.Pts; - if (!op) return 0; - double a = 0; - do { - a = a + (double)(op->Pt.X + op->Prev->Pt.X) * (double)(op->Prev->Pt.Y - op->Pt.Y); - op = op->Next; - } while (op != outRec.Pts); - return a / 2; -} -//------------------------------------------------------------------------------ - -bool PointIsVertex(const IntPoint &Pt, OutPt *pp) -{ - OutPt *pp2 = pp; - do - { - if (pp2->Pt == Pt) return true; - pp2 = pp2->Next; - } - while (pp2 != pp); - return false; -} -//------------------------------------------------------------------------------ - -bool PointOnLineSegment(const IntPoint Pt, - const IntPoint linePt1, const IntPoint linePt2, bool UseFullInt64Range) -{ -#ifndef use_int32 - if (UseFullInt64Range) - return ((Pt.X == linePt1.X) && (Pt.Y == linePt1.Y)) || - ((Pt.X == linePt2.X) && (Pt.Y == linePt2.Y)) || - (((Pt.X > linePt1.X) == (Pt.X < linePt2.X)) && - ((Pt.Y > linePt1.Y) == (Pt.Y < linePt2.Y)) && - ((Int128Mul((Pt.X - linePt1.X), (linePt2.Y - linePt1.Y)) == - Int128Mul((linePt2.X - linePt1.X), (Pt.Y - linePt1.Y))))); - else -#endif - return ((Pt.X == linePt1.X) && (Pt.Y == linePt1.Y)) || - ((Pt.X == linePt2.X) && (Pt.Y == linePt2.Y)) || - (((Pt.X > linePt1.X) == (Pt.X < linePt2.X)) && - ((Pt.Y > linePt1.Y) == (Pt.Y < linePt2.Y)) && - ((Pt.X - linePt1.X) * (linePt2.Y - linePt1.Y) == - (linePt2.X - linePt1.X) * (Pt.Y - linePt1.Y))); -} -//------------------------------------------------------------------------------ - -bool PointOnPolygon(const IntPoint Pt, OutPt *pp, bool UseFullInt64Range) -{ - OutPt *pp2 = pp; - while (true) - { - if (PointOnLineSegment(Pt, pp2->Pt, pp2->Next->Pt, UseFullInt64Range)) - return true; - pp2 = pp2->Next; - if (pp2 == pp) break; - } - return false; -} -//------------------------------------------------------------------------------ - -bool PointInPolygon(const IntPoint &Pt, OutPt *pp, bool UseFullInt64Range) -{ - OutPt *pp2 = pp; - bool result = false; -#ifndef use_int32 - if (UseFullInt64Range) { - do - { - if (((pp2->Pt.Y > Pt.Y) != (pp2->Prev->Pt.Y > Pt.Y)) && - (Int128(Pt.X - pp2->Pt.X) < - Int128Mul(pp2->Prev->Pt.X - pp2->Pt.X, Pt.Y - pp2->Pt.Y) / - Int128(pp2->Prev->Pt.Y - pp2->Pt.Y))) result = !result; - pp2 = pp2->Next; - } - while (pp2 != pp); - return result; - } -#endif - do - { - //http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html - if (((pp2->Pt.Y > Pt.Y) != (pp2->Prev->Pt.Y > Pt.Y)) && - ((Pt.X - pp2->Pt.X) < (pp2->Prev->Pt.X - pp2->Pt.X) * (Pt.Y - pp2->Pt.Y) / - (pp2->Prev->Pt.Y - pp2->Pt.Y))) result = !result; - pp2 = pp2->Next; - } - while (pp2 != pp); - return result; -} -//------------------------------------------------------------------------------ - -bool SlopesEqual(const TEdge &e1, const TEdge &e2, bool UseFullInt64Range) -{ -#ifndef use_int32 - if (UseFullInt64Range) - return Int128Mul(e1.Delta.Y, e2.Delta.X) == Int128Mul(e1.Delta.X, e2.Delta.Y); - else -#endif - return e1.Delta.Y * e2.Delta.X == e1.Delta.X * e2.Delta.Y; -} -//------------------------------------------------------------------------------ - -bool SlopesEqual(const IntPoint pt1, const IntPoint pt2, - const IntPoint pt3, bool UseFullInt64Range) -{ -#ifndef use_int32 - if (UseFullInt64Range) - return Int128Mul(pt1.Y-pt2.Y, pt2.X-pt3.X) == Int128Mul(pt1.X-pt2.X, pt2.Y-pt3.Y); - else -#endif - return (pt1.Y-pt2.Y)*(pt2.X-pt3.X) == (pt1.X-pt2.X)*(pt2.Y-pt3.Y); -} -//------------------------------------------------------------------------------ - -bool SlopesEqual(const IntPoint pt1, const IntPoint pt2, - const IntPoint pt3, const IntPoint pt4, bool UseFullInt64Range) -{ -#ifndef use_int32 - if (UseFullInt64Range) - return Int128Mul(pt1.Y-pt2.Y, pt3.X-pt4.X) == Int128Mul(pt1.X-pt2.X, pt3.Y-pt4.Y); - else -#endif - return (pt1.Y-pt2.Y)*(pt3.X-pt4.X) == (pt1.X-pt2.X)*(pt3.Y-pt4.Y); -} -//------------------------------------------------------------------------------ - -inline bool IsHorizontal(TEdge &e) -{ - return e.Delta.Y == 0; -} -//------------------------------------------------------------------------------ - -inline double GetDx(const IntPoint pt1, const IntPoint pt2) -{ - return (pt1.Y == pt2.Y) ? - HORIZONTAL : (double)(pt2.X - pt1.X) / (pt2.Y - pt1.Y); -} -//--------------------------------------------------------------------------- - -inline void SetDx(TEdge &e) -{ - e.Delta.X = (e.Top.X - e.Bot.X); - e.Delta.Y = (e.Top.Y - e.Bot.Y); - - if (e.Delta.Y == 0) e.Dx = HORIZONTAL; - else e.Dx = (double)(e.Delta.X) / e.Delta.Y; -} -//--------------------------------------------------------------------------- - -inline void SwapSides(TEdge &Edge1, TEdge &Edge2) -{ - EdgeSide Side = Edge1.Side; - Edge1.Side = Edge2.Side; - Edge2.Side = Side; -} -//------------------------------------------------------------------------------ - -inline void SwapPolyIndexes(TEdge &Edge1, TEdge &Edge2) -{ - int OutIdx = Edge1.OutIdx; - Edge1.OutIdx = Edge2.OutIdx; - Edge2.OutIdx = OutIdx; -} -//------------------------------------------------------------------------------ - -inline cInt TopX(TEdge &edge, const cInt currentY) -{ - return ( currentY == edge.Top.Y ) ? - edge.Top.X : edge.Bot.X + Round(edge.Dx *(currentY - edge.Bot.Y)); -} -//------------------------------------------------------------------------------ - -bool IntersectPoint(TEdge &Edge1, TEdge &Edge2, - IntPoint &ip, bool UseFullInt64Range) -{ -#ifdef use_xyz - ip.Z = 0; -#endif - double b1, b2; - //nb: with very large coordinate values, it's possible for SlopesEqual() to - //return false but for the edge.Dx value be equal due to double precision rounding. - if (SlopesEqual(Edge1, Edge2, UseFullInt64Range) || Edge1.Dx == Edge2.Dx) - { - if (Edge2.Bot.Y > Edge1.Bot.Y) ip.Y = Edge2.Bot.Y; - else ip.Y = Edge1.Bot.Y; - return false; - } - else if (Edge1.Delta.X == 0) - { - ip.X = Edge1.Bot.X; - if (IsHorizontal(Edge2)) - ip.Y = Edge2.Bot.Y; - else - { - b2 = Edge2.Bot.Y - (Edge2.Bot.X / Edge2.Dx); - ip.Y = Round(ip.X / Edge2.Dx + b2); - } - } - else if (Edge2.Delta.X == 0) - { - ip.X = Edge2.Bot.X; - if (IsHorizontal(Edge1)) - ip.Y = Edge1.Bot.Y; - else - { - b1 = Edge1.Bot.Y - (Edge1.Bot.X / Edge1.Dx); - ip.Y = Round(ip.X / Edge1.Dx + b1); - } - } - else - { - b1 = Edge1.Bot.X - Edge1.Bot.Y * Edge1.Dx; - b2 = Edge2.Bot.X - Edge2.Bot.Y * Edge2.Dx; - double q = (b2-b1) / (Edge1.Dx - Edge2.Dx); - ip.Y = Round(q); - if (std::fabs(Edge1.Dx) < std::fabs(Edge2.Dx)) - ip.X = Round(Edge1.Dx * q + b1); - else - ip.X = Round(Edge2.Dx * q + b2); - } - - if (ip.Y < Edge1.Top.Y || ip.Y < Edge2.Top.Y) - { - if (Edge1.Top.Y > Edge2.Top.Y) - { - ip.Y = Edge1.Top.Y; - ip.X = TopX(Edge2, Edge1.Top.Y); - return ip.X < Edge1.Top.X; - } - else - { - ip.Y = Edge2.Top.Y; - ip.X = TopX(Edge1, Edge2.Top.Y); - return ip.X > Edge2.Top.X; - } - } - else - return true; -} -//------------------------------------------------------------------------------ - -void ReversePolyPtLinks(OutPt *pp) -{ - if (!pp) return; - OutPt *pp1, *pp2; - pp1 = pp; - do { - pp2 = pp1->Next; - pp1->Next = pp1->Prev; - pp1->Prev = pp2; - pp1 = pp2; - } while( pp1 != pp ); -} -//------------------------------------------------------------------------------ - -void DisposeOutPts(OutPt*& pp) -{ - if (pp == 0) return; - pp->Prev->Next = 0; - while( pp ) - { - OutPt *tmpPp = pp; - pp = pp->Next; - delete tmpPp; - } -} -//------------------------------------------------------------------------------ - -inline void InitEdge(TEdge* e, TEdge* eNext, TEdge* ePrev, const IntPoint& Pt) -{ - std::memset(e, 0, sizeof(TEdge)); - e->Next = eNext; - e->Prev = ePrev; - e->Curr = Pt; - e->OutIdx = Unassigned; -} -//------------------------------------------------------------------------------ - -void InitEdge2(TEdge& e, PolyType Pt) -{ - if (e.Curr.Y >= e.Next->Curr.Y) - { - e.Bot = e.Curr; - e.Top = e.Next->Curr; - } else - { - e.Top = e.Curr; - e.Bot = e.Next->Curr; - } - SetDx(e); - e.PolyTyp = Pt; -} -//------------------------------------------------------------------------------ - -TEdge* RemoveEdge(TEdge* e) -{ - //removes e from double_linked_list (but without removing from memory) - e->Prev->Next = e->Next; - e->Next->Prev = e->Prev; - TEdge* result = e->Next; - e->Prev = 0; //flag as removed (see ClipperBase.Clear) - return result; -} -//------------------------------------------------------------------------------ - -TEdge* GetLastHorz(TEdge* Edge) -{ - TEdge* result = Edge; - while (result->OutIdx != Skip && result->Next != Edge && IsHorizontal(*result->Next)) - result = result->Next; - return result; -} -//------------------------------------------------------------------------------ - -bool SharedVertWithPrevAtTop(TEdge* Edge) -{ - TEdge* E = Edge; - bool result = true; - while (E->Prev != Edge) - { - if (E->Top == E->Prev->Top) - { - if (E->Bot == E->Prev->Bot) - {E = E->Prev; continue;} - else result = true; - } - else result = false; - break; - } - while (E != Edge) - { - result = !result; - E = E->Next; - } - return result; -} -//------------------------------------------------------------------------------ - -bool SharedVertWithNextIsBot(TEdge* Edge) -{ - bool result = true; - TEdge* E = Edge; - while (E->Prev != Edge) - { - bool A = (E->Next->Bot == E->Bot); - bool B = (E->Prev->Bot == E->Bot); - if (A != B) - { - result = A; - break; - } - A = (E->Next->Top == E->Top); - B = (E->Prev->Top == E->Top); - if (A != B) - { - result = B; - break; - } - E = E->Prev; - } - while (E != Edge) - { - result = !result; - E = E->Next; - } - return result; -} -//------------------------------------------------------------------------------ - -bool MoreBelow(TEdge* Edge) -{ - //Edge is Skip heading down. - TEdge* E = Edge; - if (IsHorizontal(*E)) - { - while (IsHorizontal(*E->Next)) E = E->Next; - return E->Next->Bot.Y > E->Bot.Y; - } else if (IsHorizontal(*E->Next)) - { - while (IsHorizontal(*E->Next)) E = E->Next; - return E->Next->Bot.Y > E->Bot.Y; - } - else return (E->Bot == E->Next->Top); -} -//------------------------------------------------------------------------------ - -bool JustBeforeLocMin(TEdge* Edge) -{ - //Edge is Skip and was heading down. - TEdge*E = Edge; - if (IsHorizontal(*E)) - { - while (IsHorizontal(*E->Next)) E = E->Next; - return E->Next->Top.Y < E->Bot.Y; - } - else return SharedVertWithNextIsBot(E); -} -//------------------------------------------------------------------------------ - -bool MoreAbove(TEdge* Edge) -{ - if (IsHorizontal(*Edge)) - { - Edge = GetLastHorz(Edge); - return (Edge->Next->Top.Y < Edge->Top.Y); - } else if (IsHorizontal(*Edge->Next)) - { - Edge = GetLastHorz(Edge->Next); - return (Edge->Next->Top.Y < Edge->Top.Y); - } - else - return (Edge->Next->Top.Y < Edge->Top.Y); -} -//------------------------------------------------------------------------------ - -bool AllHorizontal(TEdge* Edge) -{ - if (!IsHorizontal(*Edge)) return false; - TEdge* E = Edge->Next; - while (E != Edge) - { - if (!IsHorizontal(*E)) return false; - else E = E->Next; - } - return true; -} -//------------------------------------------------------------------------------ - -inline void ReverseHorizontal(TEdge &e) -{ - //swap horizontal edges' Top and Bottom x's so they follow the natural - //progression of the bounds - ie so their xbots will align with the - //adjoining lower edge. [Helpful in the ProcessHorizontal() method.] - cInt tmp = e.Top.X; - e.Top.X = e.Bot.X; - e.Bot.X = tmp; -#ifdef use_xyz - tmp = e.Top.Z; - e.Top.Z = e.Bot.Z; - e.Bot.Z = tmp; -#endif -} -//------------------------------------------------------------------------------ - -void SwapPoints(IntPoint &pt1, IntPoint &pt2) -{ - IntPoint tmp = pt1; - pt1 = pt2; - pt2 = tmp; -} -//------------------------------------------------------------------------------ - -bool GetOverlapSegment(IntPoint pt1a, IntPoint pt1b, IntPoint pt2a, - IntPoint pt2b, IntPoint &pt1, IntPoint &pt2) -{ - //precondition: segments are Collinear. - if (Abs(pt1a.X - pt1b.X) > Abs(pt1a.Y - pt1b.Y)) - { - if (pt1a.X > pt1b.X) SwapPoints(pt1a, pt1b); - if (pt2a.X > pt2b.X) SwapPoints(pt2a, pt2b); - if (pt1a.X > pt2a.X) pt1 = pt1a; else pt1 = pt2a; - if (pt1b.X < pt2b.X) pt2 = pt1b; else pt2 = pt2b; - return pt1.X < pt2.X; - } else - { - if (pt1a.Y < pt1b.Y) SwapPoints(pt1a, pt1b); - if (pt2a.Y < pt2b.Y) SwapPoints(pt2a, pt2b); - if (pt1a.Y < pt2a.Y) pt1 = pt1a; else pt1 = pt2a; - if (pt1b.Y > pt2b.Y) pt2 = pt1b; else pt2 = pt2b; - return pt1.Y > pt2.Y; - } -} -//------------------------------------------------------------------------------ - -bool FirstIsBottomPt(const OutPt* btmPt1, const OutPt* btmPt2) -{ - OutPt *p = btmPt1->Prev; - while ((p->Pt == btmPt1->Pt) && (p != btmPt1)) p = p->Prev; - double dx1p = std::fabs(GetDx(btmPt1->Pt, p->Pt)); - p = btmPt1->Next; - while ((p->Pt == btmPt1->Pt) && (p != btmPt1)) p = p->Next; - double dx1n = std::fabs(GetDx(btmPt1->Pt, p->Pt)); - - p = btmPt2->Prev; - while ((p->Pt == btmPt2->Pt) && (p != btmPt2)) p = p->Prev; - double dx2p = std::fabs(GetDx(btmPt2->Pt, p->Pt)); - p = btmPt2->Next; - while ((p->Pt == btmPt2->Pt) && (p != btmPt2)) p = p->Next; - double dx2n = std::fabs(GetDx(btmPt2->Pt, p->Pt)); - return (dx1p >= dx2p && dx1p >= dx2n) || (dx1n >= dx2p && dx1n >= dx2n); -} -//------------------------------------------------------------------------------ - -OutPt* GetBottomPt(OutPt *pp) -{ - OutPt* dups = 0; - OutPt* p = pp->Next; - while (p != pp) - { - if (p->Pt.Y > pp->Pt.Y) - { - pp = p; - dups = 0; - } - else if (p->Pt.Y == pp->Pt.Y && p->Pt.X <= pp->Pt.X) - { - if (p->Pt.X < pp->Pt.X) - { - dups = 0; - pp = p; - } else - { - if (p->Next != pp && p->Prev != pp) dups = p; - } - } - p = p->Next; - } - if (dups) - { - //there appears to be at least 2 vertices at BottomPt so ... - while (dups != p) - { - if (!FirstIsBottomPt(p, dups)) pp = dups; - dups = dups->Next; - while (dups->Pt != pp->Pt) dups = dups->Next; - } - } - return pp; -} -//------------------------------------------------------------------------------ - -bool FindSegment(OutPt* &pp, bool UseFullInt64Range, - IntPoint &pt1, IntPoint &pt2) -{ - //OutPt1 & OutPt2 => the overlap segment (if the function returns true) - if (!pp) return false; - OutPt* pp2 = pp; - IntPoint pt1a = pt1, pt2a = pt2; - do - { - if (SlopesEqual(pt1a, pt2a, pp->Pt, pp->Prev->Pt, UseFullInt64Range) && - SlopesEqual(pt1a, pt2a, pp->Pt, UseFullInt64Range) && - GetOverlapSegment(pt1a, pt2a, pp->Pt, pp->Prev->Pt, pt1, pt2)) - return true; - pp = pp->Next; - } - while (pp != pp2); - return false; -} -//------------------------------------------------------------------------------ - -bool Pt2IsBetweenPt1AndPt3(const IntPoint pt1, - const IntPoint pt2, const IntPoint pt3) -{ - if ((pt1 == pt3) || (pt1 == pt2) || (pt3 == pt2)) - return false; - else if (pt1.X != pt3.X) - return (pt2.X > pt1.X) == (pt2.X < pt3.X); - else - return (pt2.Y > pt1.Y) == (pt2.Y < pt3.Y); -} -//------------------------------------------------------------------------------ - -OutPt* InsertPolyPtBetween(OutPt* p1, OutPt* p2, const IntPoint Pt) -{ - if (p1 == p2) throw "JoinError"; - OutPt* result = new OutPt; - result->Pt = Pt; - if (p2 == p1->Next) - { - p1->Next = result; - p2->Prev = result; - result->Next = p2; - result->Prev = p1; - } else - { - p2->Next = result; - p1->Prev = result; - result->Next = p1; - result->Prev = p2; - } - return result; -} -//------------------------------------------------------------------------------ - -bool HorzSegmentsOverlap(const IntPoint& pt1a, const IntPoint& pt1b, - const IntPoint& pt2a, const IntPoint& pt2b) -{ - //precondition: both segments are horizontal - if ((pt1a.X > pt2a.X) == (pt1a.X < pt2b.X)) return true; - else if ((pt1b.X > pt2a.X) == (pt1b.X < pt2b.X)) return true; - else if ((pt2a.X > pt1a.X) == (pt2a.X < pt1b.X)) return true; - else if ((pt2b.X > pt1a.X) == (pt2b.X < pt1b.X)) return true; - else if ((pt1a.X == pt2a.X) && (pt1b.X == pt2b.X)) return true; - else if ((pt1a.X == pt2b.X) && (pt1b.X == pt2a.X)) return true; - else return false; -} - - -//------------------------------------------------------------------------------ -// ClipperBase class methods ... -//------------------------------------------------------------------------------ - -ClipperBase::ClipperBase() //constructor -{ - m_MinimaList = 0; - m_CurrentLM = 0; - m_UseFullRange = false; -} -//------------------------------------------------------------------------------ - -ClipperBase::~ClipperBase() //destructor -{ - Clear(); -} -//------------------------------------------------------------------------------ - -void RangeTest(const IntPoint& Pt, bool& useFullRange) -{ - if (useFullRange) - { - if (Pt.X > hiRange || Pt.Y > hiRange || -Pt.X > hiRange || -Pt.Y > hiRange) - throw "Coordinate outside allowed range"; - } - else if (Pt.X > loRange|| Pt.Y > loRange || -Pt.X > loRange || -Pt.Y > loRange) - { - useFullRange = true; - RangeTest(Pt, useFullRange); - } -} -//------------------------------------------------------------------------------ - -bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed) -{ -#ifdef use_lines - if (!Closed && PolyTyp == ptClip) - throw clipperException("AddPath: Open paths must be subject."); -#else - if (!Closed) - throw clipperException("AddPath: Open paths have been disabled."); -#endif - - int highI = (int)pg.size() -1; - bool ClosedOrSemiClosed = (highI > 0) && (Closed || (pg[0] == pg[highI])); - while (highI > 0 && (pg[highI] == pg[0])) --highI; - while (highI > 0 && (pg[highI] == pg[highI -1])) --highI; - if ((Closed && highI < 2) || (!Closed && highI < 1)) return false; - - //create a new edge array ... - TEdge *edges = new TEdge [highI +1]; - - //1. Basic initialization of Edges ... - try - { - edges[1].Curr = pg[1]; - RangeTest(pg[0], m_UseFullRange); - RangeTest(pg[highI], m_UseFullRange); - InitEdge(&edges[0], &edges[1], &edges[highI], pg[0]); - InitEdge(&edges[highI], &edges[0], &edges[highI-1], pg[highI]); - for (int i = highI - 1; i >= 1; --i) - { - RangeTest(pg[i], m_UseFullRange); - InitEdge(&edges[i], &edges[i+1], &edges[i-1], pg[i]); - } - } - catch(...) - { - delete [] edges; - return false; //almost certainly a vertex has exceeded range - } - - TEdge *eStart = &edges[0]; - if (!ClosedOrSemiClosed) eStart->Prev->OutIdx = Skip; - - //2. Remove duplicate vertices, and collinear edges (when closed) ... - TEdge *E = eStart, *eLoopStop = eStart; - for (;;) - { - if ((E->Curr == E->Next->Curr)) - { - if (E == eStart) eStart = E->Next; - E = RemoveEdge(E); - eLoopStop = E; - continue; - } - if (E->Prev == E->Next) - break; //only two vertices - else if ((ClosedOrSemiClosed || - (E->Prev->OutIdx != Skip && E->OutIdx != Skip && - E->Next->OutIdx != Skip)) && - SlopesEqual(E->Prev->Curr, E->Curr, E->Next->Curr, m_UseFullRange)) - { - //All collinear edges are allowed for open paths but in closed paths - //inner vertices of adjacent collinear edges are removed. However if the - //PreserveCollinear property has been enabled, only overlapping collinear - //edges (ie spikes) are removed from closed paths. - if (Closed && (!m_PreserveCollinear || - !Pt2IsBetweenPt1AndPt3(E->Prev->Curr, E->Curr, E->Next->Curr))) - { - if (E == eStart) eStart = E->Next; - E = RemoveEdge(E); - E = E->Prev; - eLoopStop = E; - continue; - } - } - E = E->Next; - if (E == eLoopStop) break; - } - - if ((!Closed && (E == E->Next)) || (Closed && (E->Prev == E->Next))) - { - delete [] edges; - return false; - } - m_edges.push_back(edges); - - if (!Closed) - m_HasOpenPaths = true; - - //3. Do final Init and also find the 'highest' Edge. (nb: since I'm much - //more familiar with positive downwards Y axes, 'highest' here will be - //the Edge with the *smallest* Top.Y.) - TEdge *eHighest = eStart; - E = eStart; - do - { - InitEdge2(*E, PolyTyp); - if (E->Top.Y < eHighest->Top.Y) eHighest = E; - E = E->Next; - } - while (E != eStart); - - //4. build the local minima list ... - if (AllHorizontal(E)) - { - if (ClosedOrSemiClosed) - E->Prev->OutIdx = Skip; - AscendToMax(E, false, false); - return true; - } - - //if eHighest is also the Skip then it's a natural break, otherwise - //make sure eHighest is positioned so we're either at a top horizontal or - //just starting to head down one edge of the polygon - E = eStart->Prev; //EStart.Prev == Skip edge - if (E->Prev == E->Next) - eHighest = E->Next; - else if (!ClosedOrSemiClosed && E->Top.Y == eHighest->Top.Y) - { - if ((IsHorizontal(*E) || IsHorizontal(*E->Next)) && - E->Next->Bot.Y == eHighest->Top.Y) - eHighest = E->Next; - else if (SharedVertWithPrevAtTop(E)) eHighest = E; - else if (E->Top == E->Prev->Top) eHighest = E->Prev; - else eHighest = E->Next; - } else - { - E = eHighest; - while (IsHorizontal(*eHighest) || - (eHighest->Top == eHighest->Next->Top) || - (eHighest->Top == eHighest->Next->Bot)) //next is high horizontal - { - eHighest = eHighest->Next; - if (eHighest == E) - { - while (IsHorizontal(*eHighest) || !SharedVertWithPrevAtTop(eHighest)) - eHighest = eHighest->Next; - break; //avoids potential endless loop - } - } - } - E = eHighest; - do - E = AddBoundsToLML(E, Closed); - while (E != eHighest); - return true; -} -//------------------------------------------------------------------------------ - -bool ClipperBase::AddPaths(const Paths &ppg, PolyType PolyTyp, bool Closed) -{ - bool result = false; - for (Paths::size_type i = 0; i < ppg.size(); ++i) - if (AddPath(ppg[i], PolyTyp, Closed)) result = true; - return result; -} -//------------------------------------------------------------------------------ - -void ClipperBase::InsertLocalMinima(LocalMinima *newLm) -{ - if( ! m_MinimaList ) - { - m_MinimaList = newLm; - } - else if( newLm->Y >= m_MinimaList->Y ) - { - newLm->Next = m_MinimaList; - m_MinimaList = newLm; - } else - { - LocalMinima* tmpLm = m_MinimaList; - while( tmpLm->Next && ( newLm->Y < tmpLm->Next->Y ) ) - tmpLm = tmpLm->Next; - newLm->Next = tmpLm->Next; - tmpLm->Next = newLm; - } -} -//------------------------------------------------------------------------------ - -void ClipperBase::DoMinimaLML(TEdge* E1, TEdge* E2, bool IsClosed) -{ - if (!E1) - { - if (!E2) return; - LocalMinima* NewLm = new LocalMinima; - NewLm->Next = 0; - NewLm->Y = E2->Bot.Y; - NewLm->LeftBound = 0; - E2->WindDelta = 0; - NewLm->RightBound = E2; - InsertLocalMinima(NewLm); - } else - { - //E and E.Prev are now at a local minima ... - LocalMinima* NewLm = new LocalMinima; - NewLm->Y = E1->Bot.Y; - NewLm->Next = 0; - if (IsHorizontal(*E2)) //Horz. edges never start a Left bound - { - if (E2->Bot.X != E1->Bot.X) ReverseHorizontal(*E2); - NewLm->LeftBound = E1; - NewLm->RightBound = E2; - } else if (E2->Dx < E1->Dx) - { - NewLm->LeftBound = E1; - NewLm->RightBound = E2; - } else - { - NewLm->LeftBound = E2; - NewLm->RightBound = E1; - } - NewLm->LeftBound->Side = esLeft; - NewLm->RightBound->Side = esRight; - //set the winding state of the first edge in each bound - //(it'll be copied to subsequent edges in the bound) ... - if (!IsClosed) NewLm->LeftBound->WindDelta = 0; - else if (NewLm->LeftBound->Next == NewLm->RightBound) NewLm->LeftBound->WindDelta = -1; - else NewLm->LeftBound->WindDelta = 1; - NewLm->RightBound->WindDelta = -NewLm->LeftBound->WindDelta; - InsertLocalMinima(NewLm); - } -} -//---------------------------------------------------------------------- - -TEdge* ClipperBase::DescendToMin(TEdge *&E) -{ - //PRECONDITION: STARTING EDGE IS A VALID DESCENDING EDGE. - //Starting at the top of one bound we progress to the bottom where there's - //A local minima. We go to the top of the Next bound. These two bounds - //form the left and right (or right and left) bounds of the local minima. - TEdge* EHorz; - E->NextInLML = 0; - if (IsHorizontal(*E)) - { - EHorz = E; - while (IsHorizontal(*EHorz->Next)) EHorz = EHorz->Next; - if (EHorz->Bot != EHorz->Next->Top) - ReverseHorizontal(*E); - } - for (;;) - { - E = E->Next; - if (E->OutIdx == Skip) break; - else if (IsHorizontal(*E)) - { - //nb: proceed through horizontals when approaching from their right, - // but break on horizontal minima if approaching from their left. - // This ensures 'local minima' are always on the left of horizontals. - - //look ahead is required in case of multiple consec. horizontals - EHorz = GetLastHorz(E); - if(EHorz == E->Prev || //horizontal line - (EHorz->Next->Top.Y < E->Top.Y && //bottom horizontal - EHorz->Next->Bot.X > E->Prev->Bot.X)) //approaching from the left - break; - if (E->Top.X != E->Prev->Bot.X) ReverseHorizontal(*E); - if (EHorz->OutIdx == Skip) EHorz = EHorz->Prev; - while (E != EHorz) - { - E->NextInLML = E->Prev; - E = E->Next; - if (E->Top.X != E->Prev->Bot.X) ReverseHorizontal(*E); - } - } - else if (E->Bot.Y == E->Prev->Bot.Y) break; - E->NextInLML = E->Prev; - } - return E->Prev; -} -//---------------------------------------------------------------------- - -void ClipperBase::AscendToMax(TEdge *&E, bool Appending, bool IsClosed) -{ - if (E->OutIdx == Skip) - { - E = E->Next; - if (!MoreAbove(E->Prev)) return; - } - - if (IsHorizontal(*E) && Appending && (E->Bot != E->Prev->Bot)) - ReverseHorizontal(*E); - //now process the ascending bound .... - TEdge *EStart = E; - for (;;) - { - if (E->Next->OutIdx == Skip || - ((E->Next->Top.Y == E->Top.Y) && !IsHorizontal(*E->Next))) break; - E->NextInLML = E->Next; - E = E->Next; - if (IsHorizontal(*E) && (E->Bot.X != E->Prev->Top.X)) - ReverseHorizontal(*E); - } - - if (!Appending) - { - if (EStart->OutIdx == Skip) EStart = EStart->Next; - if (EStart != E->Next) - DoMinimaLML(0, EStart, IsClosed); - } - E = E->Next; -} -//---------------------------------------------------------------------- - -TEdge* ClipperBase::AddBoundsToLML(TEdge* E, bool IsClosed) -{ - //Starting at the top of one bound we progress to the bottom where there's - //A local minima. We then go to the top of the Next bound. These two bounds - //form the left and right (or right and left) bounds of the local minima. - - TEdge* B; - bool AppendMaxima; - //do minima ... - if (E->OutIdx == Skip) - { - if (MoreBelow(E)) - { - E = E->Next; - B = DescendToMin(E); - } else - B = 0; - } else - B = DescendToMin(E); - - if (E->OutIdx == Skip) //nb: may be BEFORE, AT or just THRU LM - { - //do minima before Skip... - DoMinimaLML(0, B, IsClosed); //store what we've got so far (if anything) - AppendMaxima = false; - //finish off any minima ... - if ((E->Bot != E->Prev->Bot) && MoreBelow(E)) - { - E = E->Next; - B = DescendToMin(E); - DoMinimaLML(B, E, IsClosed); - AppendMaxima = true; - } - else if (JustBeforeLocMin(E)) - E = E->Next; - } else - { - DoMinimaLML(B, E, IsClosed); - AppendMaxima = true; - } - - //now do maxima ... - AscendToMax(E, AppendMaxima, IsClosed); - - if (E->OutIdx == Skip && (E->Top != E->Prev->Top)) - { - //may be BEFORE, AT or just AFTER maxima - //finish off any maxima ... - if (MoreAbove(E)) - { - E = E->Next; - AscendToMax(E, false, IsClosed); - } - else if ((E->Top == E->Next->Top) || - (IsHorizontal(*E->Next) && (E->Top == E->Next->Bot))) - E = E->Next; //ie just before Maxima - } - return E; -} -//---------------------------------------------------------------------- - -void ClipperBase::Clear() -{ - DisposeLocalMinimaList(); - for (EdgeList::size_type i = 0; i < m_edges.size(); ++i) - { - //for each edge array in turn, find the first used edge and - //check for and remove any hiddenPts in each edge in the array. - TEdge* edges = m_edges[i]; - delete [] edges; - } - m_edges.clear(); - m_UseFullRange = false; - m_HasOpenPaths = false; -} -//------------------------------------------------------------------------------ - -void ClipperBase::Reset() -{ - m_CurrentLM = m_MinimaList; - if( !m_CurrentLM ) return; //ie nothing to process - - //reset all edges ... - LocalMinima* lm = m_MinimaList; - while( lm ) - { - TEdge* e = lm->LeftBound; - if (e) - { - e->Curr = e->Bot; - e->Side = esLeft; - if (e->OutIdx != Skip) - e->OutIdx = Unassigned; - } - e = lm->RightBound; - e->Curr = e->Bot; - e->Side = esRight; - if (e->OutIdx != Skip) - e->OutIdx = Unassigned; - - lm = lm->Next; - } -} -//------------------------------------------------------------------------------ - -void ClipperBase::DisposeLocalMinimaList() -{ - while( m_MinimaList ) - { - LocalMinima* tmpLm = m_MinimaList->Next; - delete m_MinimaList; - m_MinimaList = tmpLm; - } - m_CurrentLM = 0; -} -//------------------------------------------------------------------------------ - -void ClipperBase::PopLocalMinima() -{ - if( ! m_CurrentLM ) return; - m_CurrentLM = m_CurrentLM->Next; -} -//------------------------------------------------------------------------------ - -IntRect ClipperBase::GetBounds() -{ - IntRect result; - LocalMinima* lm = m_MinimaList; - if (!lm) - { - result.left = result.top = result.right = result.bottom = 0; - return result; - } - result.left = lm->LeftBound->Bot.X; - result.top = lm->LeftBound->Bot.Y; - result.right = lm->LeftBound->Bot.X; - result.bottom = lm->LeftBound->Bot.Y; - while (lm) - { - if (lm->LeftBound->Bot.Y > result.bottom) - result.bottom = lm->LeftBound->Bot.Y; - TEdge* e = lm->LeftBound; - for (;;) { - TEdge* bottomE = e; - while (e->NextInLML) - { - if (e->Bot.X < result.left) result.left = e->Bot.X; - if (e->Bot.X > result.right) result.right = e->Bot.X; - e = e->NextInLML; - } - if (e->Bot.X < result.left) result.left = e->Bot.X; - if (e->Bot.X > result.right) result.right = e->Bot.X; - if (e->Top.X < result.left) result.left = e->Top.X; - if (e->Top.X > result.right) result.right = e->Top.X; - if (e->Top.Y < result.top) result.top = e->Top.Y; - - if (bottomE == lm->LeftBound) e = lm->RightBound; - else break; - } - lm = lm->Next; - } - return result; -} - -//------------------------------------------------------------------------------ -// TClipper methods ... -//------------------------------------------------------------------------------ - -Clipper::Clipper(int initOptions) : ClipperBase() //constructor -{ - m_ActiveEdges = 0; - m_SortedEdges = 0; - m_IntersectNodes = 0; - m_ExecuteLocked = false; - m_UseFullRange = false; - m_ReverseOutput = ((initOptions & ioReverseSolution) != 0); - m_StrictSimple = ((initOptions & ioStrictlySimple) != 0); - m_PreserveCollinear = ((initOptions & ioPreserveCollinear) != 0); - m_HasOpenPaths = false; -#ifdef use_xyz - m_ZFill = 0; -#endif -} -//------------------------------------------------------------------------------ - -Clipper::~Clipper() //destructor -{ - Clear(); - m_Scanbeam.clear(); -} -//------------------------------------------------------------------------------ - -#ifdef use_xyz -void Clipper::ZFillFunction(TZFillCallback zFillFunc) -{ - m_ZFill = zFillFunc; -} -//------------------------------------------------------------------------------ -#endif - -void Clipper::Clear() -{ - if (m_edges.empty()) return; //avoids problems with ClipperBase destructor - DisposeAllOutRecs(); - ClipperBase::Clear(); -} -//------------------------------------------------------------------------------ - -void Clipper::Reset() -{ - ClipperBase::Reset(); - m_Scanbeam.clear(); - m_ActiveEdges = 0; - m_SortedEdges = 0; - DisposeAllOutRecs(); - LocalMinima* lm = m_MinimaList; - while (lm) - { - InsertScanbeam(lm->Y); - lm = lm->Next; - } -} -//------------------------------------------------------------------------------ - -bool Clipper::Execute(ClipType clipType, Paths &solution, - PolyFillType subjFillType, PolyFillType clipFillType) -{ - if( m_ExecuteLocked ) return false; - if (m_HasOpenPaths) - throw clipperException("Error: PolyTree struct is need for open path clipping."); - m_ExecuteLocked = true; - solution.resize(0); - m_SubjFillType = subjFillType; - m_ClipFillType = clipFillType; - m_ClipType = clipType; - m_UsingPolyTree = false; - bool succeeded = ExecuteInternal(); - if (succeeded) BuildResult(solution); - m_ExecuteLocked = false; - return succeeded; -} -//------------------------------------------------------------------------------ - -bool Clipper::Execute(ClipType clipType, PolyTree& polytree, - PolyFillType subjFillType, PolyFillType clipFillType) -{ - if( m_ExecuteLocked ) return false; - m_ExecuteLocked = true; - m_SubjFillType = subjFillType; - m_ClipFillType = clipFillType; - m_ClipType = clipType; - m_UsingPolyTree = true; - bool succeeded = ExecuteInternal(); - if (succeeded) BuildResult2(polytree); - m_ExecuteLocked = false; - return succeeded; -} -//------------------------------------------------------------------------------ - -void Clipper::FixHoleLinkage(OutRec &outrec) -{ - //skip OutRecs that (a) contain outermost polygons or - //(b) already have the correct owner/child linkage ... - if (!outrec.FirstLeft || - (outrec.IsHole != outrec.FirstLeft->IsHole && - outrec.FirstLeft->Pts)) return; - - OutRec* orfl = outrec.FirstLeft; - while (orfl && ((orfl->IsHole == outrec.IsHole) || !orfl->Pts)) - orfl = orfl->FirstLeft; - outrec.FirstLeft = orfl; -} -//------------------------------------------------------------------------------ - -bool Clipper::ExecuteInternal() -{ - bool succeeded = true; - try { - Reset(); - if (!m_CurrentLM) return false; - cInt botY = PopScanbeam(); - do { - InsertLocalMinimaIntoAEL(botY); - ClearGhostJoins(); - ProcessHorizontals(false); - if (m_Scanbeam.empty()) break; - cInt topY = PopScanbeam(); - succeeded = ProcessIntersections(botY, topY); - if (!succeeded) break; - ProcessEdgesAtTopOfScanbeam(topY); - botY = topY; - } while (!m_Scanbeam.empty() || m_CurrentLM); - } - catch(...) - { - succeeded = false; - } - - if (succeeded) - { - //fix orientations ... - for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i) - { - OutRec *outRec = m_PolyOuts[i]; - if (!outRec->Pts || outRec->IsOpen) continue; - if ((outRec->IsHole ^ m_ReverseOutput) == (Area(*outRec) > 0)) - ReversePolyPtLinks(outRec->Pts); - } - - if (!m_Joins.empty()) JoinCommonEdges(); - - //unfortunately FixupOutPolygon() must be done after JoinCommonEdges() - for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i) - { - OutRec *outRec = m_PolyOuts[i]; - if (outRec->Pts && !outRec->IsOpen) - FixupOutPolygon(*outRec); - } - - if (m_StrictSimple) DoSimplePolygons(); - } - - ClearJoins(); - ClearGhostJoins(); - return succeeded; -} -//------------------------------------------------------------------------------ - -void Clipper::InsertScanbeam(const cInt Y) -{ - m_Scanbeam.insert(Y); -} -//------------------------------------------------------------------------------ - -cInt Clipper::PopScanbeam() -{ - cInt Y = *m_Scanbeam.begin(); - m_Scanbeam.erase(m_Scanbeam.begin()); - return Y; -} -//------------------------------------------------------------------------------ - -void Clipper::DisposeAllOutRecs(){ - for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i) - DisposeOutRec(i); - m_PolyOuts.clear(); -} -//------------------------------------------------------------------------------ - -void Clipper::DisposeOutRec(PolyOutList::size_type index) -{ - OutRec *outRec = m_PolyOuts[index]; - if (outRec->Pts) DisposeOutPts(outRec->Pts); - delete outRec; - m_PolyOuts[index] = 0; -} -//------------------------------------------------------------------------------ - -void Clipper::SetWindingCount(TEdge &edge) -{ - TEdge *e = edge.PrevInAEL; - //find the edge of the same polytype that immediately preceeds 'edge' in AEL - while (e && ((e->PolyTyp != edge.PolyTyp) || (e->WindDelta == 0))) e = e->PrevInAEL; - if (!e) - { - edge.WindCnt = (edge.WindDelta == 0 ? 1 : edge.WindDelta); - edge.WindCnt2 = 0; - e = m_ActiveEdges; //ie get ready to calc WindCnt2 - } - else if (edge.WindDelta == 0 && m_ClipType != ctUnion) - { - edge.WindCnt = 1; - edge.WindCnt2 = e->WindCnt2; - e = e->NextInAEL; //ie get ready to calc WindCnt2 - } - else if (IsEvenOddFillType(edge)) - { - //EvenOdd filling ... - if (edge.WindDelta == 0) - { - //are we inside a subj polygon ... - bool Inside = true; - TEdge *e2 = e->PrevInAEL; - while (e2) - { - if (e2->PolyTyp == e->PolyTyp && e2->WindDelta != 0) - Inside = !Inside; - e2 = e2->PrevInAEL; - } - edge.WindCnt = (Inside ? 0 : 1); - } - else - { - edge.WindCnt = edge.WindDelta; - } - edge.WindCnt2 = e->WindCnt2; - e = e->NextInAEL; //ie get ready to calc WindCnt2 - } - else - { - //nonZero, Positive or Negative filling ... - if (e->WindCnt * e->WindDelta < 0) - { - //prev edge is 'decreasing' WindCount (WC) toward zero - //so we're outside the previous polygon ... - if (Abs(e->WindCnt) > 1) - { - //outside prev poly but still inside another. - //when reversing direction of prev poly use the same WC - if (e->WindDelta * edge.WindDelta < 0) edge.WindCnt = e->WindCnt; - //otherwise continue to 'decrease' WC ... - else edge.WindCnt = e->WindCnt + edge.WindDelta; - } - else - //now outside all polys of same polytype so set own WC ... - edge.WindCnt = (edge.WindDelta == 0 ? 1 : edge.WindDelta); - } else - { - //prev edge is 'increasing' WindCount (WC) away from zero - //so we're inside the previous polygon ... - if (edge.WindDelta == 0) - edge.WindCnt = (e->WindCnt < 0 ? e->WindCnt - 1 : e->WindCnt + 1); - //if wind direction is reversing prev then use same WC - else if (e->WindDelta * edge.WindDelta < 0) edge.WindCnt = e->WindCnt; - //otherwise add to WC ... - else edge.WindCnt = e->WindCnt + edge.WindDelta; - } - edge.WindCnt2 = e->WindCnt2; - e = e->NextInAEL; //ie get ready to calc WindCnt2 - } - - //update WindCnt2 ... - if (IsEvenOddAltFillType(edge)) - { - //EvenOdd filling ... - while (e != &edge) - { - if (e->WindDelta != 0) - edge.WindCnt2 = (edge.WindCnt2 == 0 ? 1 : 0); - e = e->NextInAEL; - } - } else - { - //nonZero, Positive or Negative filling ... - while ( e != &edge ) - { - edge.WindCnt2 += e->WindDelta; - e = e->NextInAEL; - } - } -} -//------------------------------------------------------------------------------ - -bool Clipper::IsEvenOddFillType(const TEdge& edge) const -{ - if (edge.PolyTyp == ptSubject) - return m_SubjFillType == pftEvenOdd; else - return m_ClipFillType == pftEvenOdd; -} -//------------------------------------------------------------------------------ - -bool Clipper::IsEvenOddAltFillType(const TEdge& edge) const -{ - if (edge.PolyTyp == ptSubject) - return m_ClipFillType == pftEvenOdd; else - return m_SubjFillType == pftEvenOdd; -} -//------------------------------------------------------------------------------ - -bool Clipper::IsContributing(const TEdge& edge) const -{ - PolyFillType pft, pft2; - if (edge.PolyTyp == ptSubject) - { - pft = m_SubjFillType; - pft2 = m_ClipFillType; - } else - { - pft = m_ClipFillType; - pft2 = m_SubjFillType; - } - - switch(pft) - { - case pftEvenOdd: - //return false if a subj line has been flagged as inside a subj polygon - if (edge.WindDelta == 0 && edge.WindCnt != 1) return false; - break; - case pftNonZero: - if (Abs(edge.WindCnt) != 1) return false; - break; - case pftPositive: - if (edge.WindCnt != 1) return false; - break; - default: //pftNegative - if (edge.WindCnt != -1) return false; - } - - switch(m_ClipType) - { - case ctIntersection: - switch(pft2) - { - case pftEvenOdd: - case pftNonZero: - return (edge.WindCnt2 != 0); - case pftPositive: - return (edge.WindCnt2 > 0); - default: - return (edge.WindCnt2 < 0); - } - break; - case ctUnion: - switch(pft2) - { - case pftEvenOdd: - case pftNonZero: - return (edge.WindCnt2 == 0); - case pftPositive: - return (edge.WindCnt2 <= 0); - default: - return (edge.WindCnt2 >= 0); - } - break; - case ctDifference: - if (edge.PolyTyp == ptSubject) - switch(pft2) - { - case pftEvenOdd: - case pftNonZero: - return (edge.WindCnt2 == 0); - case pftPositive: - return (edge.WindCnt2 <= 0); - default: - return (edge.WindCnt2 >= 0); - } - else - switch(pft2) - { - case pftEvenOdd: - case pftNonZero: - return (edge.WindCnt2 != 0); - case pftPositive: - return (edge.WindCnt2 > 0); - default: - return (edge.WindCnt2 < 0); - } - break; - case ctXor: - if (edge.WindDelta == 0) //XOr always contributing unless open - switch(pft2) - { - case pftEvenOdd: - case pftNonZero: - return (edge.WindCnt2 == 0); - case pftPositive: - return (edge.WindCnt2 <= 0); - default: - return (edge.WindCnt2 >= 0); - } - else - return true; - break; - default: - return true; - } -} -//------------------------------------------------------------------------------ - -OutPt* Clipper::AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &Pt) -{ - OutPt* result; - TEdge *e, *prevE; - if (IsHorizontal(*e2) || ( e1->Dx > e2->Dx )) - { - result = AddOutPt(e1, Pt); - e2->OutIdx = e1->OutIdx; - e1->Side = esLeft; - e2->Side = esRight; - e = e1; - if (e->PrevInAEL == e2) - prevE = e2->PrevInAEL; - else - prevE = e->PrevInAEL; - } else - { - result = AddOutPt(e2, Pt); - e1->OutIdx = e2->OutIdx; - e1->Side = esRight; - e2->Side = esLeft; - e = e2; - if (e->PrevInAEL == e1) - prevE = e1->PrevInAEL; - else - prevE = e->PrevInAEL; - } - - if (prevE && prevE->OutIdx >= 0 && - (TopX(*prevE, Pt.Y) == TopX(*e, Pt.Y)) && - SlopesEqual(*e, *prevE, m_UseFullRange) && - (e->WindDelta != 0) && (prevE->WindDelta != 0)) - { - OutPt* outPt = AddOutPt(prevE, Pt); - AddJoin(result, outPt, e->Top); - } - return result; -} -//------------------------------------------------------------------------------ - -void Clipper::AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &Pt) -{ - AddOutPt( e1, Pt ); - if( e1->OutIdx == e2->OutIdx ) - { - e1->OutIdx = Unassigned; - e2->OutIdx = Unassigned; - } - else if (e1->OutIdx < e2->OutIdx) - AppendPolygon(e1, e2); - else - AppendPolygon(e2, e1); -} -//------------------------------------------------------------------------------ - -void Clipper::AddEdgeToSEL(TEdge *edge) -{ - //SEL pointers in PEdge are reused to build a list of horizontal edges. - //However, we don't need to worry about order with horizontal edge processing. - if( !m_SortedEdges ) - { - m_SortedEdges = edge; - edge->PrevInSEL = 0; - edge->NextInSEL = 0; - } - else - { - edge->NextInSEL = m_SortedEdges; - edge->PrevInSEL = 0; - m_SortedEdges->PrevInSEL = edge; - m_SortedEdges = edge; - } -} -//------------------------------------------------------------------------------ - -void Clipper::CopyAELToSEL() -{ - TEdge* e = m_ActiveEdges; - m_SortedEdges = e; - while ( e ) - { - e->PrevInSEL = e->PrevInAEL; - e->NextInSEL = e->NextInAEL; - e = e->NextInAEL; - } -} -//------------------------------------------------------------------------------ - -void Clipper::AddJoin(OutPt *op1, OutPt *op2, const IntPoint OffPt) -{ - Join* j = new Join; - j->OutPt1 = op1; - j->OutPt2 = op2; - j->OffPt = OffPt; - m_Joins.push_back(j); -} -//------------------------------------------------------------------------------ - -void Clipper::ClearJoins() -{ - for (JoinList::size_type i = 0; i < m_Joins.size(); i++) - delete m_Joins[i]; - m_Joins.resize(0); -} -//------------------------------------------------------------------------------ - -void Clipper::ClearGhostJoins() -{ - for (JoinList::size_type i = 0; i < m_GhostJoins.size(); i++) - delete m_GhostJoins[i]; - m_GhostJoins.resize(0); -} -//------------------------------------------------------------------------------ - -void Clipper::AddGhostJoin(OutPt *op, const IntPoint OffPt) -{ - Join* j = new Join; - j->OutPt1 = op; - j->OutPt2 = 0; - j->OffPt = OffPt; - m_GhostJoins.push_back(j); -} -//------------------------------------------------------------------------------ - -void Clipper::InsertLocalMinimaIntoAEL(const cInt botY) -{ - while( m_CurrentLM && ( m_CurrentLM->Y == botY ) ) - { - TEdge* lb = m_CurrentLM->LeftBound; - TEdge* rb = m_CurrentLM->RightBound; - PopLocalMinima(); - OutPt *Op1 = 0; - if (!lb) - { - //nb: don't insert LB into either AEL or SEL - InsertEdgeIntoAEL(rb, 0); - SetWindingCount(*rb); - if (IsContributing(*rb)) - Op1 = AddOutPt(rb, rb->Bot); - } - else - { - InsertEdgeIntoAEL(lb, 0); - InsertEdgeIntoAEL(rb, lb); - SetWindingCount( *lb ); - rb->WindCnt = lb->WindCnt; - rb->WindCnt2 = lb->WindCnt2; - if (IsContributing(*lb)) - Op1 = AddLocalMinPoly(lb, rb, lb->Bot); - InsertScanbeam(lb->Top.Y); - } - - if(IsHorizontal(*rb)) - AddEdgeToSEL(rb); - else - InsertScanbeam( rb->Top.Y ); - - if (!lb) continue; - - //if any output polygons share an edge, they'll need joining later ... - if (Op1 && IsHorizontal(*rb) && - m_GhostJoins.size() > 0 && (rb->WindDelta != 0)) - { - for (JoinList::size_type i = 0; i < m_GhostJoins.size(); ++i) - { - Join* jr = m_GhostJoins[i]; - //if the horizontal Rb and a 'ghost' horizontal overlap, then convert - //the 'ghost' join to a real join ready for later ... - if (HorzSegmentsOverlap(jr->OutPt1->Pt, jr->OffPt, rb->Bot, rb->Top)) - AddJoin(jr->OutPt1, Op1, jr->OffPt); - } - } - - if (lb->OutIdx >= 0 && lb->PrevInAEL && - lb->PrevInAEL->Curr.X == lb->Bot.X && - lb->PrevInAEL->OutIdx >= 0 && - SlopesEqual(*lb->PrevInAEL, *lb, m_UseFullRange) && - (lb->WindDelta != 0) && (lb->PrevInAEL->WindDelta != 0)) - { - OutPt *Op2 = AddOutPt(lb->PrevInAEL, lb->Bot); - AddJoin(Op1, Op2, lb->Top); - } - - if(lb->NextInAEL != rb) - { - - if (rb->OutIdx >= 0 && rb->PrevInAEL->OutIdx >= 0 && - SlopesEqual(*rb->PrevInAEL, *rb, m_UseFullRange) && - (rb->WindDelta != 0) && (rb->PrevInAEL->WindDelta != 0)) - { - OutPt *Op2 = AddOutPt(rb->PrevInAEL, rb->Bot); - AddJoin(Op1, Op2, rb->Top); - } - - TEdge* e = lb->NextInAEL; - if (e) - { - while( e != rb ) - { - //nb: For calculating winding counts etc, IntersectEdges() assumes - //that param1 will be to the Right of param2 ABOVE the intersection ... - IntersectEdges(rb , e , lb->Curr); //order important here - e = e->NextInAEL; - } - } - } - - } -} -//------------------------------------------------------------------------------ - -void Clipper::DeleteFromAEL(TEdge *e) -{ - TEdge* AelPrev = e->PrevInAEL; - TEdge* AelNext = e->NextInAEL; - if( !AelPrev && !AelNext && (e != m_ActiveEdges) ) return; //already deleted - if( AelPrev ) AelPrev->NextInAEL = AelNext; - else m_ActiveEdges = AelNext; - if( AelNext ) AelNext->PrevInAEL = AelPrev; - e->NextInAEL = 0; - e->PrevInAEL = 0; -} -//------------------------------------------------------------------------------ - -void Clipper::DeleteFromSEL(TEdge *e) -{ - TEdge* SelPrev = e->PrevInSEL; - TEdge* SelNext = e->NextInSEL; - if( !SelPrev && !SelNext && (e != m_SortedEdges) ) return; //already deleted - if( SelPrev ) SelPrev->NextInSEL = SelNext; - else m_SortedEdges = SelNext; - if( SelNext ) SelNext->PrevInSEL = SelPrev; - e->NextInSEL = 0; - e->PrevInSEL = 0; -} -//------------------------------------------------------------------------------ - -#ifdef use_xyz - -void Clipper::SetZ(IntPoint& pt, TEdge& e) -{ - pt.Z = 0; - if (m_ZFill) - { - //put the 'preferred' point as first parameter ... - if (e.OutIdx < 0) - (*m_ZFill)(e.Bot, e.Top, pt); //outside a path so presume entering - else - (*m_ZFill)(e.Top, e.Bot, pt); //inside a path so presume exiting - } -} -//------------------------------------------------------------------------------ -#endif - -void Clipper::IntersectEdges(TEdge *e1, TEdge *e2, - const IntPoint &Pt, bool protect) -{ - //e1 will be to the Left of e2 BELOW the intersection. Therefore e1 is before - //e2 in AEL except when e1 is being inserted at the intersection point ... - bool e1stops = !protect && !e1->NextInLML && - e1->Top.X == Pt.X && e1->Top.Y == Pt.Y; - bool e2stops = !protect && !e2->NextInLML && - e2->Top.X == Pt.X && e2->Top.Y == Pt.Y; - bool e1Contributing = ( e1->OutIdx >= 0 ); - bool e2Contributing = ( e2->OutIdx >= 0 ); - -#ifdef use_lines - //if either edge is on an OPEN path ... - if (e1->WindDelta == 0 || e2->WindDelta == 0) - { - //ignore subject-subject open path intersections UNLESS they - //are both open paths, AND they are both 'contributing maximas' ... - if (e1->WindDelta == 0 && e2->WindDelta == 0) - { - if ((e1stops || e2stops) && e1Contributing && e2Contributing) - AddLocalMaxPoly(e1, e2, Pt); - } - - //if intersecting a subj line with a subj poly ... - else if (e1->PolyTyp == e2->PolyTyp && - e1->WindDelta != e2->WindDelta && m_ClipType == ctUnion) - { - if (e1->WindDelta == 0) - { - if (e2Contributing) - { - AddOutPt(e1, Pt); - if (e1Contributing) e1->OutIdx = Unassigned; - } - } - else - { - if (e1Contributing) - { - AddOutPt(e2, Pt); - if (e2Contributing) e2->OutIdx = Unassigned; - } - } - } - else if (e1->PolyTyp != e2->PolyTyp) - { - //toggle subj open path OutIdx on/off when Abs(clip.WndCnt) == 1 ... - if ((e1->WindDelta == 0) && std::abs(e2->WindCnt) == 1 && - (m_ClipType != ctUnion || e2->WindCnt2 == 0)) - { - AddOutPt(e1, Pt); - if (e1Contributing) e1->OutIdx = Unassigned; - } - else if ((e2->WindDelta == 0) && (std::abs(e1->WindCnt) == 1) && - (m_ClipType != ctUnion || e1->WindCnt2 == 0)) - { - AddOutPt(e2, Pt); - if (e2Contributing) e2->OutIdx = Unassigned; - } - } - - if (e1stops) - if (e1->OutIdx < 0) DeleteFromAEL(e1); - else throw clipperException("Error intersecting polylines"); - if (e2stops) - if (e2->OutIdx < 0) DeleteFromAEL(e2); - else throw clipperException("Error intersecting polylines"); - return; - } -#endif - - //update winding counts... - //assumes that e1 will be to the Right of e2 ABOVE the intersection - if ( e1->PolyTyp == e2->PolyTyp ) - { - if ( IsEvenOddFillType( *e1) ) - { - int oldE1WindCnt = e1->WindCnt; - e1->WindCnt = e2->WindCnt; - e2->WindCnt = oldE1WindCnt; - } else - { - if (e1->WindCnt + e2->WindDelta == 0 ) e1->WindCnt = -e1->WindCnt; - else e1->WindCnt += e2->WindDelta; - if ( e2->WindCnt - e1->WindDelta == 0 ) e2->WindCnt = -e2->WindCnt; - else e2->WindCnt -= e1->WindDelta; - } - } else - { - if (!IsEvenOddFillType(*e2)) e1->WindCnt2 += e2->WindDelta; - else e1->WindCnt2 = ( e1->WindCnt2 == 0 ) ? 1 : 0; - if (!IsEvenOddFillType(*e1)) e2->WindCnt2 -= e1->WindDelta; - else e2->WindCnt2 = ( e2->WindCnt2 == 0 ) ? 1 : 0; - } - - PolyFillType e1FillType, e2FillType, e1FillType2, e2FillType2; - if (e1->PolyTyp == ptSubject) - { - e1FillType = m_SubjFillType; - e1FillType2 = m_ClipFillType; - } else - { - e1FillType = m_ClipFillType; - e1FillType2 = m_SubjFillType; - } - if (e2->PolyTyp == ptSubject) - { - e2FillType = m_SubjFillType; - e2FillType2 = m_ClipFillType; - } else - { - e2FillType = m_ClipFillType; - e2FillType2 = m_SubjFillType; - } - - cInt e1Wc, e2Wc; - switch (e1FillType) - { - case pftPositive: e1Wc = e1->WindCnt; break; - case pftNegative: e1Wc = -e1->WindCnt; break; - default: e1Wc = Abs(e1->WindCnt); - } - switch(e2FillType) - { - case pftPositive: e2Wc = e2->WindCnt; break; - case pftNegative: e2Wc = -e2->WindCnt; break; - default: e2Wc = Abs(e2->WindCnt); - } - - if ( e1Contributing && e2Contributing ) - { - if ( e1stops || e2stops || - (e1Wc != 0 && e1Wc != 1) || (e2Wc != 0 && e2Wc != 1) || - (e1->PolyTyp != e2->PolyTyp && m_ClipType != ctXor) ) - AddLocalMaxPoly(e1, e2, Pt); - else - { - AddOutPt(e1, Pt); - AddOutPt(e2, Pt); - SwapSides( *e1 , *e2 ); - SwapPolyIndexes( *e1 , *e2 ); - } - } - else if ( e1Contributing ) - { - if (e2Wc == 0 || e2Wc == 1) - { - AddOutPt(e1, Pt); - SwapSides(*e1, *e2); - SwapPolyIndexes(*e1, *e2); - } - } - else if ( e2Contributing ) - { - if (e1Wc == 0 || e1Wc == 1) - { - AddOutPt(e2, Pt); - SwapSides(*e1, *e2); - SwapPolyIndexes(*e1, *e2); - } - } - else if ( (e1Wc == 0 || e1Wc == 1) && - (e2Wc == 0 || e2Wc == 1) && !e1stops && !e2stops ) - { - //neither edge is currently contributing ... - - cInt e1Wc2, e2Wc2; - switch (e1FillType2) - { - case pftPositive: e1Wc2 = e1->WindCnt2; break; - case pftNegative : e1Wc2 = -e1->WindCnt2; break; - default: e1Wc2 = Abs(e1->WindCnt2); - } - switch (e2FillType2) - { - case pftPositive: e2Wc2 = e2->WindCnt2; break; - case pftNegative: e2Wc2 = -e2->WindCnt2; break; - default: e2Wc2 = Abs(e2->WindCnt2); - } - - if (e1->PolyTyp != e2->PolyTyp) - AddLocalMinPoly(e1, e2, Pt); - else if (e1Wc == 1 && e2Wc == 1) - switch( m_ClipType ) { - case ctIntersection: - if (e1Wc2 > 0 && e2Wc2 > 0) - AddLocalMinPoly(e1, e2, Pt); - break; - case ctUnion: - if ( e1Wc2 <= 0 && e2Wc2 <= 0 ) - AddLocalMinPoly(e1, e2, Pt); - break; - case ctDifference: - if (((e1->PolyTyp == ptClip) && (e1Wc2 > 0) && (e2Wc2 > 0)) || - ((e1->PolyTyp == ptSubject) && (e1Wc2 <= 0) && (e2Wc2 <= 0))) - AddLocalMinPoly(e1, e2, Pt); - break; - case ctXor: - AddLocalMinPoly(e1, e2, Pt); - } - else - SwapSides( *e1, *e2 ); - } - - if( (e1stops != e2stops) && - ( (e1stops && (e1->OutIdx >= 0)) || (e2stops && (e2->OutIdx >= 0)) ) ) - { - SwapSides( *e1, *e2 ); - SwapPolyIndexes( *e1, *e2 ); - } - - //finally, delete any non-contributing maxima edges ... - if( e1stops ) DeleteFromAEL( e1 ); - if( e2stops ) DeleteFromAEL( e2 ); -} -//------------------------------------------------------------------------------ - -void Clipper::SetHoleState(TEdge *e, OutRec *outrec) -{ - bool IsHole = false; - TEdge *e2 = e->PrevInAEL; - while (e2) - { - if (e2->OutIdx >= 0 && e2->WindDelta != 0) - { - IsHole = !IsHole; - if (! outrec->FirstLeft) - outrec->FirstLeft = m_PolyOuts[e2->OutIdx]; - } - e2 = e2->PrevInAEL; - } - if (IsHole) outrec->IsHole = true; -} -//------------------------------------------------------------------------------ - -OutRec* GetLowermostRec(OutRec *outRec1, OutRec *outRec2) -{ - //work out which polygon fragment has the correct hole state ... - if (!outRec1->BottomPt) - outRec1->BottomPt = GetBottomPt(outRec1->Pts); - if (!outRec2->BottomPt) - outRec2->BottomPt = GetBottomPt(outRec2->Pts); - OutPt *OutPt1 = outRec1->BottomPt; - OutPt *OutPt2 = outRec2->BottomPt; - if (OutPt1->Pt.Y > OutPt2->Pt.Y) return outRec1; - else if (OutPt1->Pt.Y < OutPt2->Pt.Y) return outRec2; - else if (OutPt1->Pt.X < OutPt2->Pt.X) return outRec1; - else if (OutPt1->Pt.X > OutPt2->Pt.X) return outRec2; - else if (OutPt1->Next == OutPt1) return outRec2; - else if (OutPt2->Next == OutPt2) return outRec1; - else if (FirstIsBottomPt(OutPt1, OutPt2)) return outRec1; - else return outRec2; -} -//------------------------------------------------------------------------------ - -bool Param1RightOfParam2(OutRec* outRec1, OutRec* outRec2) -{ - do - { - outRec1 = outRec1->FirstLeft; - if (outRec1 == outRec2) return true; - } while (outRec1); - return false; -} -//------------------------------------------------------------------------------ - -OutRec* Clipper::GetOutRec(int Idx) -{ - OutRec* outrec = m_PolyOuts[Idx]; - while (outrec != m_PolyOuts[outrec->Idx]) - outrec = m_PolyOuts[outrec->Idx]; - return outrec; -} -//------------------------------------------------------------------------------ - -void Clipper::AppendPolygon(TEdge *e1, TEdge *e2) -{ - //get the start and ends of both output polygons ... - OutRec *outRec1 = m_PolyOuts[e1->OutIdx]; - OutRec *outRec2 = m_PolyOuts[e2->OutIdx]; - - OutRec *holeStateRec; - if (Param1RightOfParam2(outRec1, outRec2)) - holeStateRec = outRec2; - else if (Param1RightOfParam2(outRec2, outRec1)) - holeStateRec = outRec1; - else - holeStateRec = GetLowermostRec(outRec1, outRec2); - - //get the start and ends of both output polygons and - //join e2 poly onto e1 poly and delete pointers to e2 ... - - OutPt* p1_lft = outRec1->Pts; - OutPt* p1_rt = p1_lft->Prev; - OutPt* p2_lft = outRec2->Pts; - OutPt* p2_rt = p2_lft->Prev; - - EdgeSide Side; - //join e2 poly onto e1 poly and delete pointers to e2 ... - if( e1->Side == esLeft ) - { - if( e2->Side == esLeft ) - { - //z y x a b c - ReversePolyPtLinks(p2_lft); - p2_lft->Next = p1_lft; - p1_lft->Prev = p2_lft; - p1_rt->Next = p2_rt; - p2_rt->Prev = p1_rt; - outRec1->Pts = p2_rt; - } else - { - //x y z a b c - p2_rt->Next = p1_lft; - p1_lft->Prev = p2_rt; - p2_lft->Prev = p1_rt; - p1_rt->Next = p2_lft; - outRec1->Pts = p2_lft; - } - Side = esLeft; - } else - { - if( e2->Side == esRight ) - { - //a b c z y x - ReversePolyPtLinks(p2_lft); - p1_rt->Next = p2_rt; - p2_rt->Prev = p1_rt; - p2_lft->Next = p1_lft; - p1_lft->Prev = p2_lft; - } else - { - //a b c x y z - p1_rt->Next = p2_lft; - p2_lft->Prev = p1_rt; - p1_lft->Prev = p2_rt; - p2_rt->Next = p1_lft; - } - Side = esRight; - } - - outRec1->BottomPt = 0; - if (holeStateRec == outRec2) - { - if (outRec2->FirstLeft != outRec1) - outRec1->FirstLeft = outRec2->FirstLeft; - outRec1->IsHole = outRec2->IsHole; - } - outRec2->Pts = 0; - outRec2->BottomPt = 0; - outRec2->FirstLeft = outRec1; - - int OKIdx = e1->OutIdx; - int ObsoleteIdx = e2->OutIdx; - - e1->OutIdx = Unassigned; //nb: safe because we only get here via AddLocalMaxPoly - e2->OutIdx = Unassigned; - - TEdge* e = m_ActiveEdges; - while( e ) - { - if( e->OutIdx == ObsoleteIdx ) - { - e->OutIdx = OKIdx; - e->Side = Side; - break; - } - e = e->NextInAEL; - } - - outRec2->Idx = outRec1->Idx; -} -//------------------------------------------------------------------------------ - -OutRec* Clipper::CreateOutRec() -{ - OutRec* result = new OutRec; - result->IsHole = false; - result->IsOpen = false; - result->FirstLeft = 0; - result->Pts = 0; - result->BottomPt = 0; - result->PolyNd = 0; - m_PolyOuts.push_back(result); - result->Idx = (int)m_PolyOuts.size()-1; - return result; -} -//------------------------------------------------------------------------------ - -OutPt* Clipper::AddOutPt(TEdge *e, const IntPoint &pt) -{ - bool ToFront = (e->Side == esLeft); - if( e->OutIdx < 0 ) - { - OutRec *outRec = CreateOutRec(); - outRec->IsOpen = (e->WindDelta == 0); - OutPt* newOp = new OutPt; - outRec->Pts = newOp; - newOp->Idx = outRec->Idx; - newOp->Pt = pt; - newOp->Next = newOp; - newOp->Prev = newOp; - if (!outRec->IsOpen) - SetHoleState(e, outRec); -#ifdef use_xyz - if (pt == e->Bot) newOp->Pt = e->Bot; - else if (pt == e->Top) newOp->Pt = e->Top; - else SetZ(newOp->Pt, *e); -#endif - e->OutIdx = outRec->Idx; //nb: do this after SetZ ! - return newOp; - } else - { - OutRec *outRec = m_PolyOuts[e->OutIdx]; - //OutRec.Pts is the 'Left-most' point & OutRec.Pts.Prev is the 'Right-most' - OutPt* op = outRec->Pts; - - if (ToFront && (pt == op->Pt)) return op; - else if (!ToFront && (pt == op->Prev->Pt)) return op->Prev; - - OutPt* newOp = new OutPt; - newOp->Idx = outRec->Idx; - newOp->Pt = pt; - newOp->Next = op; - newOp->Prev = op->Prev; - newOp->Prev->Next = newOp; - op->Prev = newOp; - if (ToFront) outRec->Pts = newOp; -#ifdef use_xyz - if (pt == e->Bot) newOp->Pt = e->Bot; - else if (pt == e->Top) newOp->Pt = e->Top; - else SetZ(newOp->Pt, *e); -#endif - return newOp; - } -} -//------------------------------------------------------------------------------ - -void Clipper::ProcessHorizontals(bool IsTopOfScanbeam) -{ - TEdge* horzEdge = m_SortedEdges; - while(horzEdge) - { - DeleteFromSEL(horzEdge); - ProcessHorizontal(horzEdge, IsTopOfScanbeam); - horzEdge = m_SortedEdges; - } -} -//------------------------------------------------------------------------------ - -inline bool IsMinima(TEdge *e) -{ - return e && (e->Prev->NextInLML != e) && (e->Next->NextInLML != e); -} -//------------------------------------------------------------------------------ - -inline bool IsMaxima(TEdge *e, const cInt Y) -{ - return e && e->Top.Y == Y && !e->NextInLML; -} -//------------------------------------------------------------------------------ - -inline bool IsIntermediate(TEdge *e, const cInt Y) -{ - return e->Top.Y == Y && e->NextInLML; -} -//------------------------------------------------------------------------------ - -TEdge *GetMaximaPair(TEdge *e) -{ - TEdge* result = 0; - if ((e->Next->Top == e->Top) && !e->Next->NextInLML) - result = e->Next; - else if ((e->Prev->Top == e->Top) && !e->Prev->NextInLML) - result = e->Prev; - - if (result && (result->OutIdx == Skip || - //result is false if both NextInAEL & PrevInAEL are nil & not horizontal ... - (result->NextInAEL == result->PrevInAEL && !IsHorizontal(*result)))) - return 0; - return result; -} -//------------------------------------------------------------------------------ - -void Clipper::SwapPositionsInAEL(TEdge *Edge1, TEdge *Edge2) -{ - //check that one or other edge hasn't already been removed from AEL ... - if (Edge1->NextInAEL == Edge1->PrevInAEL || - Edge2->NextInAEL == Edge2->PrevInAEL) return; - - if( Edge1->NextInAEL == Edge2 ) - { - TEdge* Next = Edge2->NextInAEL; - if( Next ) Next->PrevInAEL = Edge1; - TEdge* Prev = Edge1->PrevInAEL; - if( Prev ) Prev->NextInAEL = Edge2; - Edge2->PrevInAEL = Prev; - Edge2->NextInAEL = Edge1; - Edge1->PrevInAEL = Edge2; - Edge1->NextInAEL = Next; - } - else if( Edge2->NextInAEL == Edge1 ) - { - TEdge* Next = Edge1->NextInAEL; - if( Next ) Next->PrevInAEL = Edge2; - TEdge* Prev = Edge2->PrevInAEL; - if( Prev ) Prev->NextInAEL = Edge1; - Edge1->PrevInAEL = Prev; - Edge1->NextInAEL = Edge2; - Edge2->PrevInAEL = Edge1; - Edge2->NextInAEL = Next; - } - else - { - TEdge* Next = Edge1->NextInAEL; - TEdge* Prev = Edge1->PrevInAEL; - Edge1->NextInAEL = Edge2->NextInAEL; - if( Edge1->NextInAEL ) Edge1->NextInAEL->PrevInAEL = Edge1; - Edge1->PrevInAEL = Edge2->PrevInAEL; - if( Edge1->PrevInAEL ) Edge1->PrevInAEL->NextInAEL = Edge1; - Edge2->NextInAEL = Next; - if( Edge2->NextInAEL ) Edge2->NextInAEL->PrevInAEL = Edge2; - Edge2->PrevInAEL = Prev; - if( Edge2->PrevInAEL ) Edge2->PrevInAEL->NextInAEL = Edge2; - } - - if( !Edge1->PrevInAEL ) m_ActiveEdges = Edge1; - else if( !Edge2->PrevInAEL ) m_ActiveEdges = Edge2; -} -//------------------------------------------------------------------------------ - -void Clipper::SwapPositionsInSEL(TEdge *Edge1, TEdge *Edge2) -{ - if( !( Edge1->NextInSEL ) && !( Edge1->PrevInSEL ) ) return; - if( !( Edge2->NextInSEL ) && !( Edge2->PrevInSEL ) ) return; - - if( Edge1->NextInSEL == Edge2 ) - { - TEdge* Next = Edge2->NextInSEL; - if( Next ) Next->PrevInSEL = Edge1; - TEdge* Prev = Edge1->PrevInSEL; - if( Prev ) Prev->NextInSEL = Edge2; - Edge2->PrevInSEL = Prev; - Edge2->NextInSEL = Edge1; - Edge1->PrevInSEL = Edge2; - Edge1->NextInSEL = Next; - } - else if( Edge2->NextInSEL == Edge1 ) - { - TEdge* Next = Edge1->NextInSEL; - if( Next ) Next->PrevInSEL = Edge2; - TEdge* Prev = Edge2->PrevInSEL; - if( Prev ) Prev->NextInSEL = Edge1; - Edge1->PrevInSEL = Prev; - Edge1->NextInSEL = Edge2; - Edge2->PrevInSEL = Edge1; - Edge2->NextInSEL = Next; - } - else - { - TEdge* Next = Edge1->NextInSEL; - TEdge* Prev = Edge1->PrevInSEL; - Edge1->NextInSEL = Edge2->NextInSEL; - if( Edge1->NextInSEL ) Edge1->NextInSEL->PrevInSEL = Edge1; - Edge1->PrevInSEL = Edge2->PrevInSEL; - if( Edge1->PrevInSEL ) Edge1->PrevInSEL->NextInSEL = Edge1; - Edge2->NextInSEL = Next; - if( Edge2->NextInSEL ) Edge2->NextInSEL->PrevInSEL = Edge2; - Edge2->PrevInSEL = Prev; - if( Edge2->PrevInSEL ) Edge2->PrevInSEL->NextInSEL = Edge2; - } - - if( !Edge1->PrevInSEL ) m_SortedEdges = Edge1; - else if( !Edge2->PrevInSEL ) m_SortedEdges = Edge2; -} -//------------------------------------------------------------------------------ - -TEdge* GetNextInAEL(TEdge *e, Direction dir) -{ - return dir == dLeftToRight ? e->NextInAEL : e->PrevInAEL; -} -//------------------------------------------------------------------------------ - -void GetHorzDirection(TEdge& HorzEdge, Direction& Dir, cInt& Left, cInt& Right) -{ - if (HorzEdge.Bot.X < HorzEdge.Top.X) - { - Left = HorzEdge.Bot.X; - Right = HorzEdge.Top.X; - Dir = dLeftToRight; - } else - { - Left = HorzEdge.Top.X; - Right = HorzEdge.Bot.X; - Dir = dRightToLeft; - } -} -//------------------------------------------------------------------------ - -void Clipper::PrepareHorzJoins(TEdge* horzEdge, bool isTopOfScanbeam) -{ - //get the last Op for this horizontal edge - //the point may be anywhere along the horizontal ... - OutPt* outPt = m_PolyOuts[horzEdge->OutIdx]->Pts; - if (horzEdge->Side != esLeft) outPt = outPt->Prev; - - //First, match up overlapping horizontal edges (eg when one polygon's - //intermediate horz edge overlaps an intermediate horz edge of another, or - //when one polygon sits on top of another) ... - for (JoinList::size_type i = 0; i < m_GhostJoins.size(); ++i) - { - Join* j = m_GhostJoins[i]; - if (HorzSegmentsOverlap(j->OutPt1->Pt, j->OffPt, horzEdge->Bot, horzEdge->Top)) - AddJoin(j->OutPt1, outPt, j->OffPt); - } - //Also, since horizontal edges at the top of one SB are often removed from - //the AEL before we process the horizontal edges at the bottom of the next, - //we need to create 'ghost' Join records of 'contrubuting' horizontals that - //we can compare with horizontals at the bottom of the next SB. - if (isTopOfScanbeam) - { - if (outPt->Pt == horzEdge->Top) - { - AddGhostJoin(outPt, horzEdge->Bot); - } - else - { - AddGhostJoin(outPt, horzEdge->Top); - } - } -} -//------------------------------------------------------------------------------ - -/******************************************************************************* -* Notes: Horizontal edges (HEs) at scanline intersections (ie at the Top or * -* Bottom of a scanbeam) are processed as if layered. The order in which HEs * -* are processed doesn't matter. HEs intersect with other HE Bot.Xs only [#] * -* (or they could intersect with Top.Xs only, ie EITHER Bot.Xs OR Top.Xs), * -* and with other non-horizontal edges [*]. Once these intersections are * -* processed, intermediate HEs then 'promote' the Edge above (NextInLML) into * -* the AEL. These 'promoted' edges may in turn intersect [%] with other HEs. * -*******************************************************************************/ - -void Clipper::ProcessHorizontal(TEdge *horzEdge, bool isTopOfScanbeam) -{ - Direction dir; - cInt horzLeft, horzRight; - - GetHorzDirection(*horzEdge, dir, horzLeft, horzRight); - - TEdge* eLastHorz = horzEdge, *eMaxPair = 0; - while (eLastHorz->NextInLML && IsHorizontal(*eLastHorz->NextInLML)) - eLastHorz = eLastHorz->NextInLML; - if (!eLastHorz->NextInLML) - eMaxPair = GetMaximaPair(eLastHorz); - - for (;;) - { - bool IsLastHorz = (horzEdge == eLastHorz); - TEdge* e = GetNextInAEL(horzEdge, dir); - while(e) - { - //Break if we've got to the end of an intermediate horizontal edge ... - //nb: Smaller Dx's are to the right of larger Dx's ABOVE the horizontal. - if (e->Curr.X == horzEdge->Top.X && horzEdge->NextInLML && - e->Dx < horzEdge->NextInLML->Dx) break; - - TEdge* eNext = GetNextInAEL(e, dir); //saves eNext for later - - if ((dir == dLeftToRight && e->Curr.X <= horzRight) || - (dir == dRightToLeft && e->Curr.X >= horzLeft)) - { - //so far we're still in range of the horizontal Edge but make sure - //we're at the last of consec. horizontals when matching with eMaxPair - if(e == eMaxPair && IsLastHorz) - { - if (horzEdge->OutIdx >= 0 && horzEdge->WindDelta != 0) - PrepareHorzJoins(horzEdge, isTopOfScanbeam); - if (dir == dLeftToRight) - IntersectEdges(horzEdge, e, e->Top); - else - IntersectEdges(e, horzEdge, e->Top); - if (eMaxPair->OutIdx >= 0) throw clipperException("ProcessHorizontal error"); - return; - } - else if(dir == dLeftToRight) - { - IntPoint Pt = IntPoint(e->Curr.X, horzEdge->Curr.Y); - IntersectEdges(horzEdge, e, Pt, true); - } - else - { - IntPoint Pt = IntPoint(e->Curr.X, horzEdge->Curr.Y); - IntersectEdges( e, horzEdge, Pt, true); - } - SwapPositionsInAEL( horzEdge, e ); - } - else if( (dir == dLeftToRight && e->Curr.X >= horzRight) || - (dir == dRightToLeft && e->Curr.X <= horzLeft) ) break; - e = eNext; - } //end while - - if (horzEdge->OutIdx >= 0 && horzEdge->WindDelta != 0) - PrepareHorzJoins(horzEdge, isTopOfScanbeam); - - if (horzEdge->NextInLML && IsHorizontal(*horzEdge->NextInLML)) - { - UpdateEdgeIntoAEL(horzEdge); - if (horzEdge->OutIdx >= 0) AddOutPt(horzEdge, horzEdge->Bot); - GetHorzDirection(*horzEdge, dir, horzLeft, horzRight); - } else - break; - } //end for (;;) - - if(horzEdge->NextInLML) - { - if(horzEdge->OutIdx >= 0) - { - OutPt* op1 = AddOutPt( horzEdge, horzEdge->Top); - UpdateEdgeIntoAEL(horzEdge); - if (horzEdge->WindDelta == 0) return; - //nb: HorzEdge is no longer horizontal here - TEdge* ePrev = horzEdge->PrevInAEL; - TEdge* eNext = horzEdge->NextInAEL; - if (ePrev && ePrev->Curr.X == horzEdge->Bot.X && - ePrev->Curr.Y == horzEdge->Bot.Y && ePrev->WindDelta != 0 && - (ePrev->OutIdx >= 0 && ePrev->Curr.Y > ePrev->Top.Y && - SlopesEqual(*horzEdge, *ePrev, m_UseFullRange))) - { - OutPt* op2 = AddOutPt(ePrev, horzEdge->Bot); - AddJoin(op1, op2, horzEdge->Top); - } - else if (eNext && eNext->Curr.X == horzEdge->Bot.X && - eNext->Curr.Y == horzEdge->Bot.Y && eNext->WindDelta != 0 && - eNext->OutIdx >= 0 && eNext->Curr.Y > eNext->Top.Y && - SlopesEqual(*horzEdge, *eNext, m_UseFullRange)) - { - OutPt* op2 = AddOutPt(eNext, horzEdge->Bot); - AddJoin(op1, op2, horzEdge->Top); - } - } - else - UpdateEdgeIntoAEL(horzEdge); - } - else if (eMaxPair) - { - if (eMaxPair->OutIdx >= 0) - { - if (dir == dLeftToRight) - IntersectEdges(horzEdge, eMaxPair, horzEdge->Top); - else - IntersectEdges(eMaxPair, horzEdge, horzEdge->Top); - if (eMaxPair->OutIdx >= 0) - throw clipperException("ProcessHorizontal error"); - } else - { - DeleteFromAEL(horzEdge); - DeleteFromAEL(eMaxPair); - } - } else - { - if (horzEdge->OutIdx >= 0) AddOutPt(horzEdge, horzEdge->Top); - DeleteFromAEL(horzEdge); - } -} -//------------------------------------------------------------------------------ - -void Clipper::UpdateEdgeIntoAEL(TEdge *&e) -{ - if( !e->NextInLML ) throw - clipperException("UpdateEdgeIntoAEL: invalid call"); - - e->NextInLML->OutIdx = e->OutIdx; - TEdge* AelPrev = e->PrevInAEL; - TEdge* AelNext = e->NextInAEL; - if (AelPrev) AelPrev->NextInAEL = e->NextInLML; - else m_ActiveEdges = e->NextInLML; - if (AelNext) AelNext->PrevInAEL = e->NextInLML; - e->NextInLML->Side = e->Side; - e->NextInLML->WindDelta = e->WindDelta; - e->NextInLML->WindCnt = e->WindCnt; - e->NextInLML->WindCnt2 = e->WindCnt2; - e = e->NextInLML; - e->Curr = e->Bot; - e->PrevInAEL = AelPrev; - e->NextInAEL = AelNext; - if (!IsHorizontal(*e)) InsertScanbeam(e->Top.Y); -} -//------------------------------------------------------------------------------ - -bool Clipper::ProcessIntersections(const cInt botY, const cInt topY) -{ - if( !m_ActiveEdges ) return true; - try { - BuildIntersectList(botY, topY); - if (!m_IntersectNodes) return true; - if (!m_IntersectNodes->Next || FixupIntersectionOrder()) ProcessIntersectList(); - else return false; - } - catch(...) - { - m_SortedEdges = 0; - DisposeIntersectNodes(); - throw clipperException("ProcessIntersections error"); - } - m_SortedEdges = 0; - return true; -} -//------------------------------------------------------------------------------ - -void Clipper::DisposeIntersectNodes() -{ - while ( m_IntersectNodes ) - { - IntersectNode* iNode = m_IntersectNodes->Next; - delete m_IntersectNodes; - m_IntersectNodes = iNode; - } -} -//------------------------------------------------------------------------------ - -void Clipper::BuildIntersectList(const cInt botY, const cInt topY) -{ - if ( !m_ActiveEdges ) return; - - //prepare for sorting ... - TEdge* e = m_ActiveEdges; - m_SortedEdges = e; - while( e ) - { - e->PrevInSEL = e->PrevInAEL; - e->NextInSEL = e->NextInAEL; - e->Curr.X = TopX( *e, topY ); - e = e->NextInAEL; - } - - //bubblesort ... - bool isModified; - do - { - isModified = false; - e = m_SortedEdges; - while( e->NextInSEL ) - { - TEdge *eNext = e->NextInSEL; - IntPoint Pt; - if(e->Curr.X > eNext->Curr.X) - { - if (!IntersectPoint(*e, *eNext, Pt, m_UseFullRange) && e->Curr.X > eNext->Curr.X +1) - throw clipperException("Intersection error"); - if (Pt.Y > botY) - { - Pt.Y = botY; - if (std::fabs(e->Dx) > std::fabs(eNext->Dx)) - Pt.X = TopX(*eNext, botY); else - Pt.X = TopX(*e, botY); - } - InsertIntersectNode( e, eNext, Pt ); - SwapPositionsInSEL(e, eNext); - isModified = true; - } - else - e = eNext; - } - if( e->PrevInSEL ) e->PrevInSEL->NextInSEL = 0; - else break; - } - while ( isModified ); - m_SortedEdges = 0; //important -} -//------------------------------------------------------------------------------ - -void Clipper::InsertIntersectNode(TEdge *e1, TEdge *e2, const IntPoint &Pt) -{ - IntersectNode* newNode = new IntersectNode; - newNode->Edge1 = e1; - newNode->Edge2 = e2; - newNode->Pt = Pt; - newNode->Next = 0; - if( !m_IntersectNodes ) m_IntersectNodes = newNode; - else if(newNode->Pt.Y > m_IntersectNodes->Pt.Y ) - { - newNode->Next = m_IntersectNodes; - m_IntersectNodes = newNode; - } - else - { - IntersectNode* iNode = m_IntersectNodes; - while(iNode->Next && newNode->Pt.Y <= iNode->Next->Pt.Y) - iNode = iNode->Next; - newNode->Next = iNode->Next; - iNode->Next = newNode; - } -} -//------------------------------------------------------------------------------ - -void Clipper::ProcessIntersectList() -{ - while( m_IntersectNodes ) - { - IntersectNode* iNode = m_IntersectNodes->Next; - { - IntersectEdges( m_IntersectNodes->Edge1 , - m_IntersectNodes->Edge2 , m_IntersectNodes->Pt, true); - SwapPositionsInAEL( m_IntersectNodes->Edge1 , m_IntersectNodes->Edge2 ); - } - delete m_IntersectNodes; - m_IntersectNodes = iNode; - } -} -//------------------------------------------------------------------------------ - -void Clipper::DoMaxima(TEdge *e) -{ - TEdge* eMaxPair = GetMaximaPair(e); - if (!eMaxPair) - { - if (e->OutIdx >= 0) - AddOutPt(e, e->Top); - DeleteFromAEL(e); - return; - } - - TEdge* eNext = e->NextInAEL; - while(eNext && eNext != eMaxPair) - { - IntersectEdges(e, eNext, e->Top, true); - SwapPositionsInAEL(e, eNext); - eNext = e->NextInAEL; - } - - if(e->OutIdx == Unassigned && eMaxPair->OutIdx == Unassigned) - { - DeleteFromAEL(e); - DeleteFromAEL(eMaxPair); - } - else if( e->OutIdx >= 0 && eMaxPair->OutIdx >= 0 ) - { - IntersectEdges( e, eMaxPair, e->Top); - } -#ifdef use_lines - else if (e->WindDelta == 0) - { - if (e->OutIdx >= 0) - { - AddOutPt(e, e->Top); - e->OutIdx = Unassigned; - } - DeleteFromAEL(e); - - if (eMaxPair->OutIdx >= 0) - { - AddOutPt(eMaxPair, e->Top); - eMaxPair->OutIdx = Unassigned; - } - DeleteFromAEL(eMaxPair); - } -#endif - else throw clipperException("DoMaxima error"); -} -//------------------------------------------------------------------------------ - -void Clipper::ProcessEdgesAtTopOfScanbeam(const cInt topY) -{ - TEdge* e = m_ActiveEdges; - while( e ) - { - //1. process maxima, treating them as if they're 'bent' horizontal edges, - // but exclude maxima with horizontal edges. nb: e can't be a horizontal. - bool IsMaximaEdge = IsMaxima(e, topY); - - if(IsMaximaEdge) - { - TEdge* eMaxPair = GetMaximaPair(e); - IsMaximaEdge = (!eMaxPair || !IsHorizontal(*eMaxPair)); - } - - if(IsMaximaEdge) - { - TEdge* ePrev = e->PrevInAEL; - DoMaxima(e); - if( !ePrev ) e = m_ActiveEdges; - else e = ePrev->NextInAEL; - } - else - { - //2. promote horizontal edges, otherwise update Curr.X and Curr.Y ... - if (IsIntermediate(e, topY) && IsHorizontal(*e->NextInLML)) - { - UpdateEdgeIntoAEL(e); - if (e->OutIdx >= 0) - AddOutPt(e, e->Bot); - AddEdgeToSEL(e); - } - else - { - e->Curr.X = TopX( *e, topY ); - e->Curr.Y = topY; - } - - if (m_StrictSimple) - { - TEdge* ePrev = e->PrevInAEL; - if ((e->OutIdx >= 0) && (e->WindDelta != 0) && ePrev && (ePrev->OutIdx >= 0) && - (ePrev->Curr.X == e->Curr.X) && (ePrev->WindDelta != 0)) - { - OutPt* op = AddOutPt(ePrev, e->Curr); - OutPt* op2 = AddOutPt(e, e->Curr); - AddJoin(op, op2, e->Curr); //StrictlySimple (type-3) join - } - } - - e = e->NextInAEL; - } - } - - //3. Process horizontals at the Top of the scanbeam ... - ProcessHorizontals(true); - - //4. Promote intermediate vertices ... - e = m_ActiveEdges; - while(e) - { - if(IsIntermediate(e, topY)) - { - OutPt* op = 0; - if( e->OutIdx >= 0 ) - op = AddOutPt(e, e->Top); - UpdateEdgeIntoAEL(e); - - //if output polygons share an edge, they'll need joining later ... - TEdge* ePrev = e->PrevInAEL; - TEdge* eNext = e->NextInAEL; - if (ePrev && ePrev->Curr.X == e->Bot.X && - ePrev->Curr.Y == e->Bot.Y && op && - ePrev->OutIdx >= 0 && ePrev->Curr.Y > ePrev->Top.Y && - SlopesEqual(*e, *ePrev, m_UseFullRange) && - (e->WindDelta != 0) && (ePrev->WindDelta != 0)) - { - OutPt* op2 = AddOutPt(ePrev, e->Bot); - AddJoin(op, op2, e->Top); - } - else if (eNext && eNext->Curr.X == e->Bot.X && - eNext->Curr.Y == e->Bot.Y && op && - eNext->OutIdx >= 0 && eNext->Curr.Y > eNext->Top.Y && - SlopesEqual(*e, *eNext, m_UseFullRange) && - (e->WindDelta != 0) && (eNext->WindDelta != 0)) - { - OutPt* op2 = AddOutPt(eNext, e->Bot); - AddJoin(op, op2, e->Top); - } - } - e = e->NextInAEL; - } -} -//------------------------------------------------------------------------------ - -void Clipper::FixupOutPolygon(OutRec &outrec) -{ - //FixupOutPolygon() - removes duplicate points and simplifies consecutive - //parallel edges by removing the middle vertex. - OutPt *lastOK = 0; - outrec.BottomPt = 0; - OutPt *pp = outrec.Pts; - - for (;;) - { - if (pp->Prev == pp || pp->Prev == pp->Next ) - { - DisposeOutPts(pp); - outrec.Pts = 0; - return; - } - - //test for duplicate points and collinear edges ... - if ((pp->Pt == pp->Next->Pt) || (pp->Pt == pp->Prev->Pt) || - (SlopesEqual(pp->Prev->Pt, pp->Pt, pp->Next->Pt, m_UseFullRange) && - (!m_PreserveCollinear || - !Pt2IsBetweenPt1AndPt3(pp->Prev->Pt, pp->Pt, pp->Next->Pt)))) - { - lastOK = 0; - OutPt *tmp = pp; - pp->Prev->Next = pp->Next; - pp->Next->Prev = pp->Prev; - pp = pp->Prev; - delete tmp; - } - else if (pp == lastOK) break; - else - { - if (!lastOK) lastOK = pp; - pp = pp->Next; - } - } - outrec.Pts = pp; -} -//------------------------------------------------------------------------------ - -int PointCount(OutPt *Pts) -{ - if (!Pts) return 0; - int result = 0; - OutPt* p = Pts; - do - { - result++; - p = p->Next; - } - while (p != Pts); - return result; -} -//------------------------------------------------------------------------------ - -void Clipper::BuildResult(Paths &polys) -{ - polys.reserve(m_PolyOuts.size()); - for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i) - { - if (!m_PolyOuts[i]->Pts) continue; - Path pg; - OutPt* p = m_PolyOuts[i]->Pts->Prev; - int cnt = PointCount(p); - if (cnt < 2) continue; - pg.reserve(cnt); - for (int i = 0; i < cnt; ++i) - { - pg.push_back(p->Pt); - p = p->Prev; - } - polys.push_back(pg); - } -} -//------------------------------------------------------------------------------ - -void Clipper::BuildResult2(PolyTree& polytree) -{ - polytree.Clear(); - polytree.AllNodes.reserve(m_PolyOuts.size()); - //add each output polygon/contour to polytree ... - for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); i++) - { - OutRec* outRec = m_PolyOuts[i]; - int cnt = PointCount(outRec->Pts); - if ((outRec->IsOpen && cnt < 2) || (!outRec->IsOpen && cnt < 3)) continue; - FixHoleLinkage(*outRec); - PolyNode* pn = new PolyNode(); - //nb: polytree takes ownership of all the PolyNodes - polytree.AllNodes.push_back(pn); - outRec->PolyNd = pn; - pn->Parent = 0; - pn->Index = 0; - pn->Contour.reserve(cnt); - OutPt *op = outRec->Pts->Prev; - for (int j = 0; j < cnt; j++) - { - pn->Contour.push_back(op->Pt); - op = op->Prev; - } - } - - //fixup PolyNode links etc ... - polytree.Childs.reserve(m_PolyOuts.size()); - for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); i++) - { - OutRec* outRec = m_PolyOuts[i]; - if (!outRec->PolyNd) continue; - if (outRec->IsOpen) - { - outRec->PolyNd->m_IsOpen = true; - polytree.AddChild(*outRec->PolyNd); - } - else if (outRec->FirstLeft) - outRec->FirstLeft->PolyNd->AddChild(*outRec->PolyNd); - else - polytree.AddChild(*outRec->PolyNd); - } -} -//------------------------------------------------------------------------------ - -void SwapIntersectNodes(IntersectNode &int1, IntersectNode &int2) -{ - //just swap the contents (because fIntersectNodes is a single-linked-list) - IntersectNode inode = int1; //gets a copy of Int1 - int1.Edge1 = int2.Edge1; - int1.Edge2 = int2.Edge2; - int1.Pt = int2.Pt; - int2.Edge1 = inode.Edge1; - int2.Edge2 = inode.Edge2; - int2.Pt = inode.Pt; -} -//------------------------------------------------------------------------------ - -inline bool EdgesAdjacent(const IntersectNode &inode) -{ - return (inode.Edge1->NextInSEL == inode.Edge2) || - (inode.Edge1->PrevInSEL == inode.Edge2); -} -//------------------------------------------------------------------------------ - -bool Clipper::FixupIntersectionOrder() -{ - //pre-condition: intersections are sorted Bottom-most (then Left-most) first. - //Now it's crucial that intersections are made only between adjacent edges, - //so to ensure this the order of intersections may need adjusting ... - IntersectNode *inode = m_IntersectNodes; - CopyAELToSEL(); - while (inode) - { - if (!EdgesAdjacent(*inode)) - { - IntersectNode *nextNode = inode->Next; - while (nextNode && !EdgesAdjacent(*nextNode)) - nextNode = nextNode->Next; - if (!nextNode) - return false; - SwapIntersectNodes(*inode, *nextNode); - } - SwapPositionsInSEL(inode->Edge1, inode->Edge2); - inode = inode->Next; - } - return true; -} -//------------------------------------------------------------------------------ - -inline bool E2InsertsBeforeE1(TEdge &e1, TEdge &e2) -{ - if (e2.Curr.X == e1.Curr.X) - { - if (e2.Top.Y > e1.Top.Y) - return e2.Top.X < TopX(e1, e2.Top.Y); - else return e1.Top.X > TopX(e2, e1.Top.Y); - } - else return e2.Curr.X < e1.Curr.X; -} -//------------------------------------------------------------------------------ - -bool GetOverlap(const cInt a1, const cInt a2, const cInt b1, const cInt b2, - cInt& Left, cInt& Right) -{ - if (a1 < a2) - { - if (b1 < b2) {Left = std::max(a1,b1); Right = std::min(a2,b2);} - else {Left = std::max(a1,b2); Right = std::min(a2,b1);} - } - else - { - if (b1 < b2) {Left = std::max(a2,b1); Right = std::min(a1,b2);} - else {Left = std::max(a2,b2); Right = std::min(a1,b1);} - } - return Left < Right; -} -//------------------------------------------------------------------------------ - -inline void UpdateOutPtIdxs(OutRec& outrec) -{ - OutPt* op = outrec.Pts; - do - { - op->Idx = outrec.Idx; - op = op->Prev; - } - while(op != outrec.Pts); -} -//------------------------------------------------------------------------------ - -void Clipper::InsertEdgeIntoAEL(TEdge *edge, TEdge* startEdge) -{ - if(!m_ActiveEdges) - { - edge->PrevInAEL = 0; - edge->NextInAEL = 0; - m_ActiveEdges = edge; - } - else if(!startEdge && E2InsertsBeforeE1(*m_ActiveEdges, *edge)) - { - edge->PrevInAEL = 0; - edge->NextInAEL = m_ActiveEdges; - m_ActiveEdges->PrevInAEL = edge; - m_ActiveEdges = edge; - } - else - { - if(!startEdge) startEdge = m_ActiveEdges; - while(startEdge->NextInAEL && - !E2InsertsBeforeE1(*startEdge->NextInAEL , *edge)) - startEdge = startEdge->NextInAEL; - edge->NextInAEL = startEdge->NextInAEL; - if(startEdge->NextInAEL) startEdge->NextInAEL->PrevInAEL = edge; - edge->PrevInAEL = startEdge; - startEdge->NextInAEL = edge; - } -} -//---------------------------------------------------------------------- - -OutPt* DupOutPt(OutPt* outPt, bool InsertAfter) -{ - OutPt* result = new OutPt; - result->Pt = outPt->Pt; - result->Idx = outPt->Idx; - if (InsertAfter) - { - result->Next = outPt->Next; - result->Prev = outPt; - outPt->Next->Prev = result; - outPt->Next = result; - } - else - { - result->Prev = outPt->Prev; - result->Next = outPt; - outPt->Prev->Next = result; - outPt->Prev = result; - } - return result; -} -//------------------------------------------------------------------------------ - -bool JoinHorz(OutPt* op1, OutPt* op1b, OutPt* op2, OutPt* op2b, - const IntPoint Pt, bool DiscardLeft) -{ - Direction Dir1 = (op1->Pt.X > op1b->Pt.X ? dRightToLeft : dLeftToRight); - Direction Dir2 = (op2->Pt.X > op2b->Pt.X ? dRightToLeft : dLeftToRight); - if (Dir1 == Dir2) return false; - - //When DiscardLeft, we want Op1b to be on the Left of Op1, otherwise we - //want Op1b to be on the Right. (And likewise with Op2 and Op2b.) - //So, to facilitate this while inserting Op1b and Op2b ... - //when DiscardLeft, make sure we're AT or RIGHT of Pt before adding Op1b, - //otherwise make sure we're AT or LEFT of Pt. (Likewise with Op2b.) - if (Dir1 == dLeftToRight) - { - while (op1->Next->Pt.X <= Pt.X && - op1->Next->Pt.X >= op1->Pt.X && op1->Next->Pt.Y == Pt.Y) - op1 = op1->Next; - if (DiscardLeft && (op1->Pt.X != Pt.X)) op1 = op1->Next; - op1b = DupOutPt(op1, !DiscardLeft); - if (op1b->Pt != Pt) - { - op1 = op1b; - op1->Pt = Pt; - op1b = DupOutPt(op1, !DiscardLeft); - } - } - else - { - while (op1->Next->Pt.X >= Pt.X && - op1->Next->Pt.X <= op1->Pt.X && op1->Next->Pt.Y == Pt.Y) - op1 = op1->Next; - if (!DiscardLeft && (op1->Pt.X != Pt.X)) op1 = op1->Next; - op1b = DupOutPt(op1, DiscardLeft); - if (op1b->Pt != Pt) - { - op1 = op1b; - op1->Pt = Pt; - op1b = DupOutPt(op1, DiscardLeft); - } - } - - if (Dir2 == dLeftToRight) - { - while (op2->Next->Pt.X <= Pt.X && - op2->Next->Pt.X >= op2->Pt.X && op2->Next->Pt.Y == Pt.Y) - op2 = op2->Next; - if (DiscardLeft && (op2->Pt.X != Pt.X)) op2 = op2->Next; - op2b = DupOutPt(op2, !DiscardLeft); - if (op2b->Pt != Pt) - { - op2 = op2b; - op2->Pt = Pt; - op2b = DupOutPt(op2, !DiscardLeft); - }; - } else - { - while (op2->Next->Pt.X >= Pt.X && - op2->Next->Pt.X <= op2->Pt.X && op2->Next->Pt.Y == Pt.Y) - op2 = op2->Next; - if (!DiscardLeft && (op2->Pt.X != Pt.X)) op2 = op2->Next; - op2b = DupOutPt(op2, DiscardLeft); - if (op2b->Pt != Pt) - { - op2 = op2b; - op2->Pt = Pt; - op2b = DupOutPt(op2, DiscardLeft); - }; - }; - - if ((Dir1 == dLeftToRight) == DiscardLeft) - { - op1->Prev = op2; - op2->Next = op1; - op1b->Next = op2b; - op2b->Prev = op1b; - } - else - { - op1->Next = op2; - op2->Prev = op1; - op1b->Prev = op2b; - op2b->Next = op1b; - } - return true; -} -//------------------------------------------------------------------------------ - -bool Clipper::JoinPoints(const Join *j, OutPt *&p1, OutPt *&p2) -{ - OutRec* outRec1 = GetOutRec(j->OutPt1->Idx); - OutRec* outRec2 = GetOutRec(j->OutPt2->Idx); - OutPt *op1 = j->OutPt1, *op1b; - OutPt *op2 = j->OutPt2, *op2b; - - //There are 3 kinds of joins for output polygons ... - //1. Horizontal joins where Join.OutPt1 & Join.OutPt2 are a vertices anywhere - //along (horizontal) collinear edges (& Join.OffPt is on the same horizontal). - //2. Non-horizontal joins where Join.OutPt1 & Join.OutPt2 are at the same - //location at the Bottom of the overlapping segment (& Join.OffPt is above). - //3. StrictSimple joins where edges touch but are not collinear and where - //Join.OutPt1, Join.OutPt2 & Join.OffPt all share the same point. - bool isHorizontal = (j->OutPt1->Pt.Y == j->OffPt.Y); - - if (isHorizontal && (j->OffPt == j->OutPt1->Pt) && - (j->OffPt == j->OutPt2->Pt)) - { - //Strictly Simple join ... - op1b = j->OutPt1->Next; - while (op1b != op1 && (op1b->Pt == j->OffPt)) - op1b = op1b->Next; - bool reverse1 = (op1b->Pt.Y > j->OffPt.Y); - op2b = j->OutPt2->Next; - while (op2b != op2 && (op2b->Pt == j->OffPt)) - op2b = op2b->Next; - bool reverse2 = (op2b->Pt.Y > j->OffPt.Y); - if (reverse1 == reverse2) return false; - if (reverse1) - { - op1b = DupOutPt(op1, false); - op2b = DupOutPt(op2, true); - op1->Prev = op2; - op2->Next = op1; - op1b->Next = op2b; - op2b->Prev = op1b; - p1 = op1; - p2 = op1b; - return true; - } else - { - op1b = DupOutPt(op1, true); - op2b = DupOutPt(op2, false); - op1->Next = op2; - op2->Prev = op1; - op1b->Prev = op2b; - op2b->Next = op1b; - p1 = op1; - p2 = op1b; - return true; - } - } - else if (isHorizontal) - { - //treat horizontal joins differently to non-horizontal joins since with - //them we're not yet sure where the overlapping is. OutPt1.Pt & OutPt2.Pt - //may be anywhere along the horizontal edge. - op1b = op1; - while (op1->Prev->Pt.Y == op1->Pt.Y && op1->Prev != op1b && op1->Prev != op2) - op1 = op1->Prev; - while (op1b->Next->Pt.Y == op1b->Pt.Y && op1b->Next != op1 && op1b->Next != op2) - op1b = op1b->Next; - if (op1b->Next == op1 || op1b->Next == op2) return false; //a flat 'polygon' - - op2b = op2; - while (op2->Prev->Pt.Y == op2->Pt.Y && op2->Prev != op2b && op2->Prev != op1b) - op2 = op2->Prev; - while (op2b->Next->Pt.Y == op2b->Pt.Y && op2b->Next != op2 && op2b->Next != op1) - op2b = op2b->Next; - if (op2b->Next == op2 || op2b->Next == op1) return false; //a flat 'polygon' - - cInt Left, Right; - //Op1 --> Op1b & Op2 --> Op2b are the extremites of the horizontal edges - if (!GetOverlap(op1->Pt.X, op1b->Pt.X, op2->Pt.X, op2b->Pt.X, Left, Right)) - return false; - - //DiscardLeftSide: when overlapping edges are joined, a spike will created - //which needs to be cleaned up. However, we don't want Op1 or Op2 caught up - //on the discard Side as either may still be needed for other joins ... - IntPoint Pt; - bool DiscardLeftSide; - if (op1->Pt.X >= Left && op1->Pt.X <= Right) - { - Pt = op1->Pt; DiscardLeftSide = (op1->Pt.X > op1b->Pt.X); - } - else if (op2->Pt.X >= Left&& op2->Pt.X <= Right) - { - Pt = op2->Pt; DiscardLeftSide = (op2->Pt.X > op2b->Pt.X); - } - else if (op1b->Pt.X >= Left && op1b->Pt.X <= Right) - { - Pt = op1b->Pt; DiscardLeftSide = op1b->Pt.X > op1->Pt.X; - } - else - { - Pt = op2b->Pt; DiscardLeftSide = (op2b->Pt.X > op2->Pt.X); - } - p1 = op1; p2 = op2; - return JoinHorz(op1, op1b, op2, op2b, Pt, DiscardLeftSide); - } else - { - //nb: For non-horizontal joins ... - // 1. Jr.OutPt1.Pt.Y == Jr.OutPt2.Pt.Y - // 2. Jr.OutPt1.Pt > Jr.OffPt.Y - - //make sure the polygons are correctly oriented ... - op1b = op1->Next; - while ((op1b->Pt == op1->Pt) && (op1b != op1)) op1b = op1b->Next; - bool Reverse1 = ((op1b->Pt.Y > op1->Pt.Y) || - !SlopesEqual(op1->Pt, op1b->Pt, j->OffPt, m_UseFullRange)); - if (Reverse1) - { - op1b = op1->Prev; - while ((op1b->Pt == op1->Pt) && (op1b != op1)) op1b = op1b->Prev; - if ((op1b->Pt.Y > op1->Pt.Y) || - !SlopesEqual(op1->Pt, op1b->Pt, j->OffPt, m_UseFullRange)) return false; - }; - op2b = op2->Next; - while ((op2b->Pt == op2->Pt) && (op2b != op2))op2b = op2b->Next; - bool Reverse2 = ((op2b->Pt.Y > op2->Pt.Y) || - !SlopesEqual(op2->Pt, op2b->Pt, j->OffPt, m_UseFullRange)); - if (Reverse2) - { - op2b = op2->Prev; - while ((op2b->Pt == op2->Pt) && (op2b != op2)) op2b = op2b->Prev; - if ((op2b->Pt.Y > op2->Pt.Y) || - !SlopesEqual(op2->Pt, op2b->Pt, j->OffPt, m_UseFullRange)) return false; - } - - if ((op1b == op1) || (op2b == op2) || (op1b == op2b) || - ((outRec1 == outRec2) && (Reverse1 == Reverse2))) return false; - - if (Reverse1) - { - op1b = DupOutPt(op1, false); - op2b = DupOutPt(op2, true); - op1->Prev = op2; - op2->Next = op1; - op1b->Next = op2b; - op2b->Prev = op1b; - p1 = op1; - p2 = op1b; - return true; - } else - { - op1b = DupOutPt(op1, true); - op2b = DupOutPt(op2, false); - op1->Next = op2; - op2->Prev = op1; - op1b->Prev = op2b; - op2b->Next = op1b; - p1 = op1; - p2 = op1b; - return true; - } - } -} -//---------------------------------------------------------------------- - -bool Poly2ContainsPoly1(OutPt* OutPt1, OutPt* OutPt2, bool UseFullInt64Range) -{ - OutPt* Pt = OutPt1; - //Because the polygons may be touching, we need to find a vertex that - //isn't touching the other polygon ... - if (PointOnPolygon(Pt->Pt, OutPt2, UseFullInt64Range)) - { - Pt = Pt->Next; - while (Pt != OutPt1 && PointOnPolygon(Pt->Pt, OutPt2, UseFullInt64Range)) - Pt = Pt->Next; - if (Pt == OutPt1) return true; - } - return PointInPolygon(Pt->Pt, OutPt2, UseFullInt64Range); -} -//---------------------------------------------------------------------- - -void Clipper::FixupFirstLefts1(OutRec* OldOutRec, OutRec* NewOutRec) -{ - - for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i) - { - OutRec* outRec = m_PolyOuts[i]; - if (outRec->Pts && outRec->FirstLeft == OldOutRec) - { - if (Poly2ContainsPoly1(outRec->Pts, NewOutRec->Pts, m_UseFullRange)) - outRec->FirstLeft = NewOutRec; - } - } -} -//---------------------------------------------------------------------- - -void Clipper::FixupFirstLefts2(OutRec* OldOutRec, OutRec* NewOutRec) -{ - for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i) - { - OutRec* outRec = m_PolyOuts[i]; - if (outRec->FirstLeft == OldOutRec) outRec->FirstLeft = NewOutRec; - } -} -//---------------------------------------------------------------------- - -void Clipper::JoinCommonEdges() -{ - for (JoinList::size_type i = 0; i < m_Joins.size(); i++) - { - Join* j = m_Joins[i]; - - OutRec *outRec1 = GetOutRec(j->OutPt1->Idx); - OutRec *outRec2 = GetOutRec(j->OutPt2->Idx); - - if (!outRec1->Pts || !outRec2->Pts) continue; - - //get the polygon fragment with the correct hole state (FirstLeft) - //before calling JoinPoints() ... - OutRec *holeStateRec; - if (outRec1 == outRec2) holeStateRec = outRec1; - else if (Param1RightOfParam2(outRec1, outRec2)) holeStateRec = outRec2; - else if (Param1RightOfParam2(outRec2, outRec1)) holeStateRec = outRec1; - else holeStateRec = GetLowermostRec(outRec1, outRec2); - - OutPt *p1, *p2; - if (!JoinPoints(j, p1, p2)) continue; - - if (outRec1 == outRec2) - { - //instead of joining two polygons, we've just created a new one by - //splitting one polygon into two. - outRec1->Pts = p1; - outRec1->BottomPt = 0; - outRec2 = CreateOutRec(); - outRec2->Pts = p2; - - //update all OutRec2.Pts Idx's ... - UpdateOutPtIdxs(*outRec2); - - if (Poly2ContainsPoly1(outRec2->Pts, outRec1->Pts, m_UseFullRange)) - { - //outRec2 is contained by outRec1 ... - outRec2->IsHole = !outRec1->IsHole; - outRec2->FirstLeft = outRec1; - - //fixup FirstLeft pointers that may need reassigning to OutRec1 - if (m_UsingPolyTree) FixupFirstLefts2(outRec2, outRec1); - - if ((outRec2->IsHole ^ m_ReverseOutput) == (Area(*outRec2) > 0)) - ReversePolyPtLinks(outRec2->Pts); - - } else if (Poly2ContainsPoly1(outRec1->Pts, outRec2->Pts, m_UseFullRange)) - { - //outRec1 is contained by outRec2 ... - outRec2->IsHole = outRec1->IsHole; - outRec1->IsHole = !outRec2->IsHole; - outRec2->FirstLeft = outRec1->FirstLeft; - outRec1->FirstLeft = outRec2; - - //fixup FirstLeft pointers that may need reassigning to OutRec1 - if (m_UsingPolyTree) FixupFirstLefts2(outRec1, outRec2); - - if ((outRec1->IsHole ^ m_ReverseOutput) == (Area(*outRec1) > 0)) - ReversePolyPtLinks(outRec1->Pts); - } - else - { - //the 2 polygons are completely separate ... - outRec2->IsHole = outRec1->IsHole; - outRec2->FirstLeft = outRec1->FirstLeft; - - //fixup FirstLeft pointers that may need reassigning to OutRec2 - if (m_UsingPolyTree) FixupFirstLefts1(outRec1, outRec2); - } - - } else - { - //joined 2 polygons together ... - - outRec2->Pts = 0; - outRec2->BottomPt = 0; - outRec2->Idx = outRec1->Idx; - - outRec1->IsHole = holeStateRec->IsHole; - if (holeStateRec == outRec2) - outRec1->FirstLeft = outRec2->FirstLeft; - outRec2->FirstLeft = outRec1; - - //fixup FirstLeft pointers that may need reassigning to OutRec1 - if (m_UsingPolyTree) FixupFirstLefts2(outRec2, outRec1); - } - } -} -//------------------------------------------------------------------------------ - -void Clipper::DoSimplePolygons() -{ - PolyOutList::size_type i = 0; - while (i < m_PolyOuts.size()) - { - OutRec* outrec = m_PolyOuts[i++]; - OutPt* op = outrec->Pts; - if (!op) continue; - do //for each Pt in Polygon until duplicate found do ... - { - OutPt* op2 = op->Next; - while (op2 != outrec->Pts) - { - if ((op->Pt == op2->Pt) && op2->Next != op && op2->Prev != op) - { - //split the polygon into two ... - OutPt* op3 = op->Prev; - OutPt* op4 = op2->Prev; - op->Prev = op4; - op4->Next = op; - op2->Prev = op3; - op3->Next = op2; - - outrec->Pts = op; - OutRec* outrec2 = CreateOutRec(); - outrec2->Pts = op2; - UpdateOutPtIdxs(*outrec2); - if (Poly2ContainsPoly1(outrec2->Pts, outrec->Pts, m_UseFullRange)) - { - //OutRec2 is contained by OutRec1 ... - outrec2->IsHole = !outrec->IsHole; - outrec2->FirstLeft = outrec; - } - else - if (Poly2ContainsPoly1(outrec->Pts, outrec2->Pts, m_UseFullRange)) - { - //OutRec1 is contained by OutRec2 ... - outrec2->IsHole = outrec->IsHole; - outrec->IsHole = !outrec2->IsHole; - outrec2->FirstLeft = outrec->FirstLeft; - outrec->FirstLeft = outrec2; - } else - { - //the 2 polygons are separate ... - outrec2->IsHole = outrec->IsHole; - outrec2->FirstLeft = outrec->FirstLeft; - } - op2 = op; //ie get ready for the Next iteration - } - op2 = op2->Next; - } - op = op->Next; - } - while (op != outrec->Pts); - } -} -//------------------------------------------------------------------------------ - -void ReversePath(Path& p) -{ - std::reverse(p.begin(), p.end()); -} -//------------------------------------------------------------------------------ - -void ReversePaths(Paths& p) -{ - for (Paths::size_type i = 0; i < p.size(); ++i) - ReversePath(p[i]); -} - -//------------------------------------------------------------------------------ -// OffsetPolygon functions ... -//------------------------------------------------------------------------------ - -DoublePoint GetUnitNormal(const IntPoint &pt1, const IntPoint &pt2) -{ - if(pt2.X == pt1.X && pt2.Y == pt1.Y) - return DoublePoint(0, 0); - - double Dx = (double)(pt2.X - pt1.X); - double dy = (double)(pt2.Y - pt1.Y); - double f = 1 *1.0/ std::sqrt( Dx*Dx + dy*dy ); - Dx *= f; - dy *= f; - return DoublePoint(dy, -Dx); -} - -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ - -class OffsetBuilder -{ -private: - const Paths& m_p; - Path* m_curr_poly; - std::vector normals; - double m_delta, m_sinA, m_sin, m_cos; - double m_miterLim, m_Steps360; - size_t m_i, m_j, m_k; - static const int buffLength = 128; - -public: - -OffsetBuilder(const Paths& in_polys, Paths& out_polys, - double Delta, JoinType jointype, EndType endtype, double limit): m_p(in_polys) -{ - //precondition: &out_polys != &in_polys - - if (NEAR_ZERO(Delta)) {out_polys = in_polys; return;} - //we can't shrink a polyline so ... - if (endtype != etClosed && Delta < 0) Delta = -Delta; - m_delta = Delta; - - if (jointype == jtMiter) - { - //m_miterLim: see offset_triginometry.svg in the documentation folder ... - if (limit > 2) m_miterLim = 2/(limit*limit); - else m_miterLim = 0.5; - if (endtype == etRound) limit = 0.25; - } - - if (jointype == jtRound || endtype == etRound) - { - if (limit <= 0) limit = 0.25; - else if (limit > std::fabs(Delta)*0.25) limit = std::fabs(Delta)*0.25; - //m_Steps360: see offset_triginometry2.svg in the documentation folder ... - m_Steps360 = pi / std::acos(1 - limit / std::fabs(Delta)); - m_sin = std::sin(2 * pi / m_Steps360); - m_cos = std::cos(2 * pi / m_Steps360); - m_Steps360 /= pi * 2; - if (Delta < 0) m_sin = -m_sin; - } - - out_polys.clear(); - out_polys.resize(m_p.size()); - for (m_i = 0; m_i < m_p.size(); m_i++) - { - size_t len = m_p[m_i].size(); - - if (len == 0 || (len < 3 && Delta <= 0)) continue; - - if (len == 1) - { - if (jointype == jtRound) - { - double X = 1.0, Y = 0.0; - for (cInt j = 1; j <= Round(m_Steps360 * 2 * pi); j++) - { - AddPoint(IntPoint( - Round(m_p[m_i][0].X + X * Delta), - Round(m_p[m_i][0].Y + Y * Delta))); - double X2 = X; - X = X * m_cos - m_sin * Y; - Y = X2 * m_sin + Y * m_cos; - } - } else - { - double X = -1.0, Y = -1.0; - for (int j = 0; j < 4; ++j) - { - AddPoint(IntPoint( Round(m_p[m_i][0].X + X * Delta), - Round(m_p[m_i][0].Y + Y * Delta))); - if (X < 0) X = 1; - else if (Y < 0) Y = 1; - else X = -1; - } - } - continue; - } - - //build normals ... - normals.clear(); - normals.resize(len); - for (m_j = 0; m_j < len -1; ++m_j) - normals[m_j] = GetUnitNormal(m_p[m_i][m_j], m_p[m_i][m_j +1]); - if (endtype == etClosed) - normals[len-1] = GetUnitNormal(m_p[m_i][len-1], m_p[m_i][0]); - else //is open polyline - normals[len-1] = normals[len-2]; - - m_curr_poly = &out_polys[m_i]; - m_curr_poly->reserve(len); - - if (endtype == etClosed) - { - m_k = len -1; - for (m_j = 0; m_j < len; ++m_j) - OffsetPoint(jointype); - } - else //is open polyline - { - //offset the polyline going forward ... - m_k = 0; - for (m_j = 1; m_j < len -1; ++m_j) - OffsetPoint(jointype); - - //handle the end (butt, round or square) ... - IntPoint pt1; - if (endtype == etButt) - { - m_j = len - 1; - pt1 = IntPoint(Round(m_p[m_i][m_j].X + normals[m_j].X * m_delta), - Round(m_p[m_i][m_j].Y + normals[m_j].Y * m_delta)); - AddPoint(pt1); - pt1 = IntPoint(Round(m_p[m_i][m_j].X - normals[m_j].X * m_delta), - Round(m_p[m_i][m_j].Y - normals[m_j].Y * m_delta)); - AddPoint(pt1); - } - else - { - m_j = len - 1; - m_k = len - 2; - m_sinA = 0; - normals[m_j].X = -normals[m_j].X; - normals[m_j].Y = -normals[m_j].Y; - if (endtype == etSquare) - DoSquare(); - else - DoRound(); - } - - //re-build Normals ... - for (int j = len - 1; j > 0; --j) - { - normals[j].X = -normals[j - 1].X; - normals[j].Y = -normals[j - 1].Y; - } - normals[0].X = -normals[1].X; - normals[0].Y = -normals[1].Y; - - //offset the polyline going backward ... - m_k = len -1; - for (m_j = m_k - 1; m_j > 0; --m_j) - OffsetPoint(jointype); - - //finally handle the start (butt, round or square) ... - if (endtype == etButt) - { - pt1 = IntPoint(Round(m_p[m_i][0].X - normals[0].X * m_delta), - Round(m_p[m_i][0].Y - normals[0].Y * m_delta)); - AddPoint(pt1); - pt1 = IntPoint(Round(m_p[m_i][0].X + normals[0].X * m_delta), - Round(m_p[m_i][0].Y + normals[0].Y * m_delta)); - AddPoint(pt1); - } else - { - m_sinA = 0; - m_k = 1; - if (endtype == etSquare) - DoSquare(); - else - DoRound(); - } - } - } - - //and clean up untidy corners using Clipper ... - Clipper clpr; - clpr.AddPaths(out_polys, ptSubject, true); - if (Delta > 0) - { - if (!clpr.Execute(ctUnion, out_polys, pftPositive, pftPositive)) - out_polys.clear(); - } - else - { - IntRect r = clpr.GetBounds(); - Path outer(4); - outer[0] = IntPoint(r.left - 10, r.bottom + 10); - outer[1] = IntPoint(r.right + 10, r.bottom + 10); - outer[2] = IntPoint(r.right + 10, r.top - 10); - outer[3] = IntPoint(r.left - 10, r.top - 10); - - clpr.AddPath(outer, ptSubject, true); - clpr.ReverseSolution(true); - if (clpr.Execute(ctUnion, out_polys, pftNegative, pftNegative)) - out_polys.erase(out_polys.begin()); - else - out_polys.clear(); - } -} -//------------------------------------------------------------------------------ - -private: - -void OffsetPoint(JoinType jointype) -{ - m_sinA = (normals[m_k].X * normals[m_j].Y - normals[m_j].X * normals[m_k].Y); - if (std::fabs(m_sinA) < 0.00005) return; //ie collinear - else if (m_sinA > 1.0) m_sinA = 1.0; - else if (m_sinA < -1.0) m_sinA = -1.0; - - if (m_sinA * m_delta < 0) - { - AddPoint(IntPoint(Round(m_p[m_i][m_j].X + normals[m_k].X * m_delta), - Round(m_p[m_i][m_j].Y + normals[m_k].Y * m_delta))); - AddPoint(m_p[m_i][m_j]); - AddPoint(IntPoint(Round(m_p[m_i][m_j].X + normals[m_j].X * m_delta), - Round(m_p[m_i][m_j].Y + normals[m_j].Y * m_delta))); - } - else - switch (jointype) - { - case jtMiter: - { - double r = 1 + (normals[m_j].X*normals[m_k].X + - normals[m_j].Y*normals[m_k].Y); - if (r >= m_miterLim) DoMiter(r); else DoSquare(); - break; - } - case jtSquare: DoSquare(); break; - case jtRound: DoRound(); break; - } - m_k = m_j; -} -//------------------------------------------------------------------------------ - -void AddPoint(const IntPoint& Pt) -{ - if (m_curr_poly->size() == m_curr_poly->capacity()) - m_curr_poly->reserve(m_curr_poly->capacity() + buffLength); - m_curr_poly->push_back(Pt); -} -//------------------------------------------------------------------------------ - -void DoSquare() -{ - double Dx = std::tan(std::atan2(m_sinA, - normals[m_k].X * normals[m_j].X + normals[m_k].Y * normals[m_j].Y)/4); - AddPoint(IntPoint( - Round(m_p[m_i][m_j].X + m_delta * (normals[m_k].X - normals[m_k].Y *Dx)), - Round(m_p[m_i][m_j].Y + m_delta * (normals[m_k].Y + normals[m_k].X *Dx)))); - AddPoint(IntPoint( - Round(m_p[m_i][m_j].X + m_delta * (normals[m_j].X + normals[m_j].Y *Dx)), - Round(m_p[m_i][m_j].Y + m_delta * (normals[m_j].Y - normals[m_j].X *Dx)))); -} -//------------------------------------------------------------------------------ - -void DoMiter(double r) -{ - double q = m_delta / r; - AddPoint(IntPoint(Round(m_p[m_i][m_j].X + (normals[m_k].X + normals[m_j].X) * q), - Round(m_p[m_i][m_j].Y + (normals[m_k].Y + normals[m_j].Y) * q))); -} -//------------------------------------------------------------------------------ - -void DoRound() -{ - double a = std::atan2(m_sinA, - normals[m_k].X * normals[m_j].X + normals[m_k].Y * normals[m_j].Y); - int steps = (int)Round(m_Steps360 * std::fabs(a)); - - double X = normals[m_k].X, Y = normals[m_k].Y, X2; - for (int i = 0; i < steps; ++i) - { - AddPoint(IntPoint( - Round(m_p[m_i][m_j].X + X * m_delta), - Round(m_p[m_i][m_j].Y + Y * m_delta))); - X2 = X; - X = X * m_cos - m_sin * Y; - Y = X2 * m_sin + Y * m_cos; - } - AddPoint(IntPoint( - Round(m_p[m_i][m_j].X + normals[m_j].X * m_delta), - Round(m_p[m_i][m_j].Y + normals[m_j].Y * m_delta))); -} -//-------------------------------------------------------------------------- - -}; //end PolyOffsetBuilder - -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ - -void StripDupsAndGetBotPt(Path& in_path, Path& out_path, bool closed, IntPoint* botPt) -{ - botPt = 0; - size_t len = in_path.size(); - if (closed) - while (len > 0 && (in_path[0] == in_path[len -1])) len--; - if (len == 0) return; - out_path.resize(len); - int j = 0; - out_path[0] = in_path[0]; - botPt = &out_path[0]; - for (size_t i = 1; i < len; ++i) - if (in_path[i] != out_path[j]) - { - j++; - out_path[j] = in_path[i]; - if (out_path[j].Y > botPt->Y) - botPt = &out_path[j]; - else if ((out_path[j].Y == botPt->Y) && out_path[j].X < botPt->X) - botPt = &out_path[j]; - } - j++; - if (j < 2 || (closed && (j == 2))) j = 0; - out_path.resize(j); -} -//------------------------------------------------------------------------------ - -void OffsetPaths(const Paths &in_polys, Paths &out_polys, - double delta, JoinType jointype, EndType endtype, double limit) -{ - //just in case in_polys == &out_polys ... - Paths inPolys = Paths(in_polys); - out_polys.clear(); - out_polys.resize(inPolys.size()); - - IntPoint *botPt = 0, *pt = 0; - int botIdx = -1; - for (size_t i = 0; i < in_polys.size(); ++i) - { - StripDupsAndGetBotPt(inPolys[i], out_polys[i], endtype == etClosed, pt); - if (botPt) - if (!botPt || pt->Y > botPt->Y || (pt->Y == botPt->Y && pt->X < botPt->X)) - { - botPt = pt; - botIdx = i; - } - - } - if (endtype == etClosed && botIdx >= 0 && !Orientation(inPolys[botIdx])) - ReversePaths(inPolys); - - OffsetBuilder(inPolys, out_polys, delta, jointype, endtype, limit); -} -//------------------------------------------------------------------------------ - -void SimplifyPolygons(const Paths &in_polys, Paths &out_polys, PolyFillType fillType) -{ - Clipper c; - c.StrictlySimple(true); - c.AddPaths(in_polys, ptSubject, true); - c.Execute(ctUnion, out_polys, fillType, fillType); -} -//------------------------------------------------------------------------------ - -void SimplifyPolygons(Paths &polys, PolyFillType fillType) -{ - SimplifyPolygons(polys, polys, fillType); -} -//------------------------------------------------------------------------------ - -inline double DistanceSqrd(const IntPoint& pt1, const IntPoint& pt2) -{ - double Dx = ((double)pt1.X - pt2.X); - double dy = ((double)pt1.Y - pt2.Y); - return (Dx*Dx + dy*dy); -} -//------------------------------------------------------------------------------ - -DoublePoint ClosestPointOnLine(const IntPoint& Pt, const IntPoint& linePt1, const IntPoint& linePt2) -{ - double Dx = ((double)linePt2.X - linePt1.X); - double dy = ((double)linePt2.Y - linePt1.Y); - if (Dx == 0 && dy == 0) - return DoublePoint((double)linePt1.X, (double)linePt1.Y); - double q = ((Pt.X-linePt1.X)*Dx + (Pt.Y-linePt1.Y)*dy) / (Dx*Dx + dy*dy); - return DoublePoint( - (1-q)*linePt1.X + q*linePt2.X, - (1-q)*linePt1.Y + q*linePt2.Y); -} -//------------------------------------------------------------------------------ - -bool SlopesNearCollinear(const IntPoint& pt1, - const IntPoint& pt2, const IntPoint& pt3, double distSqrd) -{ - if (DistanceSqrd(pt1, pt2) > DistanceSqrd(pt1, pt3)) return false; - DoublePoint cpol = ClosestPointOnLine(pt2, pt1, pt3); - double Dx = pt2.X - cpol.X; - double dy = pt2.Y - cpol.Y; - return (Dx*Dx + dy*dy) < distSqrd; -} -//------------------------------------------------------------------------------ - -bool PointsAreClose(IntPoint pt1, IntPoint pt2, double distSqrd) -{ - double Dx = (double)pt1.X - pt2.X; - double dy = (double)pt1.Y - pt2.Y; - return ((Dx * Dx) + (dy * dy) <= distSqrd); -} -//------------------------------------------------------------------------------ - -void CleanPolygon(const Path& in_poly, Path& out_poly, double distance) -{ - //distance = proximity in units/pixels below which vertices - //will be stripped. Default ~= sqrt(2). - int highI = in_poly.size() -1; - double distSqrd = distance * distance; - while (highI > 0 && PointsAreClose(in_poly[highI], in_poly[0], distSqrd)) highI--; - if (highI < 2) { out_poly.clear(); return; } - - if (&in_poly != &out_poly) - out_poly.resize(highI + 1); - - IntPoint Pt = in_poly[highI]; - int i = 0, k = 0; - for (;;) - { - while (i < highI && PointsAreClose(Pt, in_poly[i+1], distSqrd)) i+=2; - int i2 = i; - while (i < highI && (PointsAreClose(in_poly[i], in_poly[i+1], distSqrd) || - SlopesNearCollinear(Pt, in_poly[i], in_poly[i+1], distSqrd))) i++; - if (i >= highI) break; - else if (i != i2) continue; - Pt = in_poly[i++]; - out_poly[k++] = Pt; - } - if (i <= highI) out_poly[k++] = in_poly[i]; - if (k > 2 && SlopesNearCollinear(out_poly[k -2], out_poly[k -1], out_poly[0], distSqrd)) k--; - if (k < 3) out_poly.clear(); - else if (k <= highI) out_poly.resize(k); -} -//------------------------------------------------------------------------------ - -void CleanPolygon(Path& poly, double distance) -{ - CleanPolygon(poly, poly, distance); -} -//------------------------------------------------------------------------------ - -void CleanPolygons(const Paths& in_polys, Paths& out_polys, double distance) -{ - for (Paths::size_type i = 0; i < in_polys.size(); ++i) - CleanPolygon(in_polys[i], out_polys[i], distance); -} -//------------------------------------------------------------------------------ - -void CleanPolygons(Paths& polys, double distance) -{ - CleanPolygons(polys, polys, distance); -} -//------------------------------------------------------------------------------ - -void Minkowki(const Path& poly, const Path& path, - Paths& solution, bool isSum, bool isClosed) -{ - int delta = (isClosed ? 1 : 0); - size_t polyCnt = poly.size(); - size_t pathCnt = path.size(); - Paths pp; - pp.reserve(pathCnt); - if (isSum) - for (size_t i = 0; i < pathCnt; ++i) - { - Path p; - p.reserve(polyCnt); - for (size_t j = 0; j < poly.size(); ++j) - p.push_back(IntPoint(path[i].X + poly[j].X, path[i].Y + poly[j].Y)); - pp.push_back(p); - } - else - for (size_t i = 0; i < pathCnt; ++i) - { - Path p; - p.reserve(polyCnt); - for (size_t j = 0; j < poly.size(); ++j) - p.push_back(IntPoint(path[i].X - poly[j].X, path[i].Y - poly[j].Y)); - pp.push_back(p); - } - - Paths quads; - quads.reserve((pathCnt + delta) * (polyCnt + 1)); - for (size_t i = 0; i <= pathCnt - 2 + delta; ++i) - for (size_t j = 0; j <= polyCnt - 1; ++j) - { - Path quad; - quad.reserve(4); - quad.push_back(pp[i % pathCnt][j % polyCnt]); - quad.push_back(pp[(i + 1) % pathCnt][j % polyCnt]); - quad.push_back(pp[(i + 1) % pathCnt][(j + 1) % polyCnt]); - quad.push_back(pp[i % pathCnt][(j + 1) % polyCnt]); - if (!Orientation(quad)) ReversePath(quad); - quads.push_back(quad); - } - - Clipper c; - c.AddPaths(quads, ptSubject, true); - c.Execute(ctUnion, solution, pftNonZero, pftNonZero); -} -//------------------------------------------------------------------------------ - -void MinkowkiSum(const Path& poly, const Path& path, Paths& solution, bool isClosed) -{ - Minkowki(poly, path, solution, true, isClosed); -} -//------------------------------------------------------------------------------ - -void MinkowkiDiff(const Path& poly, const Path& path, Paths& solution, bool isClosed) -{ - Minkowki(poly, path, solution, false, isClosed); -} -//------------------------------------------------------------------------------ - -enum NodeType {ntAny, ntOpen, ntClosed}; - -void AddPolyNodeToPolygons(const PolyNode& polynode, NodeType nodetype, Paths& paths) -{ - bool match = true; - if (nodetype == ntClosed) match = !polynode.IsOpen(); - else if (nodetype == ntOpen) return; - - if (!polynode.Contour.empty() && match) - paths.push_back(polynode.Contour); - for (int i = 0; i < polynode.ChildCount(); ++i) - AddPolyNodeToPolygons(*polynode.Childs[i], nodetype, paths); -} -//------------------------------------------------------------------------------ - -void PolyTreeToPaths(const PolyTree& polytree, Paths& paths) -{ - paths.resize(0); - paths.reserve(polytree.Total()); - AddPolyNodeToPolygons(polytree, ntAny, paths); -} -//------------------------------------------------------------------------------ - -void ClosedPathsFromPolyTree(const PolyTree& polytree, Paths& paths) -{ - paths.resize(0); - paths.reserve(polytree.Total()); - AddPolyNodeToPolygons(polytree, ntClosed, paths); -} -//------------------------------------------------------------------------------ - -void OpenPathsFromPolyTree(PolyTree& polytree, Paths& paths) -{ - paths.resize(0); - paths.reserve(polytree.Total()); - //Open paths are top level only, so ... - for (int i = 0; i < polytree.ChildCount(); ++i) - if (polytree.Childs[i]->IsOpen()) - paths.push_back(polytree.Childs[i]->Contour); -} -//------------------------------------------------------------------------------ - -std::ostream& operator <<(std::ostream &s, const IntPoint &p) -{ - s << "(" << p.X << "," << p.Y << ")"; - return s; -} -//------------------------------------------------------------------------------ - -std::ostream& operator <<(std::ostream &s, const Path &p) -{ - if (p.empty()) return s; - Path::size_type last = p.size() -1; - for (Path::size_type i = 0; i < last; i++) - s << "(" << p[i].X << "," << p[i].Y << "), "; - s << "(" << p[last].X << "," << p[last].Y << ")\n"; - return s; -} -//------------------------------------------------------------------------------ - -std::ostream& operator <<(std::ostream &s, const Paths &p) -{ - for (Paths::size_type i = 0; i < p.size(); i++) - s << p[i]; - s << "\n"; - return s; -} -//------------------------------------------------------------------------------ - -#ifdef use_deprecated -bool ClipperBase::AddPolygon(const Path &pg, PolyType PolyTyp) -{ - return AddPath(pg, PolyTyp, true); -} -//------------------------------------------------------------------------------ - -bool ClipperBase::AddPolygons(const Paths &ppg, PolyType PolyTyp) -{ - bool result = false; - for (Paths::size_type i = 0; i < ppg.size(); ++i) - if (AddPath(ppg[i], PolyTyp, true)) result = true; - return result; -} -//------------------------------------------------------------------------------ - -void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys, - double delta, JoinType jointype, double limit, bool autoFix) -{ - OffsetPaths(in_polys, out_polys, delta, jointype, etClosed, limit); -} -//------------------------------------------------------------------------------ - -void PolyTreeToPolygons(const PolyTree& polytree, Paths& paths) -{ - PolyTreeToPaths(polytree, paths); -} -//------------------------------------------------------------------------------ - -void ReversePolygon(Path& p) -{ - std::reverse(p.begin(), p.end()); -} -//------------------------------------------------------------------------------ - -void ReversePolygons(Paths& p) -{ - for (Paths::size_type i = 0; i < p.size(); ++i) - ReversePolygon(p[i]); -} -#endif - - -} //ClipperLib namespace diff --git a/deps/mapnik/build.py b/deps/mapnik/build.py index e2bbe21a5..32afe1189 100644 --- a/deps/mapnik/build.py +++ b/deps/mapnik/build.py @@ -7,7 +7,6 @@ subdirs = { 'sparsehash':'sparsehash', 'sparsehash/internal':'sparsehash/internal', '../agg/include':'agg', - '../clipper/include':'agg' } if 'install' in COMMAND_LINE_TARGETS: diff --git a/docs/contributing.markdown b/docs/contributing.md similarity index 89% rename from docs/contributing.markdown rename to docs/contributing.md index 74c6c2ebf..e7f327977 100644 --- a/docs/contributing.markdown +++ b/docs/contributing.md @@ -1,5 +1,41 @@ # Contributing +## Testing + +Developers adding new features or fixing bugs should always write tests alongside. + +Mapnik has both C++ unit tests in `./test/unit` and visual tests in `./test/visual`. + +Test data for the unit and visual tests is pulled in from standalone repos via git submodules. + +After building Mapnik (see INSTALL.md), the submodules can be loaded and the tests can be run like: + + make test + +Developers with commit access can update test data like: + + cd test/data + git remote set-url origin git@github.com:mapnik/test-data + git commit -a -m "update test data" + git push origin HEAD:master + +And the visual test data can up updated like: + + cd test/data-visual + git remote set-url origin git@github.com:mapnik/test-data-visual + git add styles/* images/* + git commit -a -m "add more visual tests" + git push origin HEAD:master + +After updating the test data you can then do: + + # then go back to mapnik core + cd ../../ + # the submodule should be marked dirty + git status + # now commit the changes to the submodule + git commit test/data test/data-visual -m "update visual tests and data" + ## Community Mapnik is a creative community focused on making beautiful maps with beautiful software. diff --git a/docs/design.markdown b/docs/design.md similarity index 100% rename from docs/design.markdown rename to docs/design.md diff --git a/fonts/build.py b/fonts/build.py index 1dbcacfa9..de8b21487 100644 --- a/fonts/build.py +++ b/fonts/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os import glob @@ -32,4 +32,4 @@ if not env['SYSTEM_FONTS']: target_path = env['MAPNIK_FONTS_DEST'] if 'uninstall' not in COMMAND_LINE_TARGETS: env.Alias(target='install', source=env.Install(target_path, includes)) - env['create_uninstall_target'](env, target_path) \ No newline at end of file + env['create_uninstall_target'](env, target_path) diff --git a/include/build.py b/include/build.py index 5629841db..54bb16b59 100644 --- a/include/build.py +++ b/include/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/agg_helpers.hpp b/include/mapnik/agg_helpers.hpp index 8e2b1b2d7..139405cd9 100644 --- a/include/mapnik/agg_helpers.hpp +++ b/include/mapnik/agg_helpers.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/agg_pattern_source.hpp b/include/mapnik/agg_pattern_source.hpp index 324dee630..a0000204f 100644 --- a/include/mapnik/agg_pattern_source.hpp +++ b/include/mapnik/agg_pattern_source.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,7 @@ #define MAPNIK_AGG_PATTERN_SOURCE_HPP // mapnik -#include +#include #include // agg @@ -36,7 +36,7 @@ namespace mapnik class pattern_source : private util::noncopyable { public: - pattern_source(image_data_rgba8 const& pattern, double opacity = 1.0) + pattern_source(image_rgba8 const& pattern, double opacity = 1.0) : pattern_(pattern), opacity_(opacity) {} @@ -57,7 +57,7 @@ public: static_cast(((c >> 24) & 0xff) * opacity_)); } private: - image_data_rgba8 const& pattern_; + image_rgba8 const& pattern_; double opacity_; }; } diff --git a/include/mapnik/agg_rasterizer.hpp b/include/mapnik/agg_rasterizer.hpp index 0232f8858..51cf4cd5d 100644 --- a/include/mapnik/agg_rasterizer.hpp +++ b/include/mapnik/agg_rasterizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/agg_render_marker.hpp b/include/mapnik/agg_render_marker.hpp index dcd7dac9c..65e531cfd 100644 --- a/include/mapnik/agg_render_marker.hpp +++ b/include/mapnik/agg_render_marker.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,12 +22,13 @@ #include #include -#include #include #include #include #include #include +#include +#include // agg #include "agg_color_rgba.h" @@ -66,12 +67,14 @@ void render_vector_marker(SvgRenderer & svg_renderer, RasterizerType & ras, Rend } template -void render_raster_marker(RendererType renb, RasterizerType & ras, image_data_rgba8 const& src, +void render_raster_marker(RendererType renb, RasterizerType & ras, image_rgba8 const& src, agg::trans_affine const& tr, double opacity, float scale_factor, bool snap_to_pixels) { using color_type = agg::rgba8; - using pixfmt_pre = agg::pixfmt_rgba32_pre; + using const_rendering_buffer = util::rendering_buffer; + using pixfmt_pre = agg::pixfmt_alpha_blend_rgba; + agg::scanline_u8 sl; double width = src.width(); double height = src.height(); @@ -81,22 +84,22 @@ void render_raster_marker(RendererType renb, RasterizerType & ras, image_data_rg && (std::fabs(0.0 - tr.shx) < agg::affine_epsilon) && (std::fabs(1.0 - tr.sy) < agg::affine_epsilon)) { - agg::rendering_buffer src_buffer((unsigned char *)src.getBytes(),src.width(),src.height(),src.width() * 4); + const_rendering_buffer src_buffer(src); pixfmt_pre pixf_mask(src_buffer); if (snap_to_pixels) { renb.blend_from(pixf_mask, 0, - std::floor(tr.tx + .5), - std::floor(tr.ty + .5), + static_cast(std::floor(tr.tx + .5)), + static_cast(std::floor(tr.ty + .5)), unsigned(255*opacity)); } else { renb.blend_from(pixf_mask, 0, - tr.tx, - tr.ty, + static_cast(tr.tx), + static_cast(tr.ty), unsigned(255*opacity)); } } @@ -122,11 +125,8 @@ void render_raster_marker(RendererType renb, RasterizerType & ras, image_data_rg agg::span_allocator sa; agg::image_filter_lut filter; filter.calculate(agg::image_filter_bilinear(), true); - agg::rendering_buffer marker_buf((unsigned char *)src.getBytes(), - src.width(), - src.height(), - src.width()*4); - pixfmt_pre pixf(marker_buf); + const_rendering_buffer src_buffer(src); + pixfmt_pre pixf(src_buffer); img_accessor_type ia(pixf); agg::trans_affine final_tr(p, 0, 0, width, height); if (snap_to_pixels) diff --git a/include/mapnik/agg_renderer.hpp b/include/mapnik/agg_renderer.hpp index 7e50aea86..776632d68 100644 --- a/include/mapnik/agg_renderer.hpp +++ b/include/mapnik/agg_renderer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,14 +29,12 @@ #include // for noncopyable #include // for rule, symbolizers #include // for box2d -#include // for color #include // for view_transform #include // for composite_mode_e #include #include #include #include -#include // stl #include @@ -50,10 +48,12 @@ namespace mapnik { class feature_type_style; class label_collision_detector4; class layer; - class marker; + class color; + struct marker; class proj_transform; struct rasterizer; - class image_32; + struct rgba8_t; + template class image; } namespace mapnik { @@ -171,7 +171,7 @@ private: void setup(Map const& m); }; -extern template class MAPNIK_DECL agg_renderer; +extern template class MAPNIK_DECL agg_renderer>; } // namespace mapnik diff --git a/include/mapnik/attribute.hpp b/include/mapnik/attribute.hpp index 0e581e24d..b0cf6839a 100644 --- a/include/mapnik/attribute.hpp +++ b/include/mapnik/attribute.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,7 +26,7 @@ // mapnik #include #include - +#include // stl #include #include @@ -53,16 +53,7 @@ struct geometry_type_attribute template V value(F const& f) const { - mapnik::value_integer type = 0; - for (auto const& geom : f.paths()) - { - if (type != 0 && geom.type() != type) - { - return value_integer(4); // Collection - } - type = geom.type(); - } - return type; + return static_cast(util::to_ds_type(f.get_geometry())); } }; diff --git a/include/mapnik/attribute_collector.hpp b/include/mapnik/attribute_collector.hpp index 9f2e81573..878bfd4d4 100644 --- a/include/mapnik/attribute_collector.hpp +++ b/include/mapnik/attribute_collector.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -42,6 +42,9 @@ // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #pragma GCC diagnostic pop @@ -274,8 +277,8 @@ inline void group_attribute_collector::operator() (group_symbolizer const& sym) } // get indexed column names - int start = get(sym, keys::start_column); - int end = start + get(sym, keys::num_columns); + value_integer start = get(sym, keys::start_column); + value_integer end = start + get(sym, keys::num_columns); for (auto const& col_name : group_columns) { if (expand_index_columns_ && col_name.find('%') != std::string::npos) @@ -286,7 +289,7 @@ inline void group_attribute_collector::operator() (group_symbolizer const& sym) if (col_name.size() > 1) { // Indexed column name. add column name for each index value. - for (int col_idx = start; col_idx < end; ++col_idx) + for (value_integer col_idx = start; col_idx < end; ++col_idx) { std::string col_idx_str; if (mapnik::util::to_string(col_idx_str,col_idx)) diff --git a/include/mapnik/attribute_descriptor.hpp b/include/mapnik/attribute_descriptor.hpp index 1656cbb15..ff9715730 100644 --- a/include/mapnik/attribute_descriptor.hpp +++ b/include/mapnik/attribute_descriptor.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/boolean.hpp b/include/mapnik/boolean.hpp index 122604fc0..92751b7fe 100644 --- a/include/mapnik/boolean.hpp +++ b/include/mapnik/boolean.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,10 +28,7 @@ // std #include -#include #include -//#include -//#include namespace mapnik { diff --git a/include/mapnik/box2d.hpp b/include/mapnik/box2d.hpp index e6fc2a976..4471c281c 100644 --- a/include/mapnik/box2d.hpp +++ b/include/mapnik/box2d.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/cairo/cairo_context.hpp b/include/mapnik/cairo/cairo_context.hpp index 022d04092..3f065db36 100644 --- a/include/mapnik/cairo/cairo_context.hpp +++ b/include/mapnik/cairo/cairo_context.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,7 +27,8 @@ // mapnik #include #include -#include +#include +#include #include #include #include @@ -121,14 +122,14 @@ private: class cairo_pattern : private util::noncopyable { public: - explicit cairo_pattern(image_data_rgba8 const& data, double opacity = 1.0) + explicit cairo_pattern(image_rgba8 const& data, double opacity = 1.0) { - int pixels = data.width() * data.height(); - const unsigned int *in_ptr = data.getData(); + std::size_t pixels = data.width() * data.height(); + const unsigned int *in_ptr = data.data(); const unsigned int *in_end = in_ptr + pixels; unsigned int *out_ptr; - surface_ = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, data.width(), data.height()); + surface_ = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, static_cast(data.width()), static_cast(data.height())); out_ptr = reinterpret_cast(cairo_image_surface_get_data(surface_)); @@ -279,7 +280,6 @@ inline cairo_ptr create_context(cairo_surface_ptr const& surface) class cairo_context : private util::noncopyable { public: - cairo_context(cairo_ptr const& cairo); inline ErrorStatus get_status() const @@ -308,8 +308,8 @@ public: void paint(); void set_pattern(cairo_pattern const& pattern); void set_gradient(cairo_gradient const& pattern, box2d const& bbox); - void add_image(double x, double y, image_data_rgba8 & data, double opacity = 1.0); - void add_image(agg::trans_affine const& tr, image_data_rgba8 & data, double opacity = 1.0); + void add_image(double x, double y, image_rgba8 const& data, double opacity = 1.0); + void add_image(agg::trans_affine const& tr, image_rgba8 const& data, double opacity = 1.0); void set_font_face(cairo_face_manager & manager, face_ptr face); void set_font_matrix(cairo_matrix_t const& matrix); void set_matrix(cairo_matrix_t const& matrix); diff --git a/include/mapnik/cairo/cairo_image_util.hpp b/include/mapnik/cairo/cairo_image_util.hpp index 5fe764bcf..9f039d605 100644 --- a/include/mapnik/cairo/cairo_image_util.hpp +++ b/include/mapnik/cairo/cairo_image_util.hpp @@ -25,7 +25,7 @@ #define MAPNIK_CAIRO_IMAGE_UTIL_HPP // mapnik -#include +#include #include // for cairo_surface_ptr // stl @@ -33,7 +33,7 @@ namespace mapnik { -static inline void cairo_image_to_rgba8(mapnik::image_data_rgba8 & data, +static inline void cairo_image_to_rgba8(mapnik::image_rgba8 & data, cairo_surface_ptr const& surface) { if (cairo_image_surface_get_format(&*surface) != CAIRO_FORMAT_ARGB32) @@ -41,10 +41,10 @@ static inline void cairo_image_to_rgba8(mapnik::image_data_rgba8 & data, throw std::runtime_error("Unable to convert this Cairo format to rgba8 image"); } - if (cairo_image_surface_get_width(&*surface) != data.width() || - cairo_image_surface_get_height(&*surface) != data.height()) + if (cairo_image_surface_get_width(&*surface) != static_cast(data.width()) || + cairo_image_surface_get_height(&*surface) != static_cast(data.height())) { - throw std::runtime_error("Mismatch in dimensions: size of image must match side of cairo surface"); + throw std::runtime_error("Mismatch in dimensions: size of image must match side of cairo surface"); } int stride = cairo_image_surface_get_stride(&*surface) / 4; @@ -74,7 +74,7 @@ static inline void cairo_image_to_rgba8(mapnik::image_data_rgba8 & data, out_row[column] = color(r, g, b, a).rgba(); } - data.setRow(row, out_row.get(), data.width()); + data.set_row(row, out_row.get(), data.width()); } } diff --git a/include/mapnik/cairo/cairo_render_vector.hpp b/include/mapnik/cairo/cairo_render_vector.hpp index b529a508f..37bd44925 100644 --- a/include/mapnik/cairo/cairo_render_vector.hpp +++ b/include/mapnik/cairo/cairo_render_vector.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/cairo/cairo_renderer.hpp b/include/mapnik/cairo/cairo_renderer.hpp index 5aedba82f..a39b4ed9e 100644 --- a/include/mapnik/cairo/cairo_renderer.hpp +++ b/include/mapnik/cairo/cairo_renderer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -47,7 +47,7 @@ class feature_impl; class feature_type_style; class label_collision_detector4; class layer; -class marker; +struct marker; class proj_transform; class request; struct pixel_position; diff --git a/include/mapnik/cairo_io.hpp b/include/mapnik/cairo_io.hpp new file mode 100644 index 000000000..55b107286 --- /dev/null +++ b/include/mapnik/cairo_io.hpp @@ -0,0 +1,49 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_CAIRO_IO_HPP +#define MAPNIK_CAIRO_IO_HPP + +// mapnik +#include +#include + +// stl +#include + +namespace mapnik { + +#if defined(HAVE_CAIRO) +MAPNIK_DECL void save_to_cairo_file(mapnik::Map const& map, + std::string const& filename, + double scale_factor=1.0, + double scale_denominator=0.0); +MAPNIK_DECL void save_to_cairo_file(mapnik::Map const& map, + std::string const& filename, + std::string const& type, + double scale_factor=1.0, + double scale_denominator=0.0); +#endif + +} // end ns + +#endif // MAPNIK_CAIRO_IO_HPP diff --git a/include/mapnik/color.hpp b/include/mapnik/color.hpp index f220ddd07..b22a9989d 100644 --- a/include/mapnik/color.hpp +++ b/include/mapnik/color.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -44,29 +44,39 @@ private: std::uint8_t green_; std::uint8_t blue_; std::uint8_t alpha_; - + bool premultiplied_; public: // default ctor color() : red_(0xff), green_(0xff), blue_(0xff), - alpha_(0xff) + alpha_(0xff), + premultiplied_(false) {} - color(std::uint8_t red, std::uint8_t green, std::uint8_t blue, std::uint8_t alpha = 0xff) + color(std::uint8_t red, std::uint8_t green, std::uint8_t blue, std::uint8_t alpha = 0xff, bool premultiplied = false) : red_(red), green_(green), blue_(blue), - alpha_(alpha) + alpha_(alpha), + premultiplied_(premultiplied) {} + color(std::uint32_t rgba, bool premultiplied = false) + : red_(rgba & 0xff), + green_((rgba >> 8) & 0xff), + blue_((rgba >> 16) & 0xff), + alpha_((rgba >> 24) & 0xff), + premultiplied_(premultiplied) {} + // copy ctor color(const color& rhs) : red_(rhs.red_), green_(rhs.green_), blue_(rhs.blue_), - alpha_(rhs.alpha_) + alpha_(rhs.alpha_), + premultiplied_(rhs.premultiplied_) {} // move ctor @@ -74,14 +84,15 @@ public: : red_(std::move(rhs.red_)), green_(std::move(rhs.green_)), blue_(std::move(rhs.blue_)), - alpha_(std::move(rhs.alpha_)) {} + alpha_(std::move(rhs.alpha_)), + premultiplied_(std::move(rhs.premultiplied_)) {} - color( std::string const& str); + color( std::string const& str, bool premultiplied = false); std::string to_string() const; std::string to_hex_string() const; - void premultiply(); - void demultiply(); + bool premultiply(); + bool demultiply(); color& operator=(color rhs) { @@ -135,14 +146,18 @@ public: { alpha_ = alpha; } + inline bool get_premultiplied() const + { + return premultiplied_; + } + inline void set_premultiplied(bool status) + { + premultiplied_ = status; + } inline unsigned rgba() const { -#ifdef MAPNIK_BIG_ENDIAN - return static_cast((alpha_) | (blue_ << 8) | (green_ << 16) | (red_ << 24)) ; -#else return static_cast((alpha_ << 24) | (blue_ << 16) | (green_ << 8) | (red_)) ; -#endif } private: void swap(color & rhs) diff --git a/include/mapnik/color_factory.hpp b/include/mapnik/color_factory.hpp index 6bc360b95..6fdb5663c 100644 --- a/include/mapnik/color_factory.hpp +++ b/include/mapnik/color_factory.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/config.hpp b/include/mapnik/config.hpp index c96948b47..6461a6c08 100644 --- a/include/mapnik/config.hpp +++ b/include/mapnik/config.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/config_error.hpp b/include/mapnik/config_error.hpp index 2f6b3f6f4..b8bd31f67 100644 --- a/include/mapnik/config_error.hpp +++ b/include/mapnik/config_error.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/coord.hpp b/include/mapnik/coord.hpp index 040c76b88..fcdfa9090 100644 --- a/include/mapnik/coord.hpp +++ b/include/mapnik/coord.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/coord_array.hpp b/include/mapnik/coord_array.hpp deleted file mode 100644 index 04b920645..000000000 --- a/include/mapnik/coord_array.hpp +++ /dev/null @@ -1,113 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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_COORD_ARRAY_HPP -#define MAPNIK_COORD_ARRAY_HPP - -//mapnik -#include - -// stl -#include -#include - -namespace mapnik { - -template -class coord_array -{ -public: - using coord_type = T; - - coord_array(unsigned size=0) - : pt_(static_cast(size==0?0: ::operator new (sizeof(coord_type)*size))), - size_(size) {} - - coord_array(coord_array const& rhs) - : pt_(static_cast(rhs.size_==0?0: ::operator new (sizeof(coord_type)*rhs.size_))), - size_(rhs.size_) - { - std::copy(rhs.pt_, rhs.pt_ + rhs.size_ , pt_); - } - - ~coord_array() - { - ::operator delete (pt_); - } - - unsigned size() const - { - return size_; - } - - void set(unsigned index,double x,double y) - { - assert(index #include +#include // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -45,10 +49,10 @@ BOOST_FUSION_ADAPT_ADT( mapnik::color, - (unsigned, unsigned, obj.red(), obj.set_red(val)) - (unsigned, unsigned, obj.green(), obj.set_green(val)) - (unsigned, unsigned, obj.blue(), obj.set_blue(val)) - (unsigned, unsigned, obj.alpha(), obj.set_alpha(val)) + (unsigned, unsigned, obj.red(), obj.set_red(mapnik::safe_cast(val))) + (unsigned, unsigned, obj.green(), obj.set_green(mapnik::safe_cast(val))) + (unsigned, unsigned, obj.blue(), obj.set_blue(mapnik::safe_cast(val))) + (unsigned, unsigned, obj.alpha(), obj.set_alpha(mapnik::safe_cast(val))) ) namespace mapnik @@ -216,15 +220,6 @@ struct named_colors_ : qi::symbols } } ; -// clipper helper -template -inline int clip_int(int val) -{ - if (val < MIN ) return MIN; - if (val > MAX ) return MAX; - return val; -} - struct percent_conv_impl { template @@ -235,7 +230,7 @@ struct percent_conv_impl unsigned operator() (double val) const { - return clip_int<0,255>(int((255.0 * val)/100.0 + 0.5)); + return safe_cast(std::lround((255.0 * val)/100.0)); } }; @@ -249,7 +244,7 @@ struct alpha_conv_impl unsigned operator() (double val) const { - return clip_int<0,255>(int((255.0 * val) + 0.5)); + return safe_cast(std::lround((255.0 * val))); } }; @@ -284,9 +279,9 @@ struct hsl_conv_impl double g = hue_to_rgb(m1, m2, h); double b = hue_to_rgb(m1, m2, h - 1.0/3.0); - c.set_red(clip_int<0,255>(int((255.0 * r) + 0.5))); - c.set_green(clip_int<0,255>(int((255.0 * g) + 0.5))); - c.set_blue(clip_int<0,255>(int((255.0 * b) + 0.5))); + c.set_red(safe_cast(std::lround(255.0 * r))); + c.set_green(safe_cast(std::lround(255.0 * g))); + c.set_blue(safe_cast(std::lround(255.0 * b))); } }; diff --git a/include/mapnik/css_color_grammar_impl.hpp b/include/mapnik/css_color_grammar_impl.hpp index 4fe462711..4ce313435 100644 --- a/include/mapnik/css_color_grammar_impl.hpp +++ b/include/mapnik/css_color_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/datasource.hpp b/include/mapnik/datasource.hpp index ae2524c06..ec14a621c 100644 --- a/include/mapnik/datasource.hpp +++ b/include/mapnik/datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,14 +32,12 @@ #include #include #include - -// boost -#include -#include +#include // stl #include #include +#include namespace mapnik { @@ -71,13 +69,6 @@ public: Raster }; - enum geometry_t : std::uint8_t { - Point = 1, - LineString = 2, - Polygon = 3, - Collection = 4 - }; - datasource (parameters const& params) : params_(params) {} @@ -103,22 +94,26 @@ public: return params_ == rhs.params(); } + bool operator!=(datasource const& rhs) const + { + return !(*this == rhs); + } + /*! * @brief Get the type of the datasource * @return The type of the datasource (Vector or Raster) */ virtual datasource_t type() const = 0; - virtual processor_context_ptr get_context(feature_style_context_map&) const { return processor_context_ptr(); } - virtual featureset_ptr features_with_context(query const& q,processor_context_ptr /*ctx*/) const + virtual featureset_ptr features_with_context(query const& q, processor_context_ptr /*ctx*/) const { // default implementation without context use features method return features(q); } + virtual boost::optional get_geometry_type() 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 box2d envelope() const = 0; - virtual boost::optional get_geometry_type() const = 0; virtual layer_descriptor get_descriptor() const = 0; virtual ~datasource() {} protected: diff --git a/include/mapnik/datasource_cache.hpp b/include/mapnik/datasource_cache.hpp index a4ff89c7d..bf951e7f7 100644 --- a/include/mapnik/datasource_cache.hpp +++ b/include/mapnik/datasource_cache.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,7 @@ // mapnik #include -#include +#include #include // stl @@ -55,7 +55,6 @@ private: datasource_cache(); ~datasource_cache(); std::map > plugins_; - bool registered_; std::set plugin_directories_; }; diff --git a/bindings/python/mapnik_svg_generator_grammar.cpp b/include/mapnik/datasource_geometry_type.hpp similarity index 72% rename from bindings/python/mapnik_svg_generator_grammar.cpp rename to include/mapnik/datasource_geometry_type.hpp index 051eb0add..00e4b2af7 100644 --- a/bindings/python/mapnik_svg_generator_grammar.cpp +++ b/include/mapnik/datasource_geometry_type.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,9 +20,22 @@ * *****************************************************************************/ -#include -#include -#include +#ifndef MAPNIK_DATASOURCE_GEOMETRY_TYPE_HPP +#define MAPNIK_DATASOURCE_GEOMETRY_TYPE_HPP -using sink_type = std::back_insert_iterator; -template struct mapnik::svg::svg_path_generator; +#include + +namespace mapnik { + +enum datasource_geometry_t : std::uint8_t { + Unknown = 0, + Point = 1, + LineString = 2, + Polygon = 3, + Collection = 4 +}; + +} + + +#endif // MAPNIK_DATASOURCE_GEOMETRY_TYPE_HPP diff --git a/include/mapnik/debug.hpp b/include/mapnik/debug.hpp index 4e9609d90..aaccb4fb7 100644 --- a/include/mapnik/debug.hpp +++ b/include/mapnik/debug.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,8 +25,7 @@ // mapnik (should not depend on anything that need to use this) #include -#include -#include +#include #include // std @@ -70,7 +69,7 @@ namespace mapnik { static void set_severity(severity_type const& severity_level) { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(severity_mutex_); + std::lock_guard lock(severity_mutex_); #endif severity_level_ = severity_level; @@ -94,7 +93,7 @@ namespace mapnik { severity_type const& security_level) { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(severity_mutex_); + std::lock_guard lock(severity_mutex_); #endif if (! object_name.empty()) { @@ -105,7 +104,7 @@ namespace mapnik { static void clear_object_severity() { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(severity_mutex_); + std::lock_guard lock(severity_mutex_); #endif object_severity_level_.clear(); @@ -120,7 +119,7 @@ namespace mapnik { static void set_format(std::string const& format) { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(format_mutex_); + std::lock_guard lock(format_mutex_); #endif format_ = format; } @@ -166,7 +165,7 @@ namespace mapnik { { #ifdef MAPNIK_THREADSAFE static std::mutex mutex; - mapnik::scoped_lock lock(mutex); + std::lock_guard lock(mutex); #endif std::clog << logger::str() << " " << s.str() << std::endl; } diff --git a/include/mapnik/ellipsoid.hpp b/include/mapnik/ellipsoid.hpp index e1be68ca3..6f872d4d4 100644 --- a/include/mapnik/ellipsoid.hpp +++ b/include/mapnik/ellipsoid.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/enumeration.hpp b/include/mapnik/enumeration.hpp index 935d2f8e2..c0cfe1e8a 100644 --- a/include/mapnik/enumeration.hpp +++ b/include/mapnik/enumeration.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,11 +25,13 @@ // mapnik #include +#include // stl #include #include #include +#include namespace mapnik { @@ -176,11 +178,24 @@ public: * */ void from_string(std::string const& str) { + // TODO: Enum value strings with underscore are deprecated in Mapnik 3.x + // and support will be removed in Mapnik 4.x. + bool deprecated = false; + std::string str_copy(str); + if (str_copy.find('_') != std::string::npos) + { + std::replace(str_copy.begin(), str_copy.end(), '_', '-'); + deprecated = true; + } for (unsigned i = 0; i < THE_MAX; ++i) { - if (str == our_strings_[i]) + if (str_copy == our_strings_[i]) { value_ = static_cast(i); + if (deprecated) + { + MAPNIK_LOG_ERROR(enumerations) << "enumeration value (" << str << ") using \"_\" is deprecated and will be removed in Mapnik 4.x, use '" << str_copy << "' instead"; + } return; } } diff --git a/include/mapnik/evaluate_global_attributes.hpp b/include/mapnik/evaluate_global_attributes.hpp index 63f0348a4..3e3d63cbd 100644 --- a/include/mapnik/evaluate_global_attributes.hpp +++ b/include/mapnik/evaluate_global_attributes.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/expression.hpp b/include/mapnik/expression.hpp index 88945074a..7b9ca59e7 100644 --- a/include/mapnik/expression.hpp +++ b/include/mapnik/expression.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/expression_evaluator.hpp b/include/mapnik/expression_evaluator.hpp index 1d37bdecc..6ac0451ef 100644 --- a/include/mapnik/expression_evaluator.hpp +++ b/include/mapnik/expression_evaluator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/expression_grammar.hpp b/include/mapnik/expression_grammar.hpp index f82387ea1..7a71976a7 100644 --- a/include/mapnik/expression_grammar.hpp +++ b/include/mapnik/expression_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,11 +29,14 @@ #include #include #include - +//#include // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -109,12 +112,12 @@ struct regex_replace_impl mapnik::transcoder const& tr_; }; -struct geometry_types : qi::symbols +struct geometry_types : qi::symbols { geometry_types() { add - ("point",1) + ("point", 1) ("linestring", 2) ("polygon",3) ("collection",4) diff --git a/include/mapnik/expression_grammar_impl.hpp b/include/mapnik/expression_grammar_impl.hpp index a4d8353b0..d123b3bae 100644 --- a/include/mapnik/expression_grammar_impl.hpp +++ b/include/mapnik/expression_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/expression_node.hpp b/include/mapnik/expression_node.hpp index e9f00dcaa..7731414a4 100644 --- a/include/mapnik/expression_node.hpp +++ b/include/mapnik/expression_node.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -38,21 +38,21 @@ namespace mapnik using value_type = mapnik::value; template struct make_op; -template <> struct make_op { using type = std::negate;}; -template <> struct make_op { using type = std::plus;}; -template <> struct make_op { using type = std::minus;}; -template <> struct make_op { using type = std::multiplies;}; -template <> struct make_op { using type = std::divides;}; -template <> struct make_op { using type = std::modulus;}; -template <> struct make_op { using type = std::less;}; -template <> struct make_op { using type = std::less_equal;}; -template <> struct make_op { using type = std::greater;}; -template <> struct make_op { using type = std::greater_equal;}; -template <> struct make_op { using type = std::equal_to;}; -template <> struct make_op { using type = std::not_equal_to;}; -template <> struct make_op { using type = std::logical_not;}; -template <> struct make_op { using type = std::logical_and;}; -template <> struct make_op { using type = std::logical_or;}; +template <> struct make_op { using type = std::negate;}; +template <> struct make_op { using type = std::plus;}; +template <> struct make_op { using type = std::minus;}; +template <> struct make_op { using type = std::multiplies;}; +template <> struct make_op { using type = std::divides;}; +template <> struct make_op { using type = std::modulus;}; +template <> struct make_op { using type = std::less;}; +template <> struct make_op { using type = std::less_equal;}; +template <> struct make_op { using type = std::greater;}; +template <> struct make_op { using type = std::greater_equal;}; +template <> struct make_op { using type = std::equal_to;}; +template <> struct make_op { using type = std::not_equal_to;}; +template <> struct make_op { using type = std::logical_not;}; +template <> struct make_op { using type = std::logical_and;}; +template <> struct make_op { using type = std::logical_or;}; template struct unary_node @@ -86,8 +86,8 @@ struct unary_function_call { using argument_type = expr_node; unary_function_call() = default; - unary_function_call(unary_function_impl fun, argument_type const& arg) - : fun(fun), arg(arg) {} + unary_function_call(unary_function_impl _fun, argument_type const& _arg) + : fun(_fun), arg(_arg) {} unary_function_impl fun; argument_type arg; @@ -97,8 +97,8 @@ struct binary_function_call { using argument_type = expr_node; binary_function_call() = default; - binary_function_call(binary_function_impl fun, argument_type const& arg1, argument_type const& arg2) - : fun(fun), arg1(arg1), arg2(arg2) {} + binary_function_call(binary_function_impl _fun, argument_type const& _arg1, argument_type const& _arg2) + : fun(_fun), arg1(_arg1), arg2(_arg2) {} binary_function_impl fun; argument_type arg1; argument_type arg2; @@ -130,77 +130,77 @@ struct MAPNIK_DECL regex_replace_node inline expr_node & operator- (expr_node& expr) { - return expr = unary_node(expr); + return expr = unary_node(expr); } inline expr_node & operator += ( expr_node &left, expr_node const& right) { - return left = binary_node(left,right); + return left = binary_node(left,right); } inline expr_node & operator -= ( expr_node &left, expr_node const& right) { - return left = binary_node(left,right); + return left = binary_node(left,right); } inline expr_node & operator *= ( expr_node &left , expr_node const& right) { - return left = binary_node(left,right); + return left = binary_node(left,right); } inline expr_node & operator /= ( expr_node &left , expr_node const& right) { - return left = binary_node(left,right); + return left = binary_node(left,right); } inline expr_node & operator %= ( expr_node &left , expr_node const& right) { - return left = binary_node(left,right); + return left = binary_node(left,right); } inline expr_node & operator < ( expr_node &left, expr_node const& right) { - return left = binary_node(left,right); + return left = binary_node(left,right); } inline expr_node & operator <= ( expr_node &left, expr_node const& right) { - return left = binary_node(left,right); + return left = binary_node(left,right); } inline expr_node & operator > ( expr_node &left, expr_node const& right) { - return left = binary_node(left,right); + return left = binary_node(left,right); } inline expr_node & operator >= ( expr_node &left, expr_node const& right) { - return left = binary_node(left,right); + return left = binary_node(left,right); } inline expr_node & operator == ( expr_node &left, expr_node const& right) { - return left = binary_node(left,right); + return left = binary_node(left,right); } inline expr_node & operator != ( expr_node &left, expr_node const& right) { - return left = binary_node(left,right); + return left = binary_node(left,right); } inline expr_node & operator ! (expr_node & expr) { - return expr = unary_node(expr); + return expr = unary_node(expr); } inline expr_node & operator && ( expr_node &left, expr_node const& right) { - return left = binary_node(left,right); + return left = binary_node(left,right); } inline expr_node & operator || ( expr_node &left, expr_node const& right) { - return left = binary_node(left,right); + return left = binary_node(left,right); } } diff --git a/include/mapnik/expression_node_types.hpp b/include/mapnik/expression_node_types.hpp index aff37adf7..371274a4e 100644 --- a/include/mapnik/expression_node_types.hpp +++ b/include/mapnik/expression_node_types.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -175,21 +175,21 @@ value_unicode_string, attribute, global_attribute, geometry_type_attribute, -util::recursive_wrapper >, -util::recursive_wrapper >, -util::recursive_wrapper >, -util::recursive_wrapper >, -util::recursive_wrapper >, -util::recursive_wrapper >, -util::recursive_wrapper >, -util::recursive_wrapper >, -util::recursive_wrapper >, -util::recursive_wrapper >, -util::recursive_wrapper >, -util::recursive_wrapper >, -util::recursive_wrapper >, -util::recursive_wrapper >, -util::recursive_wrapper >, +util::recursive_wrapper >, +util::recursive_wrapper >, +util::recursive_wrapper >, +util::recursive_wrapper >, +util::recursive_wrapper >, +util::recursive_wrapper >, +util::recursive_wrapper >, +util::recursive_wrapper >, +util::recursive_wrapper >, +util::recursive_wrapper >, +util::recursive_wrapper >, +util::recursive_wrapper >, +util::recursive_wrapper >, +util::recursive_wrapper >, +util::recursive_wrapper >, util::recursive_wrapper, util::recursive_wrapper, util::recursive_wrapper, diff --git a/include/mapnik/expression_string.hpp b/include/mapnik/expression_string.hpp index afb6331ca..6efc07e81 100644 --- a/include/mapnik/expression_string.hpp +++ b/include/mapnik/expression_string.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/factory.hpp b/include/mapnik/factory.hpp index 87b437157..81f261320 100644 --- a/include/mapnik/factory.hpp +++ b/include/mapnik/factory.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,7 @@ #define MAPNIK_FACTORY_HPP // mapnik -#include +#include // stl #include diff --git a/include/mapnik/feature.hpp b/include/mapnik/feature.hpp index 1baa2f594..eb084bc0c 100644 --- a/include/mapnik/feature.hpp +++ b/include/mapnik/feature.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,7 +29,8 @@ #include #include #include -#include +#include +// #include #include @@ -40,6 +41,7 @@ #include // for basic_ostream, operator<<, etc #include // for basic_stringstream #include // for out_of_range +#include namespace mapnik { @@ -103,9 +105,8 @@ public: : id_(id), ctx_(ctx), data_(ctx_->mapping_.size()), - geom_cont_(), - raster_() - {} + geom_(geometry::geometry_empty()), + raster_() {} inline mapnik::value_integer id() const { return id_;} @@ -114,13 +115,13 @@ public: template inline void put(context_type::key_type const& key, T const& val) { - put(key, std::move(value(val))); + put(key, value(val)); } template inline void put_new(context_type::key_type const& key, T const& val) { - put_new(key,std::move(value(val))); + put_new(key, value(val)); } inline void put(context_type::key_type const& key, value && val) @@ -194,55 +195,24 @@ public: return ctx_; } - inline geometry_container const& paths() const + inline void set_geometry(geometry::geometry && geom) { - return geom_cont_; + geom_ = std::move(geom); } - inline geometry_container & paths() + inline void set_geometry_copy(geometry::geometry const& geom) { - return geom_cont_; + geom_ = geom; } - inline void add_geometry(geometry_type * geom) + inline geometry::geometry const& get_geometry() const { - geom_cont_.push_back(geom); - } - - inline std::size_t num_geometries() const - { - return geom_cont_.size(); - } - - inline geometry_type const& get_geometry(std::size_t index) const - { - return geom_cont_[index]; - } - - inline geometry_type& get_geometry(std::size_t index) - { - return geom_cont_[index]; + return geom_; } inline box2d envelope() const { - // TODO - cache this - box2d result; - bool first = true; - for (auto const& geom : geom_cont_) - { - if (first) - { - box2d box = geom.envelope(); - result.init(box.minx(),box.miny(),box.maxx(),box.maxy()); - first = false; - } - else - { - result.expand_to_include(geom.envelope()); - } - } - return result; + return mapnik::geometry::envelope(geom_); } inline raster_ptr const& get_raster() const @@ -292,7 +262,7 @@ private: mapnik::value_integer id_; context_ptr ctx_; cont_type data_; - geometry_container geom_cont_; + geometry::geometry geom_; raster_ptr raster_; }; diff --git a/include/mapnik/feature_factory.hpp b/include/mapnik/feature_factory.hpp index 57ed6dc6d..c4a4d560e 100644 --- a/include/mapnik/feature_factory.hpp +++ b/include/mapnik/feature_factory.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/feature_kv_iterator.hpp b/include/mapnik/feature_kv_iterator.hpp index 5d9b93a9b..37093a897 100644 --- a/include/mapnik/feature_kv_iterator.hpp +++ b/include/mapnik/feature_kv_iterator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/feature_layer_desc.hpp b/include/mapnik/feature_layer_desc.hpp index 7dd1293f7..c89d944cb 100644 --- a/include/mapnik/feature_layer_desc.hpp +++ b/include/mapnik/feature_layer_desc.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/feature_style_processor.hpp b/include/mapnik/feature_style_processor.hpp index cc36c01e6..062c9d666 100644 --- a/include/mapnik/feature_style_processor.hpp +++ b/include/mapnik/feature_style_processor.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/feature_style_processor_context.hpp b/include/mapnik/feature_style_processor_context.hpp index 585c746ef..aca0c8f72 100644 --- a/include/mapnik/feature_style_processor_context.hpp +++ b/include/mapnik/feature_style_processor_context.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/feature_style_processor_impl.hpp b/include/mapnik/feature_style_processor_impl.hpp index 6e0094ba1..0c7782198 100644 --- a/include/mapnik/feature_style_processor_impl.hpp +++ b/include/mapnik/feature_style_processor_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -224,7 +224,7 @@ void feature_style_processor::prepare_layer(layer_rendering_material std::vector const& style_names = lay.styles(); - unsigned int num_styles = style_names.size(); + std::size_t num_styles = style_names.size(); if (num_styles == 0) { MAPNIK_LOG_DEBUG(feature_style_processor) @@ -361,7 +361,7 @@ void feature_style_processor::prepare_layer(layer_rendering_material boost::optional style=m_.find_style(style_name); if (!style) { - MAPNIK_LOG_DEBUG(feature_style_processor) + MAPNIK_LOG_ERROR(feature_style_processor) << "feature_style_processor: Style=" << style_name << " required for layer=" << lay.name() << " does not exist."; diff --git a/include/mapnik/feature_type_style.hpp b/include/mapnik/feature_type_style.hpp index 0f0d839fb..68240af3a 100644 --- a/include/mapnik/feature_type_style.hpp +++ b/include/mapnik/feature_type_style.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/featureset.hpp b/include/mapnik/featureset.hpp index e23532a4f..c6829d1eb 100644 --- a/include/mapnik/featureset.hpp +++ b/include/mapnik/featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/filter_featureset.hpp b/include/mapnik/filter_featureset.hpp index b70462556..ee3fa4087 100644 --- a/include/mapnik/filter_featureset.hpp +++ b/include/mapnik/filter_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/font_engine_freetype.hpp b/include/mapnik/font_engine_freetype.hpp index 78dc055d5..33ac45035 100644 --- a/include/mapnik/font_engine_freetype.hpp +++ b/include/mapnik/font_engine_freetype.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/font_set.hpp b/include/mapnik/font_set.hpp index 8803c99eb..5df8e35df 100644 --- a/include/mapnik/font_set.hpp +++ b/include/mapnik/font_set.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/function_call.hpp b/include/mapnik/function_call.hpp index 5453d92af..efbaa5f28 100644 --- a/include/mapnik/function_call.hpp +++ b/include/mapnik/function_call.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/geom_util.hpp b/include/mapnik/geom_util.hpp index 6e8827974..7dbe51ff4 100644 --- a/include/mapnik/geom_util.hpp +++ b/include/mapnik/geom_util.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,8 +27,7 @@ #include #include #include -#include // for geometry_type::types (TODO: avoid this interdependence) - +#include // stl #include #include @@ -377,6 +376,7 @@ bool centroid(PathType & path, double & x, double & y) } // Compute centroid over a set of paths +#if 0 template bool centroid_geoms(Iter start, Iter end, double & x, double & y) { @@ -392,9 +392,10 @@ bool centroid_geoms(Iter start, Iter end, double & x, double & y) double ytmp = 0.0; unsigned count = 0; - while (start!=end) + while (start != end) { - typename Iter::value_type const& path = *start++; + typename Iter::value_type const& geom = *start++; + vertex_adapter path(geom); path.rewind(0); unsigned command = path.vertex(&x0, &y0); if (command == SEG_END) continue; @@ -444,6 +445,8 @@ bool centroid_geoms(Iter start, Iter end, double & x, double & y) return true; } +#endif + template bool hit_test(PathType & path, double x, double y, double tol) { @@ -452,6 +455,8 @@ bool hit_test(PathType & path, double x, double y, double tol) double y0 = 0; double x1 = 0; double y1 = 0; + double start_x = 0; + double start_y = 0; path.rewind(0); unsigned command = path.vertex(&x0, &y0); if (command == SEG_END) @@ -459,23 +464,26 @@ bool hit_test(PathType & path, double x, double y, double tol) return false; } unsigned count = 0; - mapnik::geometry_type::types geom_type = static_cast(path.type()); + mapnik::geometry::geometry_types geom_type = static_cast(path.type()); while (SEG_END != (command = path.vertex(&x1, &y1))) { - if (command == SEG_CLOSE) - { - continue; - } ++count; if (command == SEG_MOVETO) { x0 = x1; y0 = y1; + start_x = x0; + start_y = y0; continue; } + else if (command == SEG_CLOSE) + { + x1 = start_x; + y1 = start_y; + } switch(geom_type) { - case mapnik::geometry_type::types::Polygon: + case mapnik::geometry::geometry_types::Polygon: { if ((((y1 <= y) && (y < y0)) || ((y0 <= y) && (y < y1))) && @@ -483,7 +491,7 @@ bool hit_test(PathType & path, double x, double y, double tol) inside=!inside; break; } - case mapnik::geometry_type::types::LineString: + case mapnik::geometry::geometry_types::LineString: { double distance = point_to_segment_distance(x,y,x0,y0,x1,y1); if (distance < tol) @@ -512,10 +520,6 @@ bool interior_position(PathType & path, double & x, double & y) if (!label::centroid(path, x,y)) return false; - // if we are not a polygon, or the default is within the polygon we are done - if (hit_test(path,x,y,0.001)) - return true; - // otherwise we find a horizontal line across the polygon and then return the // center of the widest intersection between the polygon and the line. diff --git a/include/mapnik/geometry.hpp b/include/mapnik/geometry.hpp index 29ff13b12..970f8ddcf 100644 --- a/include/mapnik/geometry.hpp +++ b/include/mapnik/geometry.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,134 +23,139 @@ #ifndef MAPNIK_GEOMETRY_HPP #define MAPNIK_GEOMETRY_HPP -// mapnik -#include -#include -#include +#include +#include +#include +#include +#include -namespace mapnik { +namespace mapnik { namespace geometry { -template class Container=vertex_vector> -class geometry : private util::noncopyable +template +struct point { - -public: - static const std::uint8_t geometry_bits = 7; - enum types : std::uint8_t - { - Unknown = 0x00, - Point = 0x01, - LineString = 0x02, - Polygon = 0x03, - PolygonExterior = Polygon, - PolygonInterior = Polygon | ( 1 << geometry_bits) - }; - using coord_type = T; - using container_type = Container; - using value_type = typename container_type::value_type; - using size_type = typename container_type::size_type; -private: - container_type cont_; - types type_; - mutable size_type itr_; -public: - - geometry() - : type_(Unknown), - itr_(0) + using value_type = T; + point() {} + point(T x_, T y_) + : x(x_), y(y_) {} + // temp - remove when geometry is templated on value_type + point(mapnik::coord const& c) + : x(c.x), y(c.y) {} - explicit geometry(types type) - : type_(type), - itr_(0) - {} - - types type() const + point(point const& other) = default; + point(point && other) noexcept = default; + point & operator=(point const& other) = default; + friend inline bool operator== (point const& a, point const& b) { - return static_cast(type_ & types::Polygon); + return a.x == b.x && a.y == b.y; + } + friend inline bool operator!= (point const& a, point const& b) + { + return a.x != b.x || a.y != b.y; + } + value_type x; + value_type y; +}; + + +template +struct line_string : std::vector > +{ + line_string() = default; + line_string (std::size_t size) + : std::vector >(size) {} + line_string (line_string && other) = default ; + line_string& operator=(line_string &&) = default; + line_string (line_string const& ) = default; + line_string& operator=(line_string const&) = default; + inline std::size_t num_points() const { return std::vector>::size(); } + inline void add_coord(T x, T y) { std::vector>::template emplace_back(x,y);} +}; + +template +struct linear_ring : line_string +{ + linear_ring() = default; + linear_ring(std::size_t size) + : line_string(size) {} + linear_ring (linear_ring && other) = default ; + linear_ring& operator=(linear_ring &&) = default; + linear_ring(line_string && other) + : line_string(other) {} + linear_ring (linear_ring const& ) = default; + linear_ring(line_string const& other) + : line_string(other) {} + linear_ring& operator=(linear_ring const&) = default; + +}; + +template +struct polygon +{ + linear_ring exterior_ring; + std::vector> interior_rings; + + polygon() = default; + inline void set_exterior_ring(linear_ring && ring) + { + exterior_ring = std::move(ring); } - bool interior() const + inline void add_hole(linear_ring && ring) { - return static_cast(type_ >> geometry_bits); + interior_rings.emplace_back(std::move(ring)); } - void set_type(types type) - { - type_ = type; - } + inline bool empty() const { return exterior_ring.empty(); } - container_type const& data() const + inline std::size_t num_rings() const { - return cont_; - } - - size_type size() const - { - return cont_.size(); - } - - box2d envelope() const - { - box2d result; - double x = 0; - double y = 0; - rewind(0); - size_type geom_size = size(); - for (size_type i = 0; i < geom_size; ++i) - { - unsigned cmd = vertex(&x,&y); - if (cmd == SEG_CLOSE) continue; - if (i == 0) - { - result.init(x,y,x,y); - } - else - { - result.expand_to_include(x,y); - } - } - return result; - } - - void push_vertex(coord_type x, coord_type y, CommandType c) - { - cont_.push_back(x,y,c); - } - - void line_to(coord_type x,coord_type y) - { - push_vertex(x,y,SEG_LINETO); - } - - void move_to(coord_type x,coord_type y) - { - push_vertex(x,y,SEG_MOVETO); - } - - void close_path() - { - push_vertex(0,0,SEG_CLOSE); - } - - unsigned vertex(double* x, double* y) const - { - return cont_.get_vertex(itr_++,x,y); - } - - unsigned vertex(std::size_t index, double* x, double* y) const - { - return cont_.get_vertex(index, x, y); - } - - void rewind(unsigned ) const - { - itr_=0; + return 1 + interior_rings.size(); } }; -using geometry_type = geometry; +template +struct multi_point : line_string {}; -} +template +struct multi_line_string : std::vector> {}; -#endif // MAPNIK_GEOMETRY_HPP +template +struct multi_polygon : std::vector> {}; + +template +struct geometry_collection; + +struct geometry_empty {}; + + +template +using geometry_base = mapnik::util::variant, + line_string, + polygon, + multi_point, + multi_line_string, + multi_polygon, + mapnik::util::recursive_wrapper > >; +template +struct geometry : geometry_base +{ + using value_type = T; + + geometry() + : geometry_base() {} // empty + + template + geometry(G && geom) + : geometry_base(std::forward(geom)) {} + +}; + +template +struct geometry_collection : std::vector> {}; + +}} + +#endif //MAPNIK_GEOMETRY_HPP diff --git a/include/mapnik/geometry_adapters.hpp b/include/mapnik/geometry_adapters.hpp new file mode 100644 index 000000000..0c7a65713 --- /dev/null +++ b/include/mapnik/geometry_adapters.hpp @@ -0,0 +1,225 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_ADAPTERS_HPP +#define MAPNIK_GEOMETRY_ADAPTERS_HPP + +#include + +// undef B0 to workaround https://svn.boost.org/trac/boost/ticket/10467 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#undef B0 +#include +#include +#include +// NOTE: ideally we would not include all of boost/geometry here to save on compile time +// however we need to pull in for things to work +// and once we do that the compile time is == to just including boost/geometry.hpp +#include +#pragma GCC diagnostic pop + +#include +#include +#include + +#include +#include + +// register point +BOOST_GEOMETRY_REGISTER_POINT_2D (mapnik::geometry::point, double, boost::geometry::cs::cartesian, x, y) +BOOST_GEOMETRY_REGISTER_POINT_2D (mapnik::geometry::point, std::int64_t, boost::geometry::cs::cartesian, x, y) +// ring +BOOST_GEOMETRY_REGISTER_RING_TEMPLATED(mapnik::geometry::linear_ring) +// needed by box2d +BOOST_GEOMETRY_REGISTER_POINT_2D(mapnik::coord2d, double, boost::geometry::cs::cartesian, x, y) + +namespace boost { + +template +struct range_iterator > +{ + using type = typename mapnik::geometry::line_string::iterator; +}; + +template +struct range_const_iterator > +{ + using type = typename mapnik::geometry::line_string::const_iterator; +}; + +template +inline typename mapnik::geometry::line_string::iterator +range_begin(mapnik::geometry::line_string & line) {return line.begin();} + +template +inline typename mapnik::geometry::line_string::iterator +range_end(mapnik::geometry::line_string & line) {return line.end();} + +template +inline typename mapnik::geometry::line_string::const_iterator +range_begin(mapnik::geometry::line_string const& line) {return line.begin();} + +template +inline typename mapnik::geometry::line_string::const_iterator +range_end(mapnik::geometry::line_string const& line) {return line.end();} + +namespace geometry { namespace traits { + +// register mapnik::box2d +template<> struct tag > { using type = box_tag; }; +template<> struct point_type > { using type = mapnik::coord2d; }; + +template <> +struct indexed_access, min_corner, 0> +{ + using ct = coordinate_type::type; + static inline ct get(mapnik::box2d const& b) { return b.minx();} + static inline void set(mapnik::box2d &b, ct const& value) { b.set_minx(value); } +}; + +template <> +struct indexed_access, min_corner, 1> +{ + using ct = coordinate_type::type; + static inline ct get(mapnik::box2d const& b) { return b.miny();} + static inline void set(mapnik::box2d &b, ct const& value) { b.set_miny(value); } +}; + +template <> +struct indexed_access, max_corner, 0> +{ + using ct = coordinate_type::type; + static inline ct get(mapnik::box2d const& b) { return b.maxx();} + static inline void set(mapnik::box2d &b, ct const& value) { b.set_maxx(value); } +}; + +template <> +struct indexed_access, max_corner, 1> +{ + using ct = coordinate_type::type; + static inline ct get(mapnik::box2d const& b) { return b.maxy();} + static inline void set(mapnik::box2d &b , ct const& value) { b.set_maxy(value); } +}; + +// mapnik::geometry::line_string +template +struct tag > +{ + using type = linestring_tag; +}; + +// mapnik::geometry::polygon +template +struct tag > +{ + using type = polygon_tag; +}; + +template +struct point_order > +{ + static const order_selector value = counterclockwise; +}; + +template +struct tag > +{ + using type = multi_point_tag; +}; + +template +struct tag > +{ + using type = multi_linestring_tag; +}; + +template +struct tag > +{ + using type = multi_polygon_tag; +}; + +// ring +template +struct ring_const_type > +{ + using type = typename mapnik::geometry::linear_ring const&; +}; + +template +struct ring_mutable_type > +{ + using type = typename mapnik::geometry::linear_ring&; +}; + +// interior +template +struct interior_const_type > +{ + using type = typename std::vector > const&; +}; + +template +struct interior_mutable_type > +{ + using type = typename std::vector >&; +}; + +// exterior +template +struct exterior_ring > +{ + static mapnik::geometry::linear_ring & get(mapnik::geometry::polygon & p) + { + return p.exterior_ring; + } + + static mapnik::geometry::linear_ring const& get(mapnik::geometry::polygon const& p) + { + return p.exterior_ring; + } +}; + +template +struct interior_rings > +{ + using holes_type = std::vector >; + static holes_type& get(mapnik::geometry::polygon & p) + { + return p.interior_rings; + } + + static holes_type const& get(mapnik::geometry::polygon const& p) + { + return p.interior_rings; + } +}; + +}}} + + +#endif //MAPNIK_GEOMETRY_ADAPTERS_HPP diff --git a/include/mapnik/geometry_centroid.hpp b/include/mapnik/geometry_centroid.hpp new file mode 100644 index 000000000..71d0c0754 --- /dev/null +++ b/include/mapnik/geometry_centroid.hpp @@ -0,0 +1,106 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_CENTROID_HPP +#define MAPNIK_GEOMETRY_CENTROID_HPP + +#include +#include +#include + +namespace mapnik { namespace geometry { + +namespace detail { + +template +struct geometry_centroid +{ + using result_type = bool; + + geometry_centroid(point & pt) + : pt_(pt) {} + + template + result_type operator() (T1 const& geom) const + { + return util::apply_visitor(*this, geom); + } + + result_type operator() (geometry_empty const&) const + { + return false; + } + + result_type operator() (geometry_collection const&) const + { + return false; + } + + result_type operator() (point const& geom) const + { + boost::geometry::centroid(geom, pt_); + return true; + } + + result_type operator() (line_string const& geom) const + { + boost::geometry::centroid(geom, pt_); + return true; + } + + result_type operator() (polygon const& geom) const + { + boost::geometry::centroid(geom, pt_); + return true; + } + + result_type operator() (multi_point const& geom) const + { + boost::geometry::centroid(geom, pt_); + return true; + } + + result_type operator() (multi_line_string const& geom) const + { + boost::geometry::centroid(geom, pt_); + return true; + } + + result_type operator() (multi_polygon const& geom) const + { + boost::geometry::centroid(geom, pt_); + return true; + } + point & pt_; +}; + +} + +template +inline bool centroid(T1 const& geom, point & pt) +{ + return detail::geometry_centroid(pt)(geom); +} + +}} + +#endif // MAPNIK_GEOMETRY_CENTROID_HPP diff --git a/include/mapnik/geometry_correct.hpp b/include/mapnik/geometry_correct.hpp new file mode 100644 index 000000000..dcbb2d7ab --- /dev/null +++ b/include/mapnik/geometry_correct.hpp @@ -0,0 +1,96 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_CORRECT_HPP +#define MAPNIK_GEOMETRY_CORRECT_HPP + +#include +#include +#include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" +#include +#pragma GCC diagnostic pop + +#include + +namespace mapnik { namespace geometry { + +namespace detail { + +struct geometry_correct +{ + using result_type = void; + + template + result_type operator() (geometry & geom) const + { + mapnik::util::apply_visitor(*this, geom); + } + + template + result_type operator() (geometry_collection & collection) const + { + for (auto & geom : collection) + { + (*this)(geom); + } + } + + template + result_type operator() (polygon & poly) const + { + boost::geometry::correct(poly); + } + + template + result_type operator() (multi_polygon & multi_poly) const + { + boost::geometry::correct(multi_poly); + } + + template + result_type operator() (T &) const + { + //no-op + } + +}; + +} + +template +inline void correct(GeomType & geom) +{ + static_assert(!std::is_const::value,"mapnik::geometry::correct on const& is invalid"); + detail::geometry_correct()(geom); +} + +}} + +#endif // MAPNIK_GEOMETRY_CORRECT_HPP diff --git a/include/mapnik/geometry_envelope.hpp b/include/mapnik/geometry_envelope.hpp new file mode 100644 index 000000000..17b8fcb44 --- /dev/null +++ b/include/mapnik/geometry_envelope.hpp @@ -0,0 +1,38 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_ENVELOPE_HPP +#define MAPNIK_GEOMETRY_ENVELOPE_HPP + +#include +#include + +namespace mapnik { +namespace geometry { + +template +MAPNIK_DECL mapnik::box2d envelope(T const& geom); + +} // end ns geometry +} // end ns mapnik + +#endif // MAPNIK_GEOMETRY_ENVELOPE_HPP diff --git a/include/mapnik/geometry_envelope_impl.hpp b/include/mapnik/geometry_envelope_impl.hpp new file mode 100644 index 000000000..dbed6aa47 --- /dev/null +++ b/include/mapnik/geometry_envelope_impl.hpp @@ -0,0 +1,152 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +#include +#include +#include + +namespace mapnik { namespace geometry { + +namespace detail { + +struct geometry_envelope +{ + using bbox_type = box2d; + bbox_type & bbox; + + geometry_envelope(bbox_type & bbox_) + : bbox(bbox_) {} + + template + void operator() (T const& geom) const + { + return mapnik::util::apply_visitor(*this, geom); + } + + void operator() (mapnik::geometry::geometry_empty const&) const {} + + template + void operator() (mapnik::geometry::point const& pt) const + { + if (!bbox.valid()) + { + bbox.init(pt.x, pt.y, pt.x, pt.y); + } + bbox.expand_to_include(pt.x, pt.y); + } + + template + void operator() (mapnik::geometry::line_string const& line) const + { + bool first = true; + for (auto const& pt : line) + { + if (first && !bbox.valid()) + { + bbox.init(pt.x, pt.y, pt.x, pt.y); + first = false; + } + else + { + bbox.expand_to_include(pt.x, pt.y); + } + } + } + + template + void operator() (mapnik::geometry::polygon const& poly) const + { + bool first = true; + for (auto const& pt : poly.exterior_ring) + { + if (first && !bbox.valid()) + { + bbox.init(pt.x, pt.y, pt.x, pt.y); + first = false; + } + else + { + bbox.expand_to_include(pt.x, pt.y); + } + } + } + + template + void operator() (mapnik::geometry::multi_point const& multi_point) const + { + bool first = true; + for (auto const& pt : multi_point) + { + if (first && !bbox.valid()) + { + bbox.init(pt.x, pt.y, pt.x, pt.y); + first = false; + } + else + { + bbox.expand_to_include(pt.x, pt.y); + } + } + } + + template + void operator() (mapnik::geometry::multi_line_string const& multi_line) const + { + for (auto const& line : multi_line) + { + (*this)(line); + } + } + + template + void operator() (mapnik::geometry::multi_polygon const& multi_poly) const + { + for (auto const& poly : multi_poly) + { + (*this)(poly); + } + } + + template + void operator() (mapnik::geometry::geometry_collection const& collection) const + { + for (auto const& geom : collection) + { + (*this)(geom); + } + } +}; + +} // end ns detail + +template +mapnik::box2d envelope(T const& geom) +{ + box2d bbox; + detail::geometry_envelope op(bbox); + op(geom); + return bbox; +} + +} // end ns geometry +} // end ns mapnik + diff --git a/include/mapnik/geometry_fusion_adapted.hpp b/include/mapnik/geometry_fusion_adapted.hpp new file mode 100644 index 000000000..6889de61f --- /dev/null +++ b/include/mapnik/geometry_fusion_adapted.hpp @@ -0,0 +1,53 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_FUSION_ADAPTED_HPP +#define MAPNIK_GEOMETRY_FUSION_ADAPTED_HPP + +#include +#include +#include + +BOOST_FUSION_ADAPT_STRUCT( + mapnik::geometry::point, + (double, x) + (double, y) +) + +BOOST_FUSION_ADAPT_STRUCT( + mapnik::geometry::point, + (std::int64_t, x) + (std::int64_t, y) +) + +BOOST_FUSION_ADAPT_STRUCT( + mapnik::geometry::polygon, + (mapnik::geometry::linear_ring const&, exterior_ring) + (std::vector > const& , interior_rings)) + +BOOST_FUSION_ADAPT_STRUCT( + mapnik::geometry::polygon, + (mapnik::geometry::linear_ring const&, exterior_ring) + (std::vector > const& , interior_rings)) + +#endif // MAPNIK_GEOMETRY_FUSION_ADAPTED_HPP diff --git a/include/mapnik/geometry_is_empty.hpp b/include/mapnik/geometry_is_empty.hpp new file mode 100644 index 000000000..5d017aa06 --- /dev/null +++ b/include/mapnik/geometry_is_empty.hpp @@ -0,0 +1,92 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_IS_EMPTY_HPP +#define MAPNIK_GEOMETRY_IS_EMPTY_HPP + +#include + +namespace mapnik { namespace geometry { + +namespace detail { + +struct geometry_is_empty +{ + bool operator() (mapnik::geometry::geometry const& geom) const + { + return mapnik::util::apply_visitor(*this, geom); + } + + bool operator() (mapnik::geometry::point const&) const + { + return false; + } + + bool operator() (mapnik::geometry::line_string const& geom) const + { + return geom.empty(); + } + + bool operator() (mapnik::geometry::polygon const& geom) const + { + return geom.empty(); + } + + bool operator() (mapnik::geometry::multi_point const& geom) const + { + return geom.empty(); + } + + bool operator() (mapnik::geometry::multi_line_string const& geom) const + { + return geom.empty(); + } + + bool operator() (mapnik::geometry::multi_polygon const& geom) const + { + return geom.empty(); + } + + bool operator() (mapnik::geometry::geometry_collection const& geom) const + { + return geom.empty(); + } + + template + bool operator() (T const& geom) const + { + return true; + } + +}; + +} + +template +inline bool is_empty(GeomType const& geom) +{ + return detail::geometry_is_empty()(geom); +} + +}} + +#endif // MAPNIK_GEOMETRY_IS_EMPTY_HPP diff --git a/include/mapnik/geometry_is_simple.hpp b/include/mapnik/geometry_is_simple.hpp new file mode 100644 index 000000000..30fff6d66 --- /dev/null +++ b/include/mapnik/geometry_is_simple.hpp @@ -0,0 +1,108 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_IS_SIMPLE_HPP +#define MAPNIK_GEOMETRY_IS_SIMPLE_HPP + +#include + +// only Boost >= 1.56 contains the is_simple function +#if BOOST_VERSION >= 105600 + +#include +#include +#include + +namespace mapnik { namespace geometry { + +namespace detail { + +struct geometry_is_simple +{ + using result_type = bool; + + template + result_type operator() (geometry const& geom) const + { + return mapnik::util::apply_visitor(*this, geom); + } + + result_type operator() (geometry_empty const& ) const + { + return false; + } + + template + result_type operator() (geometry_collection const& collection) const + { + for (auto const& geom : collection) + { + if ( !(*this)(geom)) return false; + } + return true; + } + + template + result_type operator() (point const& pt) const + { + return boost::geometry::is_simple(pt); + } + template + result_type operator() (line_string const& line) const + { + return boost::geometry::is_simple(line); + } + template + result_type operator() (polygon const& poly) const + { + return boost::geometry::is_simple(poly); + } + template + result_type operator() (multi_point const& multi_pt) const + { + return boost::geometry::is_simple(multi_pt); + } + template + result_type operator() (multi_line_string const& multi_line) const + { + return boost::geometry::is_simple(multi_line); + } + template + result_type operator() (multi_polygon const& multi_poly) const + { + return boost::geometry::is_simple(multi_poly); + } + +}; + +} + +template +inline bool is_simple(T const& geom) +{ + return detail::geometry_is_simple() (geom); +} + +}} + +#endif // BOOST_VERSION >= 1.56 +#endif // MAPNIK_GEOMETRY_IS_SIMPLE_HPP diff --git a/include/mapnik/geometry_is_valid.hpp b/include/mapnik/geometry_is_valid.hpp new file mode 100644 index 000000000..aa7f1391a --- /dev/null +++ b/include/mapnik/geometry_is_valid.hpp @@ -0,0 +1,112 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_IS_VALID_HPP +#define MAPNIK_GEOMETRY_IS_VALID_HPP + +#include + +// only Boost >= 1.56 contains the is_valid function +#if BOOST_VERSION >= 105600 + +#include +#include +#include + +namespace mapnik { namespace geometry { + +namespace detail { + +struct geometry_is_valid +{ + using result_type = bool; + + template + result_type operator() (geometry const& geom) const + { + return mapnik::util::apply_visitor(*this, geom); + } + + result_type operator() (geometry_empty const& ) const + { + return false; + } + + template + result_type operator() (geometry_collection const& collection) const + { + for (auto const& geom : collection) + { + if ( !(*this)(geom)) return false; + } + return true; + } + + template + result_type operator() (point const& pt) const + { + return boost::geometry::is_valid(pt); + } + + template + result_type operator() (line_string const& line) const + { + return boost::geometry::is_valid(line); + } + + template + result_type operator() (polygon const& poly) const + { + return boost::geometry::is_valid(poly); + } + + template + result_type operator() (multi_point const& multi_pt) const + { + return boost::geometry::is_valid(multi_pt); + } + + template + result_type operator() (multi_line_string const& multi_line) const + { + return boost::geometry::is_valid(multi_line); + } + + template + result_type operator() (multi_polygon const& multi_poly) const + { + return boost::geometry::is_valid(multi_poly); + } +}; + +} + +template +inline bool is_valid(T const& geom) +{ + return detail::geometry_is_valid() (geom); +} + +}} + +#endif // BOOST_VERSION >= 1.56 +#endif // MAPNIK_GEOMETRY_IS_VALID_HPP diff --git a/include/mapnik/geometry_reprojection.hpp b/include/mapnik/geometry_reprojection.hpp new file mode 100644 index 000000000..22a334e61 --- /dev/null +++ b/include/mapnik/geometry_reprojection.hpp @@ -0,0 +1,64 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_REPROJECTION_HPP +#define MAPNIK_GEOMETRY_REPROJECTION_HPP + +// mapnik +#include +#include + + +namespace mapnik { + +namespace geometry { + +// There is a difference between reprojecting a const vs reprojecting a non const in behavior. If you reproject a +// const a new geometry (or perhaps empty geometry) will be returned no matter how many geometries fail to reproject. +// This is done this way so that large geometry collections that only have a few failing points or polygon parts could +// still be return with out the few failing projections. + +template +MAPNIK_DECL geometry reproject_copy(geometry const& geom, proj_transform const& proj_trans, unsigned int & n_err); + +template +MAPNIK_DECL T reproject_copy(T const& geom, proj_transform const& proj_trans, unsigned int & n_err); + +template +MAPNIK_DECL T reproject_copy(T const& geom, projection const& source, projection const& dest, unsigned int & n_err); + + +// No error count is required for a non const reprojection and this will reproject in place. +// because the reprojection is done on the same memory it is important to check if it succeeded, +// otherwise you could be dealing with a corrupt geometry. + +template +MAPNIK_DECL bool reproject(T & geom, proj_transform const& proj_trans); + +template +MAPNIK_DECL bool reproject(T & geom, projection const& source, projection const& dest); + +} // end geometry ns + +} // end mapnik ns + +#endif // MAPNIK_GEOMETRY_REPROJECTION_HPP diff --git a/include/mapnik/geometry_reprojection_impl.hpp b/include/mapnik/geometry_reprojection_impl.hpp new file mode 100644 index 000000000..7e78635e4 --- /dev/null +++ b/include/mapnik/geometry_reprojection_impl.hpp @@ -0,0 +1,400 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +// mapnik +#include +#include + +namespace mapnik { + +namespace geometry { + +namespace detail { + +geometry_empty reproject_internal(geometry_empty const&, proj_transform const&, unsigned int &) +{ + return geometry_empty(); +} + +template +point reproject_internal(point const & p, proj_transform const& proj_trans, unsigned int & n_err) +{ + point new_p(p); + if (!proj_trans.forward(new_p)) + { + ++n_err; + } + return new_p; +} + +template +line_string reproject_internal(line_string const & ls, proj_transform const& proj_trans, unsigned int & n_err) +{ + line_string new_ls(ls); + unsigned int err = proj_trans.forward(new_ls); + if (err > 0) + { + n_err += err; + } + return new_ls; +} + +template +polygon reproject_internal(polygon const & poly, proj_transform const& proj_trans, unsigned int & n_err) +{ + polygon new_poly; + linear_ring new_ext(poly.exterior_ring); + unsigned int err = proj_trans.forward(new_ext); + // If the exterior ring doesn't transform don't bother with the holes. + if (err > 0 || new_ext.empty()) + { + n_err += err; + } + else + { + new_poly.set_exterior_ring(std::move(new_ext)); + new_poly.interior_rings.reserve(poly.interior_rings.size()); + + for (auto const& lr : poly.interior_rings) + { + linear_ring new_lr(lr); + err = proj_trans.forward(new_lr); + if (err > 0 || new_lr.empty()) + { + n_err += err; + // If there is an error in interior ring drop + // it from polygon. + continue; + } + new_poly.add_hole(std::move(new_lr)); + } + } + return new_poly; +} + +template +multi_point reproject_internal(multi_point const & mp, proj_transform const& proj_trans, unsigned int & n_err) +{ + multi_point new_mp; + if (proj_trans.is_known()) + { + // If the projection is known we do them all at once because it is faster + // since we know that no point will fail reprojection + new_mp.assign(mp.begin(), mp.end()); + proj_trans.forward(new_mp); + } + else + { + new_mp.reserve(mp.size()); + for (auto const& p : mp) + { + point new_p(p); + if (!proj_trans.forward(new_p)) + { + ++n_err; + } + else + { + new_mp.emplace_back(std::move(new_p)); + } + } + } + return new_mp; +} + +template +multi_line_string reproject_internal(multi_line_string const & mls, proj_transform const& proj_trans, unsigned int & n_err) +{ + multi_line_string new_mls; + new_mls.reserve(mls.size()); + for (auto const& ls : mls) + { + line_string new_ls = reproject_internal(ls, proj_trans, n_err); + if (!new_ls.empty()) + { + new_mls.emplace_back(std::move(new_ls)); + } + } + return new_mls; +} + +template +multi_polygon reproject_internal(multi_polygon const & mpoly, proj_transform const& proj_trans, unsigned int & n_err) +{ + multi_polygon new_mpoly; + new_mpoly.reserve(mpoly.size()); + for (auto const& poly : mpoly) + { + polygon new_poly = reproject_internal(poly, proj_trans, n_err); + if (!new_poly.exterior_ring.empty()) + { + new_mpoly.emplace_back(std::move(new_poly)); + } + } + return new_mpoly; +} + +template +geometry_collection reproject_internal(geometry_collection const & c, proj_transform const& proj_trans, unsigned int & n_err) +{ + geometry_collection new_c; + new_c.reserve(c.size()); + for (auto const& g : c) + { + + geometry new_g = reproject_copy(g, proj_trans, n_err); + if (!new_g.template is()) + { + new_c.emplace_back(std::move(new_g)); + } + } + return new_c; +} + +template +struct geom_reproj_copy_visitor { + + geom_reproj_copy_visitor(proj_transform const & proj_trans, unsigned int & n_err) + : proj_trans_(proj_trans), + n_err_(n_err) {} + + geometry operator() (geometry_empty const&) + { + return geometry_empty(); + } + + geometry operator() (point const& p) + { + geometry geom; // default empty + unsigned int intial_err = n_err_; + point new_p = reproject_internal(p, proj_trans_, n_err_); + if (n_err_ > intial_err) return geom; + geom = std::move(new_p); + return geom; + } + + geometry operator() (line_string const& ls) + { + geometry geom; // default empty + unsigned int intial_err = n_err_; + line_string new_ls = reproject_internal(ls, proj_trans_, n_err_); + if (n_err_ > intial_err || new_ls.empty()) return geom; + geom = std::move(new_ls); + return geom; + } + + geometry operator() (polygon const& poly) + { + geometry geom; // default empty + polygon new_poly = reproject_internal(poly, proj_trans_, n_err_); + if (new_poly.exterior_ring.empty()) return geom; + geom = std::move(new_poly); + return geom; + } + + geometry operator() (multi_point const& mp) + { + geometry geom; // default empty + multi_point new_mp = reproject_internal(mp, proj_trans_, n_err_); + if (new_mp.empty()) return geom; + geom = std::move(new_mp); + return geom; + } + + geometry operator() (multi_line_string const& mls) + { + geometry geom; // default empty + multi_line_string new_mls = reproject_internal(mls, proj_trans_, n_err_); + if (new_mls.empty()) return geom; + geom = std::move(new_mls); + return geom; + } + + geometry operator() (multi_polygon const& mpoly) + { + geometry geom; // default empty + multi_polygon new_mpoly = reproject_internal(mpoly, proj_trans_, n_err_); + if (new_mpoly.empty()) return geom; + geom = std::move(new_mpoly); + return geom; + } + + geometry operator() (geometry_collection const& c) + { + geometry geom; // default empty + geometry_collection new_c = reproject_internal(c, proj_trans_, n_err_); + if (new_c.empty()) return geom; + geom = std::move(new_c); + return geom; + } + +private: + proj_transform const& proj_trans_; + unsigned int & n_err_; + +}; + +} // end detail ns + +template +geometry reproject_copy(geometry const& geom, proj_transform const& proj_trans, unsigned int & n_err) +{ + detail::geom_reproj_copy_visitor visit(proj_trans, n_err); + return mapnik::util::apply_visitor(visit, geom); +} + +template +T reproject_copy(T const& geom, proj_transform const& proj_trans, unsigned int & n_err) +{ + return detail::reproject_internal(geom, proj_trans, n_err); +} + +template +T reproject_copy(T const& geom, projection const& source, projection const& dest, unsigned int & n_err) +{ + proj_transform proj_trans(source, dest); + return reproject_copy(geom, proj_trans, n_err); +} + +namespace detail { + +struct geom_reproj_visitor { + + geom_reproj_visitor(proj_transform const & proj_trans) + : proj_trans_(proj_trans) {} + + template + bool operator() (geometry & geom) + { + return mapnik::util::apply_visitor((*this), geom); + } + + bool operator() (geometry_empty &) { return true; } + + template + bool operator() (point & p) + { + if (!proj_trans_.forward(p)) + { + return false; + } + return true; + } + + template + bool operator() (line_string & ls) + { + if (proj_trans_.forward(ls) > 0) + { + return false; + } + return true; + } + + template + bool operator() (polygon & poly) + { + if (proj_trans_.forward(poly.exterior_ring) > 0) + { + return false; + } + + for (auto & lr : poly.interior_rings) + { + if (proj_trans_.forward(lr) > 0) + { + return false; + } + } + return true; + } + + template + bool operator() (multi_point & mp) + { + return (*this) (static_cast &>(mp)); + } + + template + bool operator() (multi_line_string & mls) + { + for (auto & ls : mls) + { + if (! (*this) (ls)) + { + return false; + } + } + return true; + } + + template + bool operator() (multi_polygon & mpoly) + { + for (auto & poly : mpoly) + { + if(! (*this)(poly)) + { + return false; + } + } + return true; + } + + template + bool operator() (geometry_collection & c) + { + for (auto & g : c) + { + if (! (*this)(g) ) + { + return false; + } + } + return true; + } + +private: + proj_transform const& proj_trans_; + +}; + +} // end detail ns + +template +bool reproject(T & geom, proj_transform const& proj_trans) +{ + detail::geom_reproj_visitor visit(proj_trans); + return visit(geom); +} + +template +bool reproject(T & geom, projection const& source, projection const& dest) +{ + proj_transform proj_trans(source, dest); + detail::geom_reproj_visitor visit(proj_trans); + return visit(geom); +} + +} // end geometry ns + +} // end mapnik ns diff --git a/include/mapnik/geometry_strategy.hpp b/include/mapnik/geometry_strategy.hpp new file mode 100644 index 000000000..cc4121e60 --- /dev/null +++ b/include/mapnik/geometry_strategy.hpp @@ -0,0 +1,210 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_STRATEGY_HPP +#define MAPNIK_GEOMETRY_STRATEGY_HPP + +#include +#include + +namespace mapnik { +namespace geometry { + +namespace helper +{ + template + struct index {}; + + template + struct gen_seq : gen_seq {}; + + template + struct gen_seq<0, Ts...> : index {}; +} + +// Groups a set of strategies at runtime, the conversion from P1 to P2 will take place on the LAST strategy. +template +struct strategy_group +{ + strategy_group(Strategies const& ... ops) + : ops_(ops ...) {} + + template + inline bool apply(P1 const& p1, P2 & p2) const + { + bool status = true; + p2 = execute_start(p1, status, ops_); + return status; + } + + template + inline P2 execute_start(P1 const & p1, bool & status, std::tuple const& tup, helper::index) const + { + return execute(p1, status, std::get(tup)...); + } + + template + inline P2 execute_start(P1 const& p, bool & status, std::tuple const& tup) const + { + return execute_start(p, status, tup, helper::gen_seq {} ); + } + + template + inline P2 execute(P1 const& p, bool & status, T const& strat, Args const& ... args) const + { + return execute(strat.template execute(p, status), status, args...); + } + + template + inline P2 execute(P1 const& p, bool & status, T const& strat) const + { + return strat.template execute(p, status); + } + +private: + std::tuple ops_; + +}; + + +// The difference between this strategy group and the previous is that the conversion from P1 to P2 happens +// in the first strategy rather then the last strategy. +template +struct strategy_group_first +{ + strategy_group_first(Strategies const& ... ops) + : ops_(ops ...) {} + + template + inline bool apply(P1 const& p1, P2 & p2) const + { + bool status = true; + p2 = execute_start(p1, status, ops_); + return status; + } + + template + inline P2 execute_start(P1 const & p1, bool & status, std::tuple const& tup, helper::index) const + { + return execute_first(p1, status, std::get(tup)...); + } + + template + inline P2 execute_start(P1 const& p, bool & status, std::tuple const& tup) const + { + return execute_start(p, status, tup, helper::gen_seq {} ); + } + + template + inline P2 execute_first(P1 const& p, bool & status, T const& strat, Args const& ... args) const + { + return execute(strat.template execute(p, status), status, args...); + } + + template + inline P2 execute(P2 const& p, bool & status, T const& strat, Args const& ... args) const + { + return execute(strat.template execute(p, status), status, args...); + } + + template + inline P2 execute(P2 const& p, bool & status, T const& strat) const + { + return strat.template execute(p, status); + } + + template + inline P2 execute(P2 const& p, bool & status) const + { + return p; + } + +private: + std::tuple ops_; + +}; + +struct scale_strategy +{ + scale_strategy(double scale, double offset = 0) + : scale_(scale), offset_(offset) {} + + template + inline bool apply(P1 const & p1, P2 & p2) const + { + + using p2_type = typename boost::geometry::coordinate_type::type; + double x = (boost::geometry::get<0>(p1) * scale_) + offset_; + double y = (boost::geometry::get<1>(p1) * scale_) + offset_; + boost::geometry::set<0>(p2, static_cast(x)); + boost::geometry::set<1>(p2, static_cast(y)); + return true; + } + + template + inline P2 execute(P1 const& p1, bool & status) const + { + P2 p2; + status = apply(p1, p2); + return p2; + } + +private: + double scale_; + double offset_; +}; + +struct scale_rounding_strategy +{ + scale_rounding_strategy(double scale, double offset = 0) + : scale_(scale), offset_(offset) {} + + template + inline bool apply(P1 const & p1, P2 & p2) const + { + + using p2_type = typename boost::geometry::coordinate_type::type; + double x = (boost::geometry::get<0>(p1) * scale_) + offset_; + double y = (boost::geometry::get<1>(p1) * scale_) + offset_; + boost::geometry::set<0>(p2, static_cast(std::round(x))); + boost::geometry::set<1>(p2, static_cast(std::round(y))); + return true; + } + + template + inline P2 execute(P1 const& p1, bool & status) const + { + P2 p2; + status = apply(p1, p2); + return p2; + } + +private: + double scale_; + double offset_; +}; + + +} // end geometry ns +} // end mapnik ns + +#endif //MAPNIK_GEOMETRY_STRATEGY_HPP diff --git a/include/mapnik/geometry_to_path.hpp b/include/mapnik/geometry_to_path.hpp new file mode 100644 index 000000000..d443158a6 --- /dev/null +++ b/include/mapnik/geometry_to_path.hpp @@ -0,0 +1,166 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_TO_PATH_HPP +#define MAPNIK_GEOMETRY_TO_PATH_HPP + +#include +#include + +namespace mapnik { namespace geometry { namespace detail { + +//template +struct geometry_to_path +{ + geometry_to_path(path_type & p) + : p_(p) {} + + template + void operator() (geometry const& geom) const + { + mapnik::util::apply_visitor(*this, geom); + } + + void operator() (geometry_empty const&) const + { + // no-op + } + // point + template + void operator() (point const& pt) const + { + //point pt_new; + //Transformer::apply(pt, pt_new); + p_.move_to(pt.x, pt.y); + } + + // line_string + template + void operator() (line_string const& line) const + { + bool first = true; + for (auto const& pt : line) + { + //point pt_new; + //Transformer::apply(pt, pt_new); + if (first) { p_.move_to(pt.x, pt.y); first=false;} + else p_.line_to(pt.x, pt.y); + } + } + + // polygon + template + void operator() (polygon const& poly) const + { + // exterior + bool first = true; + for (auto const& pt : poly.exterior_ring) + { + if (first) + { + p_.move_to(pt.x, pt.y); + first=false; + } + else + { + p_.line_to(pt.x, pt.y); + } + } + if (!first) + { + p_.close_path(); + } + // interior + for (auto const& ring : poly.interior_rings) + { + first = true; + for (auto const& pt : ring) + { + if (first) { + p_.move_to(pt.x, pt.y); + first=false; + } + else + { + p_.line_to(pt.x, pt.y); + } + } + if (!first) + { + p_.close_path(); + } + } + } + + // multi point + template + void operator() (multi_point const& multi_pt) const + { + for (auto const& pt : multi_pt) + { + (*this)(pt); + } + } + // multi_line_string + template + void operator() (multi_line_string const& multi_line) const + { + for (auto const& line : multi_line) + { + (*this)(line); + } + } + + // multi_polygon + template + void operator() (multi_polygon const& multi_poly) const + { + for (auto const& poly : multi_poly) + { + (*this)(poly); + } + } + + template + void operator() (geometry_collection const& collection) const + { + for (auto const& geom : collection) + { + (*this)(geom); + } + } + + path_type & p_; + +}; +} // ns detail + +template +void to_path(T const& geom, path_type & p) +{ + detail::geometry_to_path func(p); + func(geom); +} + +}} + +#endif // MAPNIK_GEOMETRY_TO_PATH_HPP diff --git a/include/mapnik/geometry_transform.hpp b/include/mapnik/geometry_transform.hpp new file mode 100644 index 000000000..a7bb2f13d --- /dev/null +++ b/include/mapnik/geometry_transform.hpp @@ -0,0 +1,220 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_TRANSFORM_HPP +#define MAPNIK_GEOMETRY_TRANSFORM_HPP + +#include +#include +#include + +namespace mapnik { namespace geometry { namespace detail { + +template +inline point transform_geometry(point const& geom, Transformer const& transformer) +{ + point geom_transformed; + if (!boost::geometry::transform(geom, geom_transformed, transformer)) + { + throw std::runtime_error("Can't transformm geometry"); + } + return geom_transformed; +} + +template +inline multi_point transform_geometry(multi_point const& geom, Transformer const& transformer) +{ + multi_point geom_transformed; + if (!boost::geometry::transform(geom, geom_transformed, transformer)) + { + throw std::runtime_error("Can't transformm geometry"); + } + return geom_transformed; +} + +template +inline line_string transform_geometry(line_string const& geom, Transformer const& transformer) +{ + line_string geom_transformed; + if (!boost::geometry::transform(geom, geom_transformed, transformer)) + { + throw std::runtime_error("Can't transformm geometry"); + } + return geom_transformed; +} + +template +inline multi_line_string transform_geometry(multi_line_string const& geom, Transformer const& transformer) +{ + multi_line_string geom_transformed; + if (!boost::geometry::transform(geom, geom_transformed, transformer)) + { + throw std::runtime_error("Can't transformm geometry"); + } + return geom_transformed; +} + +template +inline polygon transform_geometry(polygon const& geom, Transformer const& transformer) +{ + polygon geom_transformed; + if (!boost::geometry::transform(geom, geom_transformed, transformer)) + { + throw std::runtime_error("Can't transformm geometry"); + } + return geom_transformed; +} + +template +inline multi_polygon transform_geometry(multi_polygon const& geom, Transformer const& transformer) +{ + multi_polygon geom_transformed; + if (!boost::geometry::transform(geom, geom_transformed, transformer)) + { + throw std::runtime_error("Can't transformm geometry"); + } + return geom_transformed; +} + +template +struct geometry_transform +{ + geometry_transform(Transformer const& transformer) + : transformer_(transformer) {} + + using result_type = geometry; + + geometry operator() (geometry_empty const& empty) const + { + return empty; + } + + template + geometry operator() (geometry_collection const& collection) const + { + geometry_collection collection_out; + for (auto const& geom : collection) + { + collection_out.push_back((*this)(geom)); + } + return collection_out; + } + + template + geometry operator() (geometry const& geom) const + { + return mapnik::util::apply_visitor(*this, geom); + } + + template + geometry operator() (point const& geom) const + { + return transform_geometry(geom, transformer_); + } + + template + geometry operator() (line_string const& geom) const + { + return transform_geometry(geom, transformer_); + } + + template + geometry operator() (polygon const& geom) const + { + return transform_geometry(geom, transformer_); + } + + template + geometry operator() (multi_point const& geom) const + { + return transform_geometry(geom, transformer_); + } + + template + geometry operator() (multi_line_string const& geom) const + { + return transform_geometry(geom, transformer_); + } + + template + geometry operator() (multi_polygon const& geom) const + { + return transform_geometry(geom, transformer_); + } + + Transformer const& transformer_; +}; + +} // ns detail + +template +geometry transform(geometry const& geom, T2 const& transformer) +{ + return detail::geometry_transform(transformer)(geom); +} + +template +geometry transform(geometry_collection const& geom, T2 const& transformer) +{ + return detail::geometry_transform(transformer)(geom); +} + +template +point transform(point const& geom, T2 const& transformer) +{ + return detail::transform_geometry(geom, transformer); +} + +template +multi_point transform(multi_point const& geom, T2 const& transformer) +{ + return detail::transform_geometry(geom, transformer); +} + +template +line_string transform(line_string const& geom, T2 const& transformer) +{ + return detail::transform_geometry(geom, transformer); +} + +template +multi_line_string transform(multi_line_string const& geom, T2 const& transformer) +{ + return detail::transform_geometry(geom, transformer); +} + +template +polygon transform(polygon const& geom, T2 const& transformer) +{ + return detail::transform_geometry(geom, transformer); +} + +template +multi_polygon transform(multi_polygon const& geom, T2 const& transformer) +{ + return detail::transform_geometry(geom, transformer); +} + + +}} + +#endif // MAPNIK_GEOMETRY_TRANSFORM_HPP diff --git a/include/mapnik/geometry_type.hpp b/include/mapnik/geometry_type.hpp new file mode 100644 index 000000000..b052446cd --- /dev/null +++ b/include/mapnik/geometry_type.hpp @@ -0,0 +1,98 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_TYPE_HPP +#define MAPNIK_GEOMETRY_TYPE_HPP + +// mapnik +#include +#include + +namespace mapnik { namespace geometry { namespace detail { + +struct geometry_type +{ + template + mapnik::geometry::geometry_types operator () (T const& geom) const + { + return mapnik::util::apply_visitor(*this, geom); + } + + mapnik::geometry::geometry_types operator() (geometry_empty const& ) const + { + return mapnik::geometry::geometry_types::Unknown; + } + + template + mapnik::geometry::geometry_types operator () (mapnik::geometry::point const&) const + { + return mapnik::geometry::geometry_types::Point; + } + + template + mapnik::geometry::geometry_types operator () (mapnik::geometry::line_string const&) const + { + return mapnik::geometry::geometry_types::LineString; + } + + template + mapnik::geometry::geometry_types operator () (mapnik::geometry::polygon const&) const + { + return mapnik::geometry::geometry_types::Polygon; + } + + template + mapnik::geometry::geometry_types operator () (mapnik::geometry::multi_point const&) const + { + return mapnik::geometry::geometry_types::MultiPoint; + } + + template + mapnik::geometry::geometry_types operator () (mapnik::geometry::multi_line_string const&) const + { + return mapnik::geometry::geometry_types::MultiLineString; + } + + template + mapnik::geometry::geometry_types operator () (mapnik::geometry::multi_polygon const&) const + { + return mapnik::geometry::geometry_types::MultiPolygon; + } + + template + mapnik::geometry::geometry_types operator () (mapnik::geometry::geometry_collection const&) const + { + return mapnik::geometry::geometry_types::GeometryCollection; + } +}; +} // detail + +template +static inline mapnik::geometry::geometry_types geometry_type(T const& geom) +{ + return detail::geometry_type()(geom); +} + +}} + + +#endif // MAPNIK_GEOMETRY_TYPE_HPP diff --git a/include/mapnik/geometry_types.hpp b/include/mapnik/geometry_types.hpp new file mode 100644 index 000000000..8c4d67722 --- /dev/null +++ b/include/mapnik/geometry_types.hpp @@ -0,0 +1,45 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_TYPES_HPP +#define MAPNIK_GEOMETRY_TYPES_HPP + +#include + +namespace mapnik { namespace geometry { + +// OGC compatible types +enum geometry_types : std::uint8_t +{ + Unknown = 0, + Point = 1, + LineString = 2, + Polygon = 3, + MultiPoint = 4, + MultiLineString = 5, + MultiPolygon = 6, + GeometryCollection = 7, +}; + +}} + +#endif // MAPNIK_GEOMETRY_TYPES_HPP diff --git a/include/mapnik/geometry_unique.hpp b/include/mapnik/geometry_unique.hpp new file mode 100644 index 000000000..167822801 --- /dev/null +++ b/include/mapnik/geometry_unique.hpp @@ -0,0 +1,82 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_GEOMETRY_UNIQUE_HPP +#define MAPNIK_GEOMETRY_UNIQUE_HPP + +#include +#include +#include + +#include + +namespace mapnik { namespace geometry { + +namespace detail { + +struct geometry_unique +{ + using result_type = void; + + result_type operator() (geometry & geom) const + { + mapnik::util::apply_visitor(*this, geom); + } + + result_type operator() (geometry_collection & collection) const + { + for (auto & geom : collection) + { + (*this)(geom); + } + } + + result_type operator() (line_string & line) const + { + boost::geometry::unique(line); + } + + result_type operator() (polygon & poly) const + { + boost::geometry::unique(poly); + } + + template + result_type operator() (T & geom) const + { + // no-op + } + +}; + +} + +template +inline void unique(GeomType & geom) +{ + static_assert(!std::is_const::value,"mapnik::geometry::unique on const& is invalid"); + detail::geometry_unique()(geom); +} + +}} + +#endif // MAPNIK_GEOMETRY_UNIQUE_HPP diff --git a/include/mapnik/global.hpp b/include/mapnik/global.hpp index f9b3d3a5a..aa5be35f5 100644 --- a/include/mapnik/global.hpp +++ b/include/mapnik/global.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -48,8 +48,6 @@ namespace mapnik (((std::uint64_t) ((std::uint8_t) (A)[1])) << 48) | \ (((std::uint64_t) ((std::uint8_t) (A)[0])) << 56)) -using byte = std::uint8_t; - #define float8net(V,M) do { double def_temp; \ ((std::uint8_t*) &def_temp)[0]=(M)[7]; \ ((std::uint8_t*) &def_temp)[1]=(M)[6]; \ diff --git a/include/mapnik/gradient.hpp b/include/mapnik/gradient.hpp index a7e628a56..eb70be4c2 100644 --- a/include/mapnik/gradient.hpp +++ b/include/mapnik/gradient.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/graphics.hpp b/include/mapnik/graphics.hpp deleted file mode 100644 index 98e800107..000000000 --- a/include/mapnik/graphics.hpp +++ /dev/null @@ -1,304 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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_GRAPHICS_HPP -#define MAPNIK_GRAPHICS_HPP - -// mapnik -#include -#include -#include -#include -#include -#include - -// stl -#include -#include -#include - -// boost -#include - -namespace mapnik -{ - -class MAPNIK_DECL image_32 -{ -private: - image_data_rgba8 data_; - boost::optional background_; - bool painted_; - bool premultiplied_; -public: - image_32(int width,int height); - image_32(image_32 const& rhs); - image_32(image_data_rgba8 && data); - ~image_32(); - - void painted(bool painted) - { - painted_ = painted; - } - - bool painted() const - { - return painted_; - } - - bool premultiplied() const - { - return premultiplied_; - } - - inline void clear() - { - std::fill(data_.getData(), data_.getData() + data_.width() * data_.height(), 0); - } - - boost::optional const& get_background() const; - - void set_background(const color& c); - - void premultiply(); - - void demultiply(); - - void set_grayscale_to_alpha(); - - void set_color_to_alpha(color const& c); - - void set_alpha(float opacity); - - inline const image_data_rgba8& data() const - { - return data_; - } - - inline image_data_rgba8& data() - { - return data_; - } - - inline const unsigned char* raw_data() const - { - return data_.getBytes(); - } - - inline unsigned char* raw_data() - { - return data_.getBytes(); - } - - inline image_view get_view(unsigned x,unsigned y, unsigned w,unsigned h) - { - return image_view(x,y,w,h,data_); - } - -private: - - inline bool checkBounds(int x, int y) const - { - return (x >= 0 && x < static_cast(data_.width()) && y >= 0 && y < static_cast(data_.height())); - } - -public: - inline void setPixel(int x,int y,unsigned int rgba) - { - if (checkBounds(x,y)) - { - data_(x,y)=rgba; - } - } - - void composite_pixel(unsigned op, int x,int y,unsigned c, unsigned cover, double opacity); - - inline unsigned width() const - { - return data_.width(); - } - - inline unsigned height() const - { - return data_.height(); - } - - inline void set_rectangle(int x0,int y0,image_data_rgba8 const& data) - { - box2d ext0(0,0,data_.width(),data_.height()); - box2d ext1(x0,y0,x0+data.width(),y0+data.height()); - - if (ext0.intersects(ext1)) - { - box2d box = ext0.intersect(ext1); - for (int y = box.miny(); y < box.maxy(); ++y) - { - unsigned int* row_to = data_.getRow(y); - unsigned int const * row_from = data.getRow(y-y0); - - for (int x = box.minx(); x < box.maxx(); ++x) - { - if (row_from[x-x0] & 0xff000000) - { - row_to[x] = row_from[x-x0]; - } - } - } - } - } - - inline void set_rectangle_alpha(int x0,int y0,const image_data_rgba8& data) - { - box2d ext0(0,0,data_.width(),data_.height()); - box2d ext1(x0,y0,x0 + data.width(),y0 + data.height()); - - if (ext0.intersects(ext1)) - { - box2d box = ext0.intersect(ext1); - for (int y = box.miny(); y < box.maxy(); ++y) - { - unsigned int* row_to = data_.getRow(y); - unsigned int const * row_from = data.getRow(y-y0); - for (int x = box.minx(); x < box.maxx(); ++x) - { - unsigned rgba0 = row_to[x]; - unsigned rgba1 = row_from[x-x0]; - unsigned a1 = (rgba1 >> 24) & 0xff; - if (a1 == 0) continue; - if (a1 == 0xff) - { - row_to[x] = rgba1; - continue; - } - unsigned r1 = rgba1 & 0xff; - unsigned g1 = (rgba1 >> 8 ) & 0xff; - unsigned b1 = (rgba1 >> 16) & 0xff; - - unsigned a0 = (rgba0 >> 24) & 0xff; - unsigned r0 = (rgba0 & 0xff) * a0; - unsigned g0 = ((rgba0 >> 8 ) & 0xff) * a0; - unsigned b0 = ((rgba0 >> 16) & 0xff) * a0; - - a0 = ((a1 + a0) << 8) - a0*a1; - - r0 = ((((r1 << 8) - r0) * a1 + (r0 << 8)) / a0); - g0 = ((((g1 << 8) - g0) * a1 + (g0 << 8)) / a0); - b0 = ((((b1 << 8) - b0) * a1 + (b0 << 8)) / a0); - a0 = a0 >> 8; - row_to[x] = (a0 << 24)| (b0 << 16) | (g0 << 8) | (r0) ; - } - } - } - } - - inline void set_rectangle_alpha2(image_data_rgba8 const& data, unsigned x0, unsigned y0, float opacity) - { - box2d ext0(0,0,data_.width(),data_.height()); - box2d ext1(x0,y0,x0 + data.width(),y0 + data.height()); - - if (ext0.intersects(ext1)) - { - box2d box = ext0.intersect(ext1); - for (int y = box.miny(); y < box.maxy(); ++y) - { - unsigned int* row_to = data_.getRow(y); - unsigned int const * row_from = data.getRow(y-y0); - for (int x = box.minx(); x < box.maxx(); ++x) - { - unsigned rgba0 = row_to[x]; - unsigned rgba1 = row_from[x-x0]; - unsigned a1 = int( ((rgba1 >> 24) & 0xff) * opacity ); - if (a1 == 0) continue; - if (a1 == 0xff) - { - row_to[x] = rgba1; - continue; - } - unsigned r1 = rgba1 & 0xff; - unsigned g1 = (rgba1 >> 8 ) & 0xff; - unsigned b1 = (rgba1 >> 16) & 0xff; - - unsigned a0 = (rgba0 >> 24) & 0xff; - unsigned r0 = rgba0 & 0xff ; - unsigned g0 = (rgba0 >> 8 ) & 0xff; - unsigned b0 = (rgba0 >> 16) & 0xff; - - unsigned atmp = a1 + a0 - ((a1 * a0 + 255) >> 8); - if (atmp) - { - r0 = byte((r1 * a1 + (r0 * a0) - ((r0 * a0 * a1 + 255) >> 8)) / atmp); - g0 = byte((g1 * a1 + (g0 * a0) - ((g0 * a0 * a1 + 255) >> 8)) / atmp); - b0 = byte((b1 * a1 + (b0 * a0) - ((b0 * a0 * a1 + 255) >> 8)) / atmp); - } - a0 = byte(atmp); - - row_to[x] = (a0 << 24)| (b0 << 16) | (g0 << 8) | (r0) ; - } - } - } - } - - template - inline void merge_rectangle(image_data_rgba8 const& data, unsigned x0, unsigned y0, float opacity) - { - box2d ext0(0,0,data_.width(),data_.height()); - box2d ext1(x0,y0,x0 + data.width(),y0 + data.height()); - - if (ext0.intersects(ext1)) - { - box2d box = ext0.intersect(ext1); - for (int y = box.miny(); y < box.maxy(); ++y) - { - unsigned int* row_to = data_.getRow(y); - unsigned int const * row_from = data.getRow(y-y0); - for (int x = box.minx(); x < box.maxx(); ++x) - { - unsigned rgba0 = row_to[x]; - unsigned rgba1 = row_from[x-x0]; - unsigned a1 = int( ((rgba1 >> 24) & 0xff) * opacity ); - if (a1 == 0) continue; - unsigned r1 = rgba1 & 0xff; - unsigned g1 = (rgba1 >> 8 ) & 0xff; - unsigned b1 = (rgba1 >> 16) & 0xff; - - unsigned a0 = (rgba0 >> 24) & 0xff; - unsigned r0 = rgba0 & 0xff ; - unsigned g0 = (rgba0 >> 8 ) & 0xff; - unsigned b0 = (rgba0 >> 16) & 0xff; - - unsigned a = (a1 * 255 + (255 - a1) * a0 + 127)/255; - - MergeMethod::mergeRGB(r0,g0,b0,r1,g1,b1); - - r0 = (r1*a1 + (((255 - a1) * a0 + 127)/255) * r0 + 127)/a; - g0 = (g1*a1 + (((255 - a1) * a0 + 127)/255) * g0 + 127)/a; - b0 = (b1*a1 + (((255 - a1) * a0 + 127)/255) * b0 + 127)/a; - - row_to[x] = (a << 24)| (b0 << 16) | (g0 << 8) | (r0) ; - } - } - } - } -}; -} - -#endif // MAPNIK_GRAPHICS_HPP diff --git a/include/mapnik/grid/grid.hpp b/include/mapnik/grid/grid.hpp index bd4cd1e5d..ab79cdd2a 100644 --- a/include/mapnik/grid/grid.hpp +++ b/include/mapnik/grid/grid.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,7 @@ // mapnik #include -#include +#include #include #include #include @@ -33,9 +33,9 @@ #include #include #include +#include // stl -#include #include #include #include @@ -49,8 +49,8 @@ template class MAPNIK_DECL hit_grid { public: - using value_type = T; - using data_type = mapnik::image_data; + using value_type = typename T::type; + using data_type = mapnik::image; using lookup_type = std::string; // mapping between pixel id and key using feature_key_type = std::map; @@ -58,11 +58,10 @@ public: static const value_type base_mask; private: - unsigned width_; - unsigned height_; + std::size_t width_; + std::size_t height_; std::string key_; data_type data_; - unsigned int resolution_; std::string id_name_; bool painted_; std::set names_; @@ -72,7 +71,7 @@ private: public: - hit_grid(int width, int height, std::string const& key, unsigned int resolution); + hit_grid(std::size_t width, std::size_t height, std::string const& key); hit_grid(hit_grid const& rhs); @@ -97,12 +96,12 @@ public: void add_feature(mapnik::feature_impl const& feature); - inline void add_property_name(std::string const& name) + inline void add_field(std::string const& name) { names_.insert(name); } - inline std::set const& property_names() const + inline std::set const& get_fields() const { return names_; } @@ -127,16 +126,6 @@ public: key_ = key; } - inline unsigned int get_resolution() const - { - return resolution_; - } - - inline void set_resolution(unsigned int res) - { - resolution_ = res; - } - inline data_type const& data() const { return data_; @@ -147,30 +136,30 @@ public: return data_; } - inline T const * raw_data() const + inline value_type const * raw_data() const { - return data_.getData(); + return data_.data(); } - inline T* raw_data() + inline value_type* raw_data() { - return data_.getData(); + return data_.data(); } - inline value_type const * getRow(unsigned row) const + inline value_type const * get_row(std::size_t row) const { - return data_.getRow(row); + return data_.get_row(row); } - inline mapnik::grid_view get_view(unsigned x, unsigned y, unsigned w, unsigned h) + inline mapnik::grid_view get_view(std::size_t x, std::size_t y, std::size_t w, std::size_t h) { - return mapnik::grid_view(x,y,w,h, - data_,key_,id_name_,resolution_,names_,f_keys_,features_); + return mapnik::grid_view(x, y, w, h, + data_, key_, id_name_, names_, f_keys_, features_); } private: - inline bool checkBounds(unsigned x, unsigned y) const + inline bool checkBounds(std::size_t x, std::size_t y) const { return (x < width_ && y < height_); } @@ -178,39 +167,43 @@ private: hit_grid& operator=(const hit_grid&); public: - inline void setPixel(int x,int y,value_type feature_id) + inline void setPixel(std::size_t x, std::size_t y, value_type feature_id) { - if (checkBounds(x,y)) + if (checkBounds(x, y)) { - data_(x,y) = feature_id; + data_(x, y) = feature_id; } } - inline unsigned width() const + inline std::size_t width() const { return width_; } - inline unsigned height() const + inline std::size_t height() const { return height_; } - inline void set_rectangle(value_type id,image_data_rgba8 const& data,int x0,int y0) + inline void set_rectangle(value_type id, image_rgba8 const& data, std::size_t x0, std::size_t y0) { - box2d ext0(0,0,width_,height_); - box2d ext1(x0,y0,x0+data.width(),y0+data.height()); + box2d ext0(0, 0, width_, height_); + box2d ext1(x0, y0, x0 + data.width(), y0 + data.height()); if (ext0.intersects(ext1)) { box2d box = ext0.intersect(ext1); - for (int y = box.miny(); y < box.maxy(); ++y) + std::size_t miny = safe_cast(box.miny()); + std::size_t maxy = safe_cast(box.maxy()); + std::size_t minx = safe_cast(box.minx()); + std::size_t maxx = safe_cast(box.maxx()); + for (std::size_t y = miny; y < maxy; ++y) { - value_type* row_to = data_.getRow(y); - unsigned int const * row_from = data.getRow(y-y0); + value_type* row_to = data_.get_row(y); + image_rgba8::pixel_type const * row_from = data.get_row(y - y0); - for (int x = box.minx(); x < box.maxx(); ++x) + for (std::size_t x = minx; x < maxx; ++x) { - unsigned rgba = row_from[x-x0]; + image_rgba8::pixel_type rgba = row_from[x - x0]; unsigned a = (rgba >> 24) & 0xff; // if the pixel is more than a tenth // opaque then burn in the feature id @@ -222,10 +215,9 @@ public: } } } - }; -using grid = hit_grid; +using grid = hit_grid; } #endif //MAPNIK_GRID_HPP diff --git a/include/mapnik/grid/grid_marker_helpers.hpp b/include/mapnik/grid/grid_marker_helpers.hpp deleted file mode 100644 index 4a27f841a..000000000 --- a/include/mapnik/grid/grid_marker_helpers.hpp +++ /dev/null @@ -1,236 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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_GRID_MARKER_HELPERS_HPP -#define MAPNIK_GRID_MARKER_HELPERS_HPP - -// mapnik -#include -#include -#include -#include - -// agg -#include "agg_renderer_scanline.h" -#include "agg_scanline_bin.h" -#include "agg_image_filters.h" -#include "agg_trans_bilinear.h" -#include "agg_span_allocator.h" -#include "agg_image_accessors.h" -#include "agg_span_image_filter_gray.h" - - -namespace mapnik { - -template -struct raster_markers_rasterizer_dispatch_grid : util::noncopyable -{ - using pixfmt_type = typename RendererBase::pixfmt_type; - using color_type = typename RendererBase::pixfmt_type::color_type; - - using BufferType = typename std::tuple_element<0,RendererContext>::type; - using RasterizerType = typename std::tuple_element<1,RendererContext>::type; - using PixMapType = typename std::tuple_element<2,RendererContext>::type; - - raster_markers_rasterizer_dispatch_grid(image_data_rgba8 const& src, - agg::trans_affine const& marker_trans, - markers_symbolizer const& sym, - Detector & detector, - double scale_factor, - mapnik::feature_impl const& feature, - attributes const& vars, - RendererContext const& renderer_context) - : buf_(std::get<0>(renderer_context)), - pixf_(buf_), - renb_(pixf_), - ras_(std::get<1>(renderer_context)), - src_(src), - marker_trans_(marker_trans), - sym_(sym), - detector_(detector), - scale_factor_(scale_factor), - feature_(feature), - vars_(vars), - pixmap_(std::get<2>(renderer_context)), - placed_(false) {} - - template - void add_path(T & path) - { - agg::scanline_bin sl_; - marker_placement_enum placement_method = get(sym_, keys::markers_placement_type, feature_, vars_, MARKER_POINT_PLACEMENT); - bool ignore_placement = get(sym_, keys::ignore_placement, feature_, vars_, false); - bool allow_overlap = get(sym_, keys::allow_overlap, feature_, vars_, false); - bool avoid_edges = get(sym_, keys::avoid_edges, feature_, vars_, false); - box2d bbox(0,0, src_.width(), src_.height()); - double spacing = get(sym_, keys::spacing, feature_, vars_, 100.0); - double max_error = get(sym_, keys::max_error, feature_, vars_, 0.2); - markers_placement_params params { bbox, marker_trans_, spacing * scale_factor_, max_error, allow_overlap, avoid_edges }; - markers_placement_finder placement_finder( - placement_method, path, detector_, params); - double x, y, angle = .0; - while (placement_finder.get_point(x, y, angle, ignore_placement)) - { - agg::trans_affine matrix = marker_trans_; - matrix.rotate(angle); - matrix.translate(x, y); - render_raster_marker(matrix); - if (!placed_) - { - pixmap_.add_feature(feature_); - placed_ = true; - } - } - } - - void render_raster_marker(agg::trans_affine const& marker_tr) - { - agg::scanline_bin sl_; - double width = src_.width(); - double height = src_.height(); - double p[8]; - p[0] = 0; p[1] = 0; - p[2] = width; p[3] = 0; - p[4] = width; p[5] = height; - p[6] = 0; p[7] = height; - marker_tr.transform(&p[0], &p[1]); - marker_tr.transform(&p[2], &p[3]); - marker_tr.transform(&p[4], &p[5]); - marker_tr.transform(&p[6], &p[7]); - ras_.move_to_d(p[0],p[1]); - ras_.line_to_d(p[2],p[3]); - ras_.line_to_d(p[4],p[5]); - ras_.line_to_d(p[6],p[7]); - RendererType ren(renb_); - ren.color(color_type(feature_.id())); - agg::render_scanlines(ras_, sl_, ren); - } - -private: - BufferType & buf_; - pixfmt_type pixf_; - RendererBase renb_; - RasterizerType & ras_; - image_data_rgba8 const& src_; - agg::trans_affine const& marker_trans_; - markers_symbolizer const& sym_; - Detector & detector_; - double scale_factor_; - mapnik::feature_impl const& feature_; - attributes const& vars_; - PixMapType & pixmap_; - bool placed_; -}; - - -template -struct vector_markers_rasterizer_dispatch_grid : util::noncopyable -{ - using renderer_base = typename SvgRenderer::renderer_base ; - using vertex_source_type = typename SvgRenderer::vertex_source_type ; - using attribute_source_type = typename SvgRenderer::attribute_source_type; - using pixfmt_type = typename renderer_base::pixfmt_type ; - - using BufferType = typename std::tuple_element<0,RendererContext>::type; - using RasterizerType = typename std::tuple_element<1,RendererContext>::type; - using PixMapType = typename std::tuple_element<2,RendererContext>::type; - - vector_markers_rasterizer_dispatch_grid(vertex_source_type & path, - attribute_source_type const& attrs, - box2d const& bbox, - agg::trans_affine const& marker_trans, - markers_symbolizer const& sym, - Detector & detector, - double scale_factor, - mapnik::feature_impl const& feature, - attributes const& vars, - bool /*snap_to_pixels*/, - RendererContext const& renderer_context) - : buf_(std::get<0>(renderer_context)), - pixf_(buf_), - renb_(pixf_), - svg_renderer_(path, attrs), - ras_(std::get<1>(renderer_context)), - bbox_(bbox), - marker_trans_(marker_trans), - sym_(sym), - detector_(detector), - scale_factor_(scale_factor), - feature_(feature), - vars_(vars), - pixmap_(std::get<2>(renderer_context)), - placed_(false) - { - } - - template - void add_path(T & path) - { - agg::scanline_bin sl_; - marker_placement_enum placement_method = - get(sym_, keys::markers_placement_type, feature_, vars_, MARKER_POINT_PLACEMENT); - bool ignore_placement = get(sym_, keys::ignore_placement, feature_, vars_, false); - double opacity = get(sym_,keys::opacity, feature_, vars_, 1.0); - bool allow_overlap = get(sym_, keys::allow_overlap, feature_, vars_, false); - bool avoid_edges = get(sym_, keys::avoid_edges, feature_, vars_, false); - double spacing = get(sym_, keys::spacing, feature_, vars_, 100.0); - double max_error = get(sym_, keys::max_error, feature_, vars_, 0.2); - coord2d center = bbox_.center(); - agg::trans_affine_translation recenter(-center.x, -center.y); - agg::trans_affine tr = recenter * marker_trans_; - markers_placement_params params { bbox_, tr, spacing * scale_factor_, max_error, allow_overlap, avoid_edges }; - markers_placement_finder placement_finder( - placement_method, path, detector_, params); - double x, y, angle = .0; - while (placement_finder.get_point(x, y, angle, ignore_placement)) - { - agg::trans_affine matrix = tr; - matrix.rotate(angle); - matrix.translate(x, y); - svg_renderer_.render_id(ras_, sl_, renb_, feature_.id(), matrix, opacity, bbox_); - if (!placed_) - { - pixmap_.add_feature(feature_); - placed_ = true; - } - } - } - -private: - BufferType & buf_; - pixfmt_type pixf_; - renderer_base renb_; - SvgRenderer svg_renderer_; - RasterizerType & ras_; - box2d const& bbox_; - agg::trans_affine const& marker_trans_; - markers_symbolizer const& sym_; - Detector & detector_; - double scale_factor_; - mapnik::feature_impl const& feature_; - attributes const& vars_; - PixMapType & pixmap_; - bool placed_; -}; - -} -#endif diff --git a/include/mapnik/grid/grid_pixel.hpp b/include/mapnik/grid/grid_pixel.hpp index 5ef1c78bd..fda65779a 100644 --- a/include/mapnik/grid/grid_pixel.hpp +++ b/include/mapnik/grid/grid_pixel.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/grid/grid_pixfmt.hpp b/include/mapnik/grid/grid_pixfmt.hpp index 6f61b9933..a26a936c9 100644 --- a/include/mapnik/grid/grid_pixfmt.hpp +++ b/include/mapnik/grid/grid_pixfmt.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,9 +24,15 @@ #define MAPNIK_GRID_PIXFMT_HPP #include +#include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include "agg_basics.h" #include -#include +#pragma GCC diagnostic pop namespace mapnik { diff --git a/include/mapnik/grid/grid_rasterizer.hpp b/include/mapnik/grid/grid_rasterizer.hpp index cd7381384..98a6dd31f 100644 --- a/include/mapnik/grid/grid_rasterizer.hpp +++ b/include/mapnik/grid/grid_rasterizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/grid/grid_render_marker.hpp b/include/mapnik/grid/grid_render_marker.hpp index 454ae038f..8f345e301 100644 --- a/include/mapnik/grid/grid_render_marker.hpp +++ b/include/mapnik/grid/grid_render_marker.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2012 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -41,7 +41,7 @@ namespace mapnik { template void render_raster_marker(RendererType ren, RasterizerType & ras, - image_data_rgba8 & src, + image_rgba8 const& src, mapnik::feature_impl const& feature, agg::trans_affine const& marker_tr, double opacity) diff --git a/include/mapnik/grid/grid_renderer.hpp b/include/mapnik/grid/grid_renderer.hpp index 500c95059..cc689e308 100644 --- a/include/mapnik/grid/grid_renderer.hpp +++ b/include/mapnik/grid/grid_renderer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -49,7 +49,7 @@ namespace mapnik { class feature_type_style; class label_collision_detector4; class layer; - class marker; + struct marker; class proj_transform; struct grid_rasterizer; class request; diff --git a/include/mapnik/grid/grid_renderer_base.hpp b/include/mapnik/grid/grid_renderer_base.hpp index 9524b1661..462010b6a 100644 --- a/include/mapnik/grid/grid_renderer_base.hpp +++ b/include/mapnik/grid/grid_renderer_base.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,9 +23,14 @@ #ifndef MAPNIK_GRID_RENDERER_BASE_HPP #define MAPNIK_GRID_RENDERER_BASE_HPP +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include "agg_renderer_base.h" -#include #include +#pragma GCC diagnostic pop +#include namespace mapnik { diff --git a/include/mapnik/grid/grid_rendering_buffer.hpp b/include/mapnik/grid/grid_rendering_buffer.hpp index d5031c826..4282e3bb9 100644 --- a/include/mapnik/grid/grid_rendering_buffer.hpp +++ b/include/mapnik/grid/grid_rendering_buffer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/grid/grid_util.hpp b/include/mapnik/grid/grid_util.hpp index e740d5794..826d2e15d 100644 --- a/include/mapnik/grid/grid_util.hpp +++ b/include/mapnik/grid/grid_util.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -61,7 +61,7 @@ static inline void scale_grid(mapnik::grid::data_type & target, //no scaling or subpixel offset if (target_height == source_height && target_width == source_width && offs_x == 0 && offs_y == 0){ for (y=0;y +#include #include #include #include @@ -55,7 +55,6 @@ public: T const& data, std::string const& key, std::string const& id_name, - unsigned resolution, std::set const& names, feature_key_type const& f_keys, feature_type const& features @@ -66,7 +65,6 @@ public: height_(height), data_(data), key_(key), - resolution_(resolution), id_name_(id_name), names_(names), f_keys_(f_keys), @@ -88,7 +86,6 @@ public: height_(rhs.height_), data_(rhs.data_), key_(rhs.key_), - resolution_(rhs.resolution_), id_name_(rhs.id_name_), names_(rhs.names_), f_keys_(rhs.f_keys_), @@ -104,7 +101,6 @@ public: height_ = rhs.height_; data_ = rhs.data_; key_ = rhs.key_; - resolution_ = rhs.resolution_; id_name_ = rhs.id_name_; names_ = rhs.names_; f_keys_ = rhs.f_keys_; @@ -137,9 +133,9 @@ public: return id_name_; } - inline value_type const * getRow(unsigned row) const + inline value_type const * get_row(unsigned row) const { - return data_.getRow(row + y_) + x_; + return data_.get_row(row + y_) + x_; } inline T& data() @@ -154,10 +150,10 @@ public: inline const unsigned char* raw_data() const { - return data_.getBytes(); + return data_.bytes(); } - inline std::set const& property_names() const + inline std::set const& get_fields() const { return names_; } @@ -177,11 +173,6 @@ public: return key_; } - inline unsigned int get_resolution() const - { - return resolution_; - } - private: unsigned x_; unsigned y_; @@ -189,14 +180,13 @@ private: unsigned height_; T const& data_; std::string const& key_; - unsigned int resolution_; std::string const& id_name_; std::set const& names_; feature_key_type const& f_keys_; feature_type const& features_; }; -using grid_view = hit_grid_view >; +using grid_view = hit_grid_view >; } diff --git a/include/mapnik/group/group_layout.hpp b/include/mapnik/group/group_layout.hpp index 2087b0b6c..23811e800 100644 --- a/include/mapnik/group/group_layout.hpp +++ b/include/mapnik/group/group_layout.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/group/group_layout_manager.hpp b/include/mapnik/group/group_layout_manager.hpp index 89acf5338..38ee30b5d 100644 --- a/include/mapnik/group/group_layout_manager.hpp +++ b/include/mapnik/group/group_layout_manager.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/group/group_rule.hpp b/include/mapnik/group/group_rule.hpp index a0442ce10..58f8505b4 100644 --- a/include/mapnik/group/group_rule.hpp +++ b/include/mapnik/group/group_rule.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/group/group_symbolizer_helper.hpp b/include/mapnik/group/group_symbolizer_helper.hpp index ec9d21e17..93c7d4f3f 100644 --- a/include/mapnik/group/group_symbolizer_helper.hpp +++ b/include/mapnik/group/group_symbolizer_helper.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -80,22 +80,23 @@ public: pixel_position_list const& get(); -private: - - /** Iterate over the given path, placing line-following labels or point labels with respect to label_spacing. */ + // Iterate over the given path, placing line-following labels or point labels with respect to label_spacing. template bool find_line_placements(T & path); - /** Check if a point placement fits at given position */ +private: + + + // Check if a point placement fits at given position bool check_point_placement(pixel_position const& pos); - /** Checks for collision. */ + // Checks for collision. bool collision(box2d const& box, value_unicode_string const& repeat_key = "") const; double get_spacing(double path_length) const; DetectorType & detector_; - /** Boxes and repeat keys to take into account when finding placement. - * Boxes are relative to starting point of current placement. - */ + // Boxes and repeat keys to take into account when finding placement. + // Boxes are relative to starting point of current placement. + // std::list box_elements_; pixel_position_list results_; diff --git a/include/mapnik/group/group_symbolizer_properties.hpp b/include/mapnik/group/group_symbolizer_properties.hpp index fce169431..f5967b8be 100644 --- a/include/mapnik/group/group_symbolizer_properties.hpp +++ b/include/mapnik/group/group_symbolizer_properties.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/hextree.hpp b/include/mapnik/hextree.hpp index 868784270..466462404 100644 --- a/include/mapnik/hextree.hpp +++ b/include/mapnik/hextree.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -98,7 +98,7 @@ class hextree : private util::noncopyable // penalty of using this node as color double reduce_cost; // number of !=0 positions in children_ array - byte children_count; + std::uint8_t children_count; }; // highest reduce_cost first @@ -184,7 +184,7 @@ public: } // process alpha value based on trans_mode_ - byte preprocessAlpha(byte a) const + std::uint8_t preprocessAlpha(std::uint8_t a) const { switch(trans_mode_) { @@ -199,7 +199,7 @@ public: void insert(T const& data) { - byte a = preprocessAlpha(data.a); + std::uint8_t a = preprocessAlpha(data.a); unsigned level = 0; node * cur_node = root_.get(); if (a < InsertPolicy::MIN_ALPHA) @@ -238,7 +238,7 @@ public: // return color index in returned earlier palette int quantize(unsigned val) const { - byte a = preprocessAlpha(U2ALPHA(val)); + std::uint8_t a = preprocessAlpha(U2ALPHA(val)); unsigned ind=0; if (a < InsertPolicy::MIN_ALPHA || colors_ == 0) { @@ -396,12 +396,12 @@ private: if (itr->count != 0) { unsigned count = itr->count; - byte a = byte(itr->alphas/float(count)); + std::uint8_t a = std::uint8_t(itr->alphas/float(count)); if (a > InsertPolicy::MAX_ALPHA) a = 255; if (a < InsertPolicy::MIN_ALPHA) a = 0; - palette.push_back(rgba((byte)round(gamma(itr->reds / count, gamma_)), - (byte)round(gamma(itr->greens / count, gamma_)), - (byte)round(gamma(itr->blues / count, gamma_)), a)); + palette.push_back(rgba((std::uint8_t)round(gamma(itr->reds / count, gamma_)), + (std::uint8_t)round(gamma(itr->greens / count, gamma_)), + (std::uint8_t)round(gamma(itr->blues / count, gamma_)), a)); } for (unsigned idx=0; idx < 16; ++idx) { diff --git a/include/mapnik/hit_test_filter.hpp b/include/mapnik/hit_test_filter.hpp index 86a712f2a..d4b850496 100644 --- a/include/mapnik/hit_test_filter.hpp +++ b/include/mapnik/hit_test_filter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,11 +25,136 @@ // mapnik #include +#include #include -// boost - namespace mapnik { + +namespace detail { + +inline bool pip(double x0, + double y0, + double x1, + double y1, + double x, + double y) +{ + return ((((y1 <= y) && (y < y0)) || ((y0 <= y) && (y < y1))) && (x < (x0 - x1) * (y - y1) / (y0 - y1) + x1)); +} + +struct hit_test_visitor +{ + hit_test_visitor(double x, double y, double tol) + : x_(x), + y_(y), + tol_(tol) {} + + bool operator() (geometry::geometry_empty const& ) const + { + return false; + } + + bool operator() (geometry::point const& geom) const + { + return distance(geom.x, geom.y, x_, y_) <= tol_; + } + bool operator() (geometry::multi_point const& geom) const + { + for (auto const& pt : geom) + { + if (distance(pt.x, pt.y, x_, y_) <= tol_) return true; + } + return false; + } + bool operator() (geometry::line_string const& geom) const + { + std::size_t num_points = geom.num_points(); + if (num_points > 1) + { + for (std::size_t i = 1; i < num_points; ++i) + { + auto const& pt0 = geom[i-1]; + auto const& pt1 = geom[i]; + double distance = point_to_segment_distance(x_,y_,pt0.x,pt0.y,pt1.x,pt1.y); + if (distance < tol_) return true; + } + } + return false; + } + bool operator() (geometry::multi_line_string const& geom) const + { + for (auto const& line: geom) + { + if (operator()(line)) return true; + } + return false; + } + bool operator() (geometry::polygon const& geom) const + { + auto const& exterior = geom.exterior_ring; + std::size_t num_points = exterior.num_points(); + if (num_points < 4) return false; + bool inside = false; + for (std::size_t i = 1; i < num_points; ++i) + { + auto const& pt0 = exterior[i-1]; + auto const& pt1 = exterior[i]; + // todo - account for tolerance + if (pip(pt0.x,pt0.y,pt1.x,pt1.y,x_,y_)) + { + inside = !inside; + } + } + if (!inside) return false; + for (auto const& ring : geom.interior_rings) + { + std::size_t num_interior_points = ring.size(); + if (num_interior_points < 4) + { + continue; + } + for (std::size_t j = 1; j < num_interior_points; ++j) + { + auto const& pt0 = ring[j-1]; + auto const& pt1 = ring[j]; + if (pip(pt0.x,pt0.y,pt1.x,pt1.y,x_,y_)) + { + // TODO - account for tolerance + inside=!inside; + } + } + } + return inside; + } + bool operator() (geometry::multi_polygon const& geom) const + { + for (auto const& poly: geom) + { + if (operator()(poly)) return true; + } + return false; + } + bool operator() (geometry::geometry_collection const& collection) const + { + for (auto const& geom: collection) + { + if (mapnik::util::apply_visitor((*this),geom)) return true; + } + return false; + } + + double x_; + double y_; + double tol_; +}; + +} + +inline bool hit_test(mapnik::geometry::geometry const& geom, double x, double y, double tol) +{ + return mapnik::util::apply_visitor(detail::hit_test_visitor(x,y,tol), geom); +} + class hit_test_filter { public: @@ -38,14 +163,9 @@ public: y_(y), tol_(tol) {} - bool pass(feature_impl & feature) + bool pass(feature_impl const& feature) { - for (geometry_type & geom : feature.paths()) - { - if (label::hit_test(geom, x_,y_,tol_)) - return true; - } - return false; + return hit_test(feature.get_geometry(),x_,y_,tol_); } private: diff --git a/include/mapnik/image.hpp b/include/mapnik/image.hpp new file mode 100644 index 000000000..ec8b1f88a --- /dev/null +++ b/include/mapnik/image.hpp @@ -0,0 +1,146 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_IMAGE_HPP +#define MAPNIK_IMAGE_HPP + +// mapnik +#include +#include + +namespace mapnik { + +namespace detail { + +struct MAPNIK_DECL buffer +{ + explicit buffer(std::size_t size); + buffer(buffer && rhs) noexcept; + buffer(buffer const& rhs); + ~buffer(); + + buffer& operator=(buffer rhs); + inline bool operator!() const + { + return (data_ == nullptr)? true : false; + } + + void swap(buffer & rhs); + unsigned char* data(); + unsigned char const* data() const; + std::size_t size() const; +private: + std::size_t size_; + unsigned char* data_; + +}; + +template +struct image_dimensions +{ + image_dimensions(int width, int height); + image_dimensions(image_dimensions const& other) = default; + image_dimensions(image_dimensions && other) = default; + image_dimensions& operator= (image_dimensions rhs); + std::size_t width() const; + std::size_t height() const; +private: + std::size_t width_; + std::size_t height_; +}; + +} // end ns detail + +template +class image +{ +public: + using pixel = T; + using pixel_type = typename T::type; + static constexpr image_dtype dtype = T::id; + static constexpr std::size_t pixel_size = sizeof(pixel_type); +private: + detail::image_dimensions<65535> dimensions_; + detail::buffer buffer_; + pixel_type *pData_; + double offset_; + double scaling_; + bool premultiplied_alpha_; + bool painted_; +public: + image(); + image(int width, + int height, + bool initialize = true, + bool premultiplied = false, + bool painted = false); + image(image const& rhs); + image(image && rhs) noexcept; + image& operator=(image rhs); + bool operator==(image const& rhs) const; + bool operator<(image const& rhs) const; + + void swap(image & rhs); + pixel_type& operator() (std::size_t i, std::size_t j); + pixel_type const& operator() (std::size_t i, std::size_t j) const; + std::size_t width() const; + std::size_t height() const; + std::size_t size() const; + std::size_t row_size() const; + void set(pixel_type const& t); + pixel_type const* data() const; + pixel_type* data(); + unsigned char const* bytes() const; + unsigned char* bytes(); + pixel_type const* get_row(std::size_t row) const; + pixel_type const* get_row(std::size_t row, std::size_t x0) const; + pixel_type* get_row(std::size_t row); + pixel_type* get_row(std::size_t row, std::size_t x0); + void set_row(std::size_t row, pixel_type const* buf, std::size_t size); + void set_row(std::size_t row, std::size_t x0, std::size_t x1, pixel_type const* buf); + double get_offset() const; + void set_offset(double set); + double get_scaling() const; + void set_scaling(double set); + bool get_premultiplied() const; + void set_premultiplied(bool set); + void painted(bool painted); + bool painted() const; + image_dtype get_dtype() const; +}; + +using image_null = image; +using image_rgba8 = image; +using image_gray8 = image; +using image_gray8s = image; +using image_gray16 = image; +using image_gray16s = image; +using image_gray32 = image; +using image_gray32s = image; +using image_gray32f = image; +using image_gray64 = image; +using image_gray64s = image; +using image_gray64f = image; + +} // end ns mapnik + +#endif // MAPNIK_IMAGE_HPP diff --git a/include/mapnik/image_any.hpp b/include/mapnik/image_any.hpp new file mode 100644 index 000000000..c14d5dd49 --- /dev/null +++ b/include/mapnik/image_any.hpp @@ -0,0 +1,85 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_IMAGE_ANY_HPP +#define MAPNIK_IMAGE_ANY_HPP + +#include +#include +#include + +namespace mapnik { + +using image_base = util::variant; + + +struct MAPNIK_DECL image_any : image_base +{ + image_any() = default; + + image_any(int width, + int height, + image_dtype type = image_dtype_rgba8, + bool initialize = true, + bool premultiplied = false, + bool painted = false); + + template + image_any(T && data) noexcept + : image_base(std::move(data)) {} + + unsigned char const* bytes() const; + unsigned char* bytes(); + std::size_t width() const; + std::size_t height() const; + bool get_premultiplied() const; + bool painted() const; + std::size_t size() const; + std::size_t row_size() const; + double get_offset() const; + double get_scaling() const; + image_dtype get_dtype() const; + void set_offset(double val); + void set_scaling(double val); +}; + +MAPNIK_DECL image_any create_image_any(int width, + int height, + image_dtype type = image_dtype_rgba8, + bool initialize = true, + bool premultiplied = false, + bool painted = false); + +} // end mapnik ns + +#endif // MAPNIK_IMAGE_ANY_HPP diff --git a/include/mapnik/image_compositing.hpp b/include/mapnik/image_compositing.hpp index c72f62daa..2967be780 100644 --- a/include/mapnik/image_compositing.hpp +++ b/include/mapnik/image_compositing.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,7 @@ #define MAPNIK_IMAGE_COMPOSITING_HPP #include -#include +#include // boost #include @@ -87,8 +87,7 @@ MAPNIK_DECL void composite(T & dst, T const& src, composite_mode_e mode, float opacity=1, int dx=0, - int dy=0, - bool premultiply_src=false); + int dy=0); } #endif // MAPNIK_IMAGE_COMPOSITING_HPP diff --git a/include/mapnik/image_copy.hpp b/include/mapnik/image_copy.hpp new file mode 100644 index 000000000..8f40ef40a --- /dev/null +++ b/include/mapnik/image_copy.hpp @@ -0,0 +1,72 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_IMAGE_COPY_HPP +#define MAPNIK_IMAGE_COPY_HPP + +#include +#include + +namespace mapnik +{ + +template +MAPNIK_DECL T image_copy(image_any const&, double offset = 0.0, double scaling = 1.0); + +template +MAPNIK_DECL T image_copy(image_rgba8 const&, double offset = 0.0, double scaling = 1.0); + +template +MAPNIK_DECL T image_copy(image_gray8 const&, double offset = 0.0, double scaling = 1.0); + +template +MAPNIK_DECL T image_copy(image_gray8s const&, double offset = 0.0, double scaling = 1.0); + +template +MAPNIK_DECL T image_copy(image_gray16 const&, double offset = 0.0, double scaling = 1.0); + +template +MAPNIK_DECL T image_copy(image_gray16s const&, double offset = 0.0, double scaling = 1.0); + +template +MAPNIK_DECL T image_copy(image_gray32 const&, double offset = 0.0, double scaling = 1.0); + +template +MAPNIK_DECL T image_copy(image_gray32s const&, double offset = 0.0, double scaling = 1.0); + +template +MAPNIK_DECL T image_copy(image_gray32f const&, double offset = 0.0, double scaling = 1.0); + +template +MAPNIK_DECL T image_copy(image_gray64 const&, double offset = 0.0, double scaling = 1.0); + +template +MAPNIK_DECL T image_copy(image_gray64s const&, double offset = 0.0, double scaling = 1.0); + +template +MAPNIK_DECL T image_copy(image_gray64f const&, double offset = 0.0, double scaling = 1.0); + +MAPNIK_DECL image_any image_copy(image_any const&, image_dtype type, double offset = 0.0, double scaling = 1.0); + +} // end mapnik ns + +#endif // MAPNIK_IMAGE_COPY_HPP diff --git a/include/mapnik/image_data.hpp b/include/mapnik/image_data.hpp deleted file mode 100644 index 833a0f16e..000000000 --- a/include/mapnik/image_data.hpp +++ /dev/null @@ -1,256 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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_IMAGE_DATA_HPP -#define MAPNIK_IMAGE_DATA_HPP - -// mapnik -#include -// stl -#include -#include -#include - -namespace mapnik { - -namespace detail { - -struct buffer -{ - explicit buffer(std::size_t size) - : size_(size), - data_(static_cast(size_ != 0 ? ::operator new(size_) : nullptr)) - {} - - buffer(buffer && rhs) noexcept - : size_(std::move(rhs.size_)), - data_(std::move(rhs.data_)) - { - rhs.size_ = 0; - rhs.data_ = nullptr; - } - - buffer(buffer const& rhs) - : size_(rhs.size_), - data_(static_cast(size_ != 0 ? ::operator new(size_) : nullptr)) - { - if (data_) std::copy(rhs.data_, rhs.data_ + rhs.size_, data_); - } - - buffer& operator=(buffer rhs) - { - swap(rhs); - return *this; - } - - void swap(buffer & rhs) - { - std::swap(size_, rhs.size_); - std::swap(data_, rhs.data_); - } - - inline bool operator!() const { return (data_ == nullptr)? false : true; } - ~buffer() - { - ::operator delete(data_); - } - - inline unsigned char* data() { return data_; } - inline unsigned char const* data() const { return data_; } - inline std::size_t size() const { return size_; } - std::size_t size_; - unsigned char* data_; - -}; - -template -struct image_dimensions -{ - image_dimensions(int width, int height) - : width_(width), - height_(height) - { - if (width < 0 || static_cast(width) > max_size) throw std::runtime_error("Invalid width for image dimensions requested"); - if (height < 0 || static_cast(height) > max_size) throw std::runtime_error("Invalid height for image dimensions requested"); - } - - image_dimensions(image_dimensions const& other) = default; - image_dimensions(image_dimensions && other) = default; - image_dimensions& operator= (image_dimensions rhs) - { - std::swap(width_, rhs.width_); - std::swap(height_, rhs.height_); - return *this; - } - std::size_t width() const - { - return width_; - } - std::size_t height() const - { - return height_; - } - std::size_t width_; - std::size_t height_; -}; - -} - -template -class image_data -{ -public: - using pixel_type = T; - static constexpr std::size_t pixel_size = sizeof(pixel_type); - - image_data(int width, int height, bool initialize = true) - : dimensions_(width, height), - buffer_(dimensions_.width() * dimensions_.height() * pixel_size), - pData_(reinterpret_cast(buffer_.data())) - { - if (pData_ && initialize) std::fill(pData_, pData_ + dimensions_.width() * dimensions_.height(), 0); - } - - image_data(image_data const& rhs) - : dimensions_(rhs.dimensions_), - buffer_(rhs.buffer_), - pData_(reinterpret_cast(buffer_.data())) - {} - - image_data(image_data && rhs) noexcept - : dimensions_(std::move(rhs.dimensions_)), - buffer_(std::move(rhs.buffer_)), - pData_(reinterpret_cast(buffer_.data())) - { - rhs.dimensions_ = { 0, 0 }; - rhs.pData_ = nullptr; - } - - image_data& operator=(image_data rhs) - { - swap(rhs); - return *this; - } - - void swap(image_data & rhs) - { - std::swap(dimensions_, rhs.dimensions_); - std::swap(buffer_, rhs.buffer_); - } - - inline pixel_type& operator() (std::size_t i, std::size_t j) - { - assert(i < dimensions_.width() && j < dimensions_.height()); - return pData_[j * dimensions_.width() + i]; - } - inline const pixel_type& operator() (std::size_t i, std::size_t j) const - { - assert(i < dimensions_.width() && j < dimensions_.height()); - return pData_[j * dimensions_.width() + i]; - } - inline std::size_t width() const - { - return dimensions_.width(); - } - inline std::size_t height() const - { - return dimensions_.height(); - } - inline unsigned getSize() const - { - return dimensions_.height() * dimensions_.width() * pixel_size; - } - inline unsigned getRowSize() const - { - return dimensions_.width() * pixel_size; - } - inline void set(pixel_type const& t) - { - std::fill(pData_, pData_ + dimensions_.width() * dimensions_.height(), t); - } - - inline const pixel_type* getData() const - { - return pData_; - } - - inline pixel_type* getData() - { - return pData_; - } - - inline const unsigned char* getBytes() const - { - return buffer_.data(); - } - - inline unsigned char* getBytes() - { - return buffer_.data(); - } - - inline const pixel_type* getRow(std::size_t row) const - { - return pData_ + row * dimensions_.width(); - } - - inline const pixel_type* getRow(std::size_t row, std::size_t x0) const - { - return pData_ + row * dimensions_.width() + x0; - } - - inline pixel_type* getRow(std::size_t row) - { - return pData_ + row * dimensions_.width(); - } - - inline pixel_type* getRow(std::size_t row, std::size_t x0) - { - return pData_ + row * dimensions_.width() + x0; - } - - inline void setRow(std::size_t row, pixel_type const* buf, std::size_t size) - { - assert(row < dimensions_.height()); - assert(size <= dimensions_.width()); - std::copy(buf, buf + size, pData_ + row * dimensions_.width()); - } - inline void setRow(std::size_t row, std::size_t x0, std::size_t x1, pixel_type const* buf) - { - assert(row < dimensions_.height()); - assert ((x1 - x0) <= dimensions_.width() ); - std::copy(buf, buf + (x1 - x0), pData_ + row * dimensions_.width() + x0); - } - -private: - detail::image_dimensions dimensions_; - detail::buffer buffer_; - pixel_type *pData_; -}; - -using image_data_rgba8 = image_data; -using image_data_gray8 = image_data ; -using image_data_gray16 = image_data; -using image_data_gray32f = image_data; -} - -#endif // MAPNIK_IMAGE_DATA_HPP diff --git a/include/mapnik/image_data_any.hpp b/include/mapnik/image_data_any.hpp deleted file mode 100644 index c09bfdf7d..000000000 --- a/include/mapnik/image_data_any.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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_IMAGE_DATA_ANY_HPP -#define MAPNIK_IMAGE_DATA_ANY_HPP - -#include -#include - -namespace mapnik { - -struct image_data_null -{ - unsigned char const* getBytes() const { return nullptr; } - unsigned char* getBytes() { return nullptr;} - std::size_t width() const { return 0; } - std::size_t height() const { return 0; } -}; - -using image_data_base = util::variant; - -namespace detail { - -struct get_bytes_visitor -{ - template - unsigned char* operator()(T & data) - { - return data.getBytes(); - } -}; - -struct get_bytes_visitor_const -{ - template - unsigned char const* operator()(T const& data) const - { - return data.getBytes(); - } -}; - -struct get_width_visitor -{ - template - std::size_t operator()(T const& data) const - { - return data.width(); - } -}; - -struct get_height_visitor -{ - template - std::size_t operator()(T const& data) const - { - return data.height(); - } -}; - -} // namespace detail - -struct image_data_any : image_data_base -{ - image_data_any() = default; - - template - image_data_any(T && data) noexcept - : image_data_base(std::move(data)) {} - - unsigned char const* getBytes() const - { - return util::apply_visitor(detail::get_bytes_visitor_const(),*this); - } - - unsigned char* getBytes() - { - return util::apply_visitor(detail::get_bytes_visitor(),*this); - } - - std::size_t width() const - { - return util::apply_visitor(detail::get_width_visitor(),*this); - } - - std::size_t height() const - { - return util::apply_visitor(detail::get_height_visitor(),*this); - } -}; - -} - -#endif // MAPNIK_IMAGE_DATA_ANY_HPP diff --git a/include/mapnik/image_filter.hpp b/include/mapnik/image_filter.hpp index 064e94a43..37c332786 100644 --- a/include/mapnik/image_filter.hpp +++ b/include/mapnik/image_filter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,7 +31,11 @@ // boost GIL #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wc++11-narrowing" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #pragma GCC diagnostic pop @@ -139,7 +143,7 @@ boost::gil::rgba8_view_t rgba8_view(Image & img) using boost::gil::interleaved_view; using boost::gil::rgba8_pixel_t; return interleaved_view(img.width(), img.height(), - reinterpret_cast(img.raw_data()), + reinterpret_cast(img.bytes()), img.width() * sizeof(rgba8_pixel_t)); } @@ -250,10 +254,10 @@ void apply_convolution_3x3(Src const& src_view, Dst & dst_view, Filter const& fi typename Src::x_iterator dst_it = dst_view.row_begin(0); // top row - for (int x = 0 ; x < src_view.width(); ++x) + for (std::size_t x = 0 ; x < static_cast(src_view.width()); ++x) { (*dst_it)[3] = src_loc[loc11][3]; // Dst.a = Src.a - for (int i = 0; i < 3; ++i) + for (std::size_t i = 0; i < 3; ++i) { bits32f p[9]; @@ -271,7 +275,7 @@ void apply_convolution_3x3(Src const& src_view, Dst & dst_view, Filter const& fi p[6] = src_loc[loc02][i]; } - if ( x == src_view.width()-1) + if ( x == static_cast(src_view.width())-1) { p[5] = p[4]; p[8] = p[7]; @@ -292,15 +296,15 @@ void apply_convolution_3x3(Src const& src_view, Dst & dst_view, Filter const& fi ++dst_it; } // carrige-return - src_loc += point2(-src_view.width(),1); + src_loc += point2(-static_cast(src_view.width()),1); // 1... height-1 rows - for (int y = 1; y(src_view.height())-1; ++y) { - for (int x = 0; x < src_view.width(); ++x) + for (std::size_t x = 0; x < static_cast(src_view.width()); ++x) { (*dst_it)[3] = src_loc[loc11][3]; // Dst.a = Src.a - for (int i = 0; i < 3; ++i) + for (std::size_t i = 0; i < 3; ++i) { bits32f p[9]; @@ -321,7 +325,7 @@ void apply_convolution_3x3(Src const& src_view, Dst & dst_view, Filter const& fi p[6] = src_loc[loc02][i]; } - if ( x == src_view.width() - 1) + if ( x == static_cast(src_view.width()) - 1) { p[2] = p[1]; p[5] = p[4]; @@ -339,15 +343,15 @@ void apply_convolution_3x3(Src const& src_view, Dst & dst_view, Filter const& fi ++src_loc.x(); } // carrige-return - src_loc += point2(-src_view.width(),1); + src_loc += point2(-static_cast(src_view.width()),1); } // bottom row - //src_loc = src_view.xy_at(0,src_view.height()-1); - for (int x = 0 ; x < src_view.width(); ++x) + //src_loc = src_view.xy_at(0,static_cast(src_view.height())-1); + for (std::size_t x = 0 ; x < static_cast(src_view.width()); ++x) { (*dst_it)[3] = src_loc[loc11][3]; // Dst.a = Src.a - for (int i = 0; i < 3; ++i) + for (std::size_t i = 0; i < 3; ++i) { bits32f p[9]; @@ -365,7 +369,7 @@ void apply_convolution_3x3(Src const& src_view, Dst & dst_view, Filter const& fi p[3] = src_loc[loc01][i]; } - if ( x == src_view.width()-1) + if ( x == static_cast(src_view.width())-1) { p[2] = p[1]; p[5] = p[4]; @@ -391,17 +395,17 @@ template void apply_filter(Src & src, Filter const& filter) { { - src.demultiply(); + demultiply_alpha(src); double_buffer tb(src); apply_convolution_3x3(tb.src_view, tb.dst_view, filter); } // ensure ~double_buffer() is called before premultiplying - src.premultiply(); + premultiply_alpha(src); } template void apply_filter(Src & src, agg_stack_blur const& op) { - agg::rendering_buffer buf(src.raw_data(),src.width(),src.height(), src.width() * 4); + agg::rendering_buffer buf(src.bytes(),src.width(),src.height(), src.row_size()); agg::pixfmt_rgba32_pre pixf(buf); agg::stack_blur_rgba32(pixf,op.rx,op.ry); } @@ -427,10 +431,10 @@ void apply_filter(Src & src, color_to_alpha const& op) double cr = static_cast(op.color.red())/255.0; double cg = static_cast(op.color.green())/255.0; double cb = static_cast(op.color.blue())/255.0; - for (int y=0; y(src_view.height()); ++y) { - rgba8_view_t::x_iterator src_it = src_view.row_begin(y); - for (int x=0; x(y)); + for (std::size_t x=0; x(src_view.width()); ++x) { uint8_t & r = get_color(src_it[x], red_t()); uint8_t & g = get_color(src_it[x], green_t()); @@ -488,10 +492,10 @@ void apply_filter(Src & src, colorize_alpha const& op) mapnik::filter::color_stop const& stop = op[0]; mapnik::color const& c = stop.color; rgba8_view_t src_view = rgba8_view(src); - for (int y=0; y(src_view.height()); ++y) { - rgba8_view_t::x_iterator src_it = src_view.row_begin(y); - for (int x=0; x(y)); + for (std::size_t x=0; x(src_view.width()); ++x) { uint8_t & r = get_color(src_it[x], red_t()); uint8_t & g = get_color(src_it[x], green_t()); @@ -529,10 +533,10 @@ void apply_filter(Src & src, colorize_alpha const& op) if (grad_lut.build_lut()) { rgba8_view_t src_view = rgba8_view(src); - for (int y=0; y(src_view.height()); ++y) { - rgba8_view_t::x_iterator src_it = src_view.row_begin(y); - for (int x=0; x(y)); + for (std::size_t x=0; x(src_view.width()); ++x) { uint8_t & r = get_color(src_it[x], red_t()); uint8_t & g = get_color(src_it[x], green_t()); @@ -594,10 +598,10 @@ void apply_filter(Src & src, scale_hsla const& transform) if (tinting || set_alpha) { rgba8_view_t src_view = rgba8_view(src); - for (int y=0; y(src_view.height()); ++y) { - rgba8_view_t::x_iterator src_it = src_view.row_begin(y); - for (int x=0; x(y)); + for (std::size_t x=0; x(src_view.width()); ++x) { uint8_t & r = get_color(src_it[x], red_t()); uint8_t & g = get_color(src_it[x], green_t()); @@ -677,10 +681,10 @@ void apply_filter(Src & src, gray const& /*op*/) rgba8_view_t src_view = rgba8_view(src); - for (int y=0; y(src_view.height()); ++y) { - rgba8_view_t::x_iterator src_it = src_view.row_begin(y); - for (int x=0; x(y)); + for (std::size_t x=0; x(src_view.width()); ++x) { // formula taken from boost/gil/color_convert.hpp:rgb_to_luminance uint8_t & r = get_color(src_it[x], red_t()); @@ -695,22 +699,22 @@ void apply_filter(Src & src, gray const& /*op*/) template void x_gradient_impl(Src const& src_view, Dst const& dst_view) { - for (int y=0; y(src_view.height()); ++y) { - typename Src::x_iterator src_it = src_view.row_begin(y); - typename Dst::x_iterator dst_it = dst_view.row_begin(y); + typename Src::x_iterator src_it = src_view.row_begin(static_cast(y)); + typename Dst::x_iterator dst_it = dst_view.row_begin(static_cast(y)); dst_it[0][0] = 128 + (src_it[0][0] - src_it[1][0]) / 2; dst_it[0][1] = 128 + (src_it[0][1] - src_it[1][1]) / 2; dst_it[0][2] = 128 + (src_it[0][2] - src_it[1][2]) / 2; - dst_it[dst_view.width()-1][0] = 128 + (src_it[src_view.width()-2][0] - src_it[src_view.width()-1][0]) / 2; - dst_it[dst_view.width()-1][1] = 128 + (src_it[src_view.width()-2][1] - src_it[src_view.width()-1][1]) / 2; - dst_it[dst_view.width()-1][2] = 128 + (src_it[src_view.width()-2][2] - src_it[src_view.width()-1][2]) / 2; + dst_it[dst_view.width()-1][0] = 128 + (src_it[static_cast(src_view.width())-2][0] - src_it[static_cast(src_view.width())-1][0]) / 2; + dst_it[dst_view.width()-1][1] = 128 + (src_it[static_cast(src_view.width())-2][1] - src_it[static_cast(src_view.width())-1][1]) / 2; + dst_it[dst_view.width()-1][2] = 128 + (src_it[static_cast(src_view.width())-2][2] - src_it[static_cast(src_view.width())-1][2]) / 2; - dst_it[0][3] = dst_it[src_view.width()-1][3] = 255; + dst_it[0][3] = dst_it[static_cast(src_view.width())-1][3] = 255; - for (int x=1; x(src_view.width())-1; ++x) { dst_it[x][0] = 128 + (src_it[x-1][0] - src_it[x+1][0]) / 2; dst_it[x][1] = 128 + (src_it[x-1][1] - src_it[x+1][1]) / 2; @@ -742,10 +746,10 @@ void apply_filter(Src & src, invert const& /*op*/) rgba8_view_t src_view = rgba8_view(src); - for (int y=0; y(src_view.height()); ++y) { - rgba8_view_t::x_iterator src_it = src_view.row_begin(y); - for (int x=0; x(y)); + for (std::size_t x=0; x(src_view.width()); ++x) { // we only work with premultiplied source, // thus all color values must be <= alpha diff --git a/include/mapnik/image_filter_grammar.hpp b/include/mapnik/image_filter_grammar.hpp index a7c0bd90c..5f2d719bd 100644 --- a/include/mapnik/image_filter_grammar.hpp +++ b/include/mapnik/image_filter_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,6 +27,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop diff --git a/include/mapnik/image_filter_grammar_impl.hpp b/include/mapnik/image_filter_grammar_impl.hpp index c88089f90..a9f11d823 100644 --- a/include/mapnik/image_filter_grammar_impl.hpp +++ b/include/mapnik/image_filter_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,10 @@ #include // spirit +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" #include +#pragma GCC diagnostic pop namespace mapnik { diff --git a/include/mapnik/image_filter_types.hpp b/include/mapnik/image_filter_types.hpp index e4c9df03b..5d61d1d3f 100644 --- a/include/mapnik/image_filter_types.hpp +++ b/include/mapnik/image_filter_types.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_impl.hpp b/include/mapnik/image_impl.hpp new file mode 100644 index 000000000..5a84f9e85 --- /dev/null +++ b/include/mapnik/image_impl.hpp @@ -0,0 +1,317 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +// mapnik +#include +#include + +// stl +#include +#include +#include + +namespace mapnik { + +namespace detail { + +// IMAGE_DIMENSIONS +template +image_dimensions::image_dimensions(int width, int height) + : width_(width), + height_(height) +{ + if (width < 0 || static_cast(width) > max_size) throw std::runtime_error("Invalid width for image dimensions requested"); + if (height < 0 || static_cast(height) > max_size) throw std::runtime_error("Invalid height for image dimensions requested"); +} + +template +image_dimensions& image_dimensions::operator= (image_dimensions rhs) +{ + std::swap(width_, rhs.width_); + std::swap(height_, rhs.height_); + return *this; +} + +template +std::size_t image_dimensions::width() const +{ + return width_; +} + +template +std::size_t image_dimensions::height() const +{ + return height_; +} + +} // end detail ns + +// IMAGE +template +image::image() + : dimensions_(0,0), + buffer_(0), + pData_(nullptr), + offset_(0.0), + scaling_(1.0), + premultiplied_alpha_(false), + painted_(false) +{} + +template +image::image(int width, int height, bool initialize, bool premultiplied, bool painted) + : dimensions_(width, height), + buffer_(dimensions_.width() * dimensions_.height() * pixel_size), + pData_(reinterpret_cast(buffer_.data())), + offset_(0.0), + scaling_(1.0), + premultiplied_alpha_(premultiplied), + painted_(painted) +{ + if (pData_ && initialize) + { + std::fill(pData_, pData_ + dimensions_.width() * dimensions_.height(), 0); + } +} + +template +image::image(image const& rhs) + : dimensions_(rhs.dimensions_), + buffer_(rhs.buffer_), + pData_(reinterpret_cast(buffer_.data())), + offset_(rhs.offset_), + scaling_(rhs.scaling_), + premultiplied_alpha_(rhs.premultiplied_alpha_), + painted_(rhs.painted_) +{} + +template +image::image(image && rhs) noexcept + : dimensions_(std::move(rhs.dimensions_)), + buffer_(std::move(rhs.buffer_)), + pData_(reinterpret_cast(buffer_.data())), + offset_(rhs.offset_), + scaling_(rhs.scaling_), + premultiplied_alpha_(rhs.premultiplied_alpha_), + painted_(rhs.painted_) +{ + rhs.dimensions_ = { 0, 0 }; + rhs.pData_ = nullptr; +} + +template +image& image::operator=(image rhs) +{ + swap(rhs); + return *this; +} + +template +bool image::operator==(image const& rhs) const +{ + return rhs.bytes() == bytes(); +} + +template +bool image::operator<(image const& rhs) const +{ + return size() < rhs.size(); +} + +template +void image::swap(image & rhs) +{ + std::swap(dimensions_, rhs.dimensions_); + std::swap(buffer_, rhs.buffer_); + std::swap(offset_, rhs.offset_); + std::swap(scaling_, rhs.scaling_); + std::swap(premultiplied_alpha_, rhs.premultiplied_alpha_); + std::swap(painted_, rhs.painted_); +} + +template +inline typename image::pixel_type& image::operator() (std::size_t i, std::size_t j) +{ + assert(i < dimensions_.width() && j < dimensions_.height()); + return pData_[j * dimensions_.width() + i]; +} + +template +inline const typename image::pixel_type& image::operator() (std::size_t i, std::size_t j) const +{ + assert(i < dimensions_.width() && j < dimensions_.height()); + return pData_[j * dimensions_.width() + i]; +} + +template +inline std::size_t image::width() const +{ + return dimensions_.width(); +} + +template +inline std::size_t image::height() const +{ + return dimensions_.height(); +} + +template +inline std::size_t image::size() const +{ + return dimensions_.height() * dimensions_.width() * pixel_size; +} + +template +inline std::size_t image::row_size() const +{ + return dimensions_.width() * pixel_size; +} + +template +inline void image::set(pixel_type const& t) +{ + std::fill(pData_, pData_ + dimensions_.width() * dimensions_.height(), t); +} + +template +inline const typename image::pixel_type* image::data() const +{ + return pData_; +} + +template +inline typename image::pixel_type* image::data() +{ + return pData_; +} + +template +inline const unsigned char* image::bytes() const +{ + return buffer_.data(); +} + +template +inline unsigned char* image::bytes() +{ + return buffer_.data(); +} + +template +inline typename image::pixel_type const* image::get_row(std::size_t row) const +{ + return pData_ + row * dimensions_.width(); +} + +template +inline const typename image::pixel_type* image::get_row(std::size_t row, std::size_t x0) const +{ + return pData_ + row * dimensions_.width() + x0; +} + +template +inline typename image::pixel_type* image::get_row(std::size_t row) +{ + return pData_ + row * dimensions_.width(); +} + +template +inline typename image::pixel_type* image::get_row(std::size_t row, std::size_t x0) +{ + return pData_ + row * dimensions_.width() + x0; +} + +template +inline void image::set_row(std::size_t row, pixel_type const* buf, std::size_t size) +{ + assert(row < dimensions_.height()); + assert(size <= dimensions_.width()); + std::copy(buf, buf + size, pData_ + row * dimensions_.width()); +} + +template +inline void image::set_row(std::size_t row, std::size_t x0, std::size_t x1, pixel_type const* buf) +{ + assert(row < dimensions_.height()); + assert ((x1 - x0) <= dimensions_.width() ); + std::copy(buf, buf + (x1 - x0), pData_ + row * dimensions_.width() + x0); +} + +template +inline double image::get_offset() const +{ + return offset_; +} + +template +inline void image::set_offset(double set) +{ + offset_ = set; +} + +template +inline double image::get_scaling() const +{ + return scaling_; +} + +template +inline void image::set_scaling(double scaling) +{ + if (scaling != 0.0) + { + scaling_ = scaling; + return; + } +} + +template +inline bool image::get_premultiplied() const +{ + return premultiplied_alpha_; +} + +template +inline void image::set_premultiplied(bool set) +{ + premultiplied_alpha_ = set; +} + +template +inline void image::painted(bool painted) +{ + painted_ = painted; +} + +template +inline bool image::painted() const +{ + return painted_; +} + +template +inline image_dtype image::get_dtype() const +{ + return dtype; +} + +} // end ns diff --git a/include/mapnik/image_null.hpp b/include/mapnik/image_null.hpp new file mode 100644 index 000000000..c318c766c --- /dev/null +++ b/include/mapnik/image_null.hpp @@ -0,0 +1,79 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_IMAGE_NULL_HPP +#define MAPNIK_IMAGE_NULL_HPP + +// mapnik +#include +#include + +//stl +#include + +namespace mapnik +{ + +template <> +class MAPNIK_DECL image +{ +public: + using pixel_type = null_t::type; + static const image_dtype dtype = null_t::id; +private: +public: + image() {} + image(int /*width*/, + int /*height*/, + bool /*initialize*/ = true, + bool /*premultiplied*/ = false, + bool /*painted*/ = false) {} + image(image const&) {} + image(image &&) noexcept {} + image& operator=(image) { return *this; } + imageconst& operator=(image const& rhs) const { return rhs; } + bool operator==(image const&) const { return true; } + bool operator<(image const&) const { return false; } + + std::size_t width() const { return 0; } + std::size_t height() const { return 0; } + std::size_t size() const { return 0; } + std::size_t row_size() const { return 0; } + void set(pixel_type const&) { throw std::runtime_error("Can not set values for null image"); } + pixel_type& operator() (std::size_t, std::size_t) { throw std::runtime_error("Can not get or set values for null image"); } + pixel_type const& operator() (std::size_t, std::size_t) const { throw std::runtime_error("Can not get or set values for null image"); } + unsigned const char* bytes() const { return nullptr; } + unsigned char* bytes() {return nullptr; } + double get_offset() const { return 0.0; } + void set_offset(double) {} + double get_scaling() const { return 1.0; } + void set_scaling(double) {} + bool get_premultiplied() const { return false; } + void set_premultiplied(bool) {} + void painted(bool) {} + bool painted() const { return false; } + image_dtype get_dtype() const { return dtype; } +}; + +} // end ns mapnik + +#endif // MAPNIK_IMAGE_NULL_HPP diff --git a/include/mapnik/image_options.hpp b/include/mapnik/image_options.hpp new file mode 100644 index 000000000..fc8f9f1a5 --- /dev/null +++ b/include/mapnik/image_options.hpp @@ -0,0 +1,38 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_IMAGE_OPTIONS_HPP +#define MAPNIK_IMAGE_OPTIONS_HPP + +#include +#include +#include + +namespace mapnik { + +using image_options_map = std::map >; +inline std::string to_string(boost::optional const& val) { return val ? *val : "";} +image_options_map parse_image_options(std::string const& options); + +} + +#endif // MAPNIK_IMAGE_OPTIONS_HPP diff --git a/include/mapnik/image_reader.hpp b/include/mapnik/image_reader.hpp index 31a12f4f0..a15d7c9dd 100644 --- a/include/mapnik/image_reader.hpp +++ b/include/mapnik/image_reader.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,7 @@ #define MAPNIK_IMAGE_READER_HPP // mapnik -#include +#include #include #include #include @@ -59,10 +59,9 @@ struct MAPNIK_DECL image_reader : private util::noncopyable virtual unsigned width() const = 0; virtual unsigned height() const = 0; virtual bool has_alpha() const = 0; - virtual bool premultiplied_alpha() const = 0; virtual boost::optional > bounding_box() const = 0; - virtual void read(unsigned x,unsigned y,image_data_rgba8& image) = 0; - virtual image_data_any read(unsigned x, unsigned y, unsigned width, unsigned height) = 0; + virtual void read(unsigned x,unsigned y,image_rgba8& image) = 0; + virtual image_any read(unsigned x, unsigned y, unsigned width, unsigned height) = 0; virtual ~image_reader() {} }; diff --git a/include/mapnik/image_scaling.hpp b/include/mapnik/image_scaling.hpp index c8c916fa6..ad4954eb1 100644 --- a/include/mapnik/image_scaling.hpp +++ b/include/mapnik/image_scaling.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,7 @@ // mapnik #include -#include +#include // stl #include diff --git a/include/mapnik/image_scaling_traits.hpp b/include/mapnik/image_scaling_traits.hpp index fe2ce61ed..e2d0220ff 100644 --- a/include/mapnik/image_scaling_traits.hpp +++ b/include/mapnik/image_scaling_traits.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -38,7 +38,7 @@ template struct agg_scaling_traits {}; template <> -struct agg_scaling_traits +struct agg_scaling_traits { using pixfmt_pre = agg::pixfmt_rgba32_pre; using color_type = agg::rgba8; @@ -50,7 +50,7 @@ struct agg_scaling_traits }; template <> -struct agg_scaling_traits +struct agg_scaling_traits { using pixfmt_pre = agg::pixfmt_gray8_pre; using color_type = agg::gray8; @@ -61,7 +61,18 @@ struct agg_scaling_traits }; template <> -struct agg_scaling_traits +struct agg_scaling_traits +{ + using pixfmt_pre = agg::pixfmt_gray8_pre; + using color_type = agg::gray8; + using interpolator_type = agg::span_interpolator_linear<>; + using img_src_type = agg::image_accessor_clone; + using span_image_filter = agg::span_image_filter_gray_nn; + using span_image_resample_affine = agg::span_image_resample_gray_affine; +}; + +template <> +struct agg_scaling_traits { using pixfmt_pre = agg::pixfmt_gray16_pre; using color_type = agg::gray16; @@ -72,7 +83,73 @@ struct agg_scaling_traits }; template <> -struct agg_scaling_traits +struct agg_scaling_traits +{ + using pixfmt_pre = agg::pixfmt_gray16_pre; + using color_type = agg::gray16; + using interpolator_type = agg::span_interpolator_linear<>; + using img_src_type = agg::image_accessor_clone; + using span_image_filter = agg::span_image_filter_gray_nn; + using span_image_resample_affine = agg::span_image_resample_gray_affine; +}; + +template <> +struct agg_scaling_traits +{ + using pixfmt_pre = agg::pixfmt_gray32_pre; + using color_type = agg::gray32; + using interpolator_type = agg::span_interpolator_linear<>; + using img_src_type = agg::image_accessor_clone; + using span_image_filter = agg::span_image_filter_gray_nn; + using span_image_resample_affine = agg::span_image_resample_gray_affine; +}; + +template <> +struct agg_scaling_traits +{ + using pixfmt_pre = agg::pixfmt_gray32_pre; + using color_type = agg::gray32; + using interpolator_type = agg::span_interpolator_linear<>; + using img_src_type = agg::image_accessor_clone; + using span_image_filter = agg::span_image_filter_gray_nn; + using span_image_resample_affine = agg::span_image_resample_gray_affine; +}; + +template <> +struct agg_scaling_traits +{ + using pixfmt_pre = agg::pixfmt_gray32_pre; + using color_type = agg::gray32; + using interpolator_type = agg::span_interpolator_linear<>; + using img_src_type = agg::image_accessor_clone; + using span_image_filter = agg::span_image_filter_gray_nn; + using span_image_resample_affine = agg::span_image_resample_gray_affine; +}; + +template <> +struct agg_scaling_traits +{ + using pixfmt_pre = agg::pixfmt_gray32_pre; + using color_type = agg::gray32; + using interpolator_type = agg::span_interpolator_linear<>; + using img_src_type = agg::image_accessor_clone; + using span_image_filter = agg::span_image_filter_gray_nn; + using span_image_resample_affine = agg::span_image_resample_gray_affine; +}; + +template <> +struct agg_scaling_traits +{ + using pixfmt_pre = agg::pixfmt_gray32_pre; + using color_type = agg::gray32; + using interpolator_type = agg::span_interpolator_linear<>; + using img_src_type = agg::image_accessor_clone; + using span_image_filter = agg::span_image_filter_gray_nn; + using span_image_resample_affine = agg::span_image_resample_gray_affine; +}; + +template <> +struct agg_scaling_traits { using pixfmt_pre = agg::pixfmt_gray32_pre; using color_type = agg::gray32; diff --git a/include/mapnik/image_util.hpp b/include/mapnik/image_util.hpp index 95bc64c0d..1207bb80b 100644 --- a/include/mapnik/image_util.hpp +++ b/include/mapnik/image_util.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,36 +25,41 @@ // mapnik #include -#include -#include - +#include +#include // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop // stl #include -#include #include namespace mapnik { // fwd declares -class Map; class rgba_palette; +struct image_any; +template class image; +struct image_view_any; +template class image_view; +class color; -class ImageWriterException : public std::exception +class image_writer_exception : public std::exception { private: std::string message_; public: - ImageWriterException(std::string const& message) + image_writer_exception(std::string const& message) : message_(message) {} - ~ImageWriterException() throw() {} + ~image_writer_exception() throw() {} virtual const char* what() const throw() { @@ -62,18 +67,6 @@ public: } }; -#if defined(HAVE_CAIRO) -MAPNIK_DECL void save_to_cairo_file(mapnik::Map const& map, - std::string const& filename, - double scale_factor=1.0, - double scale_denominator=0.0); -MAPNIK_DECL void save_to_cairo_file(mapnik::Map const& map, - std::string const& filename, - std::string const& type, - double scale_factor=1.0, - double scale_denominator=0.0); -#endif - template MAPNIK_DECL void save_to_file(T const& image, std::string const& filename, @@ -121,17 +114,223 @@ MAPNIK_DECL void save_to_stream std::string const& type ); -template -void save_as_png(T const& image, - std::string const& filename, - rgba_palette const& palette); +// PREMULTIPLY ALPHA +MAPNIK_DECL bool premultiply_alpha(image_any & image); -#if defined(HAVE_JPEG) template -void save_as_jpeg(std::string const& filename, - int quality, - T const& image); -#endif +MAPNIK_DECL bool premultiply_alpha(T & image); + +// DEMULTIPLY ALPHA +MAPNIK_DECL bool demultiply_alpha(image_any & image); + +template +MAPNIK_DECL bool demultiply_alpha(T & image); + +// SET PREMULTIPLIED ALPHA +MAPNIK_DECL void set_premultiplied_alpha(image_any & image, bool status); + +template +MAPNIK_DECL void set_premultiplied_alpha(T & image, bool status); + +// IS SOLID +MAPNIK_DECL bool is_solid (image_any const& image); +MAPNIK_DECL bool is_solid (image_view_any const& image); + +template +MAPNIK_DECL bool is_solid (T const& image); + +// APPLY OPACITY +MAPNIK_DECL void apply_opacity (image_any & image, float opacity); + +template +MAPNIK_DECL void apply_opacity (T & image, float opacity); + +// SET GRAYSCALE TO ALPHA +MAPNIK_DECL void set_grayscale_to_alpha (image_any & image); +MAPNIK_DECL void set_grayscale_to_alpha (image_any & image, color const& c); + +template +MAPNIK_DECL void set_grayscale_to_alpha (T & image); + +template +MAPNIK_DECL void set_grayscale_to_alpha (T & image, color const& c); + +// SET COLOR TO ALPHA +MAPNIK_DECL void set_color_to_alpha (image_any & image, color const& c); + +template +MAPNIK_DECL void set_color_to_alpha (T & image, color const& c); + +// FILL +template +MAPNIK_DECL void fill (image_any & data, T const&); + +template +MAPNIK_DECL void fill (image & data, T const&); + +template +MAPNIK_DECL void fill (image & data, T const&); + +template +MAPNIK_DECL void fill (image & data, T const&); + +template +MAPNIK_DECL void fill (image & data, T const&); + +template +MAPNIK_DECL void fill (image & data, T const&); + +template +MAPNIK_DECL void fill (image & data, T const&); + +template +MAPNIK_DECL void fill (image & data, T const&); + +template +MAPNIK_DECL void fill (image & data, T const&); + +template +MAPNIK_DECL void fill (image & data, T const&); + +template +MAPNIK_DECL void fill (image & data, T const&); + +template +MAPNIK_DECL void fill (image & data, T const&); + +// CHECK BOUNDS +template +inline bool check_bounds (T const& data, std::size_t x, std::size_t y) +{ + return (x < data.width() && y < data.height()); +} + +// COMPOSITE_PIXEL +MAPNIK_DECL void composite_pixel(image_any & data, composite_mode_e comp_op, std::size_t x, std::size_t y, unsigned c, unsigned cover, double opacity ); + +template +MAPNIK_DECL void composite_pixel(T & data, composite_mode_e comp_op, std::size_t x, std::size_t y, unsigned c, unsigned cover, double opacity ); + +// SET PIXEL +template +MAPNIK_DECL void set_pixel(image_any & data, std::size_t x, std::size_t y, T const& val); + +template +MAPNIK_DECL void set_pixel(image & data, std::size_t x, std::size_t y, T const& val); + +template +MAPNIK_DECL void set_pixel(image & data, std::size_t x, std::size_t y, T const& val); + +template +MAPNIK_DECL void set_pixel(image & data, std::size_t x, std::size_t y, T const& val); + +template +MAPNIK_DECL void set_pixel(image & data, std::size_t x, std::size_t y, T const& val); + +template +MAPNIK_DECL void set_pixel(image & data, std::size_t x, std::size_t y, T const& val); + +template +MAPNIK_DECL void set_pixel(image & data, std::size_t x, std::size_t y, T const& val); + +template +MAPNIK_DECL void set_pixel(image & data, std::size_t x, std::size_t y, T const& val); + +template +MAPNIK_DECL void set_pixel(image & data, std::size_t x, std::size_t y, T const& val); + +template +MAPNIK_DECL void set_pixel(image & data, std::size_t x, std::size_t y, T const& val); + +template +MAPNIK_DECL void set_pixel(image & data, std::size_t x, std::size_t y, T const& val); + +template +MAPNIK_DECL void set_pixel(image & data, std::size_t x, std::size_t y, T const& val); + +// GET PIXEL +template +MAPNIK_DECL T get_pixel(image_any const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image_view_any const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image_view > const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image_view > const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image_view > const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image_view > const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image_view > const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image_view > const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image_view > const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image_view > const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image_view > const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image_view > const& data, std::size_t x, std::size_t y); + +template +MAPNIK_DECL T get_pixel(image_view > const& data, std::size_t x, std::size_t y); + +// VIEW TO OUTPUT STREAM +template +MAPNIK_DECL void view_to_stream (image_view_any const& view, Out & os); + +// CREATE VIEW +MAPNIK_DECL image_view_any create_view (image_any const& data, std::size_t x, std::size_t y, std::size_t w, std::size_t h); + +// COMPARE +template +MAPNIK_DECL std::size_t compare(T const& im1, T const& im2, double threshold = 0.0, bool alpha = true); inline bool is_png(std::string const& filename) { @@ -208,83 +407,6 @@ void add_border(T & image) image(image.width()-1,y) = 0xffff0000; // blue } } - - -extern template MAPNIK_DECL void save_to_file(image_data_rgba8 const&, - std::string const&, - std::string const&, - rgba_palette const&); - -extern template MAPNIK_DECL void save_to_file(image_data_rgba8 const&, - std::string const&, - std::string const&); - -extern template MAPNIK_DECL void save_to_file(image_data_rgba8 const&, - std::string const&, - rgba_palette const&); - -extern template MAPNIK_DECL void save_to_file(image_data_rgba8 const&, - std::string const&); - - -extern template MAPNIK_DECL void save_to_file > (image_view const&, - std::string const&, - std::string const&, - rgba_palette const&); - -extern template MAPNIK_DECL void save_to_file > (image_view const&, - std::string const&, - std::string const&); - -extern template MAPNIK_DECL void save_to_file > (image_view const&, - std::string const&, - rgba_palette const&); - -extern template MAPNIK_DECL void save_to_file > (image_view const&, - std::string const&); - -extern template MAPNIK_DECL std::string save_to_string(image_data_rgba8 const&, - std::string const&); - -extern template MAPNIK_DECL std::string save_to_string(image_data_rgba8 const&, - std::string const&, - rgba_palette const&); - -extern template MAPNIK_DECL std::string save_to_string > (image_view const&, - std::string const&); - -extern template MAPNIK_DECL std::string save_to_string > (image_view const&, - std::string const&, - rgba_palette const&); -#ifdef _MSC_VER - -template MAPNIK_DECL void save_to_stream( - image_data_rgba8 const& image, - std::ostream & stream, - std::string const& type, - rgba_palette const& palette -); - -template MAPNIK_DECL void save_to_stream( - image_data_rgba8 const& image, - std::ostream & stream, - std::string const& type -); - -template MAPNIK_DECL void save_to_stream > ( - image_view const& image, - std::ostream & stream, - std::string const& type, - rgba_palette const& palette -); - -template MAPNIK_DECL void save_to_stream > ( - image_view const& image, - std::ostream & stream, - std::string const& type -); -#endif - } #endif // MAPNIK_IMAGE_UTIL_HPP diff --git a/include/mapnik/geometry_container.hpp b/include/mapnik/image_util_jpeg.hpp similarity index 69% rename from include/mapnik/geometry_container.hpp rename to include/mapnik/image_util_jpeg.hpp index 2c5507db2..b4d2648db 100644 --- a/include/mapnik/geometry_container.hpp +++ b/include/mapnik/image_util_jpeg.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,20 +20,25 @@ * *****************************************************************************/ -#ifndef MAPNIK_GEOMETRY_CONTAINER_HPP -#define MAPNIK_GEOMETRY_CONTAINER_HPP +#ifndef MAPNIK_IMAGE_UTIL_JPEG_HPP +#define MAPNIK_IMAGE_UTIL_JPEG_HPP -// boost -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#include -#pragma GCC diagnostic pop +// stl +#include +#include namespace mapnik { -using geometry_container = boost::ptr_vector; +struct jpeg_saver +{ + jpeg_saver(std::ostream &, std::string const&); + template + void operator() (T const&) const; + private: + std::ostream & stream_; + std::string const& t_; +}; -} +} // end ns -#endif // MAPNIK_GEOMETRY_CONTAINER_HPP +#endif // MAPNIK_IMAGE_UTIL_JPEG_HPP diff --git a/include/mapnik/image_util_png.hpp b/include/mapnik/image_util_png.hpp new file mode 100644 index 000000000..e02cb4427 --- /dev/null +++ b/include/mapnik/image_util_png.hpp @@ -0,0 +1,55 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_IMAGE_UTIL_PNG_HPP +#define MAPNIK_IMAGE_UTIL_PNG_HPP + +// stl +#include +#include + +namespace mapnik { + +struct png_saver_pal +{ + png_saver_pal(std::ostream &, std::string const&, rgba_palette const&); + template + void operator() (T const&) const; + private: + std::ostream & stream_; + std::string const& t_; + rgba_palette const& pal_; +}; + +struct png_saver +{ + png_saver(std::ostream &, std::string const&); + template + void operator() (T const&) const; + private: + std::ostream & stream_; + std::string const& t_; +}; + +} // end ns + +#endif // MAPNIK_IMAGE_UTIL_PNG_HPP diff --git a/include/mapnik/image_util_tiff.hpp b/include/mapnik/image_util_tiff.hpp new file mode 100644 index 000000000..39b524d88 --- /dev/null +++ b/include/mapnik/image_util_tiff.hpp @@ -0,0 +1,44 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_IMAGE_UTIL_TIFF_HPP +#define MAPNIK_IMAGE_UTIL_TIFF_HPP + +// stl +#include +#include + +namespace mapnik { + +struct tiff_saver +{ + tiff_saver(std::ostream &, std::string const&); + template + void operator() (T const&) const; + private: + std::ostream & stream_; + std::string const& t_; +}; + +} // end ns + +#endif // MAPNIK_IMAGE_UTIL_TIFF_HPP diff --git a/include/mapnik/image_util_webp.hpp b/include/mapnik/image_util_webp.hpp new file mode 100644 index 000000000..6d28138de --- /dev/null +++ b/include/mapnik/image_util_webp.hpp @@ -0,0 +1,44 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_IMAGE_UTIL_WEBP_HPP +#define MAPNIK_IMAGE_UTIL_WEBP_HPP + +// stl +#include +#include + +namespace mapnik { + +struct webp_saver +{ + webp_saver(std::ostream &, std::string const&); + template + void operator() (T const&) const; + private: + std::ostream & stream_; + std::string const& t_; +}; + +} // end ns + +#endif // MAPNIK_IMAGE_UTIL_WEBP_HPP diff --git a/include/mapnik/image_view.hpp b/include/mapnik/image_view.hpp index 3daed9e31..c2f023a30 100644 --- a/include/mapnik/image_view.hpp +++ b/include/mapnik/image_view.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,100 +23,64 @@ #ifndef MAPNIK_IMAGE_VIEW_HPP #define MAPNIK_IMAGE_VIEW_HPP +#include + namespace mapnik { template class image_view { public: + using pixel = typename T::pixel; using pixel_type = typename T::pixel_type; + static constexpr image_dtype dtype = T::dtype; static constexpr std::size_t pixel_size = sizeof(pixel_type); - - image_view(unsigned x, unsigned y, unsigned width, unsigned height, T const& data) - : x_(x), - y_(y), - width_(width), - height_(height), - data_(data) - { - if (x_ >= data_.width()) x_=data_.width()-1; - if (y_ >= data_.height()) y_=data_.height()-1; - if (x_ + width_ > data_.width()) width_= data_.width() - x_; - if (y_ + height_ > data_.height()) height_= data_.height() - y_; - } - ~image_view() {} + image_view(std::size_t x, std::size_t y, std::size_t width, std::size_t height, T const& data); + ~image_view(); - image_view(image_view const& rhs) - : x_(rhs.x_), - y_(rhs.y_), - width_(rhs.width_), - height_(rhs.height_), - data_(rhs.data_) {} + image_view(image_view const& rhs); + image_view(image_view && other) noexcept; + image_view& operator=(image_view rhs) = delete; + bool operator==(image_view const& rhs) const; + bool operator<(image_view const& rhs) const; - image_view & operator=(image_view const& rhs) - { - if (&rhs==this) return *this; - x_ = rhs.x_; - y_ = rhs.y_; - width_ = rhs.width_; - height_ = rhs.height_; - data_ = rhs.data_; - return *this; - } - - inline unsigned x() const - { - return x_; - } - - inline unsigned y() const - { - return y_; - } - - inline unsigned width() const - { - return width_; - } - - inline unsigned height() const - { - return height_; - } - - inline unsigned getSize() const - { - return height_ * width_ * pixel_size; - } - - inline unsigned getRowSize() const - { - return width_ * pixel_size; - } - - inline const pixel_type* getRow(unsigned row) const - { - return data_.getRow(row + y_) + x_; - } - - inline const pixel_type* getRow(unsigned row, std::size_t x0) const - { - return data_.getRow(row + y_, x0) + x_; - } - - inline T const& data() const - { - return data_; - } + std::size_t x() const; + std::size_t y() const; + std::size_t width() const; + std::size_t height() const; + pixel_type const& operator() (std::size_t i, std::size_t j) const; + std::size_t size() const; + std::size_t row_size() const; + pixel_type const* get_row(std::size_t row) const; + pixel_type const* get_row(std::size_t row, std::size_t x0) const; + T const& data() const; + bool get_premultiplied() const; + double get_offset() const; + double get_scaling() const; + image_dtype get_dtype() const; private: - unsigned x_; - unsigned y_; - unsigned width_; - unsigned height_; + std::size_t x_; + std::size_t y_; + std::size_t width_; + std::size_t height_; T const& data_; }; -} + +using image_view_null = image_view; +using image_view_rgba8 = image_view; +using image_view_gray8 = image_view; +using image_view_gray8s = image_view; +using image_view_gray16 = image_view; +using image_view_gray16s = image_view; +using image_view_gray32 = image_view; +using image_view_gray32s = image_view; +using image_view_gray32f = image_view; +using image_view_gray64 = image_view; +using image_view_gray64s = image_view; +using image_view_gray64f = image_view; + +} // end ns #endif // MAPNIK_IMAGE_VIEW_HPP diff --git a/include/mapnik/image_view_any.hpp b/include/mapnik/image_view_any.hpp new file mode 100644 index 000000000..f61e33db5 --- /dev/null +++ b/include/mapnik/image_view_any.hpp @@ -0,0 +1,65 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_IMAGE_VIEW_ANY_HPP +#define MAPNIK_IMAGE_VIEW_ANY_HPP + +#include +#include +#include + +namespace mapnik { + +using image_view_base = util::variant; + +struct MAPNIK_DECL image_view_any : image_view_base +{ + image_view_any() = default; + + template + image_view_any(T && data) noexcept + : image_view_base(std::move(data)) {} + + std::size_t width() const; + std::size_t height() const; + std::size_t size() const; + std::size_t row_size() const; + bool get_premultiplied() const; + double get_offset() const; + double get_scaling() const; + image_dtype get_dtype() const; +}; + +} // end mapnik ns + +#endif // MAPNIK_IMAGE_VIEW_ANY_HPP diff --git a/include/mapnik/image_view_impl.hpp b/include/mapnik/image_view_impl.hpp new file mode 100644 index 000000000..89ae15182 --- /dev/null +++ b/include/mapnik/image_view_impl.hpp @@ -0,0 +1,160 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +#include +#include + +//std +#include + +namespace mapnik { + +template +image_view::image_view(std::size_t x, std::size_t y, std::size_t width, std::size_t height, T const& data) + : x_(x), + y_(y), + width_(width), + height_(height), + data_(data) +{ + if (x_ >= data_.width() && data_.width() > 0) x_ = data_.width() - 1; + if (y_ >= data_.height() && data.height() > 0) y_ = data_.height() - 1; + if (x_ + width_ > data_.width()) width_ = data_.width() - x_; + if (y_ + height_ > data_.height()) height_ = data_.height() - y_; +} + +template +image_view::~image_view() {} + +template +image_view::image_view(image_view const& rhs) + : x_(rhs.x_), + y_(rhs.y_), + width_(rhs.width_), + height_(rhs.height_), + data_(rhs.data_) {} + +template +image_view::image_view(image_view && other) noexcept + : x_(std::move(other.x_)), + y_(std::move(other.y_)), + width_(std::move(other.width_)), + height_(std::move(other.height_)), + data_(std::move(other.data_)) {} + +template +bool image_view::operator==(image_view const& rhs) const +{ + return rhs.data_.bytes() == data_.bytes(); +} + +template +bool image_view::operator<(image_view const& rhs) const +{ + return data_.size() < rhs.data_.size(); +} + +template +inline std::size_t image_view::x() const +{ + return x_; +} + +template +inline std::size_t image_view::y() const +{ + return y_; +} + +template +inline std::size_t image_view::width() const +{ + return width_; +} + +template +inline std::size_t image_view::height() const +{ + return height_; +} + +template +inline typename image_view::pixel_type const& image_view::operator() (std::size_t i, std::size_t j) const +{ + return data_(i + x_,j + y_); +} + +template +inline std::size_t image_view::size() const +{ + return height_ * width_ * pixel_size; +} + +template +inline std::size_t image_view::row_size() const +{ + return width_ * pixel_size; +} + +template +inline typename image_view::pixel_type const* image_view::get_row(std::size_t row) const +{ + return data_.get_row(row + y_) + x_; +} + +template +inline typename image_view::pixel_type const* image_view::get_row(std::size_t row, std::size_t x0) const +{ + return data_.get_row(row + y_, x0) + x_; +} + +template +inline T const& image_view::data() const +{ + return data_; +} + +template +inline bool image_view::get_premultiplied() const +{ + return data_.get_premultiplied(); +} + +template +inline double image_view::get_offset() const +{ + return data_.get_offset(); +} + +template +inline double image_view::get_scaling() const +{ + return data_.get_scaling(); +} + +template +inline image_dtype image_view::get_dtype() const +{ + return dtype; +} + +} // end ns diff --git a/include/mapnik/image_view_null.hpp b/include/mapnik/image_view_null.hpp new file mode 100644 index 000000000..5672c05dd --- /dev/null +++ b/include/mapnik/image_view_null.hpp @@ -0,0 +1,65 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_IMAGE_VIEW_NULL_HPP +#define MAPNIK_IMAGE_VIEW_NULL_HPP + +#include + +//stl +#include + +namespace mapnik { + +template <> +class MAPNIK_DECL image_view +{ +public: + using pixel_type = image_null::pixel_type; + static const image_dtype dtype = image_null::dtype; + + image_view() {} + ~image_view() {}; + + image_view(image_view const&) {} + image_view & operator=(image_view const&) { return *this; } + bool operator==(image_view const&) const { return true; } + bool operator<(image_view const&) const { return false; } + + std::size_t x() const { return 0; } + std::size_t y() const { return 0; } + std::size_t width() const { return 0; } + std::size_t height() const { return 0; } + pixel_type operator() (std::size_t, std::size_t) const { throw std::runtime_error("Can not get from a null image view"); } + std::size_t size() const { return 0; } + std::size_t row_size() const { return 0; } + const pixel_type* get_row(std::size_t) const { return nullptr; } + const pixel_type* get_row(std::size_t, std::size_t) const { return nullptr; } + bool get_premultiplied() const { return false; } + double get_offset() const { return 0.0; } + double get_scaling() const { return 1.0; } + image_dtype get_dtype() const { return dtype; } +}; + +} // end ns + +#endif // MAPNIK_IMAGE_VIEW_NULL_HPP diff --git a/include/mapnik/internal/dump_xml.hpp b/include/mapnik/internal/dump_xml.hpp deleted file mode 100644 index f8075907f..000000000 --- a/include/mapnik/internal/dump_xml.hpp +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef DUMP_XML_HPP -#define DUMP_XML_HPP -#include - -namespace mapnik -{ - -// Debug dump ptree XML representation. - -void dump_xml(xml_node const& xml, unsigned level=0) -{ - std::string indent; - unsigned i; - for (i=0; i( ::operator new (sizeof(JSAMPLE) * width*3)); while (cinfo.next_scanline < cinfo.image_height) { - const unsigned* imageRow=image.getRow(cinfo.next_scanline); + const unsigned* imageRow=image.get_row(cinfo.next_scanline); int index=0; for (int i=0;i #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" #include +#pragma GCC diagnostic pop namespace mapnik { namespace json { @@ -34,7 +37,7 @@ struct error_handler { using result_type = void; void operator() ( - Iterator, Iterator last, + Iterator, Iterator, Iterator err_pos, boost::spirit::info const& what) const { std::stringstream s; diff --git a/include/mapnik/json/extract_bounding_box_grammar.hpp b/include/mapnik/json/extract_bounding_box_grammar.hpp index e79ed00e1..2183fe501 100644 --- a/include/mapnik/json/extract_bounding_box_grammar.hpp +++ b/include/mapnik/json/extract_bounding_box_grammar.hpp @@ -27,11 +27,14 @@ #include #include #include - +#include // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -42,7 +45,7 @@ namespace mapnik { namespace json { -using position = std::tuple; +using position = mapnik::geometry::point; using boxes = std::vector, std::pair>>; namespace qi = boost::spirit::qi; @@ -55,8 +58,8 @@ struct calculate_bounding_box_impl { if (pos) { - double x = std::get<0>(*pos); - double y = std::get<1>(*pos); + double x = pos->x; + double y = pos->y; if (!bbox.valid()) { bbox.init(x, y, x, y); //TODO: add init(x,y) convinience method diff --git a/include/mapnik/json/extract_bounding_box_grammar_impl.hpp b/include/mapnik/json/extract_bounding_box_grammar_impl.hpp index 49ac87cf8..c6fd321ba 100644 --- a/include/mapnik/json/extract_bounding_box_grammar_impl.hpp +++ b/include/mapnik/json/extract_bounding_box_grammar_impl.hpp @@ -55,13 +55,14 @@ extract_bounding_box_grammar::extract_bounding_box_gramm qi::_b_type _b; qi::eps_type eps; qi::raw_type raw; - boost::spirit::standard_wide::char_type char_; + qi::char_type char_; boost::spirit::repository::qi::iter_pos_type iter_pos; using qi::fail; using qi::on_error; start = features(_r1) ; + features = iter_pos[_a = _1] >> -(lit('{') >> -lit("\"type\"") >> lit(':') >> lit("\"FeatureCollection\"") >> *(lit(',') >> (json.key_value - lit("\"features\""))) @@ -69,45 +70,58 @@ extract_bounding_box_grammar::extract_bounding_box_gramm >> lit(':')) >> lit('[') >> (feature(_r1,_a) % lit(',')) >> lit(']') ; - feature = raw[lit('{')[_a = 1] >> lit("\"type\"") >> lit(':') >> lit("\"Feature\"") - >> *(eps(_a > 0) >> (lit('{')[_a += 1] - | - lit('}')[_a -=1] - | - coords[_b = _1] - | - char_))][push_box(_r1, _r2, _b, _1)] + + feature = raw[lit('{')[_a = 1] + >> *(eps(_a > 0) >> (lit('{')[_a += 1] + | + lit('}')[_a -=1] + | + coords[_b = _1] + | + char_))][push_box(_r1, _r2, _b, _1)] ; - coords = lit("\"coordinates\"") >> lit(':') >> (rings_array(_a) | rings (_a) | ring(_a) | pos[calculate_bounding_box(_a,_1)])[_val = _a] + + coords = lit("\"coordinates\"") + >> lit(':') >> (rings_array(_a) | rings (_a) | ring(_a) | pos[calculate_bounding_box(_a,_1)])[_val = _a] ; + pos = lit('[') > -(double_ > lit(',') > double_) > omit[*(lit(',') > double_)] > lit(']') ; + ring = lit('[') >> pos[calculate_bounding_box(_r1,_1)] % lit(',') > lit(']') ; + rings = lit('[') >> ring(_r1) % lit(',') > lit(']') ; + rings_array = lit('[') >> rings(_r1) % lit(',') > lit(']') ; // generic json types json.value = json.object | json.array | json.string_ | json.number ; + json.pairs = json.key_value % lit(',') ; + json.key_value = (json.string_ >> lit(':') >> json.value) ; + json.object = lit('{') >> *json.pairs >> lit('}') ; + json.array = lit('[') >> json.value >> *(lit(',') >> json.value) >> lit(']') ; + json.number = json.strict_double | json.int__ | lit("true") | lit("false") | lit("null") ; + coords.name("Coordinates"); pos.name("Position"); ring.name("Ring"); diff --git a/include/mapnik/json/feature_collection_grammar.hpp b/include/mapnik/json/feature_collection_grammar.hpp index 33b82ffbe..5c13f8c7c 100644 --- a/include/mapnik/json/feature_collection_grammar.hpp +++ b/include/mapnik/json/feature_collection_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -75,7 +75,7 @@ struct feature_collection_grammar : qi::rule, void(context_ptr const& ctx, std::size_t, FeatureCallback&), space_type> feature; qi::rule, void(context_ptr const& ctx, std::size_t, FeatureCallback&), space_type> feature_from_geometry; // phoenix functions - phoenix::function extract_geometry; + phoenix::function set_geometry; phoenix::function on_feature; }; diff --git a/include/mapnik/json/feature_collection_grammar_impl.hpp b/include/mapnik/json/feature_collection_grammar_impl.hpp index 7ef81c76d..8f7391896 100644 --- a/include/mapnik/json/feature_collection_grammar_impl.hpp +++ b/include/mapnik/json/feature_collection_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -38,14 +38,14 @@ feature_collection_grammar::feature_colle { qi::lit_type lit; qi::eps_type eps; + qi::_1_type _1; + qi::_2_type _2; + qi::_3_type _3; qi::_4_type _4; - qi::_3_type _2; - qi::_2_type _3; qi::_a_type _a; qi::_r1_type _r1; qi::_r2_type _r2; qi::_r3_type _r3; - using phoenix::push_back; using phoenix::construct; using phoenix::new_; using phoenix::val; @@ -72,7 +72,7 @@ feature_collection_grammar::feature_colle feature_from_geometry = eps[_a = phoenix::construct(new_(_r1, _r2))] - >> geometry_g(extract_geometry(*_a)) [on_feature(_r3, _a)] + >> geometry_g[set_geometry(*_a, _1)] [on_feature(_r3, _a)] ; start.name("start"); diff --git a/include/mapnik/json/feature_generator.hpp b/include/mapnik/json/feature_generator.hpp index 0d3fcb847..f24df4ed8 100644 --- a/include/mapnik/json/feature_generator.hpp +++ b/include/mapnik/json/feature_generator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/feature_generator_grammar.hpp b/include/mapnik/json/feature_generator_grammar.hpp index 84a30022e..9eaa3bb99 100644 --- a/include/mapnik/json/feature_generator_grammar.hpp +++ b/include/mapnik/json/feature_generator_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,7 @@ // mapnik #include -#include + #include #include @@ -65,12 +65,12 @@ struct end_container template <> struct transform_attribute, - mapnik::geometry_container const& ,karma::domain> + mapnik::geometry::geometry const& , karma::domain> { - using type = mapnik::geometry_container const&; + using type = mapnik::geometry::geometry const&; static type pre(const boost::fusion::cons& f) { - return boost::fusion::at >(f).paths(); + return boost::fusion::at >(f).get_geometry(); } }; @@ -84,8 +84,8 @@ template struct get_id { using feature_type = T; - using result_type = int; - int operator() (feature_type const& f) const + using result_type = mapnik::value_integer; + result_type operator() (feature_type const& f) const { return f.id(); } @@ -98,7 +98,7 @@ struct feature_generator_grammar : { feature_generator_grammar(); karma::rule feature; - multi_geometry_generator_grammar geometry; + geometry_generator_grammar > geometry; properties_generator_grammar properties; boost::phoenix::function > id_; }; diff --git a/include/mapnik/json/feature_generator_grammar_impl.hpp b/include/mapnik/json/feature_generator_grammar_impl.hpp index 7147bd892..f819baa80 100644 --- a/include/mapnik/json/feature_generator_grammar_impl.hpp +++ b/include/mapnik/json/feature_generator_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/feature_grammar.hpp b/include/mapnik/json/feature_grammar.hpp index 6728f0e7d..59261d707 100644 --- a/include/mapnik/json/feature_grammar.hpp +++ b/include/mapnik/json/feature_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,15 +27,17 @@ #include #include #include -#include #include #include #include #include -// spirit::qi + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #include #include +#pragma GCC diagnostic pop namespace mapnik { namespace json { @@ -77,13 +79,13 @@ struct put_property mapnik::transcoder const& tr_; }; -struct extract_geometry +struct set_geometry_impl { - using result_type = mapnik::geometry_container&; - template - result_type operator() (T & feature) const + using result_type = void; + template + result_type operator() (T0 & feature, T1 && geom) const { - return feature.paths(); + return feature.set_geometry(std::move(geom)); } }; @@ -108,7 +110,7 @@ struct feature_grammar : qi::rule, std::string(), space_type> stringify_array; // functions phoenix::function put_property_; - phoenix::function extract_geometry_; + phoenix::function set_geometry; // error handler boost::phoenix::function const error_handler; // geometry diff --git a/include/mapnik/json/feature_grammar_impl.hpp b/include/mapnik/json/feature_grammar_impl.hpp index c5cc89798..409925a38 100644 --- a/include/mapnik/json/feature_grammar_impl.hpp +++ b/include/mapnik/json/feature_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -82,8 +82,8 @@ feature_grammar::feature_grammar(mapnik::tran feature = lit('{') >> (feature_type | (lit("\"geometry\"") >> lit(':') - >> geometry_grammar_(extract_geometry_(_r1))) | properties(_r1) | json_.key_value) % lit(',') - >> lit('}') + >> geometry_grammar_[set_geometry(_r1, _1)]) | properties(_r1) | json_.key_value) % lit(',') + >> lit('}') ; properties = lit("\"properties\"") diff --git a/include/mapnik/json/feature_parser.hpp b/include/mapnik/json/feature_parser.hpp index e4cf569ed..433d19e30 100644 --- a/include/mapnik/json/feature_parser.hpp +++ b/include/mapnik/json/feature_parser.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -39,7 +39,7 @@ inline bool from_geojson(std::string const& json, mapnik::feature_impl & feature using iterator_type = char const*; static const mapnik::json::feature_grammar g(tr); using namespace boost::spirit; - ascii::space_type space; + standard::space_type space; iterator_type start = json.c_str(); iterator_type end = start + json.length(); return qi::phrase_parse(start, end, (g)(boost::phoenix::ref(feature)), space); diff --git a/include/mapnik/json/generic_json.hpp b/include/mapnik/json/generic_json.hpp index e86e9aa40..adc199041 100644 --- a/include/mapnik/json/generic_json.hpp +++ b/include/mapnik/json/generic_json.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop @@ -37,9 +40,9 @@ namespace mapnik { namespace json { namespace qi = boost::spirit::qi; -namespace ascii = boost::spirit::ascii; +namespace standard = boost::spirit::standard; namespace phoenix = boost::phoenix; -using space_type = ascii::space_type; +using space_type = standard::space_type; using json_value = mapnik::util::variant; using uchar = std::uint32_t; // a unicode code point @@ -57,8 +60,7 @@ struct unicode_string : qi::grammar struct push_utf8 { - template - struct result { typedef void type; }; + using result_type = void; void operator()(std::string& utf8, uchar code_point) const { @@ -71,8 +73,7 @@ struct push_utf8 struct push_esc { - template - struct result { typedef void type; }; + using result_type = void; void operator()(std::string& utf8, uchar c) const { @@ -154,8 +155,8 @@ struct generic_json qi::rule pairs; qi::real_parser > strict_double; // conversions - boost::phoenix::function > integer_converter; - boost::phoenix::function > double_converter; + boost::phoenix::function > integer_converter; + boost::phoenix::function > double_converter; }; }} diff --git a/include/mapnik/json/geometry_generator_grammar.hpp b/include/mapnik/json/geometry_generator_grammar.hpp index 77b522e8f..01b631804 100644 --- a/include/mapnik/json/geometry_generator_grammar.hpp +++ b/include/mapnik/json/geometry_generator_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,23 +26,21 @@ // mapnik #include #include -#include -#include -#include // for CommandType::SEG_MOVETO - +#include +#include // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include -#include #include // for vc++ and android whose c++11 libs lack std::trunc +#include #pragma GCC diagnostic pop -//stl -#include - namespace mapnik { namespace json { namespace karma = boost::spirit::karma; @@ -52,59 +50,12 @@ namespace detail { template struct get_type { - using result_type = int; - result_type operator() (Geometry const& geom) const + using result_type = mapnik::geometry::geometry_types; + template + result_type operator() (T const& geom) const { - return static_cast(geom.type()); - } -}; - -template -struct get_first -{ - using result_type = typename Geometry::value_type const; - result_type operator() (Geometry const& geom) const - { - typename Geometry::value_type coord; - geom.rewind(0); - std::get<0>(coord) = geom.vertex(&std::get<1>(coord),&std::get<2>(coord)); - return coord; - } -}; - -template -struct multi_geometry_type -{ - using result_type = std::tuple ; - result_type operator() (GeometryContainer const& cont) const - { - unsigned type = 0u; - bool collection = false; - for (auto const& geom : cont) - { - if (type != 0u && geom.type() != type) - { - collection = true; - break; - } - type = geom.type(); - } - if (cont.size() > 1) type +=3; - return std::tuple(type, collection); - } -}; - -template -struct not_empty -{ - using result_type = bool; - result_type operator() (GeometryContainer const& cont) const - { - for (auto const& geom : cont) - { - if (geom.size() > 0) return true; - } - return false; + auto type = mapnik::geometry::geometry_type(geom); + return type; } }; @@ -141,47 +92,30 @@ struct json_coordinate_policy : karma::real_policies template struct geometry_generator_grammar : - karma::grammar + karma::grammar { - using geometry_type = Geometry; - using coord_type = typename std::remove_pointer::type; geometry_generator_grammar(); - karma::rule coordinates; - karma::rule point; - karma::rule linestring; - karma::rule polygon; - karma::rule coords; - karma::rule, geometry_type const& ()> coords2; - karma::rule point_coord; - karma::rule polygon_coord; - boost::phoenix::function > _type; - boost::phoenix::function > _first; + karma::rule geometry; + karma::rule, Geometry const&() > geometry_dispatch; + karma::rule const&()> point; + karma::rule const&()> point_coord; + karma::rule const&()> linestring; + karma::rule const&()> linestring_coord; + karma::rule const&()> polygon; + karma::rule const&()> polygon_coord; + karma::rule const&()> exterior_ring_coord; + karma::rule > const&()> interior_ring_coord; + karma::rule const& ()> multi_point; + karma::rule const& ()> multi_point_coord; + karma::rule const& ()> multi_linestring; + karma::rule const& ()> multi_linestring_coord; + karma::rule const& ()> multi_polygon; + karma::rule const& ()> multi_polygon_coord; + karma::rule const& ()> geometry_collection; + karma::rule const& ()> geometries; + boost::phoenix::function > geometry_type; karma::real_generator > coordinate; -}; - -template -struct multi_geometry_generator_grammar : - karma::grammar >, - GeometryContainer const& ()> -{ - using geometry_type = typename std::remove_pointer::type; - multi_geometry_generator_grammar(); - karma::rule >, - GeometryContainer const&()> start; - karma::rule >, - GeometryContainer const&()> geometry_collection; - karma::rule >, - GeometryContainer const&()> geometry; - karma::rule, - geometry_type const&()> geometry2; - karma::rule coordinates; - geometry_generator_grammar path; - // phoenix functions - boost::phoenix::function > multi_type_; - boost::phoenix::function > type_; - boost::phoenix::function > not_empty_; - karma::symbols geometry_types; }; }} diff --git a/include/mapnik/json/geometry_generator_grammar_impl.hpp b/include/mapnik/json/geometry_generator_grammar_impl.hpp index e1b16bc83..c6968cfc0 100644 --- a/include/mapnik/json/geometry_generator_grammar_impl.hpp +++ b/include/mapnik/json/geometry_generator_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,6 +22,7 @@ // mapnik #include +#include // boost #include @@ -33,110 +34,78 @@ namespace mapnik { namespace json { namespace karma = boost::spirit::karma; +namespace phoenix = boost::phoenix; template geometry_generator_grammar::geometry_generator_grammar() - : geometry_generator_grammar::base_type(coordinates) + : geometry_generator_grammar::base_type(geometry) { - boost::spirit::karma::uint_type uint_; - boost::spirit::bool_type bool_; boost::spirit::karma::_val_type _val; boost::spirit::karma::_1_type _1; - boost::spirit::karma::lit_type lit; boost::spirit::karma::_a_type _a; - boost::spirit::karma::_r1_type _r1; - boost::spirit::karma::eps_type eps; - boost::spirit::karma::string_type kstring; - - coordinates = point | linestring | polygon - ; - - point = &uint_(mapnik::geometry_type::types::Point)[_1 = _type(_val)] - << point_coord [_1 = _first(_val)] - ; - - linestring = &uint_(mapnik::geometry_type::types::LineString)[_1 = _type(_val)] - << lit('[') - << coords - << lit(']') - ; - - polygon = &uint_(mapnik::geometry_type::types::Polygon)[_1 = _type(_val)] - << lit('[') - << coords2 - << lit("]]") - ; - - point_coord = &uint_ - << lit('[') - << coordinate << lit(',') << coordinate - << lit(']') - ; - - polygon_coord %= ( &uint_(mapnik::SEG_MOVETO) << eps[_r1 += 1] - << kstring[ if_ (_r1 > 1u) [_1 = "],["] - .else_[_1 = '[' ]] - | - &uint_(mapnik::SEG_LINETO) - << lit(',')) << lit('[') << coordinate << lit(',') << coordinate << lit(']') - ; - - coords2 %= *polygon_coord(_a) - ; - - coords = point_coord % lit(',') - ; -} - -template -multi_geometry_generator_grammar::multi_geometry_generator_grammar() - : multi_geometry_generator_grammar::base_type(start) -{ + boost::spirit::karma::lit_type lit; boost::spirit::karma::uint_type uint_; - boost::spirit::bool_type bool_; - boost::spirit::karma::_val_type _val; - boost::spirit::karma::_1_type _1; - boost::spirit::karma::lit_type lit; - boost::spirit::karma::_a_type _a; boost::spirit::karma::eps_type eps; - boost::spirit::karma::string_type kstring; - geometry_types.add - (mapnik::geometry_type::types::Point,"\"Point\"") - (mapnik::geometry_type::types::LineString,"\"LineString\"") - (mapnik::geometry_type::types::Polygon,"\"Polygon\"") - (mapnik::geometry_type::types::Point + 3,"\"MultiPoint\"") - (mapnik::geometry_type::types::LineString + 3,"\"MultiLineString\"") - (mapnik::geometry_type::types::Polygon + 3,"\"MultiPolygon\"") + geometry = geometry_dispatch.alias() ; - start %= ( eps(boost::phoenix::at_c<1>(_a))[_a = multi_type_(_val)] - << lit("{\"type\":\"GeometryCollection\",\"geometries\":[") - << geometry_collection << lit("]}") - | - geometry) + geometry_dispatch = eps[_a = geometry_type(_val)] << + (&uint_(geometry::geometry_types::Point)[_1 = _a] + << (point | lit("null"))) + | + (&uint_(geometry::geometry_types::LineString)[_1 = _a] + << (linestring | lit("null"))) + | + (&uint_(geometry::geometry_types::Polygon)[_1 = _a] + << (polygon | lit("null"))) + | + (&uint_(geometry::geometry_types::MultiPoint)[_1 = _a] + << (multi_point | lit("null"))) + | + (&uint_(geometry::geometry_types::MultiLineString)[_1 = _a] + << (multi_linestring | lit("null"))) + | + (&uint_(geometry::geometry_types::MultiPolygon)[_1 = _a] + << (multi_polygon | lit("null"))) + | + (&uint_(geometry::geometry_types::GeometryCollection)[_1 = _a] + << (geometry_collection | lit("null"))) + | + lit("null") ; - geometry_collection = -(geometry2 % lit(',')) + point = lit("{\"type\":\"Point\",\"coordinates\":") << point_coord << lit("}") ; - - geometry = ( &bool_(true)[_1 = not_empty_(_val)] << lit("{\"type\":") - << geometry_types[_1 = boost::phoenix::at_c<0>(_a)][_a = multi_type_(_val)] - << lit(",\"coordinates\":") - << kstring[ boost::phoenix::if_ (boost::phoenix::at_c<0>(_a) > 3u) [_1 = '['].else_[_1 = ""]] - << coordinates - << kstring[ boost::phoenix::if_ (boost::phoenix::at_c<0>(_a) > 3u) [_1 = ']'].else_[_1 = ""]] - << lit('}')) | lit("null") + linestring = lit("{\"type\":\"LineString\",\"coordinates\":[") << linestring_coord << lit("]}") ; - - geometry2 = lit("{\"type\":") - << geometry_types[_1 = _a][_a = type_(_val)] - << lit(",\"coordinates\":") - << path - << lit('}') + polygon = lit("{\"type\":\"Polygon\",\"coordinates\":[") << polygon_coord << lit("]}") ; - - coordinates %= path % lit(',') + multi_point = lit("{\"type\":\"MultiPoint\",\"coordinates\":[") << multi_point_coord << lit("]}") + ; + multi_linestring = lit("{\"type\":\"MultiLineString\",\"coordinates\":[") << multi_linestring_coord << lit("]}") + ; + multi_polygon = lit("{\"type\":\"MultiPolygon\",\"coordinates\":[") << multi_polygon_coord << lit("]}") + ; + geometry_collection = lit("{\"type\":\"GeometryCollection\",\"geometries\":[") << geometries << lit("]}") + ; + point_coord = lit('[') << coordinate << lit(',') << coordinate << lit(']') + ; + linestring_coord = point_coord % lit(',') + ; + polygon_coord = lit('[') << exterior_ring_coord << lit(']') << interior_ring_coord + ; + exterior_ring_coord = linestring_coord.alias() + ; + interior_ring_coord = *(lit(",[") << exterior_ring_coord << lit(']')) + ; + multi_point_coord = linestring_coord.alias() + ; + multi_linestring_coord = (lit('[') << linestring_coord << lit(']')) % lit(',') + ; + multi_polygon_coord = (lit('[') << polygon_coord << lit(']')) % lit(',') + ; + geometries = geometry % lit(',') ; } diff --git a/include/mapnik/json/geometry_grammar.hpp b/include/mapnik/json/geometry_grammar.hpp index f93e8a0ea..4bc25c967 100644 --- a/include/mapnik/json/geometry_grammar.hpp +++ b/include/mapnik/json/geometry_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,12 +25,10 @@ // mapnik #include // for geometry_type -#include // for CommandType #include #include #include #include -#include // spirit::qi #include @@ -42,14 +40,13 @@ namespace qi = boost::spirit::qi; template > struct geometry_grammar : - qi::grammar + qi::grammar() ,space_type> { geometry_grammar(); - qi::rule start; - qi::rule, void(mapnik::geometry_container& ), space_type> geometry; + qi::rule(), space_type> start; + qi::rule, mapnik::geometry::geometry(), space_type> geometry; qi::symbols geometry_type_dispatch; - qi::rule geometry_collection; + qi::rule(), space_type> geometry_collection; positions_grammar coordinates; boost::phoenix::function create_geometry; // error handler diff --git a/include/mapnik/json/geometry_grammar_impl.hpp b/include/mapnik/json/geometry_grammar_impl.hpp index afc22f874..9fa7df98e 100644 --- a/include/mapnik/json/geometry_grammar_impl.hpp +++ b/include/mapnik/json/geometry_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -42,23 +42,23 @@ geometry_grammar::geometry_grammar() qi::lit_type lit; qi::int_type int_; qi::double_type double_; + qi::_val_type _val; qi::_1_type _1; qi::_2_type _2; qi::_3_type _3; qi::_4_type _4; qi::_a_type _a; qi::_b_type _b; - qi::_r1_type _r1; qi::eps_type eps; using qi::fail; using qi::on_error; - - start = geometry(_r1) | geometry_collection(_r1); + using phoenix::push_back; + start = geometry | geometry_collection; geometry = (lit('{')[_a = 0 ] >> (-lit(',') >> lit("\"type\"") >> lit(':') >> geometry_type_dispatch[_a = _1] ^ - (-lit(',') >> lit("\"coordinates\"") >> lit(':') >> coordinates[_b = _1]))[create_geometry(_r1,_a,_b)] + (-lit(',') >> lit("\"coordinates\"") >> lit(':') >> coordinates[_b = _1]))[create_geometry(_val,_a,_b)] >> lit('}')) | lit("null") ; @@ -67,7 +67,7 @@ geometry_grammar::geometry_grammar() >> (-lit(',') >> lit("\"type\"") >> lit(':') >> lit("\"GeometryCollection\"") ^ -lit(',') >> lit("\"geometries\"") >> lit(':') - >> lit('[') >> geometry(_r1) % lit(',') >> lit(']')) + >> lit('[') >> geometry[push_back(_val, _1)] % lit(',') >> lit(']')) >> lit('}')) | lit("null") ; diff --git a/include/mapnik/json/geometry_parser.hpp b/include/mapnik/json/geometry_parser.hpp index 6ad8acce1..c83901d32 100644 --- a/include/mapnik/json/geometry_parser.hpp +++ b/include/mapnik/json/geometry_parser.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,8 +24,8 @@ #define MAPNIK_JSON_GEOMETRY_PARSER_HPP // mapnik -#include -#include + + #include // boost @@ -34,14 +34,14 @@ namespace mapnik { namespace json { -inline bool from_geojson(std::string const& json, geometry_container & paths) +inline bool from_geojson(std::string const& json, mapnik::geometry::geometry & geom) { using namespace boost::spirit; static const geometry_grammar g; - ascii::space_type space; + standard::space_type space; char const* start = json.c_str(); char const* end = start + json.length(); - return qi::phrase_parse(start, end, (g)(boost::phoenix::ref(paths)), space); + return qi::phrase_parse(start, end, g, space, geom); } }} diff --git a/include/mapnik/json/geometry_util.hpp b/include/mapnik/json/geometry_util.hpp index be42d7ede..6e8fb6794 100644 --- a/include/mapnik/json/geometry_util.hpp +++ b/include/mapnik/json/geometry_util.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,208 +23,218 @@ #ifndef MAPNIK_JSON_GEOMETRY_UTIL_HPP #define MAPNIK_JSON_GEOMETRY_UTIL_HPP -#include // for geometry_type -#include // for CommandType -#include +#include +#include namespace mapnik { namespace json { // geometries -template +template struct create_point { - explicit create_point(Path & path) - : path_(path) {} + explicit create_point(Geometry & geom) + : geom_(geom) {} - void operator()(position const& pos) const + void operator() (position const& pos) const { - auto pt = std::make_unique(geometry_type::types::Point); - pt->move_to(std::get<0>(pos), std::get<1>(pos)); - path_.push_back(pt.release()); + mapnik::geometry::point point(pos.x, pos.y); + geom_ = std::move(point); } template void operator()(T const&) const {} // no-op - shouldn't get here - Path & path_; + Geometry & geom_; }; -template +template struct create_linestring { - explicit create_linestring(Path & path) - : path_(path) {} + explicit create_linestring(Geometry & geom) + : geom_(geom) {} - void operator()(positions const& ring) const + void operator() (positions const& ring) const { std::size_t size = ring.size(); if (size > 1) { - auto line = std::make_unique(geometry_type::types::LineString); - line->move_to(std::get<0>(ring.front()), std::get<1>(ring.front())); - - for (std::size_t index = 1; index < size; ++index) + mapnik::geometry::line_string line; + line.reserve(size); + for (auto && pt : ring) { - line->line_to(std::get<0>(ring[index]), std::get<1>(ring[index])); + line.emplace_back(std::move(pt)); } - path_.push_back(line.release()); + geom_ = std::move(line); } } template void operator()(T const&) const {} // no-op - shouldn't get here - Path & path_; + Geometry & geom_; }; -template +template struct create_polygon { - explicit create_polygon(Path & path) - : path_(path) {} + explicit create_polygon(Geometry & geom) + : geom_(geom) {} - void operator()(std::vector const& rings) const + void operator() (std::vector const& rings) const { - auto poly = std::make_unique(geometry_type::types::Polygon); - - for (auto const& ring : rings) + mapnik::geometry::polygon poly; + std::size_t num_rings = rings.size(); + if (num_rings > 1) { - std::size_t size = ring.size(); - if (size > 2) // at least 3 vertices to form a ring - { - poly->move_to(std::get<0>(ring.front()), std::get<1>(ring.front())); - for (std::size_t index = 1; index < size; ++index) - { - poly->line_to(std::get<0>(ring[index]), std::get<1>(ring[index])); - } - poly->close_path(); - } + poly.interior_rings.reserve(num_rings - 1); } - path_.push_back(poly.release()); + + for ( std::size_t i = 0; i < num_rings; ++i) + { + std::size_t size = rings[i].size(); + mapnik::geometry::linear_ring ring; + ring.reserve(size); + for ( auto && pt : rings[i]) + { + ring.emplace_back(std::move(pt)); + } + if (i == 0) poly.set_exterior_ring(std::move(ring)); + else poly.add_hole(std::move(ring)); + } + geom_ = std::move(poly); + mapnik::geometry::correct(geom_); } template void operator()(T const&) const {} // no-op - shouldn't get here - Path & path_; + Geometry & geom_; }; // multi-geometries - -template +template struct create_multipoint { - explicit create_multipoint(Path & path) - : path_(path) {} + explicit create_multipoint(Geometry & geom) + : geom_(geom) {} - void operator()(positions const& points) const + void operator() (positions const& points) const { - for (auto const& pos : points) + mapnik::geometry::multi_point multi_point; + multi_point.reserve(points.size()); + for (auto && pos : points) { - auto point = std::make_unique(geometry_type::types::Point); - point->move_to(std::get<0>(pos), std::get<1>(pos)); - path_.push_back(point.release()); + multi_point.emplace_back(std::move(pos)); } + geom_ = std::move(multi_point); } template void operator()(T const&) const {} // no-op - shouldn't get here - Path & path_; + Geometry & geom_; }; -template +template struct create_multilinestring { - explicit create_multilinestring(Path & path) - : path_(path) {} + explicit create_multilinestring(Geometry & geom) + : geom_(geom) {} - void operator()(std::vector const& rings) const + void operator() (std::vector const& rings) const { + mapnik::geometry::multi_line_string multi_line; + multi_line.reserve(rings.size()); + for (auto const& ring : rings) { - auto line = std::make_unique(geometry_type::types::LineString); - std::size_t size = ring.size(); - if (size > 1) // at least 2 vertices to form a linestring + mapnik::geometry::line_string line; + line.reserve(ring.size()); + for (auto && pt : ring) { - line->move_to(std::get<0>(ring.front()), std::get<1>(ring.front())); - for (std::size_t index = 1; index < size; ++index) - { - line->line_to(std::get<0>(ring[index]), std::get<1>(ring[index])); - } + line.emplace_back(std::move(pt)); } - path_.push_back(line.release()); + multi_line.emplace_back(std::move(line)); } + geom_ = std::move(multi_line); } template void operator()(T const&) const {} // no-op - shouldn't get here - Path & path_; + Geometry & geom_; }; -template +template struct create_multipolygon { - explicit create_multipolygon(Path & path) - : path_(path) {} + explicit create_multipolygon(Geometry & geom) + : geom_(geom) {} void operator()(std::vector > const& rings_array) const { + mapnik::geometry::multi_polygon multi_poly; + multi_poly.reserve(rings_array.size()); for (auto const& rings : rings_array) { - auto poly = std::make_unique(geometry_type::types::Polygon); - for (auto const& ring : rings) + mapnik::geometry::polygon poly; + std::size_t num_rings = rings.size(); + if ( num_rings > 1) + poly.interior_rings.reserve(num_rings - 1); + + for ( std::size_t i = 0; i < num_rings; ++i) { - std::size_t size = ring.size(); - if (size > 2) // at least 3 vertices to form a ring + std::size_t size = rings[i].size(); + mapnik::geometry::linear_ring ring; + ring.reserve(size); + for ( auto && pt : rings[i]) { - poly->move_to(std::get<0>(ring.front()), std::get<1>(ring.front())); - for (std::size_t index = 1; index < size; ++index) - { - poly->line_to(std::get<0>(ring[index]), std::get<1>(ring[index])); - } - poly->close_path(); + ring.emplace_back(std::move(pt)); } + if (i == 0) poly.set_exterior_ring(std::move(ring)); + else poly.add_hole(std::move(ring)); } - path_.push_back(poly.release()); + multi_poly.emplace_back(std::move(poly)); } + geom_ = std::move(multi_poly); + mapnik::geometry::correct(geom_); } template void operator()(T const&) const {} // no-op - shouldn't get here - Path & path_; + Geometry & geom_; }; struct create_geometry_impl { using result_type = void; - template - void operator() (T0 & path, int type, mapnik::json::coordinates const& coords) const + template + void operator() (Geometry & geom, int type, mapnik::json::coordinates const& coords) const { switch (type) { case 1 ://Point - util::apply_visitor(create_point(path), coords); + util::apply_visitor(create_point(geom), coords); break; case 2 ://LineString - util::apply_visitor(create_linestring(path), coords); - break; + util::apply_visitor(create_linestring(geom), coords); + break; case 3 ://Polygon - util::apply_visitor(create_polygon(path), coords); + util::apply_visitor(create_polygon(geom), coords); break; case 4 ://MultiPoint - util::apply_visitor(create_multipoint(path), coords); + util::apply_visitor(create_multipoint(geom), coords); break; case 5 ://MultiLineString - util::apply_visitor(create_multilinestring(path), coords); + util::apply_visitor(create_multilinestring(geom), coords); break; case 6 ://MultiPolygon - util::apply_visitor(create_multipolygon(path), coords); + util::apply_visitor(create_multipolygon(geom), coords); break; default: break; } + } }; diff --git a/include/mapnik/json/positions_grammar.hpp b/include/mapnik/json/positions_grammar.hpp index a6ec17303..b7d65d027 100644 --- a/include/mapnik/json/positions_grammar.hpp +++ b/include/mapnik/json/positions_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,11 +27,15 @@ #include #include #include - +#include +#include // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -41,8 +45,10 @@ #include namespace mapnik { namespace json { + struct empty {}; -using position = std::tuple; + +using position = mapnik::geometry::point; using positions = std::vector; using coordinates = util::variant, std::vector > > ; diff --git a/include/mapnik/json/positions_grammar_impl.hpp b/include/mapnik/json/positions_grammar_impl.hpp index d90843c0d..7737e46b5 100644 --- a/include/mapnik/json/positions_grammar_impl.hpp +++ b/include/mapnik/json/positions_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/properties_generator_grammar.hpp b/include/mapnik/json/properties_generator_grammar.hpp index e52b55ed4..781d807ea 100644 --- a/include/mapnik/json/properties_generator_grammar.hpp +++ b/include/mapnik/json/properties_generator_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,6 +28,12 @@ #include // boost +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -37,6 +43,7 @@ #include #include #include +#pragma GCC diagnostic pop namespace mapnik { namespace json { diff --git a/include/mapnik/json/properties_generator_grammar_impl.hpp b/include/mapnik/json/properties_generator_grammar_impl.hpp index 197f00026..eff4565b5 100644 --- a/include/mapnik/json/properties_generator_grammar_impl.hpp +++ b/include/mapnik/json/properties_generator_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/symbolizer_grammar.hpp b/include/mapnik/json/symbolizer_grammar.hpp index bd34af0bd..494b81f96 100644 --- a/include/mapnik/json/symbolizer_grammar.hpp +++ b/include/mapnik/json/symbolizer_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/topojson_grammar.hpp b/include/mapnik/json/topojson_grammar.hpp index 881dcb594..1cc967e01 100644 --- a/include/mapnik/json/topojson_grammar.hpp +++ b/include/mapnik/json/topojson_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,6 +33,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop @@ -44,7 +47,7 @@ namespace mapnik { namespace topojson { namespace qi = boost::spirit::qi; namespace fusion = boost::fusion; -using space_type = boost::spirit::ascii::space_type; +using space_type = mapnik::json::space_type; template > struct topojson_grammar : qi::grammar diff --git a/include/mapnik/json/topojson_grammar_impl.hpp b/include/mapnik/json/topojson_grammar_impl.hpp index 3d125a630..f20fbf935 100644 --- a/include/mapnik/json/topojson_grammar_impl.hpp +++ b/include/mapnik/json/topojson_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -113,13 +113,15 @@ topojson_grammar::topojson_grammar() ; geometry_collection = lit('{') - >> lit("\"type\"") >> lit(':') >> lit("\"GeometryCollection\"") >> lit(',') - >> lit("\"geometries\"") >> lit(':') >> lit('[') >> -(geometry[push_back(_r1, _1)] % lit(',')) + >> lit("\"type\"") >> lit(':') >> lit("\"GeometryCollection\"") + >> -(lit(',') >> omit[bbox]) + >> lit(',') >> lit("\"geometries\"") >> lit(':') >> lit('[') >> -(geometry[push_back(_r1, _1)] % lit(',')) >> lit(']') >> lit('}') ; point = lit('{') >> lit("\"type\"") >> lit(':') >> lit("\"Point\"") + >> -(lit(',') >> omit[bbox]) >> ((lit(',') >> lit("\"coordinates\"") >> lit(':') >> coordinate) ^ (lit(',') >> properties) /*^ (lit(',') >> omit[id])*/) >> lit('}') @@ -127,6 +129,7 @@ topojson_grammar::topojson_grammar() multi_point = lit('{') >> lit("\"type\"") >> lit(':') >> lit("\"MultiPoint\"") + >> -(lit(',') >> omit[bbox]) >> ((lit(',') >> lit("\"coordinates\"") >> lit(':') >> lit('[') >> -(coordinate % lit(',')) >> lit(']')) ^ (lit(',') >> properties) ^ (lit(',') >> omit[id])) @@ -142,6 +145,7 @@ topojson_grammar::topojson_grammar() multi_linestring = lit('{') >> lit("\"type\"") >> lit(':') >> lit("\"MultiLineString\"") + >> -(lit(',') >> omit[bbox]) >> ((lit(',') >> lit("\"arcs\"") >> lit(':') >> lit('[') >> -((lit('[') >> int_ >> lit(']')) % lit(',')) >> lit(']')) ^ (lit(',') >> properties) ^ (lit(',') >> omit[id])) @@ -150,6 +154,7 @@ topojson_grammar::topojson_grammar() polygon = lit('{') >> lit("\"type\"") >> lit(':') >> lit("\"Polygon\"") + >> -(lit(',') >> omit[bbox]) >> ((lit(',') >> lit("\"arcs\"") >> lit(':') >> lit('[') >> -(ring % lit(',')) >> lit(']')) ^ (lit(',') >> properties) ^ (lit(',') >> omit[id])) @@ -158,6 +163,7 @@ topojson_grammar::topojson_grammar() multi_polygon = lit('{') >> lit("\"type\"") >> lit(':') >> lit("\"MultiPolygon\"") + >> -(lit(',') >> omit[bbox]) >> ((lit(',') >> lit("\"arcs\"") >> lit(':') >> lit('[') >> -((lit('[') >> -(ring % lit(',')) >> lit(']')) % lit(',')) diff --git a/include/mapnik/json/topojson_utils.hpp b/include/mapnik/json/topojson_utils.hpp index 5f7e739d5..5558bde97 100644 --- a/include/mapnik/json/topojson_utils.hpp +++ b/include/mapnik/json/topojson_utils.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,14 +26,14 @@ // mapnik #include #include -#include namespace mapnik { namespace topojson { struct bounding_box_visitor { bounding_box_visitor(topology const& topo) - : topo_(topo) {} + : topo_(topo), + num_arcs_(topo_.arcs.size()) {} box2d operator() (mapnik::topojson::point const& pt) const { @@ -50,24 +50,27 @@ struct bounding_box_visitor box2d operator() (mapnik::topojson::multi_point const& multi_pt) const { box2d bbox; - bool first = true; - for (auto const& pt : multi_pt.points) + if (num_arcs_ > 0) { - double x = pt.x; - double y = pt.y; - if (topo_.tr) + bool first = true; + for (auto const& pt : multi_pt.points) { - x = x * (*topo_.tr).scale_x + (*topo_.tr).translate_x; - y = y * (*topo_.tr).scale_y + (*topo_.tr).translate_y; // TODO : delta encoded ? - } - if (first) - { - first = false; - bbox.init(x,y,x,y); - } - else - { - bbox.expand_to_include(x,y); + double x = pt.x; + double y = pt.y; + if (topo_.tr) + { + x = x * (*topo_.tr).scale_x + (*topo_.tr).translate_x; + y = y * (*topo_.tr).scale_y + (*topo_.tr).translate_y; // TODO : delta encoded ? + } + if (first) + { + first = false; + bbox.init(x,y,x,y); + } + else + { + bbox.expand_to_include(x,y); + } } } return bbox; @@ -76,87 +79,28 @@ struct bounding_box_visitor box2d operator() (mapnik::topojson::linestring const& line) const { box2d bbox; - bool first = true; - double px = 0, py = 0; - index_type arc_index = line.ring; - for (auto pt : topo_.arcs[arc_index].coordinates) + if (num_arcs_ > 0) { - double x = pt.x; - double y = pt.y; - if (topo_.tr) - { - x = (px += x) * (*topo_.tr).scale_x + (*topo_.tr).translate_x; - y = (py += y) * (*topo_.tr).scale_y + (*topo_.tr).translate_y; - } - if (first) - { - first = false; - bbox.init(x, y, x, y); - } - else - { - bbox.expand_to_include(x, y); - } - } - return bbox; - } - - box2d operator() (mapnik::topojson::multi_linestring const& multi_line) const - { - box2d bbox; - bool first = true; - for (auto index : multi_line.rings) - { - double px = 0, py = 0; + index_type index = line.ring; index_type arc_index = index < 0 ? std::abs(index) - 1 : index; - for (auto pt : topo_.arcs[arc_index].coordinates) - { - double x = pt.x; - double y = pt.y; - if (topo_.tr) - { - x = (px += x) * (*topo_.tr).scale_x + (*topo_.tr).translate_x; - y = (py += y) * (*topo_.tr).scale_y + (*topo_.tr).translate_y; - } - if (first) - { - first = false; - bbox.init(x, y, x, y); - } - else - { - bbox.expand_to_include(x, y); - } - } - } - return bbox; - } - - box2d operator() (mapnik::topojson::polygon const& poly) const - { - box2d bbox; - bool first = true; - for (auto const& ring : poly.rings) - { - for (auto index : ring) + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) { + bool first = true; double px = 0, py = 0; - index_type arc_index = index < 0 ? std::abs(index) - 1 : index; - for (auto const& pt : topo_.arcs[arc_index].coordinates) + auto const& arcs = topo_.arcs[arc_index]; + for (auto pt : arcs.coordinates) { double x = pt.x; double y = pt.y; - if (topo_.tr) { x = (px += x) * (*topo_.tr).scale_x + (*topo_.tr).translate_x; y = (py += y) * (*topo_.tr).scale_y + (*topo_.tr).translate_y; } - if (first) { first = false; - bbox.init( x, y, x, y); + bbox.init(x, y, x, y); } else { @@ -168,33 +112,32 @@ struct bounding_box_visitor return bbox; } - box2d operator() (mapnik::topojson::multi_polygon const& multi_poly) const + box2d operator() (mapnik::topojson::multi_linestring const& multi_line) const { box2d bbox; - bool first = true; - for (auto const& poly : multi_poly.polygons) + if (num_arcs_ > 0) { - for (auto const& ring : poly) + bool first = true; + for (auto index : multi_line.rings) { - for (auto index : ring) + index_type arc_index = index < 0 ? std::abs(index) - 1 : index; + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) { double px = 0, py = 0; - index_type arc_index = index < 0 ? std::abs(index) - 1 : index; - for (auto const& pt : topo_.arcs[arc_index].coordinates) + auto const& arcs = topo_.arcs[arc_index]; + for (auto pt : arcs.coordinates) { double x = pt.x; double y = pt.y; - if (topo_.tr) { x = (px += x) * (*topo_.tr).scale_x + (*topo_.tr).translate_x; y = (py += y) * (*topo_.tr).scale_y + (*topo_.tr).translate_y; } - if (first) { first = false; - bbox.init( x, y, x, y); + bbox.init(x, y, x, y); } else { @@ -207,14 +150,103 @@ struct bounding_box_visitor return bbox; } - template - box2d operator() (T const& ) const + box2d operator() (mapnik::topojson::polygon const& poly) const + { + box2d bbox; + if (num_arcs_ > 0) + { + bool first = true; + for (auto const& ring : poly.rings) + { + for (auto index : ring) + { + index_type arc_index = index < 0 ? std::abs(index) - 1 : index; + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) + { + double px = 0, py = 0; + auto const& arcs = topo_.arcs[arc_index]; + for (auto const& pt : arcs.coordinates) + { + double x = pt.x; + double y = pt.y; + + if (topo_.tr) + { + x = (px += x) * (*topo_.tr).scale_x + (*topo_.tr).translate_x; + y = (py += y) * (*topo_.tr).scale_y + (*topo_.tr).translate_y; + } + + if (first) + { + first = false; + bbox.init( x, y, x, y); + } + else + { + bbox.expand_to_include(x, y); + } + } + } + } + } + } + return bbox; + } + + box2d operator() (mapnik::topojson::multi_polygon const& multi_poly) const + { + box2d bbox; + if (num_arcs_ > 0) + { + bool first = true; + for (auto const& poly : multi_poly.polygons) + { + for (auto const& ring : poly) + { + for (auto index : ring) + { + index_type arc_index = index < 0 ? std::abs(index) - 1 : index; + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) + { + double px = 0, py = 0; + auto const& arcs = topo_.arcs[arc_index]; + for (auto const& pt : arcs.coordinates) + { + double x = pt.x; + double y = pt.y; + + if (topo_.tr) + { + x = (px += x) * (*topo_.tr).scale_x + (*topo_.tr).translate_x; + y = (py += y) * (*topo_.tr).scale_y + (*topo_.tr).translate_y; + } + + if (first) + { + first = false; + bbox.init( x, y, x, y); + } + else + { + bbox.expand_to_include(x, y); + } + } + } + } + } + } + } + return bbox; + } + + box2d operator() (mapnik::topojson::invalid const&) const { return box2d(); } private: topology const& topo_; + std::size_t num_arcs_; }; }} diff --git a/include/mapnik/json/topology.hpp b/include/mapnik/json/topology.hpp index 7b93fcb58..3cfc2d322 100644 --- a/include/mapnik/json/topology.hpp +++ b/include/mapnik/json/topology.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,16 +23,19 @@ #ifndef MAPNIK_TOPOLOGY_HPP #define MAPNIK_TOPOLOGY_HPP -#include -#include - #include -#include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include +#pragma GCC diagnostic pop + +#include +#include +#include namespace mapnik { namespace topojson { diff --git a/include/mapnik/json/value_converters.hpp b/include/mapnik/json/value_converters.hpp index 9bbc24e24..384ecb88c 100644 --- a/include/mapnik/json/value_converters.hpp +++ b/include/mapnik/json/value_converters.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/label_collision_detector.hpp b/include/mapnik/label_collision_detector.hpp index a33747b90..6dce9ff2c 100644 --- a/include/mapnik/label_collision_detector.hpp +++ b/include/mapnik/label_collision_detector.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -78,7 +78,7 @@ public: tree_t::query_iterator end = tree_.query_end(); for ( ;itr != end; ++itr) { - if (itr->intersects(box)) return false; + if (itr->get().intersects(box)) return false; } tree_.insert(box,box); return true; @@ -108,7 +108,7 @@ public: for ( ;itr != end; ++itr) { - if (itr->intersects(box)) return false; + if (itr->get().intersects(box)) return false; } return true; } @@ -155,7 +155,7 @@ public: for ( ;itr != end; ++itr) { - if (itr->box.intersects(box)) return false; + if (itr->get().box.intersects(box)) return false; } return true; @@ -173,7 +173,7 @@ public: for (;itr != end; ++itr) { - if (itr->box.intersects(margin_box)) + if (itr->get().box.intersects(margin_box)) { return false; } @@ -201,7 +201,7 @@ public: for ( ;itr != end; ++itr) { - if (itr->box.intersects(margin_box) || (text == itr->text && itr->box.intersects(repeat_box))) + if (itr->get().box.intersects(margin_box) || (text == itr->get().text && itr->get().box.intersects(repeat_box))) { return false; } diff --git a/include/mapnik/layer.hpp b/include/mapnik/layer.hpp index 7d0e3bf31..a00b4885f 100644 --- a/include/mapnik/layer.hpp +++ b/include/mapnik/layer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -97,24 +97,24 @@ public: std::vector& styles(); /*! - * @param min_zoom The minimum zoom level to set + * @param minimum_scale_denom The minimum scale denominator */ - void set_min_zoom(double min_zoom); + void set_minimum_scale_denominator(double minimum_scale_denom); /*! - * @param max_zoom The maximum zoom level to set + * @param maximum_scale_denom The maximum scale denominator */ - void set_max_zoom(double max_zoom); + void set_maximum_scale_denominator(double maximum_scale_denom); /*! * @return the minimum zoom level of the layer. */ - double min_zoom() const; + double minimum_scale_denominator() const; /*! * @return the maximum zoom level of the layer. */ - double max_zoom() const; + double maximum_scale_denominator() const; /*! * @brief Set whether this layer is active and will be rendered. @@ -137,18 +137,18 @@ public: bool queryable() const; /*! - * @brief Get the visability for a specific scale. + * @brief Get the visibility for a specific scale denominator. * - * @param scale Accepts an integer or float input. + * @param scale_denom Accepts an integer or float input. * - * @return true if this layer's data is active and visible at a given scale. + * @return true if this layer's data is active and visible at a given scale denominator. * Otherwise returns False. * false if: - * scale >= minzoom - 1e-6 + * scale_denominator >= minimum_scale_denominator - 1e-6 * or - * scale < maxzoom + 1e-6 + * scale_denominator < maximum_scale_denominator + 1e-6 */ - bool visible(double scale) const; + bool visible(double scale_denom) const; /*! * @param clear_cache Set whether this layer's labels are cached. @@ -207,8 +207,8 @@ public: private: std::string name_; std::string srs_; - double min_zoom_; - double max_zoom_; + double minimum_scale_denom_; + double maximum_scale_denom_; bool active_; bool queryable_; bool clear_label_cache_; diff --git a/include/mapnik/load_map.hpp b/include/mapnik/load_map.hpp index 5696a9e8f..30a04eb07 100644 --- a/include/mapnik/load_map.hpp +++ b/include/mapnik/load_map.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/make_unique.hpp b/include/mapnik/make_unique.hpp index ea2974cf0..f6fd4a230 100644 --- a/include/mapnik/make_unique.hpp +++ b/include/mapnik/make_unique.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/map.hpp b/include/mapnik/map.hpp index ee1c7a3b7..23ea96a7c 100644 --- a/include/mapnik/map.hpp +++ b/include/mapnik/map.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/mapped_memory_cache.hpp b/include/mapnik/mapped_memory_cache.hpp index 3673c15e0..f41c2e803 100644 --- a/include/mapnik/mapped_memory_cache.hpp +++ b/include/mapnik/mapped_memory_cache.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,7 @@ // mapnik #include -#include +#include #include // boost diff --git a/include/mapnik/marker.hpp b/include/mapnik/marker.hpp index 63fe16c18..6f7cbf02d 100644 --- a/include/mapnik/marker.hpp +++ b/include/mapnik/marker.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,118 +24,190 @@ #define MAPNIK_MARKER_HPP // mapnik -#include +#include #include -#include #include -#include +#include // agg #include "agg_array.h" -// boost -#include - // stl #include namespace mapnik { +struct image_any; +namespace svg { struct path_attributes; } + using attr_storage = agg::pod_bvector; using svg_storage_type = mapnik::svg::svg_storage; using svg_path_ptr = std::shared_ptr; -using image_ptr = std::shared_ptr; -/** - * A class to hold either vector or bitmap marker data. This allows these to be treated equally - * in the image caches and most of the render paths. - */ -class marker: private util::noncopyable +using image_ptr = std::shared_ptr; + +struct marker_rgba8 { public: - marker() + marker_rgba8() + : bitmap_data_(4,4,true,true) { // create default OGC 4x4 black pixel - bitmap_data_ = boost::optional(std::make_shared(4,4)); - (*bitmap_data_)->set(0xff000000); + bitmap_data_.set(0xff000000); } - marker(boost::optional const& data) + marker_rgba8(image_rgba8 const & data) : bitmap_data_(data) {} - marker(boost::optional const& data) - : vector_data_(data) {} + marker_rgba8(image_rgba8 && data) + : bitmap_data_(std::move(data)) {} - marker(marker const& rhs) - : bitmap_data_(rhs.bitmap_data_), - vector_data_(rhs.vector_data_) {} + marker_rgba8(marker_rgba8 const& rhs) + : bitmap_data_(rhs.bitmap_data_) {} + + marker_rgba8(marker_rgba8 && rhs) noexcept + : bitmap_data_(std::move(rhs.bitmap_data_)) {} box2d bounding_box() const { - if (is_vector()) - { - return (*vector_data_)->bounding_box(); - } - if (is_bitmap()) - { - double width = (*bitmap_data_)->width(); - double height = (*bitmap_data_)->height(); - return box2d(0, 0, width, height); - } - return box2d(); + std::size_t width = bitmap_data_.width(); + std::size_t height = bitmap_data_.height(); + return box2d(static_cast(0), static_cast(0), static_cast(width), static_cast(height)); } inline double width() const { - if (is_bitmap()) - { - return (*bitmap_data_)->width(); - } - else if (is_vector()) - { - return (*vector_data_)->bounding_box().width(); - } - return 0; + return static_cast(bitmap_data_.width()); } + inline double height() const { - if (is_bitmap()) - { - return (*bitmap_data_)->height(); - } - else if (is_vector()) - { - return (*vector_data_)->bounding_box().height(); - } - return 0; + return static_cast(bitmap_data_.height()); } - inline bool is_bitmap() const - { - return !!bitmap_data_; - } - - inline bool is_vector() const - { - return !!vector_data_; - } - - boost::optional get_bitmap_data() const + image_rgba8 const& get_data() const { return bitmap_data_; } - boost::optional get_vector_data() const +private: + image_rgba8 bitmap_data_; +}; + +struct marker_svg +{ +public: + marker_svg() { } + + marker_svg(mapnik::svg_path_ptr data) + : vector_data_(data) {} + + marker_svg(marker_svg const& rhs) + : vector_data_(rhs.vector_data_) {} + + marker_svg(marker_svg && rhs) noexcept + : vector_data_(rhs.vector_data_) {} + + box2d bounding_box() const + { + return vector_data_->bounding_box(); + } + + inline double width() const + { + return vector_data_->bounding_box().width(); + } + inline double height() const + { + return vector_data_->bounding_box().height(); + } + + mapnik::svg_path_ptr get_data() const { return vector_data_; } private: - boost::optional bitmap_data_; - boost::optional vector_data_; + mapnik::svg_path_ptr vector_data_; }; -} +struct marker_null +{ + marker_null() = default; +public: + box2d bounding_box() const + { + return box2d(); + } + inline double width() const + { + return 0; + } + inline double height() const + { + return 0; + } +}; + +using marker_base = util::variant; +namespace detail { + +struct get_marker_bbox_visitor +{ + template + box2d operator()(T & data) const + { + return data.bounding_box(); + } +}; + +struct get_marker_width_visitor +{ + template + double operator()(T const& data) const + { + return data.width(); + } +}; + +struct get_marker_height_visitor +{ + template + double operator()(T const& data) const + { + return data.height(); + } +}; + +} // end detail ns + +struct marker : marker_base +{ + marker() = default; + + template + marker(T && data) noexcept + : marker_base(std::move(data)) {} + + double width() const + { + return util::apply_visitor(detail::get_marker_width_visitor(),*this); + } + + double height() const + { + return util::apply_visitor(detail::get_marker_height_visitor(),*this); + } + + box2d bounding_box() const + { + return util::apply_visitor(detail::get_marker_bbox_visitor(),*this); + } +}; + +} // end mapnik ns #endif // MAPNIK_MARKER_HPP diff --git a/include/mapnik/marker_cache.hpp b/include/mapnik/marker_cache.hpp index 34907cc80..47aa5558e 100644 --- a/include/mapnik/marker_cache.hpp +++ b/include/mapnik/marker_cache.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,22 +24,18 @@ #define MAPNIK_MARKER_CACHE_HPP // mapnik -#include +#include #include #include -// boost -#include +#include #include -#include +#include namespace mapnik { -class marker; - -using marker_ptr = std::shared_ptr; - +struct marker; class MAPNIK_DECL marker_cache : public singleton , @@ -49,17 +45,17 @@ class MAPNIK_DECL marker_cache : private: marker_cache(); ~marker_cache(); - bool insert_marker(std::string const& key, marker_ptr path); - boost::unordered_map marker_cache_; + bool insert_marker(std::string const& key, marker && path); + std::unordered_map > marker_cache_; bool insert_svg(std::string const& name, std::string const& svg_string); - boost::unordered_map svg_cache_; + std::unordered_map svg_cache_; public: std::string known_svg_prefix_; std::string known_image_prefix_; inline bool is_uri(std::string const& path) { return is_svg_uri(path) || is_image_uri(path); } bool is_svg_uri(std::string const& path); bool is_image_uri(std::string const& path); - boost::optional find(std::string const& key, bool update_cache = false); + std::shared_ptr find(std::string const& key, bool update_cache = false); void clear(); }; diff --git a/include/mapnik/marker_helpers.hpp b/include/mapnik/marker_helpers.hpp index c7fd8becf..e6fdfa209 100644 --- a/include/mapnik/marker_helpers.hpp +++ b/include/mapnik/marker_helpers.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,32 +23,24 @@ #ifndef MAPNIK_MARKER_HELPERS_HPP #define MAPNIK_MARKER_HELPERS_HPP -#include #include #include -#include +#include +#include #include -#include -#include #include -#include #include // for svg_storage_type #include #include #include -#include -#include +#include +#include // agg #include "agg_trans_affine.h" -// boost -#include - // stl #include -#include // remove_reference -#include namespace mapnik { @@ -64,15 +56,15 @@ struct vector_markers_dispatch : util::noncopyable symbolizer_base const& sym, Detector & detector, double scale_factor, - feature_impl & feature, + feature_impl const& feature, attributes const& vars) - : src_(src), - marker_trans_(marker_trans), - sym_(sym), - detector_(detector), - feature_(feature), - vars_(vars), - scale_factor_(scale_factor) + : src_(src), + marker_trans_(marker_trans), + sym_(sym), + detector_(detector), + feature_(feature), + vars_(vars), + scale_factor_(scale_factor) {} virtual ~vector_markers_dispatch() {} @@ -90,7 +82,8 @@ struct vector_markers_dispatch : util::noncopyable coord2d center = src_->bounding_box().center(); agg::trans_affine_translation recenter(-center.x, -center.y); agg::trans_affine tr = recenter * marker_trans_; - markers_placement_params params { src_->bounding_box(), tr, spacing * scale_factor_, max_error, allow_overlap, avoid_edges }; + direction_enum direction = get(sym_, feature_, vars_); + markers_placement_params params { src_->bounding_box(), tr, spacing * scale_factor_, max_error, allow_overlap, avoid_edges, direction }; markers_placement_finder placement_finder( placement_method, path, detector_, params); double x, y, angle = .0; @@ -110,7 +103,7 @@ protected: agg::trans_affine const& marker_trans_; symbolizer_base const& sym_; Detector & detector_; - feature_impl & feature_; + feature_impl const& feature_; attributes const& vars_; double scale_factor_; }; @@ -118,12 +111,12 @@ protected: template struct raster_markers_dispatch : util::noncopyable { - raster_markers_dispatch(image_data_rgba8 & src, + raster_markers_dispatch(image_rgba8 const& src, agg::trans_affine const& marker_trans, symbolizer_base const& sym, Detector & detector, double scale_factor, - feature_impl & feature, + feature_impl const& feature, attributes const& vars) : src_(src), marker_trans_(marker_trans), @@ -147,8 +140,9 @@ struct raster_markers_dispatch : util::noncopyable value_double spacing = get(sym_, feature_, vars_); value_double max_error = get(sym_, feature_, vars_); box2d bbox(0,0, src_.width(),src_.height()); - markers_placement_params params { bbox, marker_trans_, spacing * scale_factor_, max_error, allow_overlap, avoid_edges }; - markers_placement_finder placement_finder( + direction_enum direction = get(sym_, feature_, vars_); + markers_placement_params params { bbox, marker_trans_, spacing * scale_factor_, max_error, allow_overlap, avoid_edges, direction }; + markers_placement_finder placement_finder( placement_method, path, detector_, params); double x, y, angle = .0; while (placement_finder.get_point(x, y, angle, ignore_placement)) @@ -163,16 +157,17 @@ struct raster_markers_dispatch : util::noncopyable virtual void render_marker(agg::trans_affine const& marker_tr, double opacity) = 0; protected: - image_data_rgba8 & src_; + image_rgba8 const& src_; agg::trans_affine const& marker_trans_; symbolizer_base const& sym_; Detector & detector_; - feature_impl & feature_; + feature_impl const& feature_; attributes const& vars_; double scale_factor_; }; -void build_ellipse(symbolizer_base const& sym, mapnik::feature_impl & feature, attributes const& vars, svg_storage_type & marker_ellipse, svg::svg_path_adapter & svg_path); +void build_ellipse(symbolizer_base const& sym, mapnik::feature_impl & feature, attributes const& vars, + svg_storage_type & marker_ellipse, svg::svg_path_adapter & svg_path); bool push_explicit_style(svg_attribute_type const& src, svg_attribute_type & dst, @@ -188,30 +183,40 @@ void setup_transform_scaling(agg::trans_affine & tr, symbolizer_base const& sym); // Apply markers to a feature with multiple geometries -template -void apply_markers_multi(feature_impl const& feature, attributes const& vars, Converter & converter, symbolizer_base const& sym) +template +void apply_markers_multi(feature_impl const& feature, attributes const& vars, Converter & converter, Processor & proc, symbolizer_base const& sym) { - std::size_t geom_count = feature.paths().size(); - if (geom_count == 1) + using vertex_converter_type = Converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = geometry::vertex_processor; + + auto const& geom = feature.get_geometry(); + geometry::geometry_types type = geometry::geometry_type(geom); + + if (type == geometry::geometry_types::Point + || type == geometry::geometry_types::LineString + || type == geometry::geometry_types::Polygon) { - converter.apply(const_cast(feature.paths()[0])); + apply_vertex_converter_type apply(converter, proc); + mapnik::util::apply_visitor(vertex_processor_type(apply), geom); } - else if (geom_count > 1) + else { + marker_multi_policy_enum multi_policy = get(sym, feature, vars); marker_placement_enum placement = get(sym, feature, vars); if (placement == MARKER_POINT_PLACEMENT && multi_policy == MARKER_WHOLE_MULTI) { - double x, y; - if (label::centroid_geoms(feature.paths().begin(), feature.paths().end(), x, y)) + geometry::point pt; + // test if centroid is contained by bounding box + if (geometry::centroid(geom, pt) && converter.disp_.args_.bbox.contains(pt.x, pt.y)) { - geometry_type pt(geometry_type::types::Point); - pt.move_to(x, y); // unset any clipping since we're now dealing with a point converter.template unset(); - converter.apply(pt); + geometry::point_vertex_adapter va(pt); + converter.apply(va, proc); } } else if ((placement == MARKER_POINT_PLACEMENT || placement == MARKER_INTERIOR_PLACEMENT) && @@ -219,21 +224,31 @@ void apply_markers_multi(feature_impl const& feature, attributes const& vars, Co { // Only apply to path with largest envelope area // TODO: consider using true area for polygon types - double maxarea = 0; - geometry_type const* largest = 0; - for (geometry_type const& geom : feature.paths()) + if (type == geometry::geometry_types::MultiPolygon) { - const box2d& env = geom.envelope(); - double area = env.width() * env.height(); - if (area > maxarea) + geometry::multi_polygon const& multi_poly = mapnik::util::get >(geom); + double maxarea = 0; + geometry::polygon const* largest = 0; + for (geometry::polygon const& poly : multi_poly) { - maxarea = area; - largest = &geom; + box2d bbox = geometry::envelope(poly); + geometry::polygon_vertex_adapter va(poly); + double area = bbox.width() * bbox.height(); + if (area > maxarea) + { + maxarea = area; + largest = &poly; + } + } + if (largest) + { + geometry::polygon_vertex_adapter va(*largest); + converter.apply(va, proc); } } - if (largest) + else { - converter.apply(const_cast(*largest)); + MAPNIK_LOG_WARN(marker_symbolizer) << "TODO: if you get here -> open an issue"; } } else @@ -242,10 +257,8 @@ void apply_markers_multi(feature_impl const& feature, attributes const& vars, Co { MAPNIK_LOG_WARN(marker_symbolizer) << "marker_multi_policy != 'each' has no effect with marker_placement != 'point'"; } - for (geometry_type const& path : feature.paths()) - { - converter.apply(const_cast(path)); - } + apply_vertex_converter_type apply(converter, proc); + mapnik::util::apply_visitor(vertex_processor_type(apply), geom); } } } diff --git a/include/mapnik/markers_placement.hpp b/include/mapnik/markers_placement.hpp index 1472e6ea1..3e7e3e495 100644 --- a/include/mapnik/markers_placement.hpp +++ b/include/mapnik/markers_placement.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/markers_placements/interior.hpp b/include/mapnik/markers_placements/interior.hpp index 395ee07a1..93b5e3418 100644 --- a/include/mapnik/markers_placements/interior.hpp +++ b/include/mapnik/markers_placements/interior.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ #include #include +#include namespace mapnik { @@ -48,12 +49,12 @@ public: return false; } - if (this->locator_.type() == mapnik::geometry_type::types::Point) + if (this->locator_.type() == geometry::geometry_types::Point) { return markers_point_placement::get_point(x, y, angle, ignore_placement); } - if (this->locator_.type() == mapnik::geometry_type::types::LineString) + if (this->locator_.type() == geometry::geometry_types::LineString) { if (!label::middle_point(this->locator_, x, y)) { diff --git a/include/mapnik/markers_placements/line.hpp b/include/mapnik/markers_placements/line.hpp index 24bb229ec..fe2c2bd9f 100644 --- a/include/mapnik/markers_placements/line.hpp +++ b/include/mapnik/markers_placements/line.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,6 +27,7 @@ #include #include #include +#include namespace mapnik { @@ -67,7 +68,7 @@ public: return false; } - if (this->locator_.type() == mapnik::geometry_type::types::Point) + if (this->locator_.type() == geometry::geometry_types::Point) { return markers_point_placement::get_point(x, y, angle, ignore_placement); } @@ -97,6 +98,10 @@ public: x = pos.x; y = pos.y; angle = path_.current_segment_angle(); + if (!this->set_direction(angle)) + { + continue; + } box2d box = this->perform_transform(angle, x, y); if ((this->params_.avoid_edges && !this->detector_.extent().contains(box)) || (!this->params_.allow_overlap && !this->detector_.has_placement(box))) diff --git a/include/mapnik/markers_placements/point.hpp b/include/mapnik/markers_placements/point.hpp index 3ca1ce5c8..65b95ce79 100644 --- a/include/mapnik/markers_placements/point.hpp +++ b/include/mapnik/markers_placements/point.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,11 +23,19 @@ #ifndef MAPNIK_MARKERS_PLACEMENTS_POINT_HPP #define MAPNIK_MARKERS_PLACEMENTS_POINT_HPP +#include #include +#include +#include +#include +#include +#include #include "agg_basics.h" #include "agg_trans_affine.h" +#include + namespace mapnik { struct markers_placement_params @@ -38,6 +46,7 @@ struct markers_placement_params double max_error; bool allow_overlap; bool avoid_edges; + direction_enum direction; }; template @@ -76,7 +85,7 @@ public: return false; } - if (locator_.type() == mapnik::geometry_type::types::LineString) + if (locator_.type() == geometry::geometry_types::LineString) { if (!label::middle_point(locator_, x, y)) { @@ -141,6 +150,36 @@ protected: result.expand_to_include(xD, yD); return result; } + + bool set_direction(double & angle) + { + switch (params_.direction) + { + case DIRECTION_UP: + angle = .0; + return true; + case DIRECTION_DOWN: + angle = M_PI; + return true; + case DIRECTION_AUTO: + angle = (std::fabs(util::normalize_angle(angle)) > 0.5 * M_PI) ? (angle + M_PI) : angle; + return true; + case DIRECTION_AUTO_DOWN: + angle = (std::fabs(util::normalize_angle(angle)) < 0.5 * M_PI) ? (angle + M_PI) : angle; + return true; + case DIRECTION_LEFT: + angle += M_PI; + return true; + case DIRECTION_LEFT_ONLY: + angle += M_PI; + return std::fabs(util::normalize_angle(angle)) < 0.5 * M_PI; + case DIRECTION_RIGHT_ONLY: + return std::fabs(util::normalize_angle(angle)) < 0.5 * M_PI; + case DIRECTION_RIGHT: + default: + return true; + } + } }; } diff --git a/include/mapnik/markers_placements/vertext_first.hpp b/include/mapnik/markers_placements/vertext_first.hpp index 9f142e160..bcdac2b4b 100644 --- a/include/mapnik/markers_placements/vertext_first.hpp +++ b/include/mapnik/markers_placements/vertext_first.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -47,7 +47,7 @@ public: return false; } - if (this->locator_.type() == mapnik::geometry_type::types::Point) + if (this->locator_.type() == mapnik::geometry::geometry_types::Point) { return markers_point_placement::get_point(x, y, angle, ignore_placement); } @@ -69,6 +69,10 @@ public: if (agg::is_line_to(this->locator_.vertex(&x1, &y1))) { angle = std::atan2(y1 - y0, x1 - x0); + if (!this->set_direction(angle)) + { + return false; + } } box2d box = this->perform_transform(angle, x, y); diff --git a/include/mapnik/markers_placements/vertext_last.hpp b/include/mapnik/markers_placements/vertext_last.hpp index 456687003..4d57130a2 100644 --- a/include/mapnik/markers_placements/vertext_last.hpp +++ b/include/mapnik/markers_placements/vertext_last.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -74,6 +74,10 @@ public: if (agg::is_line_to(command1)) { angle = std::atan2(y0 - y1, x0 - x1); + if (!this->set_direction(angle)) + { + return false; + } } box2d box = this->perform_transform(angle, x, y); diff --git a/include/mapnik/memory.hpp b/include/mapnik/memory.hpp deleted file mode 100644 index c4bff29f2..000000000 --- a/include/mapnik/memory.hpp +++ /dev/null @@ -1,86 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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_MEMORY_HPP -#define MAPNIK_MEMORY_HPP - -#include - -namespace mapnik -{ -class MemoryUtils -{ -public: - static size_t alignPointerSize(size_t ptrSize); -private: - MemoryUtils(); - MemoryUtils(const MemoryUtils&); - MemoryUtils& operator=(const MemoryUtils&); -}; - -class MemoryManager -{ -public: - virtual void* allocate(size_t size)=0; - virtual void deallocate(void* p)=0; - virtual ~MemoryManager(); -protected: - MemoryManager(); // {} -private: - MemoryManager(const MemoryManager&); - MemoryManager& operator=(const MemoryManager&); -}; - -class Object -{ -public: - void* operator new(size_t size); - void* operator new(size_t size, MemoryManager* manager); - void operator delete(void* p); - void operator delete(void* p, MemoryManager* manager); -protected: - virtual ~Object() {} - Object() {} - Object(const Object&) {} -protected: - Object& operator=(const Object&) - { - return *this; - } -}; - -template -class geometry_pool -{ -public: - void* allocate() - { - return ::operator new(sizeof(Geometry)); - } - void deallocate(void* p) - { - ::operator delete(p); - } -}; - -} -#endif // MAPNIK_MEMORY_HPP diff --git a/include/mapnik/memory_datasource.hpp b/include/mapnik/memory_datasource.hpp index 93d970008..a6ab9188c 100644 --- a/include/mapnik/memory_datasource.hpp +++ b/include/mapnik/memory_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -43,7 +43,7 @@ public: virtual featureset_ptr features(query const& q) const; virtual featureset_ptr features_at_point(coord2d const& pt, double tol = 0) const; virtual box2d envelope() const; - virtual boost::optional get_geometry_type() const; + virtual boost::optional get_geometry_type() const; virtual layer_descriptor get_descriptor() const; // void push(feature_ptr feature); diff --git a/include/mapnik/memory_featureset.hpp b/include/mapnik/memory_featureset.hpp index 5466354bc..cc5005b42 100644 --- a/include/mapnik/memory_featureset.hpp +++ b/include/mapnik/memory_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,6 +26,7 @@ // mapnik #include #include +#include #include #include #include @@ -77,13 +78,10 @@ public: } else { - for (std::size_t i=0; i<(*pos_)->num_geometries();++i) + geometry::geometry const& geom = (*pos_)->get_geometry(); + if (bbox_.intersects(geometry::envelope(geom))) { - geometry_type & geom = (*pos_)->get_geometry(i); - if (bbox_.intersects(geom.envelope())) - { - return *pos_++; - } + return *pos_++; } } ++pos_; diff --git a/include/mapnik/miniz_png.hpp b/include/mapnik/miniz_png.hpp index bc9221f36..6c46e448f 100644 --- a/include/mapnik/miniz_png.hpp +++ b/include/mapnik/miniz_png.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,7 +32,7 @@ #include #include -#include +#include #include /* miniz.c porting issues: @@ -83,12 +83,12 @@ private: static const unsigned char IEND_tpl[]; }; -extern template MAPNIK_DECL void PNGWriter::writeIDAT(image_data_gray8 const& image); -extern template MAPNIK_DECL void PNGWriter::writeIDAT >(image_view const& image); -extern template MAPNIK_DECL void PNGWriter::writeIDAT(image_data_rgba8 const& image); -extern template MAPNIK_DECL void PNGWriter::writeIDAT >(image_view const& image); -extern template MAPNIK_DECL void PNGWriter::writeIDATStripAlpha(image_data_rgba8 const& image); -extern template MAPNIK_DECL void PNGWriter::writeIDATStripAlpha >(image_view const& image); +extern template MAPNIK_DECL void PNGWriter::writeIDAT(image_gray8 const& image); +extern template MAPNIK_DECL void PNGWriter::writeIDAT(image_view_gray8 const& image); +extern template MAPNIK_DECL void PNGWriter::writeIDAT(image_rgba8 const& image); +extern template MAPNIK_DECL void PNGWriter::writeIDAT(image_view_rgba8 const& image); +extern template MAPNIK_DECL void PNGWriter::writeIDATStripAlpha(image_rgba8 const& image); +extern template MAPNIK_DECL void PNGWriter::writeIDATStripAlpha(image_view_rgba8 const& image); }} diff --git a/include/mapnik/octree.hpp b/include/mapnik/octree.hpp index 6119bd6cb..007e6960e 100644 --- a/include/mapnik/octree.hpp +++ b/include/mapnik/octree.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -88,8 +88,8 @@ class octree : private util::noncopyable unsigned count; double reduce_cost; unsigned count_cum; - byte children_count; - byte index; + std::uint8_t children_count; + std::uint8_t index; }; struct node_cmp { @@ -297,9 +297,9 @@ public: if (itr->count != 0) { unsigned count = itr->count; - palette.push_back(rgb(byte(itr->reds/float(count)), - byte(itr->greens/float(count)), - byte(itr->blues/float(count)))); + palette.push_back(rgb(std::uint8_t(itr->reds/float(count)), + std::uint8_t(itr->greens/float(count)), + std::uint8_t(itr->blues/float(count)))); itr->index = static_cast(palette.size()) - 1; } for (unsigned i=0; i < 8 ;++i) diff --git a/include/mapnik/offset_converter.hpp b/include/mapnik/offset_converter.hpp index aed014fa4..b1f2476c8 100644 --- a/include/mapnik/offset_converter.hpp +++ b/include/mapnik/offset_converter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,6 +29,7 @@ #include #include #include +#include // stl #include @@ -39,14 +40,14 @@ namespace mapnik { template -struct MAPNIK_DECL offset_converter +struct offset_converter { using size_type = std::size_t; offset_converter(Geometry & geom) : geom_(geom) , offset_(0.0) - , threshold_(8.0) + , threshold_(5.0) , half_turn_segments_(16) , status_(initial) , pre_first_(vertex2d::no_init) @@ -246,8 +247,8 @@ private: */ void displace(vertex2d & v, double a) const { - v.x += offset_ * std::sin(a); - v.y -= offset_ * std::cos(a); + v.x -= offset_ * std::sin(a); + v.y += offset_ * std::cos(a); } /** @@ -255,8 +256,8 @@ private: */ void displace(vertex2d & v, vertex2d const& u, double a) const { - v.x = u.x + offset_ * std::sin(a); - v.y = u.y - offset_ * std::cos(a); + v.x = u.x - offset_ * std::sin(a); + v.y = u.y + offset_ * std::cos(a); v.cmd = u.cmd; } @@ -265,8 +266,27 @@ private: double sa = offset_ * std::sin(a); double ca = offset_ * std::cos(a); double h = std::tan(0.5 * (b - a)); - v.x = v.x + sa + h * ca; - v.y = v.y - ca + h * sa; + double hsa = h * sa; + double hca = h * ca; + double abs_offset = std::abs(offset_); + if (hsa > 1.0 * abs_offset) + { + hsa = 1.0 * abs_offset; + } + else if (hsa < -1.0 * abs_offset) + { + hsa = -1.0 * abs_offset; + } + if (hca > 1.0 * abs_offset) + { + hca = 1.0 * abs_offset; + } + else if (hca < -1.0 * abs_offset) + { + hca = -1.0 * abs_offset; + } + v.x = v.x - sa - hca; + v.y = v.y + ca - hsa; } status init_vertices() @@ -275,13 +295,41 @@ private: { return status_; } - + vertex2d v0(vertex2d::no_init); vertex2d v1(vertex2d::no_init); vertex2d v2(vertex2d::no_init); vertex2d w(vertex2d::no_init); - - v1.cmd = geom_.vertex(&v1.x, &v1.y); - v2.cmd = geom_.vertex(&v2.x, &v2.y); + vertex2d start_v2(vertex2d::no_init); + std::vector points; + std::vector close_points; + bool is_polygon = false; + std::size_t cpt = 0; + v0.cmd = geom_.vertex(&v0.x, &v0.y); + v1.x = v0.x; + v1.y = v0.y; + v1.cmd = v0.cmd; + // PUSH INITIAL + points.push_back(vertex2d(v0.x, v0.y, v0.cmd)); + while ((v0.cmd = geom_.vertex(&v0.x, &v0.y)) != SEG_END) + { + points.push_back(vertex2d(v0.x, v0.y, v0.cmd)); + if (v0.cmd == SEG_CLOSE) + { + is_polygon = true; + close_points.push_back(vertex2d(v1.x, v1.y, v1.cmd)); + } + v1.x = v0.x; + v1.y = v0.y; + v1.cmd = v0.cmd; + } + // Push SEG_END + points.push_back(vertex2d(v0.x, v0.y, v0.cmd)); + std::size_t i = 0; + v1 = points[i++]; + v2 = points[i++]; + v0.cmd = v1.cmd; + v0.x = v1.x; + v0.y = v1.y; if (v2.cmd == SEG_END) // not enough vertices in source { @@ -289,50 +337,161 @@ private: } double angle_a = 0; - double angle_b = std::atan2((v2.y - v1.y), (v2.x - v1.x)); - double joint_angle; + // The vector parts from v1 to v0. + double v_x1x0 = 0; + double v_y1y0 = 0; + // The vector parts from v1 to v2; + double v_x1x2 = v2.x - v1.x; + double v_y1y2 = v2.y - v1.y; - // first vertex - displace(v1, angle_b); - push_vertex(v1); + if (is_polygon) + { + v_x1x0 = close_points[cpt].x - v1.x; + v_y1y0 = close_points[cpt].y - v1.y; + cpt++; + angle_a = std::atan2(-v_y1y0, -v_x1x0); + } + // dot product + double dot; + // determinate + double det; + double angle_b = std::atan2(v_y1y2, v_x1x2); + // Angle between the two vectors + double joint_angle; + double curve_angle; + + if (!is_polygon) + { + // first vertex + displace(v1, angle_b); + push_vertex(v1); + } + else + { + dot = v_x1x0 * v_x1x2 + v_y1y0 * v_y1y2; // dot product + det = v_x1x0 * v_y1y2 - v_y1y0 * v_x1x2; // determinant + + joint_angle = std::atan2(det, dot); // atan2(y, x) or atan2(sin, cos) + if (joint_angle < 0) joint_angle = joint_angle + 2 * M_PI; + joint_angle = std::fmod(joint_angle, 2 * M_PI); + + if (offset_ > 0.0) + { + joint_angle = 2 * M_PI - joint_angle; + } + + int bulge_steps = 0; + + if (std::abs(joint_angle) > M_PI) + { + curve_angle = explement_reflex_angle(angle_b - angle_a); + // Bulge steps should be determined by the inverse of the joint angle. + double half_turns = half_turn_segments_ * std::fabs(curve_angle); + bulge_steps = 1 + static_cast(std::floor(half_turns / M_PI)); + } + + if (bulge_steps == 0) + { + displace2(v1, angle_a, angle_b); + push_vertex(v1); + } + else + { + displace(v1, angle_b); + push_vertex(v1); + } + } // Sometimes when the first segment is too short, it causes ugly // curls at the beginning of the line. To avoid this, we make up // a fake vertex two offset-lengths before the first, and expect // intersection detection smoothes it out. - pre_first_ = v1; - displace(pre_first_, -2 * std::fabs(offset_), 0, angle_b); - - while ((v1 = v2, v2.cmd = geom_.vertex(&v2.x, &v2.y)) != SEG_END) + if (!is_polygon) { - angle_a = angle_b; - angle_b = std::atan2((v2.y - v1.y), (v2.x - v1.x)); - joint_angle = explement_reflex_angle(angle_b - angle_a); + pre_first_ = v1; + displace(pre_first_, -2 * std::fabs(offset_), 0, angle_b); + start_ = pre_first_; + } + else + { + pre_first_ = v0; + start_ = pre_first_; + } + start_v2.x = v2.x; + start_v2.y = v2.y; + bool continue_loop = true; + while (i < points.size()) + { + v1 = v2; + v2 = points[i++]; + if (v1.cmd == SEG_MOVETO) + { + if (is_polygon) + { + v1.x = start_.x; + v1.y = start_.y; + if (cpt < close_points.size()) + { + v_x1x2 = v1.x - close_points[cpt].x; + v_y1y2 = v1.y - close_points[cpt].y; + cpt++; + } + } + start_v2.x = v2.x; + start_v2.y = v2.y; + } + if (v2.cmd == SEG_MOVETO) + { + start_.x = v2.x; + start_.y = v2.y; + v2.x = start_v2.x; + v2.y = start_v2.y; + } + else if (v2.cmd == SEG_END) + { + if (!is_polygon) break; + continue_loop = false; + v2.x = start_v2.x; + v2.y = start_v2.y; + } + else if (v2.cmd == SEG_CLOSE) + { + v2.x = start_.x; + v2.y = start_.y; + } + + // Switch the previous vector's direction as the origin has changed + v_x1x0 = -v_x1x2; + v_y1y0 = -v_y1y2; + // Calculate new angle_a + angle_a = std::atan2(v_y1y2, v_x1x2); + + // Calculate the new vector + v_x1x2 = v2.x - v1.x; + v_y1y2 = v2.y - v1.y; + // Calculate the new angle_b + angle_b = std::atan2(v_y1y2, v_x1x2); + + dot = v_x1x0 * v_x1x2 + v_y1y0 * v_y1y2; // dot product + det = v_x1x0 * v_y1y2 - v_y1y0 * v_x1x2; // determinant + + joint_angle = std::atan2(det, dot); // atan2(y, x) or atan2(sin, cos) + if (joint_angle < 0) joint_angle = joint_angle + 2 * M_PI; + joint_angle = std::fmod(joint_angle, 2 * M_PI); + + if (offset_ > 0.0) + { + joint_angle = 2 * M_PI - joint_angle; + } - double half_turns = half_turn_segments_ * std::fabs(joint_angle); int bulge_steps = 0; - if (offset_ < 0.0) + if (std::abs(joint_angle) > M_PI) { - if (joint_angle > 0.0) - { - joint_angle = joint_angle - 2 * M_PI; - } - else - { - bulge_steps = 1 + static_cast(std::floor(half_turns / M_PI)); - } - } - else - { - if (joint_angle < 0.0) - { - joint_angle = joint_angle + 2 * M_PI; - } - else - { - bulge_steps = 1 + static_cast(std::floor(half_turns / M_PI)); - } + curve_angle = explement_reflex_angle(angle_b - angle_a); + // Bulge steps should be determined by the inverse of the joint angle. + double half_turns = half_turn_segments_ * std::fabs(curve_angle); + bulge_steps = 1 + static_cast(std::floor(half_turns / M_PI)); } #ifdef MAPNIK_LOG @@ -351,41 +510,64 @@ private: << " degrees ((< with " << bulge_steps << " segments"; } #endif - - displace(w, v1, angle_a); - push_vertex(w); - - for (int s = 0; ++s < bulge_steps;) + if (v1.cmd == SEG_MOVETO) { - displace(w, v1, angle_a + (joint_angle * s) / bulge_steps); - push_vertex(w); + if (bulge_steps == 0) + { + displace2(v1, angle_a, angle_b); + push_vertex(v1); + } + else + { + displace(v1, angle_b); + push_vertex(v1); + } + } + else + { + if (bulge_steps == 0) + { + displace2(v1, angle_a, angle_b); + push_vertex(v1); + } + else + { + displace(w, v1, angle_a); + w.cmd = SEG_LINETO; + push_vertex(w); + for (int s = 0; ++s < bulge_steps;) + { + displace(w, v1, angle_a + (curve_angle * s) / bulge_steps); + w.cmd = SEG_LINETO; + push_vertex(w); + } + displace(v1, angle_b); + push_vertex(v1); + } } - - displace(v1, angle_b); - push_vertex(v1); } // last vertex - displace(v1, angle_b); - push_vertex(v1); - + if (!is_polygon) + { + displace(v1, angle_b); + push_vertex(v1); + } // initialization finished return status_ = process; } unsigned output_vertex(double* px, double* py) { - *px = cur_.x; - *py = cur_.y; + if (cur_.cmd == SEG_CLOSE) *px = *py = 0.0; + else + { + *px = cur_.x; + *py = cur_.y; + } return cur_.cmd; } - unsigned output_vertex(double* px, double* py, status st) - { - status_ = st; - return output_vertex(px, py); - } - void push_vertex(vertex2d const& v) { vertices_.push_back(v); @@ -398,6 +580,7 @@ private: status status_; size_t pos_; std::vector vertices_; + vertex2d start_; vertex2d pre_first_; vertex2d pre_; vertex2d cur_; diff --git a/include/mapnik/palette.hpp b/include/mapnik/palette.hpp index 5dc3a4cdf..377967aea 100644 --- a/include/mapnik/palette.hpp +++ b/include/mapnik/palette.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,13 +30,16 @@ #define USE_DENSE_HASH_MAP +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" #ifdef USE_DENSE_HASH_MAP - #include - using rgba_hash_table = google::dense_hash_map; +#include +using rgba_hash_table = google::dense_hash_map; #else - #include - using rgba_hash_table = boost::unordered_map; +#include +using rgba_hash_table = std::unordered_map; #endif +#pragma GCC diagnostic pop // stl #include @@ -51,11 +54,11 @@ namespace mapnik { struct rgba; struct MAPNIK_DECL rgb { - byte r; - byte g; - byte b; + std::uint8_t r; + std::uint8_t g; + std::uint8_t b; - inline rgb(byte r_, byte g_, byte b_) : r(r_), g(g_), b(b_) {} + inline rgb(std::uint8_t r_, std::uint8_t g_, std::uint8_t b_) : r(r_), g(g_), b(b_) {} rgb(rgba const& c); inline bool operator==(const rgb& y) const @@ -66,12 +69,12 @@ struct MAPNIK_DECL rgb { struct MAPNIK_DECL rgba { - byte r; - byte g; - byte b; - byte a; + std::uint8_t r; + std::uint8_t g; + std::uint8_t b; + std::uint8_t a; - inline rgba(byte r_, byte g_, byte b_, byte a_) + inline rgba(std::uint8_t r_, std::uint8_t g_, std::uint8_t b_, std::uint8_t a_) : r(r_), g(g_), b(b_), diff --git a/include/mapnik/params.hpp b/include/mapnik/params.hpp index 240192c94..fc5928900 100644 --- a/include/mapnik/params.hpp +++ b/include/mapnik/params.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -40,7 +40,7 @@ namespace mapnik // fwd declare class boolean_type; -using value_holder_base = util::variant; +using value_holder_base = util::variant; struct value_holder : value_holder_base { @@ -87,6 +87,12 @@ template MAPNIK_DECL boost::optional parameters::get(std::string const& key, value_integer const& default_opt_value) const; +template MAPNIK_DECL +boost::optional parameters::get(std::string const& key) const; +template MAPNIK_DECL +boost::optional parameters::get(std::string const& key, + value_bool const& default_opt_value) const; + template MAPNIK_DECL boost::optional parameters::get(std::string const& key) const; template MAPNIK_DECL diff --git a/include/mapnik/params_impl.hpp b/include/mapnik/params_impl.hpp index 58ae52b00..469a9361e 100644 --- a/include/mapnik/params_impl.hpp +++ b/include/mapnik/params_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,6 +33,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop @@ -53,6 +56,29 @@ struct extract_value s << "No conversion from std::string to " << typeid(T).name(); throw std::runtime_error(s.str()); } + static inline boost::optional do_extract_from_bool(value_bool const& /*source*/) + { + std::ostringstream s; + s << "No conversion from boolean to " << typeid(T).name(); + throw std::runtime_error(s.str()); + } +}; + +template <> +struct extract_value +{ + static inline boost::optional do_extract_from_string(std::string const& source) + { + bool result; + if (mapnik::util::string2bool(source, result)) + return boost::optional(result); + return boost::optional(); + } + + static inline boost::optional do_extract_from_bool(value_bool const& source) + { + return boost::optional(source); + } }; template <> @@ -65,6 +91,11 @@ struct extract_value return boost::optional(result); return boost::optional(); } + + static inline boost::optional do_extract_from_bool(value_bool const& source) + { + return boost::optional(source); + } }; template <> @@ -77,6 +108,10 @@ struct extract_value return boost::optional(result); return boost::optional(); } + static inline boost::optional do_extract_from_bool(value_bool const& source) + { + return boost::optional(boost::lexical_cast(source)); + } }; template <> @@ -89,6 +124,11 @@ struct extract_value return boost::optional(result); return boost::optional(); } + + static inline boost::optional do_extract_from_bool(value_bool const& source) + { + return boost::optional(boost::lexical_cast(source)); + } }; template <> @@ -98,6 +138,11 @@ struct extract_value { return boost::optional(); // FIXME } + + static inline boost::optional do_extract_from_bool(value_bool const&) + { + return boost::optional(); // FIXME + } }; @@ -108,6 +153,14 @@ struct extract_value { return boost::optional(source); } + + static inline boost::optional do_extract_from_bool(value_bool const& source) + { + if (source) { + return boost::optional("true"); + } + return boost::optional("false"); + } }; @@ -118,6 +171,12 @@ boost::optional param_cast(std::string const& source) return extract_value::do_extract_from_string(source); } +template +boost::optional param_cast(value_bool const& source) +{ + return extract_value::do_extract_from_bool(source); +} + } // end namespace detail template @@ -133,6 +192,12 @@ struct value_extractor_visitor } + void operator() (value_bool const& val) const + { + var_ = detail::param_cast(val); + + } + template void operator () (T1 const& val) const { diff --git a/include/mapnik/parse_path.hpp b/include/mapnik/parse_path.hpp index 0667e901a..e5b5882ab 100644 --- a/include/mapnik/parse_path.hpp +++ b/include/mapnik/parse_path.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/parse_transform.hpp b/include/mapnik/parse_transform.hpp index 7baef79d2..68e605c40 100644 --- a/include/mapnik/parse_transform.hpp +++ b/include/mapnik/parse_transform.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/path.hpp b/include/mapnik/path.hpp new file mode 100644 index 000000000..6d253466d --- /dev/null +++ b/include/mapnik/path.hpp @@ -0,0 +1,184 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_PATH_HPP +#define MAPNIK_PATH_HPP + +// mapnik +#include +#include +#include + +namespace mapnik { namespace detail { + +template class Container=vertex_vector> +class path : private util::noncopyable +{ +public: + static const std::uint8_t geometry_bits = 7; + enum types : std::uint8_t + { + Unknown = 0x00, + Point = 0x01, + LineString = 0x02, + Polygon = 0x03, + PolygonExterior = Polygon, + PolygonInterior = Polygon | ( 1 << geometry_bits) + }; + using coord_type = T; + using container_type = Container; + using value_type = typename container_type::value_type; + using size_type = typename container_type::size_type; + container_type cont_; + types type_; +public: + + path() + : type_(Unknown) + {} + + explicit path(types type) + : type_(type) + {} + + types type() const + { + return static_cast(type_ & types::Polygon); + } + + bool interior() const + { + return static_cast(type_ >> geometry_bits); + } + + void set_type(types type) + { + type_ = type; + } + + container_type const& data() const + { + return cont_; + } + + size_type size() const + { + return cont_.size(); + } + void push_vertex(coord_type x, coord_type y, CommandType c) + { + cont_.push_back(x,y,c); + } + + void line_to(coord_type x,coord_type y) + { + push_vertex(x,y,SEG_LINETO); + } + + void move_to(coord_type x,coord_type y) + { + push_vertex(x,y,SEG_MOVETO); + } + + void close_path() + { + push_vertex(0,0,SEG_CLOSE); + } +}; + +template +struct vertex_adapter : private util::noncopyable +{ + using path_type = T; + using size_type = typename path_type::size_type; + using value_type = typename path_type::value_type; + using types = typename path_type::types; + + vertex_adapter(path_type const& path) + : path_(path), + itr_(0) {} + + size_type size() const + { + return path_.size(); + } + + unsigned vertex(double* x, double* y) const + { + return path_.cont_.get_vertex(static_cast(itr_++),x,y); + } + + unsigned vertex(std::size_t index, double* x, double* y) const + { + return path_.cont_.get_vertex(index, x, y); + } + + void rewind(unsigned ) const + { + itr_ = 0; + } + + types type() const + { + return path_.type(); + } + + box2d envelope() const + { + box2d result; + double x = 0; + double y = 0; + rewind(0); + size_type path_size = size(); + for (size_type i = 0; i < path_size; ++i) + { + unsigned cmd = vertex(&x,&y); + if (cmd == SEG_CLOSE) continue; + if (i == 0) + { + result.init(x,y,x,y); + } + else + { + result.expand_to_include(x,y); + } + } + return result; + } + path_type const& path_; + mutable size_type itr_; +}; +} + +template +box2d envelope(PathType const& path) +{ + detail::vertex_adapter va(path); + return va.envelope(); +} + +using path_type = detail::path; +using vertex_adapter = detail::vertex_adapter; + +} + +#endif // MAPNIK_PATH_HPP diff --git a/include/mapnik/path_expression.hpp b/include/mapnik/path_expression.hpp index 296348bed..b3dde7dab 100644 --- a/include/mapnik/path_expression.hpp +++ b/include/mapnik/path_expression.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/path_expression_grammar.hpp b/include/mapnik/path_expression_grammar.hpp index f39947ef6..04d422aff 100644 --- a/include/mapnik/path_expression_grammar.hpp +++ b/include/mapnik/path_expression_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #pragma GCC diagnostic pop diff --git a/include/mapnik/path_expression_grammar_impl.hpp b/include/mapnik/path_expression_grammar_impl.hpp index 4801d2014..bc2fcfb52 100644 --- a/include/mapnik/path_expression_grammar_impl.hpp +++ b/include/mapnik/path_expression_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/pixel_position.hpp b/include/mapnik/pixel_position.hpp index 40d00ace8..93cdb4f7f 100644 --- a/include/mapnik/pixel_position.hpp +++ b/include/mapnik/pixel_position.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/pixel_types.hpp b/include/mapnik/pixel_types.hpp new file mode 100644 index 000000000..b0d6304b3 --- /dev/null +++ b/include/mapnik/pixel_types.hpp @@ -0,0 +1,61 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_PIXEL_TYPES_HPP +#define MAPNIK_PIXEL_TYPES_HPP + +#include + +namespace mapnik { + +enum image_dtype : std::uint8_t +{ + image_dtype_rgba8 = 0, + image_dtype_gray8, + image_dtype_gray8s, + image_dtype_gray16, + image_dtype_gray16s, + image_dtype_gray32, + image_dtype_gray32s, + image_dtype_gray32f, + image_dtype_gray64, + image_dtype_gray64s, + image_dtype_gray64f, + image_dtype_null, + IMAGE_DTYPE_MAX +}; + +struct null_t { using type = std::uint8_t; static const image_dtype id = image_dtype_null; }; +struct rgba8_t { using type = std::uint32_t; static const image_dtype id = image_dtype_rgba8; }; +struct gray8_t { using type = std::uint8_t; static const image_dtype id = image_dtype_gray8; }; +struct gray8s_t { using type = std::int8_t; static const image_dtype id = image_dtype_gray8s; }; +struct gray16_t { using type = std::uint16_t; static const image_dtype id = image_dtype_gray16; }; +struct gray16s_t { using type = std::int16_t; static const image_dtype id = image_dtype_gray16s; }; +struct gray32_t { using type = std::uint32_t; static const image_dtype id = image_dtype_gray32; }; +struct gray32s_t { using type = std::int32_t; static const image_dtype id = image_dtype_gray32s; }; +struct gray32f_t { using type = float; static const image_dtype id = image_dtype_gray32f; }; +struct gray64_t { using type = std::uint64_t; static const image_dtype id = image_dtype_gray64; }; +struct gray64s_t { using type = std::int64_t; static const image_dtype id = image_dtype_gray64s; }; +struct gray64f_t { using type = double; static const image_dtype id = image_dtype_gray64f; }; + +} // end ns +#endif // MAPNIK_PIXEL_TYPES_HPP diff --git a/include/mapnik/plugin.hpp b/include/mapnik/plugin.hpp index 4be5f4ff3..a3428de81 100644 --- a/include/mapnik/plugin.hpp +++ b/include/mapnik/plugin.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/png_io.hpp b/include/mapnik/png_io.hpp index 88821eb87..1b075b175 100644 --- a/include/mapnik/png_io.hpp +++ b/include/mapnik/png_io.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,7 @@ #include #include #include -#include +#include // zlib #include // for Z_DEFAULT_COMPRESSION @@ -140,7 +140,7 @@ void save_as_png(T1 & file, const std::unique_ptr row_pointers(new png_bytep[image.height()]); for (unsigned int i = 0; i < image.height(); i++) { - row_pointers[i] = (png_bytep)image.getRow(i); + row_pointers[i] = (png_bytep)image.get_row(i); } png_set_rows(png_ptr, info_ptr, row_pointers.get()); png_write_png(png_ptr, info_ptr, (opts.trans_mode == 0) ? PNG_TRANSFORM_STRIP_FILLER_AFTER : PNG_TRANSFORM_IDENTITY, nullptr); @@ -149,7 +149,7 @@ void save_as_png(T1 & file, template void reduce_8(T const& in, - image_data_gray8 & out, + image_gray8 & out, octree trees[], unsigned limits[], unsigned levels, @@ -166,12 +166,12 @@ void reduce_8(T const& in, } for (unsigned y = 0; y < height; ++y) { - mapnik::image_data_rgba8::pixel_type const * row = in.getRow(y); - mapnik::image_data_gray8::pixel_type * row_out = out.getRow(y); + mapnik::image_rgba8::pixel_type const * row = in.get_row(y); + mapnik::image_gray8::pixel_type * row_out = out.get_row(y); for (unsigned x = 0; x < width; ++x) { unsigned val = row[x]; - byte index = 0; + std::uint8_t index = 0; int idx = -1; for(int j=levels-1; j>0; j--) { @@ -200,7 +200,7 @@ void reduce_8(T const& in, template void reduce_4(T const& in, - image_data_gray8 & out, + image_gray8 & out, octree trees[], unsigned limits[], unsigned levels, @@ -217,12 +217,12 @@ void reduce_4(T const& in, } for (unsigned y = 0; y < height; ++y) { - mapnik::image_data_rgba8::pixel_type const * row = in.getRow(y); - mapnik::image_data_gray8::pixel_type * row_out = out.getRow(y); + mapnik::image_rgba8::pixel_type const * row = in.get_row(y); + mapnik::image_gray8::pixel_type * row_out = out.get_row(y); for (unsigned x = 0; x < width; ++x) { unsigned val = row[x]; - byte index = 0; + std::uint8_t index = 0; int idx=-1; for(int j=levels-1; j>0; j--) { @@ -256,7 +256,7 @@ void reduce_4(T const& in, // 1-bit but only one color. template void reduce_1(T const&, - image_data_gray8 & out, + image_gray8 & out, octree /*trees*/[], unsigned /*limits*/[], std::vector & /*alpha*/) @@ -266,7 +266,7 @@ void reduce_1(T const&, template void save_as_png(T & file, std::vector const& palette, - mapnik::image_data_gray8 const& image, + mapnik::image_gray8 const& image, unsigned width, unsigned height, unsigned color_depth, @@ -350,7 +350,7 @@ void save_as_png(T & file, std::vector const& palette, png_write_info(png_ptr, info_ptr); for (unsigned i=0;i0 && val<255) @@ -503,7 +503,7 @@ void save_as_png8_oct(T1 & file, } for (unsigned y = 0; y < height; ++y) { - typename T2::pixel_type const * row = image.getRow(y); + typename T2::pixel_type const * row = image.get_row(y); for (unsigned x = 0; x < width; ++x) { unsigned val = row[x]; @@ -556,7 +556,7 @@ void save_as_png8_oct(T1 & file, if (palette.size() > 16 ) { // >16 && <=256 colors -> write 8-bit color depth - image_data_gray8 reduced_image(width,height); + image_gray8 reduced_image(width,height); reduce_8(image, reduced_image, trees, limits, TRANSPARENCY_LEVELS, alphaTable); save_as_png(file,palette,reduced_image,width,height,8,alphaTable,opts); } @@ -565,7 +565,7 @@ void save_as_png8_oct(T1 & file, // 1 color image -> write 1-bit color depth PNG unsigned image_width = ((width + 15) >> 3) & ~1U; // 1-bit image, round up to 16-bit boundary unsigned image_height = height; - image_data_gray8 reduced_image(image_width,image_height); + image_gray8 reduced_image(image_width,image_height); reduce_1(image,reduced_image,trees, limits, alphaTable); if (meanAlpha<255 && cols[0]==0) { @@ -579,7 +579,7 @@ void save_as_png8_oct(T1 & file, // <=16 colors -> write 4-bit color depth PNG unsigned image_width = ((width + 7) >> 1) & ~3U; // 4-bit image, round up to 32-bit boundary unsigned image_height = height; - image_data_gray8 reduced_image(image_width,image_height); + image_gray8 reduced_image(image_width,image_height); reduce_4(image, reduced_image, trees, limits, TRANSPARENCY_LEVELS, alphaTable); save_as_png(file,palette,reduced_image,width,height,4,alphaTable,opts); } @@ -600,11 +600,11 @@ void save_as_png8(T1 & file, if (palette.size() > 16 ) { // >16 && <=256 colors -> write 8-bit color depth - image_data_gray8 reduced_image(width, height); + image_gray8 reduced_image(width, height); for (unsigned y = 0; y < height; ++y) { - mapnik::image_data_rgba8::pixel_type const * row = image.getRow(y); - mapnik::image_data_gray8::pixel_type * row_out = reduced_image.getRow(y); + mapnik::image_rgba8::pixel_type const * row = image.get_row(y); + mapnik::image_gray8::pixel_type * row_out = reduced_image.get_row(y); for (unsigned x = 0; x < width; ++x) { row_out[x] = tree.quantize(row[x]); @@ -617,7 +617,7 @@ void save_as_png8(T1 & file, // 1 color image -> write 1-bit color depth PNG unsigned image_width = ((width + 15) >> 3) & ~1U; // 1-bit image, round up to 16-bit boundary unsigned image_height = height; - image_data_gray8 reduced_image(image_width, image_height); + image_gray8 reduced_image(image_width, image_height); reduced_image.set(0); save_as_png(file, palette, reduced_image, width, height, 1, alphaTable, opts); } @@ -626,12 +626,12 @@ void save_as_png8(T1 & file, // <=16 colors -> write 4-bit color depth PNG unsigned image_width = ((width + 7) >> 1) & ~3U; // 4-bit image, round up to 32-bit boundary unsigned image_height = height; - image_data_gray8 reduced_image(image_width, image_height); + image_gray8 reduced_image(image_width, image_height); for (unsigned y = 0; y < height; ++y) { - mapnik::image_data_rgba8::pixel_type const * row = image.getRow(y); - mapnik::image_data_gray8::pixel_type * row_out = reduced_image.getRow(y); - byte index = 0; + mapnik::image_rgba8::pixel_type const * row = image.get_row(y); + mapnik::image_gray8::pixel_type * row_out = reduced_image.get_row(y); + std::uint8_t index = 0; for (unsigned x = 0; x < width; ++x) { @@ -669,7 +669,7 @@ void save_as_png8_hex(T1 & file, for (unsigned y = 0; y < height; ++y) { - typename T2::pixel_type const * row = image.getRow(y); + typename T2::pixel_type const * row = image.get_row(y); for (unsigned x = 0; x < width; ++x) { unsigned val = row[x]; diff --git a/include/mapnik/polygon_clipper.hpp b/include/mapnik/polygon_clipper.hpp deleted file mode 100644 index 91f467051..000000000 --- a/include/mapnik/polygon_clipper.hpp +++ /dev/null @@ -1,238 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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_POLYGON_CLIPPER_HPP -#define MAPNIK_POLYGON_CLIPPER_HPP - -// stl -#include -#include -#include - -// mapnik -#include -#include -#include -#include - -// boost -#include - -namespace mapnik { - -using namespace boost::geometry; - -template -struct polygon_clipper -{ - using point_2d = mapnik::coord2d; - using polygon_2d = model::polygon; - using polygon_list = std::deque; - - enum - { - clip = 1, - no_clip = 2, - ignore = 3 - - } state_; - - polygon_clipper(Geometry & geom) - : state_(clip), - clip_box_(), - geom_(geom) - { - - } - - polygon_clipper(box2d const& clip_box, Geometry & geom) - :state_(clip), - clip_box_(clip_box), - geom_(geom) - { - init(); - } - - void set_clip_box(box2d const& clip_box) - { - state_ = clip; - clip_box_ = clip_box; - init(); - } - - unsigned type() const - { - return geom_.type(); - } - - void rewind(unsigned path_id) - { - if (state_ == clip) output_.rewind(path_id); - else geom_.rewind(path_id); - } - - unsigned vertex (double * x, double * y) - { - switch (state_) - { - case clip: - return output_.vertex(x,y); - case no_clip: - return geom_.vertex(x,y); - case ignore: - return SEG_END; - } - return SEG_END; - } - -private: - - void init() - { - geom_.rewind(0); - box2d bbox = geom_.envelope(); - if (clip_box_.contains(bbox)) - { - // shortcut to original geometry (no-clipping) - state_ = no_clip; - return; - } - else if (!clip_box_.intersects(bbox)) - { - // polygon is outside of clipping box - state_ = ignore; - return; - } - - polygon_2d subject_poly; - double x = 0; - double y = 0; - double prev_x = 0; - double prev_y = 0; - geom_.rewind(0); - unsigned ring_count = 0; - while (true) - { - unsigned cmd = geom_.vertex(&x,&y); - if (cmd == SEG_END) break; - if (cmd == SEG_MOVETO) - { - prev_x = x; - prev_y = y; - if (ring_count == 0) - { - append(subject_poly, make(x,y)); - } - else - { - subject_poly.inners().push_back(polygon_2d::inner_container_type::value_type()); - append(subject_poly.inners().back(),make(x,y)); - } - ++ring_count; - } - else if (cmd == SEG_LINETO) - { - if (std::abs(x - prev_x) < 1e-12 && std::abs(y - prev_y) < 1e-12) - { -#ifdef MAPNIK_LOG - MAPNIK_LOG_WARN(polygon_clipper) - << std::setprecision(12) << "coincident vertices:(" << prev_x << "," - << prev_y << ") , (" << x << "," << y << ")"; -#endif - continue; - } - prev_x = x; - prev_y = y; - if (ring_count == 1) - { - append(subject_poly, make(x,y)); - } - else - { - append(subject_poly.inners().back(),make(x,y)); - } - } - } - - polygon_list clipped_polygons; -#ifdef MAPNIK_LOG - double area = boost::geometry::area(subject_poly); - if (area < 0) - { - MAPNIK_LOG_ERROR(polygon_clipper) << "negative area detected for polygon indicating incorrect winding order"; - } -#endif - try - { - boost::geometry::intersection(clip_box_, subject_poly, clipped_polygons); - } - catch (boost::geometry::exception const& ex) - { - std::cerr << ex.what() << std::endl; - } - - for (polygon_2d const& poly : clipped_polygons) - { - bool move_to = true; - for (point_2d const& c : boost::geometry::exterior_ring(poly)) - { - if (move_to) - { - move_to = false; - output_.move_to(c.x,c.y); - } - else - { - output_.line_to(c.x,c.y); - } - } - output_.close_path(); - // interior rings - for (polygon_2d::inner_container_type::value_type const& ring : boost::geometry::interior_rings(poly)) - { - move_to = true; - for (point_2d const& c : ring) - { - if (move_to) - { - move_to = false; - output_.move_to(c.x,c.y); - } - else - { - output_.line_to(c.x,c.y); - } - } - output_.close_path(); - } - } - } - - box2d clip_box_; - Geometry & geom_; - mapnik::geometry_type output_; - -}; - -} - -#endif //MAPNIK_POLYGON_CLIPPER_HPP diff --git a/include/mapnik/pool.hpp b/include/mapnik/pool.hpp index 87580b262..ecd16eb34 100644 --- a/include/mapnik/pool.hpp +++ b/include/mapnik/pool.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,8 +24,7 @@ #define MAPNIK_POOL_HPP // mapnik -#include -#include +#include #include // boost @@ -71,7 +70,7 @@ public: HolderType borrowObject() { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif typename ContType::iterator itr=pool_.begin(); @@ -106,7 +105,7 @@ public: unsigned size() const { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif return pool_.size(); } @@ -114,7 +113,7 @@ public: unsigned max_size() const { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif return maxSize_; } @@ -122,7 +121,7 @@ public: void set_max_size(unsigned size) { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif maxSize_ = std::max(maxSize_,size); } @@ -130,7 +129,7 @@ public: unsigned initial_size() const { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif return initialSize_; } @@ -138,7 +137,7 @@ public: void set_initial_size(unsigned size) { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif if (size > initialSize_) { diff --git a/include/mapnik/proj_strategy.hpp b/include/mapnik/proj_strategy.hpp new file mode 100644 index 000000000..9bfd2e15e --- /dev/null +++ b/include/mapnik/proj_strategy.hpp @@ -0,0 +1,112 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_PROJ_STRATEGY_HPP +#define MAPNIK_PROJ_STRATEGY_HPP + +// mapnik +#include +#include +#include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" +#include +#include +#include +#pragma GCC diagnostic pop + + +namespace mapnik { + +namespace geometry { +template struct point; +template struct line_string; +} +class projection; +template class box2d; + +struct proj_strategy +{ + proj_strategy(proj_transform const& prj_trans) + : prj_trans_(prj_trans) {} + + template + inline bool apply(P1 const& p1, P2 & p2) const + { + using p2_type = typename boost::geometry::coordinate_type::type; + double x = boost::geometry::get<0>(p1); + double y = boost::geometry::get<1>(p1); + double z = 0.0; + if (!prj_trans_.forward(x, y, z)) return false; + boost::geometry::set<0>(p2, static_cast(x)); + boost::geometry::set<1>(p2, static_cast(y)); + return true; + } + + template + inline P2 execute(P1 const& p1, bool & status) const + { + P2 p2; + status = apply(p1, p2); + return p2; + } + + proj_transform const& prj_trans_; +}; + +struct proj_backward_strategy +{ + proj_backward_strategy(proj_transform const& prj_trans) + : prj_trans_(prj_trans) {} + + template + inline bool apply(P1 const& p1, P2 & p2) const + { + using p2_type = typename boost::geometry::coordinate_type::type; + double x = boost::geometry::get<0>(p1); + double y = boost::geometry::get<1>(p1); + double z = 0.0; + if (!prj_trans_.backward(x, y, z)) return false; + boost::geometry::set<0>(p2, static_cast(x)); + boost::geometry::set<1>(p2, static_cast(y)); + return true; + } + + template + inline P2 execute(P1 const& p1, bool & status) const + { + P2 p2; + status = apply(p1, p2); + return p2; + } + + proj_transform const& prj_trans_; +}; + +} + +#endif // MAPNIK_PROJ_STRATEGY_HPP diff --git a/include/mapnik/proj_transform.hpp b/include/mapnik/proj_transform.hpp index aa32a1aa0..3247a15e3 100644 --- a/include/mapnik/proj_transform.hpp +++ b/include/mapnik/proj_transform.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,6 +29,10 @@ namespace mapnik { +namespace geometry { +template struct point; +template struct line_string; +} class projection; template class box2d; @@ -39,10 +43,15 @@ public: projection const& dest); bool equal() const; + bool is_known() const; bool forward (double& x, double& y , double& z) const; bool backward (double& x, double& y , double& z) const; - bool forward (double *x, double *y , double *z, int point_count) const; - bool backward (double *x, double *y , double *z, int point_count) const; + bool forward (double *x, double *y , double *z, int point_count, int offset = 1) const; + bool backward (double *x, double *y , double *z, int point_count, int offset = 1) const; + bool forward (geometry::point & p) const; + bool backward (geometry::point & p) const; + unsigned int forward (geometry::line_string & ls) const; + unsigned int backward (geometry::line_string & ls) const; bool forward (box2d & box) const; bool backward (box2d & box) const; bool forward (box2d & box, int points) const; @@ -59,6 +68,7 @@ private: bool wgs84_to_merc_; bool merc_to_wgs84_; }; + } #endif // MAPNIK_PROJ_TRANSFORM_HPP diff --git a/include/mapnik/projection.hpp b/include/mapnik/projection.hpp index 5267dd702..cb4284fb0 100644 --- a/include/mapnik/projection.hpp +++ b/include/mapnik/projection.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/ptree_helpers.hpp b/include/mapnik/ptree_helpers.hpp index fe1a1de50..3062d7115 100644 --- a/include/mapnik/ptree_helpers.hpp +++ b/include/mapnik/ptree_helpers.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/quad_tree.hpp b/include/mapnik/quad_tree.hpp index d8d405434..d46faa28c 100644 --- a/include/mapnik/quad_tree.hpp +++ b/include/mapnik/quad_tree.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,14 +26,7 @@ // mapnik #include #include - -// boost -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#include -#pragma GCC diagnostic pop - +#include // stl #include #include @@ -86,17 +79,16 @@ class quad_tree : util::noncopyable ~node () {} }; - using nodes_t = boost::ptr_vector; + using nodes_t = std::vector >; using cont_t = typename node::cont_t; using node_data_iterator = typename cont_t::iterator; public: using iterator = typename nodes_t::iterator; using const_iterator = typename nodes_t::const_iterator; - using result_t = typename boost::ptr_vector; + using result_t = typename std::vector >; using query_iterator = typename result_t::iterator; - explicit quad_tree(box2d const& ext, unsigned int max_depth = 8, double ratio = 0.55) @@ -105,8 +97,8 @@ public: query_result_(), nodes_() { - nodes_.push_back(new node(ext)); - root_ = &nodes_[0]; + nodes_.push_back(std::make_unique(ext)); + root_ = nodes_[0].get(); } void insert(T data, box2d const& box) @@ -118,7 +110,7 @@ public: query_iterator query_in_box(box2d const& box) { query_result_.clear(); - query_node(box,query_result_,root_); + query_node(box, query_result_, root_); return query_result_.begin(); } @@ -142,8 +134,8 @@ public: { box2d ext = root_->extent_; nodes_.clear(); - nodes_.push_back(new node(ext)); - root_ = &nodes_[0]; + nodes_.push_back(std::make_unique(ext)); + root_ = nodes_[0].get(); } box2d const& extent() const @@ -160,12 +152,9 @@ private: box2d const& node_extent = node_->extent(); if (box.intersects(node_extent)) { - node_data_iterator i=node_->begin(); - node_data_iterator end=node_->end(); - while ( i!=end) + for (auto & n : *node_) { - result.push_back(&(*i)); - ++i; + result.push_back(std::ref(n)); } for (int k = 0; k < 4; ++k) { @@ -186,14 +175,14 @@ private: box2d const& node_extent = n->extent(); box2d ext[4]; split_box(node_extent,ext); - for (int i=0;i<4;++i) + for (int i = 0; i < 4; ++i) { if (ext[i].contains(box)) { if (!n->children_[i]) { - nodes_.push_back(new node(ext[i])); - n->children_[i]=&nodes_.back(); + nodes_.push_back(std::make_unique(ext[i])); + n->children_[i]=nodes_.back().get(); } do_insert_data(data,box,n->children_[i],depth); return; @@ -205,8 +194,6 @@ private: void split_box(box2d const& node_extent,box2d * ext) { - //coord2d c=node_extent.center(); - double width=node_extent.width(); double height=node_extent.height(); diff --git a/include/mapnik/query.hpp b/include/mapnik/query.hpp index 4c9455e16..5d5a6e7c8 100644 --- a/include/mapnik/query.hpp +++ b/include/mapnik/query.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/raster.hpp b/include/mapnik/raster.hpp index 8fafd27b2..311c06cf0 100644 --- a/include/mapnik/raster.hpp +++ b/include/mapnik/raster.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,7 @@ // mapnik #include -#include +#include #include #include // boost @@ -37,20 +37,17 @@ class raster : private util::noncopyable { public: box2d ext_; - image_data_any data_; + image_any data_; double filter_factor_; - bool premultiplied_alpha_; boost::optional nodata_; template raster(box2d const& ext, ImageData && data, - double filter_factor, - bool premultiplied_alpha = false) + double filter_factor) : ext_(ext), data_(std::move(data)), - filter_factor_(filter_factor), - premultiplied_alpha_(premultiplied_alpha) {} + filter_factor_(filter_factor) {} void set_nodata(double nodata) { diff --git a/include/mapnik/raster_colorizer.hpp b/include/mapnik/raster_colorizer.hpp index fe66769b8..c1e83aba1 100644 --- a/include/mapnik/raster_colorizer.hpp +++ b/include/mapnik/raster_colorizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -40,7 +40,7 @@ #include #include #include -#include +#include // boost #include // boost @@ -198,7 +198,7 @@ public: colorizer_stops const& get_stops() const { return stops_; } template - void colorize(image_data_rgba8 & out, T const& in, boost::optionalconst& nodata, feature_impl const& f) const; + void colorize(image_rgba8 & out, T const& in, boost::optionalconst& nodata, feature_impl const& f) const; //! \brief Perform the translation of input to output //! diff --git a/include/mapnik/renderer_common.hpp b/include/mapnik/renderer_common.hpp index ab74956b2..213443899 100644 --- a/include/mapnik/renderer_common.hpp +++ b/include/mapnik/renderer_common.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/renderer_common/apply_vertex_converter.hpp b/include/mapnik/renderer_common/apply_vertex_converter.hpp new file mode 100644 index 000000000..de239c95b --- /dev/null +++ b/include/mapnik/renderer_common/apply_vertex_converter.hpp @@ -0,0 +1,44 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_APPLY_VERTEX_ADAPTER_HPP +#define MAPNIK_APPLY_VERTEX_ADAPTER_HPP + +namespace mapnik { namespace detail { + +template +struct apply_vertex_converter +{ + apply_vertex_converter(VertexConverter & converter, Processor & proc) + : converter_(converter), proc_(proc) {} + template + void operator() (Adapter const& adapter) const + { + converter_.apply(adapter, proc_); + } + VertexConverter & converter_; + Processor & proc_; +}; + +}} + +#endif // MAPNIK_APPLY_VERTEX_ADAPTER_HPP diff --git a/include/mapnik/renderer_common/clipping_extent.hpp b/include/mapnik/renderer_common/clipping_extent.hpp index b8dd70bfa..aabacf36f 100644 --- a/include/mapnik/renderer_common/clipping_extent.hpp +++ b/include/mapnik/renderer_common/clipping_extent.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/renderer_common/pattern_alignment.hpp b/include/mapnik/renderer_common/pattern_alignment.hpp new file mode 100644 index 000000000..12f746d32 --- /dev/null +++ b/include/mapnik/renderer_common/pattern_alignment.hpp @@ -0,0 +1,68 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_PATTERN_ALIGNMENT_HPP +#define MAPNIK_PATTERN_ALIGNMENT_HPP + +#include + +namespace mapnik { namespace detail { + +struct apply_local_alignment +{ + apply_local_alignment(view_transform const& t, + proj_transform const& prj_trans, + box2d const& clip_box, + double & x, double & y) + : t_(t), + prj_trans_(prj_trans), + clip_box_(clip_box), + x_(x), + y_(y) {} + + void operator() (geometry::polygon_vertex_adapter & va) + { + using clipped_geometry_type = agg::conv_clip_polygon >; + using path_type = transform_path_adapter; + clipped_geometry_type clipped(va); + clipped.clip_box(clip_box_.minx(),clip_box_.miny(),clip_box_.maxx(),clip_box_.maxy()); + path_type path(t_, clipped, prj_trans_); + path.vertex(&x_,&y_); + } + + template + void operator() (Adapter &) + { + // no-op + } + + view_transform const& t_; + proj_transform const& prj_trans_; + box2d const& clip_box_; + double & x_; + double & y_; +}; + +}} + +#endif // MAPNIK_PATTERN_ALIGNMENT_HPP diff --git a/include/mapnik/renderer_common/process_building_symbolizer.hpp b/include/mapnik/renderer_common/process_building_symbolizer.hpp index 25d8e0857..6b0a94f79 100644 --- a/include/mapnik/renderer_common/process_building_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_building_symbolizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,88 +25,107 @@ #include #include -#include +#include +#include #include #include namespace mapnik { +namespace detail { + template -void render_building_symbolizer(mapnik::feature_impl &feature, +void make_building(geometry::polygon const& poly, double height, F1 const& face_func, F2 const& frame_func, F3 const& roof_func) +{ + const std::unique_ptr frame(new path_type(path_type::types::LineString)); + const std::unique_ptr roof(new path_type(path_type::types::Polygon)); + std::deque face_segments; + double x0 = 0; + double y0 = 0; + double x,y; + geometry::polygon_vertex_adapter va(poly); + va.rewind(0); + for (unsigned cm = va.vertex(&x, &y); cm != SEG_END; + cm = va.vertex(&x, &y)) + { + if (cm == SEG_MOVETO) + { + frame->move_to(x,y); + } + else if (cm == SEG_LINETO) + { + frame->line_to(x,y); + face_segments.push_back(segment_t(x0,y0,x,y)); + } + else if (cm == SEG_CLOSE) + { + frame->close_path(); + } + x0 = x; + y0 = y; + } + + std::sort(face_segments.begin(),face_segments.end(), y_order); + for (auto const& seg : face_segments) + { + const std::unique_ptr faces(new path_type(path_type::types::Polygon)); + faces->move_to(std::get<0>(seg),std::get<1>(seg)); + faces->line_to(std::get<2>(seg),std::get<3>(seg)); + faces->line_to(std::get<2>(seg),std::get<3>(seg) + height); + faces->line_to(std::get<0>(seg),std::get<1>(seg) + height); + + face_func(*faces); + // + frame->move_to(std::get<0>(seg),std::get<1>(seg)); + frame->line_to(std::get<0>(seg),std::get<1>(seg)+height); + } + + va.rewind(0); + for (unsigned cm = va.vertex(&x, &y); cm != SEG_END; + cm = va.vertex(&x, &y)) + { + if (cm == SEG_MOVETO) + { + frame->move_to(x,y+height); + roof->move_to(x,y+height); + } + else if (cm == SEG_LINETO) + { + frame->line_to(x,y+height); + roof->line_to(x,y+height); + } + else if (cm == SEG_CLOSE) + { + frame->close_path(); + roof->close_path(); + } + } + + frame_func(*frame); + roof_func(*roof); +} + +} // ns detail + +template +void render_building_symbolizer(mapnik::feature_impl const& feature, double height, F1 face_func, F2 frame_func, F3 roof_func) { - for (auto const& geom : feature.paths()) + + auto const& geom = feature.get_geometry(); + if (geom.is >()) { - if (geom.size() > 2) + auto const& poly = geom.get >(); + detail::make_building(poly, height, face_func, frame_func, roof_func); + } + else if (geom.is >()) + { + auto const& multi_poly = geom.get >(); + for (auto const& poly : multi_poly) { - const std::unique_ptr frame(new geometry_type(geometry_type::types::LineString)); - const std::unique_ptr roof(new geometry_type(geometry_type::types::Polygon)); - std::deque face_segments; - double x0 = 0; - double y0 = 0; - double x,y; - geom.rewind(0); - for (unsigned cm = geom.vertex(&x, &y); cm != SEG_END; - cm = geom.vertex(&x, &y)) - { - if (cm == SEG_MOVETO) - { - frame->move_to(x,y); - } - else if (cm == SEG_LINETO) - { - frame->line_to(x,y); - face_segments.push_back(segment_t(x0,y0,x,y)); - } - else if (cm == SEG_CLOSE) - { - frame->close_path(); - } - x0 = x; - y0 = y; - } - - std::sort(face_segments.begin(),face_segments.end(), y_order); - for (auto const& seg : face_segments) - { - const std::unique_ptr faces(new geometry_type(geometry_type::types::Polygon)); - faces->move_to(std::get<0>(seg),std::get<1>(seg)); - faces->line_to(std::get<2>(seg),std::get<3>(seg)); - faces->line_to(std::get<2>(seg),std::get<3>(seg) + height); - faces->line_to(std::get<0>(seg),std::get<1>(seg) + height); - - face_func(*faces); - // - frame->move_to(std::get<0>(seg),std::get<1>(seg)); - frame->line_to(std::get<0>(seg),std::get<1>(seg)+height); - - } - - geom.rewind(0); - for (unsigned cm = geom.vertex(&x, &y); cm != SEG_END; - cm = geom.vertex(&x, &y)) - { - if (cm == SEG_MOVETO) - { - frame->move_to(x,y+height); - roof->move_to(x,y+height); - } - else if (cm == SEG_LINETO) - { - frame->line_to(x,y+height); - roof->line_to(x,y+height); - } - else if (cm == SEG_CLOSE) - { - frame->close_path(); - roof->close_path(); - } - } - - frame_func(*frame); - roof_func(*roof); + detail::make_building(poly, height, face_func, frame_func, roof_func); } } } diff --git a/include/mapnik/renderer_common/process_group_symbolizer.hpp b/include/mapnik/renderer_common/process_group_symbolizer.hpp index 348302ef8..006d1a9f3 100644 --- a/include/mapnik/renderer_common/process_group_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_group_symbolizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,8 +25,7 @@ // mapnik #include -#include -#include +#include #include #include #include @@ -42,15 +41,12 @@ #include #include #include -#include // agg #include namespace mapnik { -class proj_transform; -struct glyph_info; class text_symbolizer_helper; using svg::svg_path_adapter; @@ -97,7 +93,7 @@ struct virtual_renderer_common : private util::noncopyable // This should allow us to re-use as much as possible of the // existing symbolizer layout and rendering code while still // being able to interpose our own decisions about whether -// a collision has occured or not. +// a collision has occurred or not. // Thunk for rendering a particular instance of a point - this // stores all the arguments necessary to re-render this point @@ -119,35 +115,24 @@ struct vector_marker_render_thunk : util::noncopyable composite_mode_e comp_op, bool snap_to_pixels); - vector_marker_render_thunk(vector_marker_render_thunk && rhs) - : src_(std::move(rhs.src_)), - attrs_(std::move(rhs.attrs_)), - tr_(std::move(rhs.tr_)), - opacity_(std::move(rhs.opacity_)), - comp_op_(std::move(rhs.comp_op_)), - snap_to_pixels_(std::move(rhs.snap_to_pixels_)) {} + vector_marker_render_thunk(vector_marker_render_thunk && rhs); }; struct raster_marker_render_thunk : util::noncopyable { - image_data_rgba8 & src_; + image_rgba8 const& src_; agg::trans_affine tr_; double opacity_; composite_mode_e comp_op_; bool snap_to_pixels_; - raster_marker_render_thunk(image_data_rgba8 & src, + raster_marker_render_thunk(image_rgba8 const& src, agg::trans_affine const& marker_trans, double opacity, composite_mode_e comp_op, bool snap_to_pixels); - raster_marker_render_thunk(raster_marker_render_thunk && rhs) - : src_(rhs.src_), - tr_(std::move(rhs.tr_)), - opacity_(std::move(rhs.opacity_)), - comp_op_(std::move(rhs.comp_op_)), - snap_to_pixels_(std::move(rhs.snap_to_pixels_)) {} + raster_marker_render_thunk(raster_marker_render_thunk && rhs); }; using helper_ptr = std::unique_ptr; @@ -166,12 +151,7 @@ struct text_render_thunk : util::noncopyable double opacity, composite_mode_e comp_op, halo_rasterizer_enum halo_rasterizer); - text_render_thunk(text_render_thunk && rhs) - : helper_(std::move(rhs.helper_)), - placements_(std::move(rhs.placements_)), - opacity_(std::move(rhs.opacity_)), - comp_op_(std::move(rhs.comp_op_)), - halo_rasterizer_(std::move(rhs.halo_rasterizer_)) {} + text_render_thunk(text_render_thunk && rhs); }; @@ -226,9 +206,6 @@ private: void update_box() const; }; -geometry_type *origin_point(proj_transform const& prj_trans, - renderer_common const& common); - template void render_offset_placements(placements_list const& placements, pixel_position const& offset, @@ -241,7 +218,7 @@ void render_offset_placements(placements_list const& placements, glyphs->set_base_point(base_point + offset); // update the position of any marker - marker_info_ptr marker_info = glyphs->marker(); + marker_info_ptr marker_info = glyphs->get_marker(); pixel_position marker_pos = glyphs->marker_pos(); if (marker_info) { @@ -303,9 +280,9 @@ void render_group_symbolizer(group_symbolizer const& sym, // run feature or sub feature through the group rules & symbolizers // for each index value in the range - int start = get(sym, keys::start_column); - int end = start + get(sym, keys::num_columns); - for (int col_idx = start; col_idx < end; ++col_idx) + value_integer start = get(sym, keys::start_column); + value_integer end = start + get(sym, keys::num_columns); + for (value_integer col_idx = start; col_idx < end; ++col_idx) { // create sub feature with indexed column values feature_ptr sub_feature = feature_factory::create(sub_feature_ctx, col_idx); @@ -318,7 +295,7 @@ void render_group_symbolizer(group_symbolizer const& sym, if (col_name.size() == 1) { // column name is '%' by itself, so give the index as the value - sub_feature->put(col_name, (value_integer)col_idx); + sub_feature->put(col_name, col_idx); } else { @@ -340,8 +317,15 @@ void render_group_symbolizer(group_symbolizer const& sym, } // add a single point geometry at pixel origin - sub_feature->add_geometry(origin_point(prj_trans, common)); - + double x = common.width_ / 2.0, y = common.height_ / 2.0, z = 0.0; + common.t_.backward(&x, &y); + prj_trans.forward(x, y, z); + // note that we choose a point in the middle of the screen to + // try to ensure that we don't get edge artefacts due to any + // symbolizers with avoid-edges set: only the avoid-edges of + // the group symbolizer itself should matter. + geometry::point origin_pt(x,y); + sub_feature->set_geometry(origin_pt); // get the layout for this set of properties for (auto const& rule : props->get_rules()) { @@ -357,10 +341,10 @@ void render_group_symbolizer(group_symbolizer const& sym, render_thunk_extractor extractor(bounds, thunks, *sub_feature, common.vars_, prj_trans, virtual_renderer, clipping_extent); - for (auto const& sym : *rule) + for (auto const& _sym : *rule) { // TODO: construct layout and obtain bounding box - util::apply_visitor(extractor, sym); + util::apply_visitor(extractor, _sym); } // add the bounding box to the layout manager @@ -393,7 +377,7 @@ void render_group_symbolizer(group_symbolizer const& sym, rpt_key_expr = get(sym, keys::repeat_key); } - // evalute the repeat key with the matched sub feature if we have one + // evaluate the repeat key with the matched sub feature if we have one if (rpt_key_expr) { rpt_key_value = util::apply_visitor(evaluate(*match_feature,common.vars_), diff --git a/include/mapnik/renderer_common/process_markers_symbolizer.hpp b/include/mapnik/renderer_common/process_markers_symbolizer.hpp index f62687ab9..9d0852675 100644 --- a/include/mapnik/renderer_common/process_markers_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_markers_symbolizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,15 +23,229 @@ #ifndef MAPNIK_RENDERER_COMMON_PROCESS_MARKERS_SYMBOLIZER_HPP #define MAPNIK_RENDERER_COMMON_PROCESS_MARKERS_SYMBOLIZER_HPP -#include #include #include #include #include #include +#include namespace mapnik { +template +struct render_marker_symbolizer_visitor +{ + using vector_dispatch_type = VD; + using raster_dispatch_type = RD; + using buffer_type = typename std::tuple_element<0,ContextType>::type; + + using vertex_converter_type = vertex_converter; + + render_marker_symbolizer_visitor(std::string const& filename, + markers_symbolizer const& sym, + mapnik::feature_impl & feature, + proj_transform const& prj_trans, + RendererType const& common, + box2d const& clip_box, + ContextType const& renderer_context) + : filename_(filename), + sym_(sym), + feature_(feature), + prj_trans_(prj_trans), + common_(common), + clip_box_(clip_box), + renderer_context_(renderer_context) {} + + void operator() (marker_null const&) {} + + void operator() (marker_svg const& mark) + { + using namespace mapnik::svg; + bool clip = get(sym_, feature_, common_.vars_); + double offset = get(sym_, feature_, common_.vars_); + double simplify_tolerance = get(sym_, feature_, common_.vars_); + double smooth = get(sym_, feature_, common_.vars_); + + // https://github.com/mapnik/mapnik/issues/1316 + bool snap_to_pixels = !mapnik::marker_cache::instance().is_uri(filename_); + + agg::trans_affine geom_tr; + auto transform = get_optional(sym_, keys::geometry_transform); + if (transform) evaluate_transform(geom_tr, feature_, common_.vars_, *transform, common_.scale_factor_); + agg::trans_affine image_tr = agg::trans_affine_scaling(common_.scale_factor_); + + boost::optional const& stock_vector_marker = mark.get_data(); + + // special case for simple ellipse markers + // to allow for full control over rx/ry dimensions + if (filename_ == "shape://ellipse" + && (has_key(sym_,keys::width) || has_key(sym_,keys::height))) + { + svg_path_ptr marker_ellipse = std::make_shared(); + vertex_stl_adapter stl_storage(marker_ellipse->source()); + svg_path_adapter svg_path(stl_storage); + build_ellipse(sym_, feature_, common_.vars_, *marker_ellipse, svg_path); + svg_attribute_type attributes; + bool result = push_explicit_style( (*stock_vector_marker)->attributes(), attributes, sym_, feature_, common_.vars_); + auto image_transform = get_optional(sym_, keys::image_transform); + if (image_transform) evaluate_transform(image_tr, feature_, common_.vars_, *image_transform); + vector_dispatch_type rasterizer_dispatch(marker_ellipse, + svg_path, + result ? attributes : (*stock_vector_marker)->attributes(), + image_tr, + sym_, + *common_.detector_, + common_.scale_factor_, + feature_, + common_.vars_, + snap_to_pixels, + renderer_context_); + + vertex_converter_type converter(clip_box_, + sym_, + common_.t_, + prj_trans_, + geom_tr, + feature_, + common_.vars_, + common_.scale_factor_); + if (clip) // optional clip (default: true) + { + geometry::geometry_types type = geometry::geometry_type(feature_.get_geometry()); + if (type == geometry::geometry_types::Polygon) + converter.template set(); + else if (type == geometry::geometry_types::LineString) + converter.template set(); + } + + converter.template set(); //always transform + if (std::fabs(offset) > 0.0) converter.template set(); // parallel offset + converter.template set(); // optional affine transform + if (simplify_tolerance > 0.0) converter.template set(); // optional simplify converter + if (smooth > 0.0) converter.template set(); // optional smooth converter + apply_markers_multi(feature_, common_.vars_, converter, rasterizer_dispatch, sym_); + } + else + { + box2d const& bbox = mark.bounding_box(); + setup_transform_scaling(image_tr, bbox.width(), bbox.height(), feature_, common_.vars_, sym_); + auto image_transform = get_optional(sym_, keys::image_transform); + if (image_transform) evaluate_transform(image_tr, feature_, common_.vars_, *image_transform); + vertex_stl_adapter stl_storage((*stock_vector_marker)->source()); + svg_path_adapter svg_path(stl_storage); + svg_attribute_type attributes; + bool result = push_explicit_style( (*stock_vector_marker)->attributes(), attributes, sym_, feature_, common_.vars_); + vector_dispatch_type rasterizer_dispatch(*stock_vector_marker, + svg_path, + result ? attributes : (*stock_vector_marker)->attributes(), + image_tr, + sym_, + *common_.detector_, + common_.scale_factor_, + feature_, + common_.vars_, + snap_to_pixels, + renderer_context_); + + vertex_converter_type converter(clip_box_, + sym_, + common_.t_, + prj_trans_, + geom_tr, + feature_, + common_.vars_, + common_.scale_factor_); + if (clip) // optional clip (default: true) + { + geometry::geometry_types type = geometry::geometry_type(feature_.get_geometry()); + if (type == geometry::geometry_types::Polygon || type == geometry::geometry_types::MultiPolygon) + converter.template set(); + else if (type == geometry::geometry_types::LineString || type == geometry::geometry_types::MultiLineString) + converter.template set(); + } + + converter.template set(); //always transform + if (std::fabs(offset) > 0.0) converter.template set(); // parallel offset + converter.template set(); // optional affine transform + if (simplify_tolerance > 0.0) converter.template set(); // optional simplify converter + if (smooth > 0.0) converter.template set(); // optional smooth converter + apply_markers_multi(feature_, common_.vars_, converter, rasterizer_dispatch, sym_); + } + } + + void operator() (marker_rgba8 const& mark) + { + using namespace mapnik::svg; + bool clip = get(sym_, feature_, common_.vars_); + double offset = get(sym_, feature_, common_.vars_); + double simplify_tolerance = get(sym_, feature_, common_.vars_); + double smooth = get(sym_, feature_, common_.vars_); + + agg::trans_affine geom_tr; + auto transform = get_optional(sym_, keys::geometry_transform); + if (transform) evaluate_transform(geom_tr, feature_, common_.vars_, *transform, common_.scale_factor_); + agg::trans_affine image_tr = agg::trans_affine_scaling(common_.scale_factor_); + + setup_transform_scaling(image_tr, mark.width(), mark.height(), feature_, common_.vars_, sym_); + auto image_transform = get_optional(sym_, keys::image_transform); + if (image_transform) evaluate_transform(image_tr, feature_, common_.vars_, *image_transform); + box2d const& bbox = mark.bounding_box(); + mapnik::image_rgba8 const& marker = mark.get_data(); + // - clamp sizes to > 4 pixels of interactivity + coord2d center = bbox.center(); + agg::trans_affine_translation recenter(-center.x, -center.y); + agg::trans_affine marker_trans = recenter * image_tr; + raster_dispatch_type rasterizer_dispatch(marker, + marker_trans, + sym_, + *common_.detector_, + common_.scale_factor_, + feature_, + common_.vars_, + renderer_context_); + + + vertex_converter_type converter(clip_box_, + sym_, + common_.t_, + prj_trans_, + geom_tr, + feature_, + common_.vars_, + common_.scale_factor_); + + if (clip) // optional clip (default: true) + { + geometry::geometry_types type = geometry::geometry_type(feature_.get_geometry()); + if (type == geometry::geometry_types::Polygon) + converter.template set(); + else if (type == geometry::geometry_types::LineString) + converter.template set(); + } + converter.template set(); //always transform + if (std::fabs(offset) > 0.0) converter.template set(); // parallel offset + converter.template set(); // optional affine transform + if (simplify_tolerance > 0.0) converter.template set(); // optional simplify converter + if (smooth > 0.0) converter.template set(); // optional smooth converter + apply_markers_multi(feature_, common_.vars_, converter, rasterizer_dispatch, sym_); + } + + private: + std::string const& filename_; + markers_symbolizer const& sym_; + mapnik::feature_impl & feature_; + proj_transform const& prj_trans_; + RendererType const& common_; + box2d const& clip_box_; + ContextType const& renderer_context_; +}; + template void render_markers_symbolizer(markers_symbolizer const& sym, mapnik::feature_impl & feature, @@ -41,167 +255,18 @@ void render_markers_symbolizer(markers_symbolizer const& sym, ContextType const& renderer_context) { using namespace mapnik::svg; - using vector_dispatch_type = VD; - using raster_dispatch_type = RD; - std::string filename = get(sym, keys::file, feature, common.vars_, "shape://ellipse"); - bool clip = get(sym, feature, common.vars_); - double offset = get(sym, feature, common.vars_); - double simplify_tolerance = get(sym, feature, common.vars_); - double smooth = get(sym, feature, common.vars_); - - // https://github.com/mapnik/mapnik/issues/1316 - bool snap_to_pixels = !mapnik::marker_cache::instance().is_uri(filename); if (!filename.empty()) { - boost::optional mark = mapnik::marker_cache::instance().find(filename, true); - if (mark && *mark) - { - agg::trans_affine geom_tr; - auto transform = get_optional(sym, keys::geometry_transform); - if (transform) evaluate_transform(geom_tr, feature, common.vars_, *transform, common.scale_factor_); - agg::trans_affine image_tr = agg::trans_affine_scaling(common.scale_factor_); - - if ((*mark)->is_vector()) - { - boost::optional const& stock_vector_marker = (*mark)->get_vector_data(); - - // special case for simple ellipse markers - // to allow for full control over rx/ry dimensions - if (filename == "shape://ellipse" - && (has_key(sym,keys::width) || has_key(sym,keys::height))) - { - svg_path_ptr marker_ellipse = std::make_shared(); - vertex_stl_adapter stl_storage(marker_ellipse->source()); - svg_path_adapter svg_path(stl_storage); - build_ellipse(sym, feature, common.vars_, *marker_ellipse, svg_path); - svg_attribute_type attributes; - bool result = push_explicit_style( (*stock_vector_marker)->attributes(), attributes, sym, feature, common.vars_); - auto image_transform = get_optional(sym, keys::image_transform); - if (image_transform) evaluate_transform(image_tr, feature, common.vars_, *image_transform); - vector_dispatch_type rasterizer_dispatch(marker_ellipse, - svg_path, - result ? attributes : (*stock_vector_marker)->attributes(), - image_tr, - sym, - *common.detector_, - common.scale_factor_, - feature, - common.vars_, - snap_to_pixels, - renderer_context); - - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,geom_tr,feature,common.vars_,common.scale_factor_); - if (clip && feature.paths().size() > 0) // optional clip (default: true) - { - geometry_type::types type = feature.paths()[0].type(); - if (type == geometry_type::types::Polygon) - converter.template set(); - else if (type == geometry_type::types::LineString) - converter.template set(); - } - converter.template set(); //always transform - if (std::fabs(offset) > 0.0) converter.template set(); // parallel offset - converter.template set(); // optional affine transform - if (simplify_tolerance > 0.0) converter.template set(); // optional simplify converter - if (smooth > 0.0) converter.template set(); // optional smooth converter - apply_markers_multi(feature, common.vars_, converter, sym); - } - else - { - box2d const& bbox = (*mark)->bounding_box(); - setup_transform_scaling(image_tr, bbox.width(), bbox.height(), feature, common.vars_, sym); - auto image_transform = get_optional(sym, keys::image_transform); - if (image_transform) evaluate_transform(image_tr, feature, common.vars_, *image_transform); - vertex_stl_adapter stl_storage((*stock_vector_marker)->source()); - svg_path_adapter svg_path(stl_storage); - svg_attribute_type attributes; - bool result = push_explicit_style( (*stock_vector_marker)->attributes(), attributes, sym, feature, common.vars_); - vector_dispatch_type rasterizer_dispatch(*stock_vector_marker, - svg_path, - result ? attributes : (*stock_vector_marker)->attributes(), - image_tr, - sym, - *common.detector_, - common.scale_factor_, - feature, - common.vars_, - snap_to_pixels, - renderer_context); - - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,geom_tr,feature,common.vars_,common.scale_factor_); - if (clip && feature.paths().size() > 0) // optional clip (default: true) - { - geometry_type::types type = feature.paths()[0].type(); - if (type == geometry_type::types::Polygon) - converter.template set(); - else if (type == geometry_type::types::LineString) - converter.template set(); - } - converter.template set(); //always transform - if (std::fabs(offset) > 0.0) converter.template set(); // parallel offset - converter.template set(); // optional affine transform - if (simplify_tolerance > 0.0) converter.template set(); // optional simplify converter - if (smooth > 0.0) converter.template set(); // optional smooth converter - apply_markers_multi(feature, common.vars_, converter, sym); - } - } - else // raster markers - { - setup_transform_scaling(image_tr, (*mark)->width(), (*mark)->height(), feature, common.vars_, sym); - auto image_transform = get_optional(sym, keys::image_transform); - if (image_transform) evaluate_transform(image_tr, feature, common.vars_, *image_transform); - box2d const& bbox = (*mark)->bounding_box(); - boost::optional marker = (*mark)->get_bitmap_data(); - // - clamp sizes to > 4 pixels of interactivity - coord2d center = bbox.center(); - agg::trans_affine_translation recenter(-center.x, -center.y); - agg::trans_affine marker_trans = recenter * image_tr; - raster_dispatch_type rasterizer_dispatch(**marker, - marker_trans, - sym, - *common.detector_, - common.scale_factor_, - feature, - common.vars_, - renderer_context); - - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,geom_tr,feature,common.vars_,common.scale_factor_); - - if (clip && feature.paths().size() > 0) // optional clip (default: true) - { - geometry_type::types type = feature.paths()[0].type(); - if (type == geometry_type::types::Polygon) - converter.template set(); - else if (type == geometry_type::types::LineString) - converter.template set(); - } - converter.template set(); //always transform - if (std::fabs(offset) > 0.0) converter.template set(); // parallel offset - converter.template set(); // optional affine transform - if (simplify_tolerance > 0.0) converter.template set(); // optional simplify converter - if (smooth > 0.0) converter.template set(); // optional smooth converter - apply_markers_multi(feature, common.vars_, converter, sym); - } - } + std::shared_ptr mark = mapnik::marker_cache::instance().find(filename, true); + render_marker_symbolizer_visitor visitor(filename, + sym, + feature, + prj_trans, + common, + clip_box, + renderer_context); + util::apply_visitor(visitor, *mark); } } diff --git a/include/mapnik/renderer_common/process_point_symbolizer.hpp b/include/mapnik/renderer_common/process_point_symbolizer.hpp index 9841f5d42..12ffba508 100644 --- a/include/mapnik/renderer_common/process_point_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_point_symbolizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,13 +23,17 @@ #ifndef MAPNIK_RENDERER_COMMON_PROCESS_POINT_SYMBOLIZER_HPP #define MAPNIK_RENDERER_COMMON_PROCESS_POINT_SYMBOLIZER_HPP -#include #include #include #include #include #include #include +#include +#include +#include +#include +#include namespace mapnik { @@ -41,18 +45,18 @@ void render_point_symbolizer(point_symbolizer const &sym, F render_marker) { std::string filename = get(sym,feature, common.vars_); - boost::optional marker = filename.empty() - ? std::make_shared() + std::shared_ptr mark = filename.empty() + ? std::make_shared(mapnik::marker_rgba8()) : marker_cache::instance().find(filename, true); - if (marker) + if (!mark->is()) { value_double opacity = get(sym, feature, common.vars_); value_bool allow_overlap = get(sym, feature, common.vars_); value_bool ignore_placement = get(sym, feature, common.vars_); point_placement_enum placement= get(sym, feature, common.vars_); - box2d const& bbox = (*marker)->bounding_box(); + box2d const& bbox = mark->bounding_box(); coord2d center = bbox.center(); agg::trans_affine tr; @@ -63,42 +67,48 @@ void render_point_symbolizer(point_symbolizer const &sym, agg::trans_affine recenter_tr = recenter * tr; box2d label_ext = bbox * recenter_tr * agg::trans_affine_scaling(common.scale_factor_); - for (std::size_t i=0; i const& geometry = feature.get_geometry(); + mapnik::geometry::point pt; + geometry::geometry_types type = geometry::geometry_type(geometry); + if (placement == CENTROID_POINT_PLACEMENT || + type == geometry::geometry_types::Point || + type == geometry::geometry_types::MultiPoint) + { + if (!geometry::centroid(geometry, pt)) return; + } + else if (type == mapnik::geometry::geometry_types::Polygon) + { + auto const& poly = mapnik::util::get >(geometry); + geometry::polygon_vertex_adapter va(poly); + if (!label::interior_position(va ,pt.x, pt.y)) + return; + } + else + { + MAPNIK_LOG_WARN(point_symbolizer) << "TODO: unhandled geometry type for point symbolizer"; + return; + } + double x = pt.x; + double y = pt.y; + double z = 0; + prj_trans.backward(x,y,z); + common.t_.forward(&x,&y); + label_ext.re_center(x,y); + if (allow_overlap || + common.detector_->has_placement(label_ext)) { - geometry_type const& geom = feature.get_geometry(i); - double x; - double y; - double z=0; - if (placement == CENTROID_POINT_PLACEMENT) - { - if (!label::centroid(geom, x, y)) - return; - } - else - { - if (!label::interior_position(geom ,x, y)) - return; - } - prj_trans.backward(x,y,z); - common.t_.forward(&x,&y); - label_ext.re_center(x,y); - if (allow_overlap || - common.detector_->has_placement(label_ext)) - { + render_marker(pixel_position(x, y), + *mark, + tr, + opacity); - render_marker(pixel_position(x, y), - **marker, - tr, - opacity); - - if (!ignore_placement) - common.detector_->insert(label_ext); - } + if (!ignore_placement) + common.detector_->insert(label_ext); } } } } // namespace mapnik -#endif /* MAPNIK_RENDERER_COMMON_PROCESS_POINT_SYMBOLIZER_HPP */ +#endif // MAPNIK_RENDERER_COMMON_PROCESS_POINT_SYMBOLIZER_HPP diff --git a/include/mapnik/renderer_common/process_polygon_symbolizer.hpp b/include/mapnik/renderer_common/process_polygon_symbolizer.hpp index bc047411a..99f12435c 100644 --- a/include/mapnik/renderer_common/process_polygon_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_polygon_symbolizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,9 +25,11 @@ #include #include +#include #include -#include + #include +#include namespace mapnik { @@ -49,7 +51,7 @@ void render_polygon_symbolizer(polygon_symbolizer const &sym, value_double smooth = get(sym, feature, common.vars_); value_double opacity = get(sym, feature, common.vars_); - vertex_converter_type converter(clip_box, ras, sym, common.t_, prj_trans, tr, + vertex_converter_type converter(clip_box, sym, common.t_, prj_trans, tr, feature,common.vars_,common.scale_factor_); if (prj_trans.equal() && clip) converter.template set(); //optional clip (default: true) @@ -58,13 +60,10 @@ void render_polygon_symbolizer(polygon_symbolizer const &sym, if (simplify_tolerance > 0.0) converter.template set(); // optional simplify converter if (smooth > 0.0) converter.template set(); // optional smooth converter - for (geometry_type & geom : feature.paths()) - { - if (geom.size() > 2) - { - converter.apply(geom); - } - } + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = geometry::vertex_processor; + apply_vertex_converter_type apply(converter, ras); + mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); color const& fill = get(sym, feature, common.vars_); fill_func(fill, opacity); @@ -72,4 +71,4 @@ void render_polygon_symbolizer(polygon_symbolizer const &sym, } // namespace mapnik -#endif /* MAPNIK_RENDERER_COMMON_PROCESS_POLYGON_SYMBOLIZER_HPP */ +#endif // MAPNIK_RENDERER_COMMON_PROCESS_POLYGON_SYMBOLIZER_HPP diff --git a/include/mapnik/renderer_common/process_raster_symbolizer.hpp b/include/mapnik/renderer_common/process_raster_symbolizer.hpp index 7229c60f2..5646785ef 100644 --- a/include/mapnik/renderer_common/process_raster_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_raster_symbolizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,6 +24,7 @@ #define MAPNIK_RENDERER_COMMON_PROCESS_RASTER_SYMBOLIZER_HPP // mapnik +#include #include #include #include @@ -44,15 +45,16 @@ namespace mapnik { namespace detail { template -struct image_data_dispatcher +struct image_dispatcher { using composite_function = F; - image_data_dispatcher(int start_x, int start_y, + image_dispatcher(int start_x, int start_y, int width, int height, double scale_x, double scale_y, scaling_method_e method, double filter_factor, double opacity, composite_mode_e comp_op, - raster_symbolizer const& sym, feature_impl const& feature, F & composite, boost::optional const& nodata) + raster_symbolizer const& sym, feature_impl const& feature, + F & composite, boost::optional const& nodata, bool need_scaling) : start_x_(start_x), start_y_(start_y), width_(width), @@ -66,25 +68,41 @@ struct image_data_dispatcher sym_(sym), feature_(feature), composite_(composite), - nodata_(nodata) {} + nodata_(nodata), + need_scaling_(need_scaling) {} - void operator() (image_data_null const& data_in) const {} //no-op - void operator() (image_data_rgba8 const& data_in) const + void operator() (image_null const&) const {} //no-op + void operator() (image_rgba8 const& data_in) const { - image_data_rgba8 data_out(width_, height_); - scale_image_agg(data_out, data_in, method_, scale_x_, scale_y_, 0.0, 0.0, filter_factor_); - composite_(data_out, comp_op_, opacity_, start_x_, start_y_); + if (need_scaling_) + { + image_rgba8 data_out(width_, height_, true, true); + scale_image_agg(data_out, data_in, method_, scale_x_, scale_y_, 0.0, 0.0, filter_factor_); + composite_(data_out, comp_op_, opacity_, start_x_, start_y_); + } + else + { + composite_(data_in, comp_op_, opacity_, start_x_, start_y_); + } } template void operator() (T const& data_in) const { - using image_data_type = T; - image_data_type data_out(width_, height_); - scale_image_agg(data_out, data_in, method_, scale_x_, scale_y_, 0.0, 0.0, filter_factor_); - image_data_rgba8 dst(width_, height_); + using image_type = T; + image_rgba8 dst(width_, height_); raster_colorizer_ptr colorizer = get(sym_, keys::colorizer); - if (colorizer) colorizer->colorize(dst, data_out, nodata_, feature_); + if (need_scaling_) + { + image_type data_out(width_, height_); + scale_image_agg(data_out, data_in, method_, scale_x_, scale_y_, 0.0, 0.0, filter_factor_); + if (colorizer) colorizer->colorize(dst, data_out, nodata_, feature_); + } + else + { + if (colorizer) colorizer->colorize(dst, data_in, nodata_, feature_); + } + premultiply_alpha(dst); composite_(dst, comp_op_, opacity_, start_x_, start_y_); } private: @@ -102,13 +120,14 @@ private: feature_impl const& feature_; composite_function & composite_; boost::optional const& nodata_; + bool need_scaling_; }; template -struct image_data_warp_dispatcher +struct image_warp_dispatcher { using composite_function = F; - image_data_warp_dispatcher(proj_transform const& prj_trans, + image_warp_dispatcher(proj_transform const& prj_trans, int start_x, int start_y, int width, int height, box2d const& target_ext, box2d const& source_ext, double offset_x, double offset_y, unsigned mesh_size, scaling_method_e scaling_method, @@ -133,11 +152,11 @@ struct image_data_warp_dispatcher composite_(composite), nodata_(nodata) {} - void operator() (image_data_null const& data_in) const {} //no-op + void operator() (image_null const&) const {} //no-op - void operator() (image_data_rgba8 const& data_in) const + void operator() (image_rgba8 const& data_in) const { - image_data_rgba8 data_out(width_, height_); + image_rgba8 data_out(width_, height_, true, true); warp_image(data_out, data_in, prj_trans_, target_ext_, source_ext_, offset_x_, offset_y_, mesh_size_, scaling_method_, filter_factor_); composite_(data_out, comp_op_, opacity_, start_x_, start_y_); } @@ -145,13 +164,14 @@ struct image_data_warp_dispatcher template void operator() (T const& data_in) const { - using image_data_type = T; - image_data_type data_out(width_, height_); + using image_type = T; + image_type data_out(width_, height_); if (nodata_) data_out.set(*nodata_); warp_image(data_out, data_in, prj_trans_, target_ext_, source_ext_, offset_x_, offset_y_, mesh_size_, scaling_method_, filter_factor_); - image_data_rgba8 dst(width_, height_); + image_rgba8 dst(width_, height_); raster_colorizer_ptr colorizer = get(sym_, keys::colorizer); if (colorizer) colorizer->colorize(dst, data_out, nodata_, feature_); + premultiply_alpha(dst); composite_(dst, comp_op_, opacity_, start_x_, start_y_); } private: @@ -202,24 +222,14 @@ void render_raster_symbolizer(raster_symbolizer const& sym, composite_mode_e comp_op = get(sym, keys::comp_op, feature, common.vars_, src_over); double opacity = get(sym,keys::opacity,feature, common.vars_, 1.0); // only premultiply rgba8 images - if (source->data_.is()) + if (source->data_.is()) { - bool premultiply_source = !source->premultiplied_alpha_; auto is_premultiplied = get_optional(sym, keys::premultiplied, feature, common.vars_); - if (is_premultiplied) + if (is_premultiplied && *is_premultiplied) { - if (*is_premultiplied) premultiply_source = false; - else premultiply_source = true; - } - if (premultiply_source) - { - agg::rendering_buffer buffer(source->data_.getBytes(), - source->data_.width(), - source->data_.height(), - source->data_.width() * 4); - agg::pixfmt_rgba32 pixf(buffer); - pixf.premultiply(); + mapnik::set_premultiplied_alpha(source->data_, true); } + mapnik::premultiply_alpha(source->data_); } if (!prj_trans.equal()) @@ -227,7 +237,7 @@ void render_raster_symbolizer(raster_symbolizer const& sym, double offset_x = ext.minx() - start_x; double offset_y = ext.miny() - start_y; unsigned mesh_size = static_cast(get(sym,keys::mesh_size,feature, common.vars_, 16)); - detail::image_data_warp_dispatcher dispatcher(prj_trans, start_x, start_y, raster_width, raster_height, + detail::image_warp_dispatcher dispatcher(prj_trans, start_x, start_y, raster_width, raster_height, target_ext, source->ext_, offset_x, offset_y, mesh_size, scaling_method, source->get_filter_factor(), opacity, comp_op, sym, feature, composite, source->nodata()); @@ -238,24 +248,15 @@ void render_raster_symbolizer(raster_symbolizer const& sym, double image_ratio_x = ext.width() / source->data_.width(); double image_ratio_y = ext.height() / source->data_.height(); double eps = 1e-5; - if ( (std::fabs(image_ratio_x - 1.0) <= eps) && - (std::fabs(image_ratio_y - 1.0) <= eps) && - (std::abs(start_x) <= eps) && - (std::abs(start_y) <= eps) ) - { - if (source->data_.is()) - { - composite(util::get(source->data_), comp_op, opacity, start_x, start_y); - } - } - else - { - detail::image_data_dispatcher dispatcher(start_x, start_y, raster_width, raster_height, - image_ratio_x, image_ratio_y, - scaling_method, source->get_filter_factor(), - opacity, comp_op, sym, feature, composite, source->nodata()); - util::apply_visitor(dispatcher, source->data_); - } + bool scale = (std::fabs(image_ratio_x - 1.0) > eps) || + (std::fabs(image_ratio_y - 1.0) > eps) || + (std::abs(start_x) > eps) || + (std::abs(start_y) > eps); + detail::image_dispatcher dispatcher(start_x, start_y, raster_width, raster_height, + image_ratio_x, image_ratio_y, + scaling_method, source->get_filter_factor(), + opacity, comp_op, sym, feature, composite, source->nodata(), scale); + util::apply_visitor(dispatcher, source->data_); } } } diff --git a/include/mapnik/renderer_common/render_pattern.hpp b/include/mapnik/renderer_common/render_pattern.hpp index e694b5454..acb989731 100644 --- a/include/mapnik/renderer_common/render_pattern.hpp +++ b/include/mapnik/renderer_common/render_pattern.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,7 +23,7 @@ #ifndef MAPNIK_RENDER_PATTERN_HPP #define MAPNIK_RENDER_PATTERN_HPP -#include +#include #include // fwd decl @@ -35,12 +35,14 @@ namespace mapnik { // fwd decl struct rasterizer; -class marker; +struct marker_svg; -std::shared_ptr render_pattern(rasterizer & ras, - marker const& marker, - agg::trans_affine const& tr, - double opacity); +template +void render_pattern(rasterizer & ras, + marker_svg const& marker, + agg::trans_affine const& tr, + double opacity, + T & image); } // namespace mapnik diff --git a/include/mapnik/request.hpp b/include/mapnik/request.hpp index e351f57f1..74c085197 100644 --- a/include/mapnik/request.hpp +++ b/include/mapnik/request.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/rule.hpp b/include/mapnik/rule.hpp index e32210e99..1c98eaf59 100644 --- a/include/mapnik/rule.hpp +++ b/include/mapnik/rule.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/rule_cache.hpp b/include/mapnik/rule_cache.hpp index 44a340659..3d6f7d025 100644 --- a/include/mapnik/rule_cache.hpp +++ b/include/mapnik/rule_cache.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/safe_cast.hpp b/include/mapnik/safe_cast.hpp new file mode 100644 index 000000000..d8973032e --- /dev/null +++ b/include/mapnik/safe_cast.hpp @@ -0,0 +1,154 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_SAFE_CAST_HPP +#define MAPNIK_SAFE_CAST_HPP + +#include +#include +#include + +namespace mapnik { + +namespace detail { + +template +struct numeric_compare; + +template +struct numeric_compare_same_sign +{ + using sizeup = typename std::conditional= sizeof(S), T, S>::type; + + static inline bool less(T t, S s) { + return static_cast(t) < static_cast(s); + } + + static inline bool greater(T t, S s) { + return static_cast(t) > static_cast(s); + } +}; + +template +struct numeric_compare::value && !std::is_floating_point::value && + ((std::is_unsigned::value && std::is_unsigned::value) + || (std::is_signed::value && std::is_signed::value))> + ::type> : numeric_compare_same_sign +{}; + + +template +struct numeric_compare::value && !std::is_floating_point::value && + std::is_integral::value && std::is_signed::value && std::is_unsigned::value>::type> +{ + static inline bool less(T t, S s) { + return (t < static_cast(0)) ? true : static_cast(t) < static_cast(s); + } + + static inline bool greater(T t, S s) { + return (t < static_cast(0)) ? false : static_cast(t) > static_cast(s); + } +}; + +template +struct numeric_compare::value && !std::is_floating_point::value && + std::is_integral::value && std::is_unsigned::value && std::is_signed::value>::type> +{ + static inline bool less(T t, S s) { + return (s < static_cast(0)) ? false : static_cast(t) < static_cast(s); + } + + static inline bool greater(T t, S s) { + return (s < static_cast(0)) ? true : static_cast(t) > static_cast(s); + } +}; + +template +struct numeric_compare::value && std::is_floating_point::value>::type> +{ + static inline bool less(T t, S s) { + return t < s; + } + + static inline bool greater(T t, S s) { + return t > s; + } +}; + +template +struct numeric_compare::value && std::is_integral::value) || + (std::is_integral::value && std::is_floating_point::value)>::type> +{ + static inline bool less(T t, S s) { + return numeric_compare::less(static_cast(t),static_cast(s)); + } + + static inline bool greater(T t, S s) { + return numeric_compare::greater(static_cast(t),static_cast(s)); + } +}; + +// floats +template +struct bounds +{ + static const T lowest() { return static_cast(-std::numeric_limits::max());} + static const T highest() { return std::numeric_limits::max();} +}; + +// integers +template +struct bounds::is_integer>::type > +{ + static const T lowest() { return std::numeric_limits::min();} + static const T highest() { return std::numeric_limits::max();} +}; + +} // ns detail + + +template +inline T safe_cast(S s) +{ + static const auto max_val = detail::bounds::highest(); + static const auto min_val = detail::bounds::lowest(); + + if (detail::numeric_compare::greater(s,max_val)) + { + return max_val; + } + else if (detail::numeric_compare::less(s,min_val)) + { + return min_val; + } + else + { + return static_cast(s); + } +} + +} // ns mapnik + + + +#endif // MAPNIK_SAFE_CAST_HPP diff --git a/include/mapnik/save_map.hpp b/include/mapnik/save_map.hpp index 894532062..80317b356 100644 --- a/include/mapnik/save_map.hpp +++ b/include/mapnik/save_map.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/scale_denominator.hpp b/include/mapnik/scale_denominator.hpp index e4aaee967..fb09cefd9 100644 --- a/include/mapnik/scale_denominator.hpp +++ b/include/mapnik/scale_denominator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/segment.hpp b/include/mapnik/segment.hpp index 2cf10398a..4463382b8 100644 --- a/include/mapnik/segment.hpp +++ b/include/mapnik/segment.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/simplify_converter.hpp b/include/mapnik/simplify_converter.hpp index cbc1fa7e3..e217eba41 100644 --- a/include/mapnik/simplify_converter.hpp +++ b/include/mapnik/simplify_converter.hpp @@ -34,7 +34,8 @@ struct weighted_vertex : private util::noncopyable double nominalWeight() { - if (prev == nullptr || next == nullptr || coord.cmd != SEG_LINETO) { + if (prev == nullptr || next == nullptr || coord.cmd != SEG_LINETO) + { return std::numeric_limits::infinity(); } vertex2d const& A = prev->coord; @@ -89,10 +90,10 @@ struct sleeve }; template -struct MAPNIK_DECL simplify_converter +struct simplify_converter { public: - simplify_converter(Geometry& geom) + simplify_converter(Geometry & geom) : geom_(geom), tolerance_(0.0), status_(initial), @@ -135,7 +136,8 @@ public: void set_simplify_tolerance(double value) { - if (tolerance_ != value) { + if (tolerance_ != value) + { tolerance_ = value; reset(); } @@ -184,22 +186,30 @@ private: return SEG_END; } - unsigned output_vertex_cached(double* x, double* y) { + unsigned output_vertex_cached(double* x, double* y) + { if (pos_ >= vertices_.size()) return SEG_END; previous_vertex_ = vertices_[pos_]; - *x = previous_vertex_.x; - *y = previous_vertex_.y; + if (previous_vertex_.cmd == SEG_CLOSE) + { + *x = *y = 0.0; // restore SEG_CLOSE command + } + else + { + *x = previous_vertex_.x; + *y = previous_vertex_.y; + } pos_++; return previous_vertex_.cmd; } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunknown-pragmas" -#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" - unsigned output_vertex_distance(double* x, double* y) { - if (status_ == closing) { + unsigned output_vertex_distance(double* x, double* y) + { + if (status_ == closing) + { + *x = *y = 0.0; status_ = end; return SEG_CLOSE; } @@ -208,30 +218,45 @@ private: vertex2d vtx(vertex2d::no_init); while ((vtx.cmd = geom_.vertex(&vtx.x, &vtx.y)) != SEG_END) { - if (vtx.cmd == SEG_LINETO) { - if (distance_to_previous(vtx) > tolerance_) { + if (vtx.cmd == SEG_LINETO) + { + if (distance_to_previous(vtx) > tolerance_) + { // Only output a vertex if it's far enough away from the previous break; - } else { + } + else + { last = vtx; // continue } - } else if (vtx.cmd == SEG_CLOSE) { - if (last.cmd == SEG_END) { + } + else if (vtx.cmd == SEG_CLOSE) + { + if (last.cmd == SEG_END) + { // The previous vertex was already output in the previous call. // We can now safely output SEG_CLOSE. status_ = end; - } else { + } + else + { // We eliminated the previous point because it was too close, but // we have to output it now anyway, since this is the end of the // vertex stream. Make sure that we output SEG_CLOSE in the next call. - vtx = last; + vtx.x = start_vertex_.x; + vtx.y = start_vertex_.y; status_ = closing; } break; - } else if (vtx.cmd == SEG_MOVETO) { + } + else if (vtx.cmd == SEG_MOVETO) + { + start_vertex_ = vtx; break; - } else { + } + else + { throw std::runtime_error("Unknown vertex command"); } } @@ -241,7 +266,6 @@ private: *y = vtx.y; return vtx.cmd; } -#pragma GCC diagnostic pop template bool fit_sleeve(Iterator itr,Iterator end, vertex2d const& v) @@ -272,8 +296,6 @@ private: vertices_.size() >= min_size) status_ = process; - previous_vertex_ = vtx; - if (vtx.cmd == SEG_MOVETO) { if (sleeve_cont_.size() > 1) @@ -283,6 +305,7 @@ private: } vertices_.push_back(vtx); sleeve_cont_.push_back(vtx); + start_vertex_ = vtx; if (status_ == process) break; } else if (vtx.cmd == SEG_LINETO) @@ -309,6 +332,8 @@ private: vertices_.push_back(sleeve_cont_.back()); sleeve_cont_.clear(); } + vtx.x = start_vertex_.x; + vtx.y = start_vertex_.y; vertices_.push_back(vtx); if (status_ == process) break; } @@ -335,14 +360,22 @@ private: { vertex2d v = vertices_.front(); vertices_.pop_front(); - *x = v.x; - *y = v.y; + if (v.cmd == SEG_CLOSE) + { + *x = *y = 0.0; // restore SEG_CLOSE command + } + else + { + *x = v.x; + *y = v.y; + } return v.cmd; } return SEG_END; } - double distance_to_previous(vertex2d const& vtx) { + double distance_to_previous(vertex2d const& vtx) + { double dx = previous_vertex_.x - vtx.x; double dy = previous_vertex_.y - vtx.y; return dx * dx + dy * dy; @@ -380,10 +413,20 @@ private: vertex2d vtx(vertex2d::no_init); while ((vtx.cmd = geom_.vertex(&vtx.x, &vtx.y)) != SEG_END) { + if (vtx.cmd == SEG_MOVETO) + { + start_vertex_ = vtx; + } + else if (vtx.cmd == SEG_CLOSE) + { + vtx.x = start_vertex_.x; + vtx.y = start_vertex_.y; + } v_list.push_back(new weighted_vertex(vtx)); } - if (v_list.empty()) { + if (v_list.empty()) + { return status_ = process; } @@ -402,7 +445,8 @@ private: { VertexSet::iterator lowest = v.begin(); weighted_vertex *removed = *lowest; - if (removed->weight >= tolerance_) { + if (removed->weight >= tolerance_) + { break; } @@ -412,12 +456,14 @@ private: if (removed->prev) removed->prev->next = removed->next; if (removed->next) removed->next->prev = removed->prev; // Adjust weight and reinsert prev/next to move them to their correct position. - if (removed->prev) { + if (removed->prev) + { v.erase(removed->prev); removed->prev->weight = std::max(removed->weight, removed->prev->nominalWeight()); v.insert(removed->prev); } - if (removed->next) { + if (removed->next) + { v.erase(removed->next); removed->next->weight = std::max(removed->weight, removed->next->nominalWeight()); v.insert(removed->next); @@ -527,6 +573,15 @@ private: vertex2d vtx(vertex2d::no_init); while ((vtx.cmd = geom_.vertex(&vtx.x, &vtx.y)) != SEG_END) { + if (vtx.cmd == SEG_MOVETO) + { + start_vertex_ = vtx; + } + else if (vtx.cmd == SEG_CLOSE) + { + vtx.x = start_vertex_.x; + vtx.y = start_vertex_.y; + } vertices.push_back(vtx); } @@ -537,7 +592,7 @@ private: } // Slurp the points back out that haven't been marked as discarded - for (vertex2d& vertex : vertices) + for (vertex2d const& vertex : vertices) { if (vertex.cmd != SEG_END) { @@ -548,13 +603,14 @@ private: return status_ = process; } - Geometry& geom_; + Geometry & geom_; double tolerance_; status status_; simplify_algorithm_e algorithm_; std::deque vertices_; std::deque sleeve_cont_; vertex2d previous_vertex_; + vertex2d start_vertex_; mutable size_t pos_; }; diff --git a/include/mapnik/span_image_filter.hpp b/include/mapnik/span_image_filter.hpp index c84ee0435..d99c21ac9 100644 --- a/include/mapnik/span_image_filter.hpp +++ b/include/mapnik/span_image_filter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/sql_utils.hpp b/include/mapnik/sql_utils.hpp index ddadd21cb..d90a55f09 100644 --- a/include/mapnik/sql_utils.hpp +++ b/include/mapnik/sql_utils.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #pragma GCC diagnostic pop @@ -73,7 +76,7 @@ namespace mapnik { namespace sql_utils { { table_name=table_name.substr(idx); } - idx = table_name.find_first_of(" )"); + idx = table_name.find_first_of(", )"); if (idx != std::string::npos) { table_name = table_name.substr(0,idx); diff --git a/include/mapnik/sse.hpp b/include/mapnik/sse.hpp new file mode 100644 index 000000000..603af7cd2 --- /dev/null +++ b/include/mapnik/sse.hpp @@ -0,0 +1,156 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_SSE_HPP +#define MAPNIK_SSE_HPP + +#include +#include + +#define ROUND_DOWN(x, s) ((x) & ~((s)-1)) + +typedef union +{ + __m128i v; + int32_t i32[4]; + uint32_t u32[4]; + uint16_t u16[8]; + uint8_t u8[16]; +} m128_int; + +static inline __m128i +_mm_cmple_epu16 (__m128i x, __m128i y) +{ + // Returns 0xFFFF where x <= y: + return _mm_cmpeq_epi16(_mm_subs_epu16(x, y), _mm_setzero_si128()); +} + +static inline __m128i +_mm_cmple_epu8 (__m128i x, __m128i y) +{ + // Returns 0xFF where x <= y: + return _mm_cmpeq_epi8(_mm_min_epu8(x, y), x); +} + +static inline __m128i +_mm_cmpgt_epu16 (__m128i x, __m128i y) +{ + // Returns 0xFFFF where x > y: + return _mm_andnot_si128(_mm_cmpeq_epi16(x, y), _mm_cmple_epu16(y, x)); +} + +static inline __m128i +_mm_cmpgt_epu8 (__m128i x, __m128i y) +{ + // Returns 0xFF where x > y: + return _mm_andnot_si128( + _mm_cmpeq_epi8(x, y), + _mm_cmpeq_epi8(_mm_max_epu8(x, y), x) + ); +} + +static inline __m128i +_mm_cmplt_epu16 (__m128i x, __m128i y) +{ + // Returns 0xFFFF where x < y: + return _mm_cmpgt_epu16(y, x); +} + +static inline __m128i +_mm_cmplt_epu8 (__m128i x, __m128i y) +{ + // Returns 0xFF where x < y: + return _mm_cmpgt_epu8(y, x); +} + +static inline __m128i +_mm_cmpge_epu16 (__m128i x, __m128i y) +{ + // Returns 0xFFFF where x >= y: + return _mm_cmple_epu16(y, x); +} + +static inline __m128i +_mm_cmpge_epu8 (__m128i x, __m128i y) +{ + // Returns 0xFF where x >= y: + return _mm_cmple_epu8(y, x); +} + +// Its not often that you want to use this! +static inline __m128i +_mm_not_si128 (__m128i x) +{ + // Returns ~x, the bitwise complement of x: + return _mm_xor_si128(x, _mm_cmpeq_epi32(_mm_setzero_si128(), _mm_setzero_si128())); +} + +static inline __m128i +_mm_absdiff_epu16 (__m128i x, __m128i y) +{ + // Calculate absolute difference: abs(x - y): + return _mm_or_si128(_mm_subs_epu16(x, y), _mm_subs_epu16(y, x)); +} + +static inline __m128i +_mm_absdiff_epu8 (__m128i x, __m128i y) +{ + // Calculate absolute difference: abs(x - y): + return _mm_or_si128(_mm_subs_epu8(x, y), _mm_subs_epu8(y, x)); +} + +static inline __m128i +_mm_div255_epu16 (__m128i x) +{ + // Divide 8 16-bit uints by 255: + // x := ((x + 1) + (x >> 8)) >> 8: + return _mm_srli_epi16(_mm_adds_epu16( + _mm_adds_epu16(x, _mm_set1_epi16(1)), + _mm_srli_epi16(x, 8)), 8); +} + +static __m128i +_mm_scale_epu8 (__m128i x, __m128i y) +{ + // Returns an "alpha blend" of x scaled by y/255; + // x := x * (y / 255) + // Reorder: x := (x * y) / 255 + + // Unpack x and y into 16-bit uints: + __m128i xlo = _mm_unpacklo_epi8(x, _mm_setzero_si128()); + __m128i ylo = _mm_unpacklo_epi8(y, _mm_setzero_si128()); + __m128i xhi = _mm_unpackhi_epi8(x, _mm_setzero_si128()); + __m128i yhi = _mm_unpackhi_epi8(y, _mm_setzero_si128()); + + // Multiply x with y, keeping the low 16 bits: + xlo = _mm_mullo_epi16(xlo, ylo); + xhi = _mm_mullo_epi16(xhi, yhi); + + // Divide by 255: + xlo = _mm_div255_epu16(xlo); + xhi = _mm_div255_epu16(xhi); + + // Repack the 16-bit uints to clamped 8-bit values: + return _mm_packus_epi16(xlo, xhi); +} + +#endif // MAPNIK_SSE_HPP diff --git a/include/mapnik/svg/geometry_svg_generator.hpp b/include/mapnik/svg/geometry_svg_generator.hpp index 281a6e82d..e70166f03 100644 --- a/include/mapnik/svg/geometry_svg_generator.hpp +++ b/include/mapnik/svg/geometry_svg_generator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,7 +26,8 @@ // mapnik #include -#include // for container stuff +// for container stuff +#include #include // for container stuff #include #include @@ -36,6 +37,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -54,7 +58,7 @@ namespace boost { namespace spirit { namespace traits { // TODO - this needs to be made generic to any path type -using path_type = mapnik::transform_path_adapter; +using path_type = mapnik::transform_path_adapter; template <> struct is_container : mpl::true_ {} ; @@ -90,69 +94,82 @@ struct end_container namespace mapnik { namespace svg { - namespace karma = boost::spirit::karma; - namespace phoenix = boost::phoenix; +namespace karma = boost::spirit::karma; +namespace phoenix = boost::phoenix; - namespace svg_detail { +namespace svg_detail { - template - struct get_type +template +struct get_type +{ + using result_type = int; + result_type operator() (Geometry const& geom) const { - using result_type = int; - result_type operator() (Geometry const& geom) const - { - return static_cast(geom.type()); - } - }; - - template - struct get_first - { - using geometry_type = T; - using result_type = typename geometry_type::value_type const; - result_type operator() (geometry_type const& geom) const - { - typename geometry_type::value_type coord; - geom.rewind(0); - std::get<0>(coord) = geom.vertex(&std::get<1>(coord),&std::get<2>(coord)); - return coord; - } - }; - - template - struct coordinate_policy : karma::real_policies - { - using base_type = boost::spirit::karma::real_policies; - static int floatfield(T) { return base_type::fmtflags::fixed; } - static unsigned precision(T) { return 4u ;} - }; + return static_cast(geom.type()); } +}; - template - struct svg_path_generator : - karma::grammar +template +struct get_first +{ + using path_type = T; + using result_type = typename path_type::value_type const; + result_type operator() (path_type const& geom) const { + typename path_type::value_type coord; + geom.rewind(0); + std::get<0>(coord) = geom.vertex(&std::get<1>(coord),&std::get<2>(coord)); + return coord; + } +}; - using geometry_type = Geometry; - using coord_type = typename boost::remove_pointer::type; +template <> +struct get_first +{ + using path_type = mapnik::path_type; + using result_type = path_type::value_type const; + result_type operator() (path_type const& geom) const + { + path_type::value_type coord; + std::get<0>(coord) = geom.cont_.get_vertex(0, &std::get<1>(coord),&std::get<2>(coord)); + return coord; + } +}; - svg_path_generator(); - // rules - karma::rule svg; - karma::rule point; - karma::rule linestring; - karma::rule polygon; - karma::rule svg_point; - karma::rule, geometry_type const& ()> svg_path; +template +struct coordinate_policy : karma::real_policies +{ + using base_type = boost::spirit::karma::real_policies; + static int floatfield(T) { return base_type::fmtflags::fixed; } + static unsigned precision(T) { return 4u ;} +}; +} - // phoenix functions - phoenix::function > _type; - phoenix::function > _first; - // - karma::real_generator > coordinate; +template +struct svg_path_generator : + karma::grammar +{ - }; + using path_type = Path; + using coord_type = typename boost::remove_pointer::type; + + svg_path_generator(); + // rules + karma::rule svg; + karma::rule point; + karma::rule linestring; + karma::rule polygon; + karma::rule svg_point; + karma::rule svg_path; + + // phoenix functions + phoenix::function > _type; + phoenix::function > _first; + // + karma::real_generator > coordinate; + +}; }} diff --git a/include/mapnik/svg/geometry_svg_generator_impl.hpp b/include/mapnik/svg/geometry_svg_generator_impl.hpp index b5fc0eeeb..57df89f96 100644 --- a/include/mapnik/svg/geometry_svg_generator_impl.hpp +++ b/include/mapnik/svg/geometry_svg_generator_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,7 +21,7 @@ *****************************************************************************/ // mapnik - +#include #include namespace mapnik { namespace svg { @@ -29,21 +29,19 @@ namespace mapnik { namespace svg { namespace karma = boost::spirit::karma; namespace phoenix = boost::phoenix; - template - svg_path_generator::svg_path_generator() + template + svg_path_generator::svg_path_generator() : svg_path_generator::base_type(svg) { boost::spirit::karma::uint_type uint_; boost::spirit::karma::_val_type _val; boost::spirit::karma::_1_type _1; boost::spirit::karma::lit_type lit; - boost::spirit::karma::_a_type _a; - boost::spirit::karma::string_type kstring; svg = point | linestring | polygon ; - point = &uint_(mapnik::geometry_type::types::Point)[_1 = _type(_val)] + point = &uint_(mapnik::geometry::geometry_types::Point)[_1 = _type(_val)] << svg_point [_1 = _first(_val)] ; @@ -53,18 +51,18 @@ namespace mapnik { namespace svg { << lit('\"') ; - linestring = &uint_(mapnik::geometry_type::types::LineString)[_1 = _type(_val)] + linestring = &uint_(mapnik::geometry::geometry_types::LineString)[_1 = _type(_val)] << lit("d=\"") << svg_path << lit("\"") ; - polygon = &uint_(mapnik::geometry_type::types::Polygon)[_1 = _type(_val)] + polygon = &uint_(mapnik::geometry::geometry_types::Polygon)[_1 = _type(_val)] << lit("d=\"") << svg_path << lit("\"") ; svg_path %= ((&uint_(mapnik::SEG_MOVETO) << lit('M') - | &uint_(mapnik::SEG_LINETO) [_a +=1] << kstring [if_(_a == 1u) [_1 = "L" ].else_[_1 =""]]) - << lit(' ') << coordinate << lit(' ') << coordinate) % lit(' ') - ; + | &uint_(mapnik::SEG_LINETO) << lit('L')) + << coordinate << lit(' ') << coordinate) % lit(' ') + ; } diff --git a/include/mapnik/svg/output/svg_generator.hpp b/include/mapnik/svg/output/svg_generator.hpp index 8bf5d54d3..1b3f18dea 100644 --- a/include/mapnik/svg/output/svg_generator.hpp +++ b/include/mapnik/svg/output/svg_generator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,7 +26,7 @@ // mapnik #include #include -#include + #include #include #include diff --git a/include/mapnik/svg/output/svg_output_attributes.hpp b/include/mapnik/svg/output/svg_output_attributes.hpp index 1de976969..00deeea26 100644 --- a/include/mapnik/svg/output/svg_output_attributes.hpp +++ b/include/mapnik/svg/output/svg_output_attributes.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/output/svg_output_grammars.hpp b/include/mapnik/svg/output/svg_output_grammars.hpp index f3ef886e7..3a47e4332 100644 --- a/include/mapnik/svg/output/svg_output_grammars.hpp +++ b/include/mapnik/svg/output/svg_output_grammars.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -40,6 +40,9 @@ namespace mapnik { namespace svg { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/include/mapnik/svg/output/svg_output_grammars_impl.hpp b/include/mapnik/svg/output/svg_output_grammars_impl.hpp index 892fdf903..41f69282e 100644 --- a/include/mapnik/svg/output/svg_output_grammars_impl.hpp +++ b/include/mapnik/svg/output/svg_output_grammars_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop diff --git a/include/mapnik/svg/output/svg_path_iterator.hpp b/include/mapnik/svg/output/svg_path_iterator.hpp index 693b8612d..b773888cd 100644 --- a/include/mapnik/svg/output/svg_path_iterator.hpp +++ b/include/mapnik/svg/output/svg_path_iterator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,7 @@ #define SVG_PATH_ITERATOR_HPP // mapnik -#include + #include #include // boost diff --git a/include/mapnik/svg/output/svg_renderer.hpp b/include/mapnik/svg/output/svg_renderer.hpp index 43b3a77c2..037ec0ddb 100644 --- a/include/mapnik/svg/output/svg_renderer.hpp +++ b/include/mapnik/svg/output/svg_renderer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -53,7 +53,7 @@ namespace mapnik { class feature_type_style; class label_collision_detector4; class layer; - class marker; + struct marker; class proj_transform; } diff --git a/include/mapnik/svg/svg_converter.hpp b/include/mapnik/svg/svg_converter.hpp index ddde41d82..0066a1f29 100644 --- a/include/mapnik/svg/svg_converter.hpp +++ b/include/mapnik/svg/svg_converter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,6 +27,7 @@ #include #include #include +#include // agg #include "agg_path_storage.h" @@ -57,8 +58,8 @@ public: void begin_path() { - unsigned idx = source_.start_new_path(); - attributes_.add(path_attributes(cur_attr(), idx)); + std::size_t idx = source_.start_new_path(); + attributes_.add(path_attributes(cur_attr(), safe_cast(idx))); } void end_path() @@ -91,7 +92,7 @@ public: double y2 = 0.0; if(source_.total_vertices()) { - source_.vertex(source_.total_vertices() - 1, &x2, &y2); + source_.vertex(safe_cast(source_.total_vertices() - 1), &x2, &y2); if(rel) x += x2; source_.line_to(x, y2); } @@ -103,7 +104,7 @@ public: double y2 = 0.0; if(source_.total_vertices()) { - source_.vertex(source_.total_vertices() - 1, &x2, &y2); + source_.vertex(safe_cast(source_.total_vertices() - 1), &x2, &y2); if(rel) y += y2; source_.line_to(x2, y); } diff --git a/include/mapnik/svg/svg_parser.hpp b/include/mapnik/svg/svg_parser.hpp index 5198bfd53..ef9eafc06 100644 --- a/include/mapnik/svg/svg_parser.hpp +++ b/include/mapnik/svg/svg_parser.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,6 +24,7 @@ #define MAPNIK_SVG_PARSER_HPP // mapnik +#include #include #include #include @@ -35,7 +36,7 @@ namespace mapnik { namespace svg { - class svg_parser : private util::noncopyable + class MAPNIK_DECL svg_parser : private util::noncopyable { public: explicit svg_parser(svg_converter_type & path); diff --git a/include/mapnik/svg/svg_path_adapter.hpp b/include/mapnik/svg/svg_path_adapter.hpp index 72fa29a65..957717166 100644 --- a/include/mapnik/svg/svg_path_adapter.hpp +++ b/include/mapnik/svg/svg_path_adapter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,6 +26,8 @@ // mapnik #include #include +#include + // agg #include "agg_math.h" #include "agg_array.h" @@ -53,7 +55,7 @@ public: // Make path functions //-------------------------------------------------------------------- - unsigned start_new_path(); + std::size_t start_new_path(); void move_to(double x, double y); void move_rel(double dx, double dy); @@ -112,7 +114,7 @@ public: const container_type& vertices() const { return vertices_; } container_type& vertices() { return vertices_; } - unsigned total_vertices() const; + std::size_t total_vertices() const; void rel_to_abs(double* x, double* y) const; @@ -263,7 +265,7 @@ private: //------------------------------------------------------------------------ template -unsigned path_adapter::start_new_path() +std::size_t path_adapter::start_new_path() { if(!is_stop(vertices_.last_command())) { @@ -547,7 +549,7 @@ inline void path_adapter::close_polygon(unsigned flags) //------------------------------------------------------------------------ template -inline unsigned path_adapter::total_vertices() const +inline std::size_t path_adapter::total_vertices() const { return vertices_.total_vertices(); } @@ -886,7 +888,7 @@ public: { return vertices_.size() ? vertices_[vertices_.size() - 1].cmd : - (unsigned)path_cmd_stop; + path_cmd_stop; } unsigned last_vertex(double* x, double* y) const @@ -896,7 +898,7 @@ public: *x = *y = 0.0; return path_cmd_stop; } - return vertex(vertices_.size() - 1, x, y); + return vertex(safe_cast(vertices_.size() - 1), x, y); } unsigned prev_vertex(double* x, double* y) const @@ -906,7 +908,7 @@ public: *x = *y = 0.0; return path_cmd_stop; } - return vertex(vertices_.size() - 2, x, y); + return vertex(safe_cast(vertices_.size() - 2), x, y); } double last_x() const diff --git a/include/mapnik/svg/svg_path_attributes.hpp b/include/mapnik/svg/svg_path_attributes.hpp index 29194ba70..7e180fdce 100644 --- a/include/mapnik/svg/svg_path_attributes.hpp +++ b/include/mapnik/svg/svg_path_attributes.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/svg_path_commands.hpp b/include/mapnik/svg/svg_path_commands.hpp index 905f262a2..105b4cabc 100644 --- a/include/mapnik/svg/svg_path_commands.hpp +++ b/include/mapnik/svg/svg_path_commands.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/include/mapnik/svg/svg_path_grammar.hpp b/include/mapnik/svg/svg_path_grammar.hpp index 1710b61dc..431bf0aed 100644 --- a/include/mapnik/svg/svg_path_grammar.hpp +++ b/include/mapnik/svg/svg_path_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/svg_path_parser.hpp b/include/mapnik/svg/svg_path_parser.hpp index e72ad1ab4..35303f98d 100644 --- a/include/mapnik/svg/svg_path_parser.hpp +++ b/include/mapnik/svg/svg_path_parser.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/svg_points_grammar.hpp b/include/mapnik/svg/svg_points_grammar.hpp index e993d35ed..dbaed8480 100644 --- a/include/mapnik/svg/svg_points_grammar.hpp +++ b/include/mapnik/svg/svg_points_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/svg_renderer_agg.hpp b/include/mapnik/svg/svg_renderer_agg.hpp index 569f3fa35..ad24cb912 100644 --- a/include/mapnik/svg/svg_renderer_agg.hpp +++ b/include/mapnik/svg/svg_renderer_agg.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,10 +27,16 @@ #include #include #include +#include #include #if defined(GRID_RENDERER) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include +#pragma GCC diagnostic pop #endif // agg @@ -341,7 +347,7 @@ public: void render_id(Rasterizer& ras, Scanline& sl, Renderer& ren, - int feature_id, + mapnik::value_integer feature_id, agg::trans_affine const& mtx, double /*opacity*/, box2d const& /*symbol_bbox*/) diff --git a/include/mapnik/svg/svg_storage.hpp b/include/mapnik/svg/svg_storage.hpp index c3618b625..c360ecf52 100644 --- a/include/mapnik/svg/svg_storage.hpp +++ b/include/mapnik/svg/svg_storage.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/svg_transform_grammar.hpp b/include/mapnik/svg/svg_transform_grammar.hpp index ce5563df1..e0f5231aa 100644 --- a/include/mapnik/svg/svg_transform_grammar.hpp +++ b/include/mapnik/svg/svg_transform_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,6 +33,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/include/mapnik/symbolizer.hpp b/include/mapnik/symbolizer.hpp index d15c1e10e..40283b9d3 100644 --- a/include/mapnik/symbolizer.hpp +++ b/include/mapnik/symbolizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -91,6 +91,7 @@ enum class property_types : std::uint8_t target_justify_alignment, target_vertical_alignment, target_upright, + target_direction, target_font_feature_settings }; @@ -184,6 +185,7 @@ ENUM_FROM_STRING( horizontal_alignment_enum ) ENUM_FROM_STRING( justify_alignment_enum ) ENUM_FROM_STRING( text_transform_enum ) ENUM_FROM_STRING( text_upright_enum ) +ENUM_FROM_STRING( direction_enum ) ENUM_FROM_STRING( gamma_method_enum ) // enum diff --git a/include/mapnik/symbolizer_base.hpp b/include/mapnik/symbolizer_base.hpp index 39a78a2b2..f960752c8 100644 --- a/include/mapnik/symbolizer_base.hpp +++ b/include/mapnik/symbolizer_base.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/symbolizer_default_values.hpp b/include/mapnik/symbolizer_default_values.hpp index 8816d7c18..b70ea194b 100644 --- a/include/mapnik/symbolizer_default_values.hpp +++ b/include/mapnik/symbolizer_default_values.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -329,6 +329,13 @@ struct symbolizer_default static marker_multi_policy_enum value() { return MARKER_EACH_MULTI; } }; +// direction +template <> +struct symbolizer_default +{ + static direction_enum value() { return DIRECTION_RIGHT; } +}; + // placement // colorizer diff --git a/include/mapnik/symbolizer_dispatch.hpp b/include/mapnik/symbolizer_dispatch.hpp index 213a38835..52f65bcfc 100644 --- a/include/mapnik/symbolizer_dispatch.hpp +++ b/include/mapnik/symbolizer_dispatch.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -100,9 +100,7 @@ template struct has_process { using processor_impl_type = typename T0::processor_impl_type; - BOOST_STATIC_CONSTANT(bool - , value = sizeof(has_process_helper(0)) == sizeof(yes_tag) - ); + constexpr static bool value = (sizeof(has_process_helper(0)) == sizeof(yes_tag)); }; } diff --git a/include/mapnik/symbolizer_enumerations.hpp b/include/mapnik/symbolizer_enumerations.hpp index 7f1c556c4..7a3e72fd8 100644 --- a/include/mapnik/symbolizer_enumerations.hpp +++ b/include/mapnik/symbolizer_enumerations.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -89,6 +89,7 @@ enum debug_symbolizer_mode_enum : std::uint8_t { DEBUG_SYM_MODE_COLLISION, DEBUG_SYM_MODE_VERTEX, + DEBUG_SYM_MODE_RINGS, debug_symbolizer_mode_enum_MAX }; @@ -189,6 +190,21 @@ enum text_upright_enum : std::uint8_t DEFINE_ENUM(text_upright_e, text_upright_enum); +enum direction_enum : std::uint8_t +{ + DIRECTION_LEFT, + DIRECTION_RIGHT, + DIRECTION_LEFT_ONLY, + DIRECTION_RIGHT_ONLY, + DIRECTION_AUTO, + DIRECTION_AUTO_DOWN, + DIRECTION_UP, + DIRECTION_DOWN, + direction_enum_MAX +}; + +DEFINE_ENUM(direction_e, direction_enum); + enum gamma_method_enum : std::uint8_t { GAMMA_POWER, //agg::gamma_power diff --git a/include/mapnik/symbolizer_hash.hpp b/include/mapnik/symbolizer_hash.hpp index feadf02d3..9c2baa4e4 100644 --- a/include/mapnik/symbolizer_hash.hpp +++ b/include/mapnik/symbolizer_hash.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/symbolizer_keys.hpp b/include/mapnik/symbolizer_keys.hpp index 4867d3764..15919dc1b 100644 --- a/include/mapnik/symbolizer_keys.hpp +++ b/include/mapnik/symbolizer_keys.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -89,6 +89,7 @@ enum class keys : std::uint8_t justify_alignment, vertical_alignment, upright, + direction, avoid_edges, ff_settings, MAX_SYMBOLIZER_KEY diff --git a/include/mapnik/symbolizer_utils.hpp b/include/mapnik/symbolizer_utils.hpp index 00a4f0208..358628bd2 100644 --- a/include/mapnik/symbolizer_utils.hpp +++ b/include/mapnik/symbolizer_utils.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -461,8 +461,8 @@ struct set_symbolizer_property_impl auto result = pre_evaluate_expression(*val); if (std::get<1>(result)) { - boost::optional enum_val = detail::enum_traits::from_string(std::get<0>(result).to_string()); - if (enum_val) + boost::optional enum_val2 = detail::enum_traits::from_string(std::get<0>(result).to_string()); + if (enum_val2) { put(sym, key, *enum_val); } diff --git a/include/mapnik/text/evaluated_format_properties_ptr.hpp b/include/mapnik/text/evaluated_format_properties_ptr.hpp index 8ead5f690..472865181 100644 --- a/include/mapnik/text/evaluated_format_properties_ptr.hpp +++ b/include/mapnik/text/evaluated_format_properties_ptr.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/face.hpp b/include/mapnik/text/face.hpp index 31dd45aa2..9c50bebcc 100644 --- a/include/mapnik/text/face.hpp +++ b/include/mapnik/text/face.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -87,7 +87,7 @@ public: void set_character_sizes(double size); void set_unscaled_character_sizes(); - unsigned size() const { return faces_.size(); } + std::size_t size() const { return faces_.size(); } iterator begin() { return faces_.begin(); } iterator end() { return faces_.end(); } private: diff --git a/include/mapnik/text/font_feature_settings.hpp b/include/mapnik/text/font_feature_settings.hpp index 9fd62596b..9d945fbe5 100644 --- a/include/mapnik/text/font_feature_settings.hpp +++ b/include/mapnik/text/font_feature_settings.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/font_library.hpp b/include/mapnik/text/font_library.hpp index fc5959a54..163aad3d6 100644 --- a/include/mapnik/text/font_library.hpp +++ b/include/mapnik/text/font_library.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/formatting/base.hpp b/include/mapnik/text/formatting/base.hpp index efda3d63e..da47d5d54 100644 --- a/include/mapnik/text/formatting/base.hpp +++ b/include/mapnik/text/formatting/base.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/formatting/format.hpp b/include/mapnik/text/formatting/format.hpp index 372598610..c540abd13 100644 --- a/include/mapnik/text/formatting/format.hpp +++ b/include/mapnik/text/formatting/format.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/formatting/layout.hpp b/include/mapnik/text/formatting/layout.hpp index 1ea1810c7..dd7f4b011 100644 --- a/include/mapnik/text/formatting/layout.hpp +++ b/include/mapnik/text/formatting/layout.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/formatting/list.hpp b/include/mapnik/text/formatting/list.hpp index 79314cfbe..45c4217db 100644 --- a/include/mapnik/text/formatting/list.hpp +++ b/include/mapnik/text/formatting/list.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/formatting/registry.hpp b/include/mapnik/text/formatting/registry.hpp index 5ad22dd5a..7328d2b9c 100644 --- a/include/mapnik/text/formatting/registry.hpp +++ b/include/mapnik/text/formatting/registry.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,7 +23,7 @@ #define FORMATTING_REGISTRY_HPP // mapnik -#include +#include #include #include #include diff --git a/include/mapnik/text/formatting/text.hpp b/include/mapnik/text/formatting/text.hpp index 214b3cf65..012288507 100644 --- a/include/mapnik/text/formatting/text.hpp +++ b/include/mapnik/text/formatting/text.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/glyph_info.hpp b/include/mapnik/text/glyph_info.hpp index 4b82ffb72..3950f9dd2 100644 --- a/include/mapnik/text/glyph_info.hpp +++ b/include/mapnik/text/glyph_info.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/glyph_positions.hpp b/include/mapnik/text/glyph_positions.hpp index 86c0302ef..554e40667 100644 --- a/include/mapnik/text/glyph_positions.hpp +++ b/include/mapnik/text/glyph_positions.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -50,18 +50,20 @@ struct glyph_position struct marker_info { - marker_info() : marker(), transform() {} - marker_info(marker_ptr _marker, agg::trans_affine const& _transform) : - marker(_marker), transform(_transform) {} - marker_ptr marker; - agg::trans_affine transform; + //marker_info() : marker(), transform() {} + marker_info(std::shared_ptr _marker, agg::trans_affine const& _transform) : + marker_(_marker), transform_(_transform) {} + std::shared_ptr marker_; + agg::trans_affine transform_; }; + using marker_info_ptr = std::shared_ptr; /** Stores positions of glphys. * * The actual glyphs and their format are stored in text_layout. */ + class glyph_positions { public: @@ -78,13 +80,13 @@ public: pixel_position const& get_base_point() const; void set_base_point(pixel_position const& base_point); void set_marker(marker_info_ptr marker, pixel_position const& marker_pos); - marker_info_ptr marker() const; + marker_info_ptr get_marker() const; pixel_position const& marker_pos() const; box2d const & bbox() const; private: std::vector data_; pixel_position base_point_; - marker_info_ptr marker_; + marker_info_ptr marker_info_; pixel_position marker_pos_; box2d bbox_; }; diff --git a/include/mapnik/text/harfbuzz_shaper.hpp b/include/mapnik/text/harfbuzz_shaper.hpp index 8bb37b180..8c4b8309f 100644 --- a/include/mapnik/text/harfbuzz_shaper.hpp +++ b/include/mapnik/text/harfbuzz_shaper.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,6 +28,7 @@ #include #include #include +#include // stl #include @@ -66,7 +67,7 @@ static void shape_text(text_line & line, { unsigned start = line.first_char(); unsigned end = line.last_char(); - size_t length = end - start; + std::size_t length = end - start; if (!length) return; std::list const& list = itemizer.itemize(start, end); @@ -75,7 +76,7 @@ static void shape_text(text_line & line, auto hb_buffer_deleter = [](hb_buffer_t * buffer) { hb_buffer_destroy(buffer);}; const std::unique_ptr buffer(hb_buffer_create(),hb_buffer_deleter); - hb_buffer_pre_allocate(buffer.get(), length); + hb_buffer_pre_allocate(buffer.get(), safe_cast(length)); mapnik::value_unicode_string const& text = itemizer.text(); for (auto const& text_item : list) @@ -86,15 +87,16 @@ static void shape_text(text_line & line, std::size_t num_faces = face_set->size(); std::size_t pos = 0; font_feature_settings const& ff_settings = text_item.format_->ff_settings; + int ff_count = safe_cast(ff_settings.count()); for (auto const& face : *face_set) { ++pos; hb_buffer_clear_contents(buffer.get()); - hb_buffer_add_utf16(buffer.get(), uchar_to_utf16(text.getBuffer()), text.length(), text_item.start, text_item.end - text_item.start); + hb_buffer_add_utf16(buffer.get(), uchar_to_utf16(text.getBuffer()), text.length(), text_item.start, static_cast(text_item.end - text_item.start)); hb_buffer_set_direction(buffer.get(), (text_item.dir == UBIDI_RTL)?HB_DIRECTION_RTL:HB_DIRECTION_LTR); hb_buffer_set_script(buffer.get(), _icu_script_to_script(text_item.script)); hb_font_t *font(hb_ft_font_create(face->get_face(), nullptr)); - hb_shape(font, buffer.get(), ff_settings.get_features(), ff_settings.count()); + hb_shape(font, buffer.get(), ff_settings.get_features(), ff_count); hb_font_destroy(font); unsigned num_glyphs = hb_buffer_get_length(buffer.get()); @@ -121,7 +123,7 @@ static void shape_text(text_line & line, double max_glyph_height = 0; for (unsigned i=0; iget_face()->units_per_EM; //Overwrite default advance with better value provided by HarfBuzz - g.unscaled_advance = pos.x_advance; - g.offset.set(pos.x_offset * g.scale_multiplier, pos.y_offset * g.scale_multiplier); + g.unscaled_advance = gpos.x_advance; + g.offset.set(gpos.x_offset * g.scale_multiplier, gpos.y_offset * g.scale_multiplier); double tmp_height = g.height(); if (tmp_height > max_glyph_height) max_glyph_height = tmp_height; width_map[char_index] += g.advance(); diff --git a/include/mapnik/text/icu_shaper.hpp b/include/mapnik/text/icu_shaper.hpp index e672eaade..dedeafd81 100644 --- a/include/mapnik/text/icu_shaper.hpp +++ b/include/mapnik/text/icu_shaper.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/itemizer.hpp b/include/mapnik/text/itemizer.hpp index 0b28bc34d..fe036ad24 100644 --- a/include/mapnik/text/itemizer.hpp +++ b/include/mapnik/text/itemizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -86,8 +86,8 @@ public: private: template struct run : util::noncopyable { - run(T const& data, unsigned start, unsigned end) - : start(start), end(end), data(data) {} + run(T const& _data, unsigned _start, unsigned _end) + : start(_start), end(_end), data(_data) {} unsigned start; unsigned end; T data; diff --git a/include/mapnik/text/placement_finder.hpp b/include/mapnik/text/placement_finder.hpp index 5069dc33f..f3ffd512a 100644 --- a/include/mapnik/text/placement_finder.hpp +++ b/include/mapnik/text/placement_finder.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -76,7 +76,7 @@ private: bool collision(box2d const& box, const value_unicode_string &repeat_key, bool line_placement) const; // Adds marker to glyph_positions and to collision detector. Returns false if there is a collision. bool add_marker(glyph_positions_ptr glyphs, pixel_position const& pos) const; - // Maps upright==auto, left_only and right_only to left,right to simplify processing. + // Maps upright==auto, left-only and right-only to left,right to simplify processing. // angle = angle of at start of line (to estimate best option for upright==auto) text_upright_e simplify_upright(text_upright_e upright, double angle) const; box2d get_bbox(text_layout const& layout, glyph_info const& glyph, pixel_position const& pos, rotation const& rot); @@ -99,8 +99,8 @@ private: box2d marker_box_; bool marker_unlocked_; pixel_position marker_displacement_; - double move_dx_ = 0.0; - horizontal_alignment_e horizontal_alignment_ = H_LEFT; + double move_dx_; + horizontal_alignment_e horizontal_alignment_; }; }//ns mapnik diff --git a/include/mapnik/text/placement_finder_impl.hpp b/include/mapnik/text/placement_finder_impl.hpp index 9bf7256cf..739238924 100644 --- a/include/mapnik/text/placement_finder_impl.hpp +++ b/include/mapnik/text/placement_finder_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/placements/base.hpp b/include/mapnik/text/placements/base.hpp index 06c6cce20..f83a54748 100644 --- a/include/mapnik/text/placements/base.hpp +++ b/include/mapnik/text/placements/base.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/placements/dummy.hpp b/include/mapnik/text/placements/dummy.hpp index 18d81fea6..036c5bde9 100644 --- a/include/mapnik/text/placements/dummy.hpp +++ b/include/mapnik/text/placements/dummy.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/placements/list.hpp b/include/mapnik/text/placements/list.hpp index 1fa4c8712..c21a4d87c 100644 --- a/include/mapnik/text/placements/list.hpp +++ b/include/mapnik/text/placements/list.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -38,7 +38,7 @@ public: virtual void add_expressions(expression_set & output) const; text_symbolizer_properties & add(); text_symbolizer_properties & get(unsigned i); - unsigned size() const; + std::size_t size() const; static text_placements_ptr from_xml(xml_node const& xml, fontset_map const& fontsets, bool is_shield); private: std::vector list_; diff --git a/include/mapnik/text/placements/registry.hpp b/include/mapnik/text/placements/registry.hpp index eadfdb361..f8d8aefb1 100644 --- a/include/mapnik/text/placements/registry.hpp +++ b/include/mapnik/text/placements/registry.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,7 +23,7 @@ #define PLACEMENTS_REGISTRY_HPP // mapnik -#include +#include #include #include diff --git a/include/mapnik/text/placements/simple.hpp b/include/mapnik/text/placements/simple.hpp index 2a9b983d7..a489bea6f 100644 --- a/include/mapnik/text/placements/simple.hpp +++ b/include/mapnik/text/placements/simple.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/properties_util.hpp b/include/mapnik/text/properties_util.hpp index a28a23fb2..0fff84e7b 100644 --- a/include/mapnik/text/properties_util.hpp +++ b/include/mapnik/text/properties_util.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/renderer.hpp b/include/mapnik/text/renderer.hpp index ac8bcb45a..a0b521d30 100644 --- a/include/mapnik/text/renderer.hpp +++ b/include/mapnik/text/renderer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/scrptrun.hpp b/include/mapnik/text/scrptrun.hpp index c8acec63b..e4c607f6c 100644 --- a/include/mapnik/text/scrptrun.hpp +++ b/include/mapnik/text/scrptrun.hpp @@ -23,15 +23,15 @@ struct ScriptRecord { - UChar32 startChar; - UChar32 endChar; - UScriptCode scriptCode; + UChar32 startChar = 0; + UChar32 endChar = 0; + UScriptCode scriptCode = USCRIPT_INVALID_CODE; }; struct ParenStackEntry { - int32_t pairIndex; - UScriptCode scriptCode; + int32_t pairIndex = 0; + UScriptCode scriptCode = USCRIPT_INVALID_CODE; }; class ScriptRun : public UObject { diff --git a/include/mapnik/text/symbolizer_helpers.hpp b/include/mapnik/text/symbolizer_helpers.hpp index 55561ae91..714d566ba 100644 --- a/include/mapnik/text/symbolizer_helpers.hpp +++ b/include/mapnik/text/symbolizer_helpers.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ //mapnik #include #include +#include namespace mapnik { @@ -42,7 +43,7 @@ struct placement_finder_adapter points_on_line_(points_on_line) {} template - void add_path(PathT & path) + void add_path(PathT & path) const { status_ = finder_.find_line_placements(path, points_on_line_); } @@ -55,11 +56,18 @@ struct placement_finder_adapter }; -using vertex_converter_type = vertex_converter,clip_line_tag , transform_tag, affine_transform_tag, simplify_tag, smooth_tag>; +using vertex_converter_type = vertex_converter; class base_symbolizer_helper { public: + + using point_cref = std::reference_wrapper const>; + using line_string_cref = std::reference_wrapper const>; + using polygon_cref = std::reference_wrapper const>; + using geometry_cref = util::variant; + // Using list instead of vector, because we delete random elements and need iterators to stay valid. + using geometry_container_type = std::list; base_symbolizer_helper(symbolizer_base const& sym, feature_impl const& feature, attributes const& vars, @@ -82,16 +90,15 @@ protected: view_transform const& t_; box2d dims_; box2d const& query_extent_; - float scale_factor_; + double scale_factor_; //Processing - // Using list instead of vector, because we delete random elements and need iterators to stay valid. // Remaining geometries to be processed. - mutable std::list geometries_to_process_; + mutable geometry_container_type geometries_to_process_; + // Geometry currently being processed. + mutable geometry_container_type::iterator geo_itr_; // Remaining points to be processed. mutable std::list points_; - // Geometry currently being processed. - mutable std::list::iterator geo_itr_; // Point currently being processed. mutable std::list::iterator point_itr_; // Use point placement. Otherwise line placement is used. diff --git a/include/mapnik/text/text_layout.hpp b/include/mapnik/text/text_layout.hpp index 360c518eb..2e59cdc8b 100644 --- a/include/mapnik/text/text_layout.hpp +++ b/include/mapnik/text/text_layout.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/text_line.hpp b/include/mapnik/text/text_line.hpp index dd3cfee1c..1bd02db66 100644 --- a/include/mapnik/text/text_line.hpp +++ b/include/mapnik/text/text_line.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/text_properties.hpp b/include/mapnik/text/text_properties.hpp index 90711a4e8..654921eb2 100644 --- a/include/mapnik/text/text_properties.hpp +++ b/include/mapnik/text/text_properties.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/tiff_io.hpp b/include/mapnik/tiff_io.hpp index af60309d1..df2b25a7a 100644 --- a/include/mapnik/tiff_io.hpp +++ b/include/mapnik/tiff_io.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,7 @@ #include #include -#include +#include #include extern "C" @@ -35,12 +35,13 @@ extern "C" #define RealTIFFClose TIFFClose } +//std +#include + #define TIFF_WRITE_SCANLINE 0 #define TIFF_WRITE_STRIPPED 1 #define TIFF_WRITE_TILED 2 -#include - namespace mapnik { static inline tsize_t tiff_write_proc(thandle_t fd, tdata_t buf, tsize_t size) @@ -181,7 +182,7 @@ struct tiff_config struct tag_setter { - tag_setter(TIFF * output, tiff_config & config) + tag_setter(TIFF * output, tiff_config const& config) : output_(output), config_(config) {} @@ -189,18 +190,25 @@ struct tag_setter void operator() (T const&) const { // Assume this would be null type - throw ImageWriterException("Could not write TIFF - unknown image type provided"); + throw image_writer_exception("Could not write TIFF - unknown image type provided"); } - inline void operator() (image_data_rgba8 const&) const + inline void operator() (image_rgba8 const& data) const { TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB); TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); TIFFSetField(output_, TIFFTAG_BITSPERSAMPLE, 8); TIFFSetField(output_, TIFFTAG_SAMPLESPERPIXEL, 4); - //uint16 extras[] = { EXTRASAMPLE_UNASSALPHA }; - uint16 extras[] = { EXTRASAMPLE_ASSOCALPHA }; - TIFFSetField(output_, TIFFTAG_EXTRASAMPLES, 1, extras); + if (data.get_premultiplied()) + { + uint16 extras[] = { EXTRASAMPLE_ASSOCALPHA }; + TIFFSetField(output_, TIFFTAG_EXTRASAMPLES, 1, extras); + } + else + { + uint16 extras[] = { EXTRASAMPLE_UNASSALPHA }; + TIFFSetField(output_, TIFFTAG_EXTRASAMPLES, 1, extras); + } if (config_.compression == COMPRESSION_DEFLATE || config_.compression == COMPRESSION_ADOBE_DEFLATE || config_.compression == COMPRESSION_LZW) @@ -209,7 +217,76 @@ struct tag_setter } } - inline void operator() (image_data_gray32f const&) const + inline void operator() (image_gray64 const&) const + { + TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); + TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); + TIFFSetField(output_, TIFFTAG_BITSPERSAMPLE, 64); + TIFFSetField(output_, TIFFTAG_SAMPLESPERPIXEL, 1); + if (config_.compression == COMPRESSION_DEFLATE + || config_.compression == COMPRESSION_ADOBE_DEFLATE + || config_.compression == COMPRESSION_LZW) + { + TIFFSetField(output_, TIFFTAG_PREDICTOR, PREDICTOR_HORIZONTAL); + + } + } + inline void operator() (image_gray64s const&) const + { + TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); + TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_INT); + TIFFSetField(output_, TIFFTAG_BITSPERSAMPLE, 64); + TIFFSetField(output_, TIFFTAG_SAMPLESPERPIXEL, 1); + if (config_.compression == COMPRESSION_DEFLATE + || config_.compression == COMPRESSION_ADOBE_DEFLATE + || config_.compression == COMPRESSION_LZW) + { + TIFFSetField(output_, TIFFTAG_PREDICTOR, PREDICTOR_HORIZONTAL); + + } + } + inline void operator() (image_gray64f const&) const + { + TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); + TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP); + TIFFSetField(output_, TIFFTAG_BITSPERSAMPLE, 64); + TIFFSetField(output_, TIFFTAG_SAMPLESPERPIXEL, 1); + if (config_.compression == COMPRESSION_DEFLATE + || config_.compression == COMPRESSION_ADOBE_DEFLATE + || config_.compression == COMPRESSION_LZW) + { + TIFFSetField(output_, TIFFTAG_PREDICTOR, PREDICTOR_FLOATINGPOINT); + } + } + inline void operator() (image_gray32 const&) const + { + TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); + TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); + TIFFSetField(output_, TIFFTAG_BITSPERSAMPLE, 32); + TIFFSetField(output_, TIFFTAG_SAMPLESPERPIXEL, 1); + if (config_.compression == COMPRESSION_DEFLATE + || config_.compression == COMPRESSION_ADOBE_DEFLATE + || config_.compression == COMPRESSION_LZW) + { + TIFFSetField(output_, TIFFTAG_PREDICTOR, PREDICTOR_HORIZONTAL); + + } + } + inline void operator() (image_gray32s const&) const + { + TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); + TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_INT); + TIFFSetField(output_, TIFFTAG_BITSPERSAMPLE, 32); + TIFFSetField(output_, TIFFTAG_SAMPLESPERPIXEL, 1); + if (config_.compression == COMPRESSION_DEFLATE + || config_.compression == COMPRESSION_ADOBE_DEFLATE + || config_.compression == COMPRESSION_LZW) + { + TIFFSetField(output_, TIFFTAG_PREDICTOR, PREDICTOR_HORIZONTAL); + + } + } + inline void operator() (image_gray32f const&) const { TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP); @@ -222,7 +299,7 @@ struct tag_setter TIFFSetField(output_, TIFFTAG_PREDICTOR, PREDICTOR_FLOATINGPOINT); } } - inline void operator() (image_data_gray16 const&) const + inline void operator() (image_gray16 const&) const { TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); @@ -236,7 +313,21 @@ struct tag_setter } } - inline void operator() (image_data_gray8 const&) const + inline void operator() (image_gray16s const&) const + { + TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); + TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_INT); + TIFFSetField(output_, TIFFTAG_BITSPERSAMPLE, 16); + TIFFSetField(output_, TIFFTAG_SAMPLESPERPIXEL, 1); + if (config_.compression == COMPRESSION_DEFLATE + || config_.compression == COMPRESSION_ADOBE_DEFLATE + || config_.compression == COMPRESSION_LZW) + { + TIFFSetField(output_, TIFFTAG_PREDICTOR, PREDICTOR_HORIZONTAL); + + } + } + inline void operator() (image_gray8 const&) const { TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); @@ -250,18 +341,32 @@ struct tag_setter } } - inline void operator() (image_data_null const&) const + inline void operator() (image_gray8s const&) const + { + TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); + TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_INT); + TIFFSetField(output_, TIFFTAG_BITSPERSAMPLE, 8); + TIFFSetField(output_, TIFFTAG_SAMPLESPERPIXEL, 1); + if (config_.compression == COMPRESSION_DEFLATE + || config_.compression == COMPRESSION_ADOBE_DEFLATE + || config_.compression == COMPRESSION_LZW) + { + TIFFSetField(output_, TIFFTAG_PREDICTOR, PREDICTOR_HORIZONTAL); + + } + } + inline void operator() (image_null const&) const { // Assume this would be null type - throw ImageWriterException("Could not write TIFF - Null image provided"); + throw image_writer_exception("Could not write TIFF - Null image provided"); } private: TIFF * output_; - tiff_config config_; + tiff_config const& config_; }; -void set_tiff_config(TIFF* output, tiff_config & config) +inline void set_tiff_config(TIFF* output, tiff_config const& config) { // Set some constant tiff information that doesn't vary based on type of data // or image size @@ -282,7 +387,7 @@ void set_tiff_config(TIFF* output, tiff_config & config) } template -void save_as_tiff(T1 & file, T2 const& image, tiff_config & config) +void save_as_tiff(T1 & file, T2 const& image, tiff_config const& config) { using pixel_type = typename T2::pixel_type; @@ -301,7 +406,7 @@ void save_as_tiff(T1 & file, T2 const& image, tiff_config & config) tiff_dummy_unmap_proc); if (! output) { - throw ImageWriterException("Could not write TIFF"); + throw image_writer_exception("Could not write TIFF"); } TIFFSetField(output, TIFFTAG_IMAGEWIDTH, width); @@ -312,7 +417,6 @@ void save_as_tiff(T1 & file, T2 const& image, tiff_config & config) // Set tags that vary based on the type of data being provided. tag_setter set(output, config); set(image); - //util::apply_visitor(set, image); // Use specific types of writing methods. if (TIFF_WRITE_SCANLINE == config.method) @@ -324,7 +428,7 @@ void save_as_tiff(T1 & file, T2 const& image, tiff_config & config) std::unique_ptr row (new pixel_type[width]); while (next_scanline < height) { - std::copy(image.getRow(next_scanline), image.getRow(next_scanline) + width, row.get()); + std::copy(image.get_row(next_scanline), image.get_row(next_scanline) + width, row.get()); TIFFWriteScanline(output, row.get(), next_scanline, 0); ++next_scanline; } @@ -339,19 +443,17 @@ void save_as_tiff(T1 & file, T2 const& image, tiff_config & config) TIFFSetField(output, TIFFTAG_ROWSPERSTRIP, rows_per_strip); std::size_t strip_size = width * rows_per_strip; std::unique_ptr strip_buffer(new pixel_type[strip_size]); - int end_y=(height/rows_per_strip+1)*rows_per_strip; - - for (int y=0; y < end_y; y+=rows_per_strip) + for (int y=0; y < height; y+=rows_per_strip) { int ty1 = std::min(height, static_cast(y + rows_per_strip)) - y; int row = y; for (int ty = 0; ty < ty1; ++ty, ++row) { - std::copy(image.getRow(row), image.getRow(row) + width, strip_buffer.get() + ty * width); + std::copy(image.get_row(row), image.get_row(row) + width, strip_buffer.get() + ty * width); } if (TIFFWriteEncodedStrip(output, TIFFComputeStrip(output, y, 0), strip_buffer.get(), strip_size * sizeof(pixel_type)) == -1) { - throw ImageWriterException("Could not write TIFF - TIFF Tile Write failed"); + throw image_writer_exception("Could not write TIFF - TIFF Tile Write failed"); } } } @@ -380,7 +482,7 @@ void save_as_tiff(T1 & file, T2 const& image, tiff_config & config) TIFFSetField(output, TIFFTAG_TILELENGTH, tile_height); TIFFSetField(output, TIFFTAG_TILEDEPTH, 1); std::size_t tile_size = tile_width * tile_height; - std::unique_ptr image_data_out (new pixel_type[tile_size]); + std::unique_ptr image_out (new pixel_type[tile_size]); int end_y = (height / tile_height + 1) * tile_height; int end_x = (width / tile_width + 1) * tile_width; end_y = std::min(end_y, height); @@ -393,16 +495,16 @@ void save_as_tiff(T1 & file, T2 const& image, tiff_config & config) for (int x = 0; x < end_x; x += tile_width) { // Prefill the entire array with zeros. - std::fill(image_data_out.get(), image_data_out.get() + tile_size, 0); + std::fill(image_out.get(), image_out.get() + tile_size, 0); int tx1 = std::min(width, x + tile_width); int row = y; for (int ty = 0; ty < ty1; ++ty, ++row) { - std::copy(image.getRow(row, x), image.getRow(row, tx1), image_data_out.get() + ty * tile_width); + std::copy(image.get_row(row, x), image.get_row(row, tx1), image_out.get() + ty * tile_width); } - if (TIFFWriteEncodedTile(output, TIFFComputeTile(output, x, y, 0, 0), image_data_out.get(), tile_size * sizeof(pixel_type)) == -1) + if (TIFFWriteEncodedTile(output, TIFFComputeTile(output, x, y, 0, 0), image_out.get(), tile_size * sizeof(pixel_type)) == -1) { - throw ImageWriterException("Could not write TIFF - TIFF Tile Write failed"); + throw image_writer_exception("Could not write TIFF - TIFF Tile Write failed"); } } } diff --git a/include/mapnik/timer.hpp b/include/mapnik/timer.hpp index 22a67a339..8111ff645 100644 --- a/include/mapnik/timer.hpp +++ b/include/mapnik/timer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/tolerance_iterator.hpp b/include/mapnik/tolerance_iterator.hpp index 041cb114a..2b9512c8b 100644 --- a/include/mapnik/tolerance_iterator.hpp +++ b/include/mapnik/tolerance_iterator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/transform_expression.hpp b/include/mapnik/transform_expression.hpp index d73554b5a..9714b1eeb 100644 --- a/include/mapnik/transform_expression.hpp +++ b/include/mapnik/transform_expression.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -53,9 +53,6 @@ struct matrix_node expr_node e_; expr_node f_; - explicit matrix_node(double const* m) - : a_(m[0]), b_(m[1]), c_(m[2]), d_(m[3]), e_(m[4]), f_(m[5]) {} - template explicit matrix_node(T const& m) : a_(m.sx), b_(m.shy), c_(m.shx), d_(m.sy), e_(m.tx), f_(m.ty) {} diff --git a/include/mapnik/transform_expression_grammar.hpp b/include/mapnik/transform_expression_grammar.hpp index 6772c80cd..f3945f39b 100644 --- a/include/mapnik/transform_expression_grammar.hpp +++ b/include/mapnik/transform_expression_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/transform_expression_grammar_impl.hpp b/include/mapnik/transform_expression_grammar_impl.hpp index 59ca57a33..f72126eb7 100644 --- a/include/mapnik/transform_expression_grammar_impl.hpp +++ b/include/mapnik/transform_expression_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/transform_path_adapter.hpp b/include/mapnik/transform_path_adapter.hpp index bb85aa1b1..cb68e9139 100644 --- a/include/mapnik/transform_path_adapter.hpp +++ b/include/mapnik/transform_path_adapter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -57,16 +57,16 @@ struct transform_path_adapter using value_type = typename select_value_type::type; transform_path_adapter(Transform const& t, - Geometry & geom, - proj_transform const& prj_trans) + Geometry & geom, + proj_transform const& prj_trans) : t_(&t), - geom_(geom), - prj_trans_(&prj_trans) {} + geom_(geom), + prj_trans_(&prj_trans) {} explicit transform_path_adapter(Geometry & geom) : t_(0), - geom_(geom), - prj_trans_(0) {} + geom_(geom), + prj_trans_(0) {} void set_proj_trans(proj_transform const& prj_trans) { diff --git a/include/mapnik/transform_processor.hpp b/include/mapnik/transform_processor.hpp index 58f7e7c09..fd45ecc38 100644 --- a/include/mapnik/transform_processor.hpp +++ b/include/mapnik/transform_processor.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/unicode.hpp b/include/mapnik/unicode.hpp index 89526f5d4..59401abfa 100644 --- a/include/mapnik/unicode.hpp +++ b/include/mapnik/unicode.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/boost_geometry_adapters.hpp b/include/mapnik/util/boost_geometry_adapters.hpp deleted file mode 100644 index ca99fbc84..000000000 --- a/include/mapnik/util/boost_geometry_adapters.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2015 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 BOOST_GEOMETRY_ADAPTERS_HPP -#define BOOST_GEOMETRY_ADAPTERS_HPP - -// boost -#include -#include -#include -#include - -BOOST_GEOMETRY_REGISTER_POINT_2D(mapnik::coord2d, double, cs::cartesian, x, y) - -// register mapnik::box2d -namespace boost { namespace geometry { namespace traits -{ - -template<> struct tag > { using type = box_tag; }; - -template<> struct point_type > { using type = mapnik::coord2d; }; - -template <> -struct indexed_access, min_corner, 0> -{ - using ct = coordinate_type::type; - static inline ct get(mapnik::box2d const& b) { return b.minx();} - static inline void set(mapnik::box2d &b, ct const& value) { b.set_minx(value); } -}; - -template <> -struct indexed_access, min_corner, 1> -{ - using ct = coordinate_type::type; - static inline ct get(mapnik::box2d const& b) { return b.miny();} - static inline void set(mapnik::box2d &b, ct const& value) { b.set_miny(value); } -}; - -template <> -struct indexed_access, max_corner, 0> -{ - using ct = coordinate_type::type; - static inline ct get(mapnik::box2d const& b) { return b.maxx();} - static inline void set(mapnik::box2d &b, ct const& value) { b.set_maxx(value); } -}; - -template <> -struct indexed_access, max_corner, 1> -{ - using ct = coordinate_type::type; - static inline ct get(mapnik::box2d const& b) { return b.maxy();} - static inline void set(mapnik::box2d &b , ct const& value) { b.set_maxy(value); } -}; - -}}} - - -#endif //BOOST_GEOMETRY_ADAPTERS_HPP diff --git a/include/mapnik/util/const_rendering_buffer.hpp b/include/mapnik/util/const_rendering_buffer.hpp new file mode 100644 index 000000000..360eea564 --- /dev/null +++ b/include/mapnik/util/const_rendering_buffer.hpp @@ -0,0 +1,58 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_CONST_RENDERING_BUFFER_HPP +#define MAPNIK_CONST_RENDERING_BUFFER_HPP + +#include + +#include "agg_basics.h" + +#include + +namespace mapnik { namespace util { + +// non-mutable rendering_buffer implementation +template +struct rendering_buffer +{ + using image_type = T; + using pixel_type = typename image_type::pixel_type; + using row_data = agg::const_row_info; + + rendering_buffer(T const& data) + : data_(data) {} + + uint8_t const* buf() const { return data_.bytes(); } + std::size_t width() const { return data_.width();} + std::size_t height() const { return data_.height();} + int stride() const { return data_.row_size();} + uint8_t const* row_ptr(int, int y, unsigned) {return row_ptr(y);} + uint8_t const* row_ptr(int y) const { return reinterpret_cast(data_.get_row(static_cast(y))); } + row_data row (int y) const { return row_data(0, safe_cast(data_.width() - 1), row_ptr(y)); } + image_type const& data_; +}; + + +}} + +#endif // MAPNIK_CONST_RENDERING_BUFFER_HPP \ No newline at end of file diff --git a/include/mapnik/util/container_adapter.hpp b/include/mapnik/util/container_adapter.hpp index f3ae03c1a..e07d7091f 100644 --- a/include/mapnik/util/container_adapter.hpp +++ b/include/mapnik/util/container_adapter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,48 +24,82 @@ #define CONTAINER_ADAPTER_HPP // mapnik -#include -#include + + #include // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #pragma GCC diagnostic pop namespace boost { namespace spirit { namespace traits { template <> -struct is_container : mpl::true_ {} ; +struct is_container : mpl::true_ {} ; + +template <> +struct is_container : mpl::true_ {} ; // make gcc and darwin toolsets happy. -template <> -struct is_container : mpl::false_ {} ; +// FIXME +//template <> +//struct is_container : mpl::false_ {} ; +// template <> -struct container_iterator +struct container_iterator { - using type = mapnik::util::path_iterator; + using type = mapnik::util::path_iterator; }; template <> -struct begin_container +struct container_iterator { - static mapnik::util::path_iterator - call (mapnik::geometry_type const& g) + using type = mapnik::util::path_iterator; +}; + +template <> +struct begin_container +{ + static mapnik::util::path_iterator + call (mapnik::path_type const& p) { - return mapnik::util::path_iterator(g); + return mapnik::util::path_iterator(p); } }; template <> -struct end_container +struct begin_container { - static mapnik::util::path_iterator - call (mapnik::geometry_type const&) + static mapnik::util::path_iterator + call (mapnik::vertex_adapter const& p) { - return mapnik::util::path_iterator(); + return mapnik::util::path_iterator(p); + } +}; + +template <> +struct end_container +{ + static mapnik::util::path_iterator + call (mapnik::path_type const&) + { + return mapnik::util::path_iterator(); + } +}; + +template <> +struct end_container +{ + static mapnik::util::path_iterator + call (mapnik::vertex_adapter const&) + { + return mapnik::util::path_iterator(); } }; diff --git a/include/mapnik/util/conversions.hpp b/include/mapnik/util/conversions.hpp index de5bd2f93..284d20e03 100644 --- a/include/mapnik/util/conversions.hpp +++ b/include/mapnik/util/conversions.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,8 +28,8 @@ #include // stl +#include #include -#include namespace mapnik { namespace util { @@ -39,32 +39,8 @@ to avoid the compile time overhead given it is included by many other headers inside mapnik. */ -MAPNIK_DECL inline bool string2bool(std::string const& value, bool & result) -{ - if (value.empty() || value.size() > 5) { - return false; - } else if (value == "true") { - return result = true; - } else if (value == "false") { - result = false; - return true; - } - std::string val(value); - std::transform(val.begin(), val.end(), val.begin(), ::tolower); - if (val == "true" || val == "yes" || val == "1" || val == "on") { - return result = true; - } else if (val == "false" || val == "no" || val == "0" || val == "off") { - result = false; - return true; - } - return false; -} - -MAPNIK_DECL inline bool string2bool(const char * iter, const char * end, bool & result) -{ - std::string val(iter,end); - return string2bool(val,result); -} +MAPNIK_DECL bool string2bool(std::string const& value, bool & result); +MAPNIK_DECL bool string2bool(const char * iter, const char * end, bool & result); MAPNIK_DECL bool string2int(std::string const& value, int & result); MAPNIK_DECL bool string2int(const char * iter, const char * end, int & result); diff --git a/include/mapnik/util/dasharray_parser.hpp b/include/mapnik/util/dasharray_parser.hpp index e5079b2b1..0ef1ae887 100644 --- a/include/mapnik/util/dasharray_parser.hpp +++ b/include/mapnik/util/dasharray_parser.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/bindings/python/boost_std_shared_shim.hpp b/include/mapnik/util/feature_to_geojson.hpp similarity index 62% rename from bindings/python/boost_std_shared_shim.hpp rename to include/mapnik/util/feature_to_geojson.hpp index e76ed58c0..ad3c0a7d4 100644 --- a/bindings/python/boost_std_shared_shim.hpp +++ b/include/mapnik/util/feature_to_geojson.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,30 +20,23 @@ * *****************************************************************************/ -#ifndef MAPNIK_PYTHON_BOOST_STD_SHARED_SHIM -#define MAPNIK_PYTHON_BOOST_STD_SHARED_SHIM +#ifndef MAPNIK_FEATURE_TO_GEOJSON_HPP +#define MAPNIK_FEATURE_TO_GEOJSON_HPP -// boost -#include -#include +// mapnik -#if BOOST_VERSION < 105300 || defined BOOST_NO_CXX11_SMART_PTR +#include -// https://github.com/mapnik/mapnik/issues/2022 -#include +namespace mapnik { namespace util { -namespace boost { -template const T* get_pointer(std::shared_ptr const& p) +inline bool to_geojson(std::string & json, mapnik::feature_impl const& feat) { - return p.get(); + using sink_type = std::back_insert_iterator; + static const mapnik::json::feature_generator_grammar grammar; + sink_type sink(json); + return boost::spirit::karma::generate(sink, grammar, feat); } -template T* get_pointer(std::shared_ptr& p) -{ - return p.get(); -} -} // namespace boost +}} -#endif - -#endif // MAPNIK_PYTHON_BOOST_STD_SHARED_SHIM +#endif // MAPNIK_FEATURE_TO_GEOJSON_HPP diff --git a/include/mapnik/util/featureset_buffer.hpp b/include/mapnik/util/featureset_buffer.hpp index 842cc8e1e..8689a41e9 100644 --- a/include/mapnik/util/featureset_buffer.hpp +++ b/include/mapnik/util/featureset_buffer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/file_io.hpp b/include/mapnik/util/file_io.hpp index 6c6553340..d3ffe9034 100644 --- a/include/mapnik/util/file_io.hpp +++ b/include/mapnik/util/file_io.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,10 +24,9 @@ #define MAPNIK_FILE_IO_HPP // mapnik -#include #include #include -//#include +#include // stl #include @@ -66,7 +65,7 @@ public: inline std::FILE * get() const { - return file_.get();; + return file_.get(); } inline std::size_t size() const diff --git a/include/mapnik/util/fs.hpp b/include/mapnik/util/fs.hpp index 3e01b9694..03905cb45 100644 --- a/include/mapnik/util/fs.hpp +++ b/include/mapnik/util/fs.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/geometry_to_ds_type.hpp b/include/mapnik/util/geometry_to_ds_type.hpp index d1b09d009..58fc89df2 100644 --- a/include/mapnik/util/geometry_to_ds_type.hpp +++ b/include/mapnik/util/geometry_to_ds_type.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,43 +20,71 @@ * *****************************************************************************/ -#ifndef MAPNIK_GEOMETRY_TO_DS_TYPE -#define MAPNIK_GEOMETRY_TO_DS_TYPE +#ifndef MAPNIK_GEOMETRY_TO_DS_TYPE_HPP +#define MAPNIK_GEOMETRY_TO_DS_TYPE_HPP // mapnik #include #include -#include - +#include +#include // boost #include namespace mapnik { namespace util { - static inline void to_ds_type(mapnik::geometry_container const& paths, - boost::optional & result) +namespace detail { + +struct datasource_geometry_type +{ + mapnik::datasource_geometry_t operator () (mapnik::geometry::geometry_empty const&) const { - if (paths.size() == 1) - { - result.reset(static_cast(paths.front().type())); - } - else if (paths.size() > 1) - { - int multi_type = 0; - for (auto const& geom : paths) - { - int type = static_cast(geom.type()); - if (multi_type > 0 && multi_type != type) - { - result.reset(datasource::Collection); - } - multi_type = type; - result.reset(static_cast(type)); - } - } + return mapnik::datasource_geometry_t::Unknown; } - }} + mapnik::datasource_geometry_t operator () (mapnik::geometry::point const&) const + { + return mapnik::datasource_geometry_t::Point; + } + + mapnik::datasource_geometry_t operator () (mapnik::geometry::line_string const&) const + { + return mapnik::datasource_geometry_t::LineString; + } + + mapnik::datasource_geometry_t operator () (mapnik::geometry::polygon const&) const + { + return mapnik::datasource_geometry_t::Polygon; + } + + mapnik::datasource_geometry_t operator () (mapnik::geometry::multi_point const&) const + { + return mapnik::datasource_geometry_t::Point; + } + + mapnik::datasource_geometry_t operator () (mapnik::geometry::multi_line_string const&) const + { + return mapnik::datasource_geometry_t::LineString; + } + + mapnik::datasource_geometry_t operator () (mapnik::geometry::multi_polygon const&) const + { + return mapnik::datasource_geometry_t::Polygon; + } + + mapnik::datasource_geometry_t operator () (mapnik::geometry::geometry_collection const&) const + { + return mapnik::datasource_geometry_t::Collection; + } +}; +} // detail + +static inline mapnik::datasource_geometry_t to_ds_type(mapnik::geometry::geometry const& geom) +{ + return util::apply_visitor(detail::datasource_geometry_type(), geom); +} + +}} -#endif // MAPNIK_GEOMETRY_TO_DS_TYPE +#endif // MAPNIK_GEOMETRY_TO_DS_TYPE_HPP diff --git a/include/mapnik/util/geometry_to_geojson.hpp b/include/mapnik/util/geometry_to_geojson.hpp index 42f73bc09..5cccb0950 100644 --- a/include/mapnik/util/geometry_to_geojson.hpp +++ b/include/mapnik/util/geometry_to_geojson.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,23 +24,15 @@ #define MAPNIK_GEOMETRY_TO_GEOJSON_HPP // mapnik -#include + #include namespace mapnik { namespace util { -inline bool to_geojson(std::string & json, mapnik::geometry_type const& geom) +inline bool to_geojson(std::string & json, mapnik::geometry::geometry const& geom) { using sink_type = std::back_insert_iterator; - static const mapnik::json::geometry_generator_grammar grammar; - sink_type sink(json); - return boost::spirit::karma::generate(sink, grammar, geom); -} - -inline bool to_geojson(std::string & json, mapnik::geometry_container const& geom) -{ - using sink_type = std::back_insert_iterator; - static const mapnik::json::multi_geometry_generator_grammar grammar; + static const mapnik::json::geometry_generator_grammar > grammar; sink_type sink(json); return boost::spirit::karma::generate(sink, grammar, geom); } diff --git a/include/mapnik/util/geometry_to_svg.hpp b/include/mapnik/util/geometry_to_svg.hpp index 61dd7b796..9efb55134 100644 --- a/include/mapnik/util/geometry_to_svg.hpp +++ b/include/mapnik/util/geometry_to_svg.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,8 +25,6 @@ // mapnik #include -#include -#include #include // boost @@ -40,7 +38,8 @@ inline bool to_svg(std::string & svg, mapnik::geometry_type const& geom) { using sink_type = std::back_insert_iterator; sink_type sink(svg); - static const svg::svg_path_generator generator; + mapnik::vertex_adapter va(geom); + static const svg::svg_path_generator generator; bool result = karma::generate(sink, generator, geom); return result; } diff --git a/include/mapnik/util/geometry_to_wkb.hpp b/include/mapnik/util/geometry_to_wkb.hpp index ad4ddedf0..bb9d05b34 100644 --- a/include/mapnik/util/geometry_to_wkb.hpp +++ b/include/mapnik/util/geometry_to_wkb.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,9 +26,9 @@ // mapnik #include #include +#include #include -#include -#include +#include // stl #include @@ -38,17 +38,17 @@ #include #include -namespace mapnik { namespace util { +namespace mapnik { namespace util { namespace detail { -std::string to_hex(const char* blob, unsigned size) +std::string to_hex(const char* blob, std::size_t size) { std::string buf; - buf.reserve(size*2); + buf.reserve(size * 2); std::ostringstream s(buf); s.seekp(0); char hex[3]; - std::memset(hex,0,3); - for ( unsigned pos=0; pos < size; ++pos) + std::memset(hex, 0, 3); + for (std::size_t pos = 0; pos < size; ++pos) { std::sprintf (hex, "%02x", int(blob[pos]) & 0xff); s << hex; @@ -56,12 +56,6 @@ std::string to_hex(const char* blob, unsigned size) return s.str(); } -enum wkbByteOrder : std::uint8_t { - wkbXDR=0, - wkbNDR=1 -}; - - inline void reverse_bytes(char size, char *address) { char * first = address; @@ -113,7 +107,7 @@ struct wkb_buffer { wkb_buffer(std::size_t size) : size_(size), - data_( (size_!=0) ? static_cast(::operator new (size_)):0) + data_( (size_ != 0) ? static_cast(::operator new (size_)) : 0) {} ~wkb_buffer() @@ -137,168 +131,183 @@ struct wkb_buffer using wkb_buffer_ptr = std::unique_ptr; -template -wkb_buffer_ptr to_point_wkb( GeometryType const& g, wkbByteOrder byte_order) +wkb_buffer_ptr point_wkb( geometry::point const& pt, wkbByteOrder byte_order) { - assert(g.size() == 1); - std::size_t size = 1 + 4 + 8*2 ; // byteOrder + wkbType + Point + std::size_t size = 1 + 4 + 8 * 2 ; // byteOrder + wkbType + Point wkb_buffer_ptr wkb = std::make_unique(size); wkb_stream ss(wkb->buffer(), wkb->size()); ss.write(reinterpret_cast(&byte_order),1); - int type = static_cast(mapnik::geometry_type::types::Point); - write(ss,type,4,byte_order); - double x = 0; - double y = 0; - g.vertex(0,&x,&y); - write(ss,x,8,byte_order); - write(ss,y,8,byte_order); + write(ss, static_cast(geometry::geometry_types::Point), 4 , byte_order); + write(ss, pt.x, 8, byte_order); + write(ss, pt.y, 8, byte_order); assert(ss.good()); - return std::move(wkb); -} - -template -wkb_buffer_ptr to_line_string_wkb( GeometryType const& g, wkbByteOrder byte_order) -{ - unsigned num_points = g.size(); - assert(num_points > 1); - std::size_t size = 1 + 4 + 4 + 8*2*num_points ; // byteOrder + wkbType + numPoints + Point*numPoints - wkb_buffer_ptr wkb = std::make_unique(size); - wkb_stream ss(wkb->buffer(), wkb->size()); - ss.write(reinterpret_cast(&byte_order),1); - int type = static_cast(mapnik::geometry_type::types::LineString); - write(ss,type,4,byte_order); - write(ss,num_points,4,byte_order); - double x = 0; - double y = 0; - for (unsigned i=0; i< num_points; ++i) - { - g.vertex(i,&x,&y); - write(ss,x,8,byte_order); - write(ss,y,8,byte_order); - } - assert(ss.good()); - return std::move(wkb); -} - -template -wkb_buffer_ptr to_polygon_wkb( GeometryType const& g, wkbByteOrder byte_order) -{ - unsigned num_points = g.size(); - assert(num_points > 1); - - using point_type = std::pair; - using linear_ring = std::vector; - std::vector rings; - - double x = 0; - double y = 0; - std::size_t size = 1 + 4 + 4 ; // byteOrder + wkbType + numRings - for (unsigned i=0; i< num_points; ++i) - { - unsigned command = g.vertex(i,&x,&y); - if (command == SEG_MOVETO) - { - linear_ring ring; - ring.reserve(1); - ring.emplace_back(x,y); - rings.push_back(std::move(ring)); // start new loop - size += 4; // num_points - size += 2 * 8; // point - } - else if (command == SEG_LINETO) - { - rings.back().emplace_back(x,y); - size += 2 * 8; // point - } - } - unsigned num_rings = rings.size(); - wkb_buffer_ptr wkb = std::make_unique(size); - wkb_stream ss(wkb->buffer(), wkb->size()); - ss.write(reinterpret_cast(&byte_order),1); - int type = static_cast(mapnik::geometry_type::types::Polygon); - write(ss,type,4,byte_order); - write(ss,num_rings,4,byte_order); - - for ( linear_ring const& ring : rings) - { - unsigned num_ring_points = ring.size(); - write(ss,num_ring_points,4,byte_order); - for ( point_type const& pt : ring) - { - write(ss,pt.first,8,byte_order); - write(ss,pt.second,8,byte_order); - } - } - - assert(ss.good()); - return std::move(wkb); -} - -template -wkb_buffer_ptr to_wkb(GeometryType const& g, wkbByteOrder byte_order ) -{ - wkb_buffer_ptr wkb; - - switch (g.type()) - { - case mapnik::geometry_type::types::Point: - wkb = to_point_wkb(g, byte_order); - break; - case mapnik::geometry_type::types::LineString: - wkb = to_line_string_wkb(g, byte_order); - break; - case mapnik::geometry_type::types::Polygon: - wkb = to_polygon_wkb(g, byte_order); - break; - default: - break; - } return wkb; } -wkb_buffer_ptr to_wkb(geometry_container const& paths, wkbByteOrder byte_order ) +wkb_buffer_ptr line_string_wkb(geometry::line_string const& line, wkbByteOrder byte_order) { - if (paths.size() == 1) + std::size_t num_points = line.size(); + assert(num_points > 1); + std::size_t size = 1 + 4 + 4 + 8 * 2 * num_points ; // byteOrder + wkbType + numPoints + Point*numPoints + wkb_buffer_ptr wkb = std::make_unique(size); + wkb_stream ss(wkb->buffer(), wkb->size()); + ss.write(reinterpret_cast(&byte_order),1); + write(ss, static_cast(mapnik::geometry::geometry_types::LineString) , 4, byte_order); + write(ss, num_points, 4, byte_order); + for (std::size_t i=0; i< num_points; ++i) { - // single geometry - return to_wkb(paths.front(), byte_order); + geometry::point const& pt = line[i]; + write(ss, pt.x, 8, byte_order); + write(ss, pt.y, 8, byte_order); } - - if (paths.size() > 1) - { - // multi geometry or geometry collection - std::vector wkb_cont; - bool collection = false; - int multi_type = 0; - size_t multi_size = 1 + 4 + 4; - - for (auto const& geom : paths) - { - wkb_buffer_ptr wkb = to_wkb(geom,byte_order); - multi_size += wkb->size(); - int type = static_cast(geom.type()); - if (multi_type > 0 && multi_type != geom.type()) - collection = true; - multi_type = type; - wkb_cont.push_back(std::move(wkb)); - } - - wkb_buffer_ptr multi_wkb = std::make_unique(multi_size); - wkb_stream ss(multi_wkb->buffer(), multi_wkb->size()); - ss.write(reinterpret_cast(&byte_order),1); - multi_type = collection ? 7 : multi_type + 3; - write(ss,multi_type, 4, byte_order); - write(ss,paths.size(),4,byte_order); - - for ( wkb_buffer_ptr const& wkb : wkb_cont) - { - ss.write(wkb->buffer(),wkb->size()); - } - return std::move(multi_wkb); - } - - return wkb_buffer_ptr(); + assert(ss.good()); + return wkb; } + +wkb_buffer_ptr polygon_wkb( geometry::polygon const& poly, wkbByteOrder byte_order) +{ + std::size_t size = 1 + 4 + 4 ; // byteOrder + wkbType + numRings + size += 4 + 2 * 8 * poly.exterior_ring.size(); + for ( auto const& ring : poly.interior_rings) + { + + size += 4 + 2 * 8 * ring.size(); + } + + wkb_buffer_ptr wkb = std::make_unique(size); + wkb_stream ss(wkb->buffer(), wkb->size()); + ss.write(reinterpret_cast(&byte_order),1); + write(ss, static_cast(mapnik::geometry::geometry_types::Polygon), 4, byte_order); + write(ss, poly.num_rings(), 4, byte_order); + + // exterior + write(ss, poly.exterior_ring.size(), 4, byte_order); + for (auto const& pt : poly.exterior_ring) + { + write(ss, pt.x, 8, byte_order); + write(ss, pt.y, 8, byte_order); + } + // interiors + for (auto const& ring : poly.interior_rings) + { + write(ss, ring.size(), 4, byte_order); + for ( auto const& pt : ring) + { + write(ss, pt.x, 8, byte_order); + write(ss, pt.y, 8, byte_order); + } + } + + assert(ss.good()); + return wkb; +} + +wkb_buffer_ptr multi_point_wkb( geometry::multi_point const& multi_pt, wkbByteOrder byte_order) +{ + std::size_t size = 1 + 4 + 4 + (1 + 4 + 8 * 2) * multi_pt.size() ; // byteOrder + wkbType + num_point + Point.size * num_points + wkb_buffer_ptr wkb = std::make_unique(size); + wkb_stream ss(wkb->buffer(), wkb->size()); + ss.write(reinterpret_cast(&byte_order),1); + write(ss, static_cast(geometry::geometry_types::MultiPoint), 4, byte_order); + write(ss, multi_pt.size(), 4 ,byte_order); + for (auto const& pt : multi_pt) + { + ss.write(reinterpret_cast(&byte_order),1); + write(ss, static_cast(geometry::geometry_types::Point), 4, byte_order); + write(ss, pt.x, 8, byte_order); + write(ss, pt.y, 8, byte_order); + } + assert(ss.good()); + return wkb; +} + + +template + wkb_buffer_ptr multi_geom_wkb(MultiGeometry const& multi_geom, wkbByteOrder byte_order); + +struct geometry_to_wkb +{ + + using result_type = wkb_buffer_ptr; + + geometry_to_wkb(wkbByteOrder byte_order) + : byte_order_(byte_order) {} + + result_type operator() (geometry::geometry const& geom) const + { + return util::apply_visitor(*this, geom); + } + + result_type operator() (geometry::geometry_empty const&) const + { + return result_type(); + } + + result_type operator() (geometry::point const& pt) const + { + return point_wkb(pt, byte_order_); + } + + result_type operator() (geometry::line_string const& line) const + { + return line_string_wkb(line, byte_order_); + } + + result_type operator() (geometry::polygon const& poly) const + { + return polygon_wkb(poly, byte_order_); + } + + // multi/collection + + result_type operator() (geometry::multi_point const& multi_pt) const + { + return multi_point_wkb(multi_pt, byte_order_); + } + + template + result_type operator() (Geometry const& geom) const + { + return multi_geom_wkb(geom, byte_order_); + } + + wkbByteOrder byte_order_; +}; + +template +wkb_buffer_ptr multi_geom_wkb(MultiGeometry const& multi_geom, wkbByteOrder byte_order) +{ + size_t multi_size = 1 + 4 + 4; + std::vector wkb_cont; + for (auto const& geom : multi_geom) + { + wkb_buffer_ptr wkb = geometry_to_wkb(byte_order)(geom); + multi_size += wkb->size(); + wkb_cont.push_back(std::move(wkb)); + } + wkb_buffer_ptr multi_wkb = std::make_unique(multi_size); + wkb_stream ss(multi_wkb->buffer(), multi_wkb->size()); + ss.write(reinterpret_cast(&byte_order),1); + write(ss, static_cast(geometry::detail::geometry_type()(multi_geom)) , 4, byte_order); + write(ss, multi_geom.size(), 4 ,byte_order); + + for ( wkb_buffer_ptr const& wkb : wkb_cont) + { + ss.write(wkb->buffer(), wkb->size()); + } + + return multi_wkb; +} +} // ns detail + +using wkb_buffer_ptr = detail::wkb_buffer_ptr; + +template +wkb_buffer_ptr to_wkb(GeometryType const& geom, wkbByteOrder byte_order ) +{ + return detail::geometry_to_wkb(byte_order)(geom); +} + }} #endif // MAPNIK_GEOMETRY_TO_WKB_HPP diff --git a/include/mapnik/util/geometry_to_wkt.hpp b/include/mapnik/util/geometry_to_wkt.hpp index aef1226b3..3c81ef440 100644 --- a/include/mapnik/util/geometry_to_wkt.hpp +++ b/include/mapnik/util/geometry_to_wkt.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,28 +24,32 @@ #define MAPNIK_GEOMETRY_TO_WKT_HPP // mapnik -#include -#include +#include #include +// boost +#include + namespace mapnik { namespace util { -inline bool to_wkt(std::string & wkt, mapnik::geometry_type const& geom) +inline bool to_wkt(std::string & wkt, mapnik::geometry::geometry const& geom) { using sink_type = std::back_insert_iterator; + static const mapnik::wkt::wkt_generator_grammar> generator; sink_type sink(wkt); - static const mapnik::wkt::wkt_generator generator(true); return boost::spirit::karma::generate(sink, generator, geom); } -inline bool to_wkt(std::string & wkt, mapnik::geometry_container const& geom) +inline bool to_wkt(std::string & wkt, mapnik::geometry::geometry const& geom) { using sink_type = std::back_insert_iterator; + static const mapnik::wkt::wkt_generator_grammar> generator; sink_type sink(wkt); - static const mapnik::wkt::wkt_multi_generator generator; return boost::spirit::karma::generate(sink, generator, geom); } }} + + #endif // MAPNIK_GEOMETRY_TO_WKT_HPP diff --git a/include/mapnik/util/hsl.hpp b/include/mapnik/util/hsl.hpp index 536f9e7ff..d060da92f 100644 --- a/include/mapnik/util/hsl.hpp +++ b/include/mapnik/util/hsl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -59,14 +59,17 @@ inline double hue_to_rgb(double m1, double m2, double h) inline void hsl2rgb(double h, double s, double l, double & r, double & g, double & b) { - if (!s) { + if (s == 0.0) { r = g = b = l; } - double m2 = (l <= 0.5) ? l * (s + 1.0) : l + s - l * s; - double m1 = l * 2.0 - m2; - r = hue_to_rgb(m1, m2, h + 1.0/3.0); - g = hue_to_rgb(m1, m2, h); - b = hue_to_rgb(m1, m2, h - 1.0/3.0); + else + { + double m2 = (l <= 0.5) ? l * (s + 1.0) : l + s - l * s; + double m1 = l * 2.0 - m2; + r = hue_to_rgb(m1, m2, h + 1.0/3.0); + g = hue_to_rgb(m1, m2, h); + b = hue_to_rgb(m1, m2, h - 1.0/3.0); + } } } diff --git a/include/mapnik/util/is_clockwise.hpp b/include/mapnik/util/is_clockwise.hpp new file mode 100644 index 000000000..248372722 --- /dev/null +++ b/include/mapnik/util/is_clockwise.hpp @@ -0,0 +1,43 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_UTIL_IS_CLOCKWISE_HPP +#define MAPNIK_UTIL_IS_CLOCKWISE_HPP + +namespace mapnik { namespace util { + +template +bool is_clockwise(T const& ring) +{ + double area = 0.0; + std::size_t num_points = ring.size(); + for (std::size_t i = 0; i < num_points; ++i) + { + auto const& p0 = ring[i]; + auto const& p1 = ring[(i + 1) % num_points]; + area += p0.x * p1.y - p0.y * p1.x; + } + return (area < 0.0) ? true : false; +} +}} + +#endif //MAPNIK_UTIL_IS_CLOCKWISE_HPP diff --git a/include/mapnik/unique_lock.hpp b/include/mapnik/util/math.hpp similarity index 81% rename from include/mapnik/unique_lock.hpp rename to include/mapnik/util/math.hpp index 58d113c35..4b24893b1 100644 --- a/include/mapnik/unique_lock.hpp +++ b/include/mapnik/util/math.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,14 +20,16 @@ * *****************************************************************************/ -#ifndef MAPNIK_UNIQUE_LOCK_HPP -#define MAPNIK_UNIQUE_LOCK_HPP +#ifndef MAPNIK_MATH_HPP +#define MAPNIK_MATH_HPP -#include +#include -namespace mapnik -{ - using scoped_lock = std::unique_lock; -} +namespace mapnik { namespace util { + +MAPNIK_DECL double normalize_angle(double angle); + +}} + +#endif -#endif // MAPNIK_UNIQUE_LOCK_HPP diff --git a/include/mapnik/util/noncopyable.hpp b/include/mapnik/util/noncopyable.hpp index e80fb4eb2..1cd4a4a31 100644 --- a/include/mapnik/util/noncopyable.hpp +++ b/include/mapnik/util/noncopyable.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/path_iterator.hpp b/include/mapnik/util/path_iterator.hpp index 11a1b3c0e..319c3461a 100644 --- a/include/mapnik/util/path_iterator.hpp +++ b/include/mapnik/util/path_iterator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,7 @@ // mapnik #include - +#include // boost #include @@ -78,9 +78,58 @@ private: value_type v_; const path_type *vertices_; - unsigned pos_; }; +// specialization for mapnik::path_type - vertex interface has been removed +template <> +class path_iterator + : public boost::iterator_facade< path_iterator, + std::tuple const, + boost::forward_traversal_tag + > +{ + +public: + using path_type = mapnik::path_type; + using value_type = std::tuple; + using size_type = path_type::size_type; + path_iterator() + : v_(mapnik::SEG_END,0,0), + vertices_(), + pos_(0) + {} + + explicit path_iterator(path_type const& vertices) + : vertices_(&vertices), + pos_(0) + { + increment(); + } + +private: + friend class boost::iterator_core_access; + + void increment() + { + std::get<0>(v_) = vertices_->cont_.get_vertex(static_cast(pos_++), &std::get<1>(v_), &std::get<2>(v_)); + } + + bool equal( path_iterator const& other) const + { + return std::get<0>(v_) == std::get<0>(other.v_); + } + + value_type const& dereference() const + { + return v_; + } + + value_type v_; + const path_type *vertices_; + size_type pos_; +}; + + }} diff --git a/include/mapnik/util/recursive_wrapper.hpp b/include/mapnik/util/recursive_wrapper.hpp index 7a212e8fb..16a670f1e 100644 --- a/include/mapnik/util/recursive_wrapper.hpp +++ b/include/mapnik/util/recursive_wrapper.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/rounding_cast.hpp b/include/mapnik/util/rounding_cast.hpp new file mode 100644 index 000000000..d67c066cc --- /dev/null +++ b/include/mapnik/util/rounding_cast.hpp @@ -0,0 +1,48 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_UTIL_ROUNDING_CAST_HPP +#define MAPNIK_UTIL_ROUNDING_CAST_HPP + +#include + +namespace mapnik { +namespace util { + +template +inline +Target rounding_cast ( Source arg ) +{ + typedef boost::numeric::conversion_traits Traits ; + + typedef +boost::numeric::converter + > Converter ; + + return Converter::convert(arg); +} + +} // end util ns +} // end mapnik ns + +#endif //MAPNIK_UTIL_ROUNDING_CAST_HPP + diff --git a/include/mapnik/utils.hpp b/include/mapnik/util/singleton.hpp similarity index 58% rename from include/mapnik/utils.hpp rename to include/mapnik/util/singleton.hpp index c43bebf37..2c4040603 100644 --- a/include/mapnik/utils.hpp +++ b/include/mapnik/util/singleton.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,20 +20,18 @@ * *****************************************************************************/ -#ifndef MAPNIK_UTILS_HPP -#define MAPNIK_UTILS_HPP +#ifndef MAPNIK_UTIL_SINGLETON_HPP +#define MAPNIK_UTIL_SINGLETON_HPP #include -#include // stl #include // std::runtime_error #include // std::atexit #include // operator new - -#ifdef MAPNIK_THREADSAFE +#include +#include #include -#endif namespace mapnik { @@ -56,26 +54,13 @@ template class CreateStatic { private: - union MaxAlign - { - char t_[sizeof(T)]; - short int shortInt_; - int int_; - long int longInt_; - float float_; - double double_; - long double longDouble_; - struct Test; - int Test::* pMember_; - int (Test::*pMemberFn_)(int); - }; - + using storage_type = typename std::aligned_storage::type; public: static T* create() { - static MaxAlign staticMemory; - return new(&staticMemory) T; + static storage_type static_memory; + return new(&static_memory) T; } static void destroy(volatile T* obj) { @@ -89,43 +74,41 @@ template class CreatePolicy=CreateStatic> class MAPNIK_DECL singleton { #else -template class CreatePolicy=CreateStatic> class singleton -{ + template class CreatePolicy=CreateStatic> class singleton + { #endif - friend class CreatePolicy; - static T* pInstance_; - static bool destroyed_; - singleton(const singleton &rhs); - singleton& operator=(const singleton&); + friend class CreatePolicy; + static std::atomic pInstance_; + static bool destroyed_; + singleton(const singleton &rhs); + singleton& operator=(const singleton&); - static void onDeadReference() - { - throw std::runtime_error("dead reference!"); - } + static void onDeadReference() + { + throw std::runtime_error("dead reference!"); + } - static void DestroySingleton() - { - CreatePolicy::destroy(pInstance_); - pInstance_ = 0; - destroyed_ = true; - } + static void DestroySingleton() + { + CreatePolicy::destroy(pInstance_); + pInstance_ = 0; + destroyed_ = true; + } -protected: - -#ifdef MAPNIK_THREADSAFE + protected: static std::mutex mutex_; -#endif singleton() {} + public: static T& instance() { - if (! pInstance_) + T * tmp = pInstance_.load(std::memory_order_acquire); + if (tmp == nullptr) { -#ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); -#endif - if (! pInstance_) + std::lock_guard lock(mutex_); + tmp = pInstance_.load(std::memory_order_relaxed); + if (tmp == nullptr) { if (destroyed_) { @@ -134,37 +117,23 @@ protected: } else { - pInstance_ = CreatePolicy::create(); - + tmp = CreatePolicy::create(); + pInstance_.store(tmp, std::memory_order_release); // register destruction std::atexit(&DestroySingleton); } } } - return *pInstance_; + return *tmp; } -}; + }; -#ifdef MAPNIK_THREADSAFE template class CreatePolicy> std::mutex singleton::mutex_; -#endif - template class CreatePolicy> T* singleton::pInstance_=0; + template class CreatePolicy> std::atomic singleton::pInstance_; template class CreatePolicy> bool singleton::destroyed_=false; - - -#ifdef _WINDOWS - -// UTF8 <--> UTF16 conversion routines - -MAPNIK_DECL std::string utf16_to_utf8(std::wstring const& wstr); -MAPNIK_DECL std::wstring utf8_to_utf16(std::string const& str); - -#endif // _WINDOWS - + template class CreatePolicy> bool singleton::destroyed_ = false; } -#endif // MAPNIK_UTILS_HPP +#endif // MAPNIK_UTIL_SINGLETON_HPP diff --git a/include/mapnik/util/spirit_transform_attribute.hpp b/include/mapnik/util/spirit_transform_attribute.hpp new file mode 100644 index 000000000..1c0bdac54 --- /dev/null +++ b/include/mapnik/util/spirit_transform_attribute.hpp @@ -0,0 +1,208 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_UTIL_SPIRIT_TRANSFORM_ATTRIBUTE_HPP +#define MAPNIK_UTIL_SPIRIT_TRANSFORM_ATTRIBUTE_HPP + +#include + +namespace boost { namespace spirit { namespace traits { + + template <> + struct transform_attribute const, + mapnik::geometry::point const&, karma::domain> + { + using type = mapnik::geometry::point const&; + static type pre(mapnik::geometry::geometry const& geom) + { + return mapnik::util::get >(geom); + } + }; + + template <> + struct transform_attribute const, + mapnik::geometry::line_string const&, karma::domain> + { + using type = mapnik::geometry::line_string const&; + static type pre(mapnik::geometry::geometry const& geom) + { + return mapnik::util::get >(geom); + } + }; + + template <> + struct transform_attribute const, + mapnik::geometry::polygon const&, karma::domain> + { + using type = mapnik::geometry::polygon const&; + static type pre(mapnik::geometry::geometry const& geom) + { + return mapnik::util::get >(geom); + } + }; + + template <> + struct transform_attribute const, + std::vector > const&, karma::domain> + { + using type = std::vector > const&; + static type pre(mapnik::geometry::polygon const& poly) + { + return poly.interior_rings; + } + }; + + template <> + struct transform_attribute const, + mapnik::geometry::multi_point const&, karma::domain> + { + using type = mapnik::geometry::multi_point const&; + static type pre(mapnik::geometry::geometry const& geom) + { + return mapnik::util::get >(geom); + } + }; + + template <> + struct transform_attribute const, + mapnik::geometry::multi_line_string const&, karma::domain> + { + using type = mapnik::geometry::multi_line_string const&; + static type pre(mapnik::geometry::geometry const& geom) + { + return mapnik::util::get >(geom); + } + }; + + template <> + struct transform_attribute const, + mapnik::geometry::multi_polygon const&, karma::domain> + { + using type = mapnik::geometry::multi_polygon const&; + static type pre(mapnik::geometry::geometry const& geom) + { + return mapnik::util::get >(geom); + } + }; + + template <> + struct transform_attribute const, + mapnik::geometry::geometry_collection const&, karma::domain> + { + using type = mapnik::geometry::geometry_collection const&; + static type pre(mapnik::geometry::geometry const& geom) + { + return mapnik::util::get >(geom); + } + }; + + template <> + struct transform_attribute const, + mapnik::geometry::point const&, karma::domain> + { + using type = mapnik::geometry::point const&; + static type pre(mapnik::geometry::geometry const& geom) + { + return mapnik::util::get >(geom); + } + }; + + template <> + struct transform_attribute const, + mapnik::geometry::line_string const&, karma::domain> + { + using type = mapnik::geometry::line_string const&; + static type pre(mapnik::geometry::geometry const& geom) + { + return mapnik::util::get >(geom); + } + }; + + template <> + struct transform_attribute const, + mapnik::geometry::polygon const&, karma::domain> + { + using type = mapnik::geometry::polygon const&; + static type pre(mapnik::geometry::geometry const& geom) + { + return mapnik::util::get >(geom); + } + }; + + template <> + struct transform_attribute const, + std::vector > const&, karma::domain> + { + using type = std::vector > const&; + static type pre(mapnik::geometry::polygon const& poly) + { + return poly.interior_rings; + } + }; + + template <> + struct transform_attribute const, + mapnik::geometry::multi_point const&, karma::domain> + { + using type = mapnik::geometry::multi_point const&; + static type pre(mapnik::geometry::geometry const& geom) + { + return mapnik::util::get >(geom); + } + }; + + template <> + struct transform_attribute const, + mapnik::geometry::multi_line_string const&, karma::domain> + { + using type = mapnik::geometry::multi_line_string const&; + static type pre(mapnik::geometry::geometry const& geom) + { + return mapnik::util::get >(geom); + } + }; + + template <> + struct transform_attribute const, + mapnik::geometry::multi_polygon const&, karma::domain> + { + using type = mapnik::geometry::multi_polygon const&; + static type pre(mapnik::geometry::geometry const& geom) + { + return mapnik::util::get >(geom); + } + }; + + template <> + struct transform_attribute const, + mapnik::geometry::geometry_collection const&, karma::domain> + { + using type = mapnik::geometry::geometry_collection const&; + static type pre(mapnik::geometry::geometry const& geom) + { + return mapnik::util::get >(geom); + } + }; + +}}} + +#endif // MAPNIK_UTIL_SPIRIT_TRANSFORM_ATTRIBUTE_HPP diff --git a/include/mapnik/util/timer.hpp b/include/mapnik/util/timer.hpp index 8f7487812..e29a8eae1 100644 --- a/include/mapnik/util/timer.hpp +++ b/include/mapnik/util/timer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/trim.hpp b/include/mapnik/util/trim.hpp index cc4816dd4..60320331b 100644 --- a/include/mapnik/util/trim.hpp +++ b/include/mapnik/util/trim.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/utf_conv_win.hpp b/include/mapnik/util/utf_conv_win.hpp new file mode 100644 index 000000000..68e28ec15 --- /dev/null +++ b/include/mapnik/util/utf_conv_win.hpp @@ -0,0 +1,43 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_UTIL_UTF_CONV_WIN_HPP +#define MAPNIK_UTIL_UTF_CONV_WIN_HPP + +#ifdef _WINDOWS +// mapnik +#include +// stl +#include + +namespace mapnik +{ + +// UTF8 <--> UTF16 conversion routines + + MAPNIK_DECL std::string utf16_to_utf8(std::wstring const& wstr); + MAPNIK_DECL std::wstring utf8_to_utf16(std::string const& str); + +} +#endif // _WINDOWS + +#endif // MAPNIK_UTIL_UTF_CONV_WIN_HPP diff --git a/include/mapnik/util/variant.hpp b/include/mapnik/util/variant.hpp index 29d0656b1..100088724 100644 --- a/include/mapnik/util/variant.hpp +++ b/include/mapnik/util/variant.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -274,8 +274,23 @@ struct unwrapper> { return obj.get(); } + + auto operator() (recursive_wrapper & obj) const + -> typename recursive_wrapper::type & + { + return obj.get(); + } }; +template +struct unwrapper> +{ + auto operator() (std::reference_wrapper const& obj) const + -> typename recursive_wrapper::type const& + { + return obj.get(); + } +}; template struct dispatcher; @@ -631,7 +646,10 @@ public: type_index = detail::direct_type::index; } - template + // get() + template::index != detail::invalid_value) + >::type* = nullptr> VARIANT_INLINE T& get() { if (type_index == detail::direct_type::index) @@ -640,11 +658,13 @@ public: } else { - throw std::runtime_error("in get()"); + throw std::runtime_error("in get()"); } } - template + template ::index != detail::invalid_value) + >::type* = nullptr> VARIANT_INLINE T const& get() const { if (type_index == detail::direct_type::index) @@ -653,7 +673,69 @@ public: } else { - throw std::runtime_error("in get()"); + throw std::runtime_error("in get()"); + } + } + + // get() - T stored as recursive_wrapper + template , Types...>::index != detail::invalid_value) + >::type* = nullptr> + VARIANT_INLINE T& get() + { + if (type_index == detail::direct_type, Types...>::index) + { + return (*reinterpret_cast*>(&data)).get(); + } + else + { + throw std::runtime_error("in get()"); + } + } + + template , Types...>::index != detail::invalid_value) + >::type* = nullptr> + VARIANT_INLINE T const& get() const + { + if (type_index == detail::direct_type, Types...>::index) + { + return (*reinterpret_cast const*>(&data)).get(); + } + else + { + throw std::runtime_error("in get()"); + } + } + + // get() - T stored as std::reference_wrapper + template , Types...>::index != detail::invalid_value) + >::type* = nullptr> + VARIANT_INLINE T& get() + { + if (type_index == detail::direct_type, Types...>::index) + { + return (*reinterpret_cast*>(&data)).get(); + } + else + { + throw std::runtime_error("in get()"); + } + } + + template , Types...>::index != detail::invalid_value) + >::type* = nullptr> + VARIANT_INLINE T const& get() const + { + if (type_index == detail::direct_type, Types...>::index) + { + return (*reinterpret_cast const*>(&data)).get(); + } + else + { + throw std::runtime_error("in get()"); } } @@ -662,6 +744,10 @@ public: return type_index; } + VARIANT_INLINE int which() const noexcept + { + return static_cast(sizeof...(Types) - type_index - 1); + } // visitor // unary template @@ -768,19 +854,17 @@ auto VARIANT_INLINE static apply_visitor(F f, V & v0, V & v1) -> decltype(V::bin // getter interface template -ResultType & get(T & var) +ResultType & get(T & var) { return var.template get(); } template -ResultType const& get(T const& var) +ResultType const& get(T const& var) { return var.template get(); } - - }} #endif // MAPNIK_UTIL_VARIANT_HPP diff --git a/include/mapnik/util/variant_io.hpp b/include/mapnik/util/variant_io.hpp index fc996e7f9..8839a7e22 100644 --- a/include/mapnik/util/variant_io.hpp +++ b/include/mapnik/util/variant_io.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -43,6 +43,16 @@ public: { out_ << operand; } + +/// specialized visitor for boolean + void operator()(bool const & val) const + { + if (val) { + out_ << "true"; + } else { + out_ << "false"; + } + } private: Out & out_; }; diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 29d4000bc..8a59b8383 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -717,6 +717,11 @@ struct convert return str; } + std::string operator() (value_bool val) const + { + return val ? "true": "false"; + } + std::string operator() (value_null const&) const { return ""; @@ -747,6 +752,16 @@ struct to_unicode return value_unicode_string(str.c_str()); } + value_unicode_string operator() (value_bool val) const + { + if (val) { + std::string str("true"); + return value_unicode_string(str.c_str()); + } + std::string str("false"); + return value_unicode_string(str.c_str()); + } + value_unicode_string operator() (value_null const&) const { return value_unicode_string(""); @@ -818,7 +833,7 @@ public: template value ( T && val) - : value_base(std::move(typename detail::mapnik_value_type::type(val))) {} + : value_base(typename detail::mapnik_value_type::type(val)) {} value & operator=( value const& other) = default; @@ -943,7 +958,6 @@ inline std::size_t hash_value(value const& val) } // namespace value_adl_barrier using value_adl_barrier::value; -using value_adl_barrier::operator<<; namespace detail { @@ -975,4 +989,18 @@ inline bool value::is_null() const } // namespace mapnik +// support for std::unordered_xxx +namespace std +{ +template <> +struct hash +{ + size_t operator()(mapnik::value const& val) const + { + return mapnik::mapnik_hash_value(val); + } +}; + +} + #endif // MAPNIK_VALUE_HPP diff --git a/include/mapnik/value_error.hpp b/include/mapnik/value_error.hpp index 1edc5419b..68df62255 100644 --- a/include/mapnik/value_error.hpp +++ b/include/mapnik/value_error.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/value_hash.hpp b/include/mapnik/value_hash.hpp index 0933f06d3..4c12bbe97 100644 --- a/include/mapnik/value_hash.hpp +++ b/include/mapnik/value_hash.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -51,7 +51,7 @@ struct value_hasher std::size_t operator() (value_unicode_string const& val) const { - return val.hashCode(); + return static_cast(val.hashCode()); } template diff --git a/include/mapnik/value_types.hpp b/include/mapnik/value_types.hpp index ffe021869..a250b49b4 100644 --- a/include/mapnik/value_types.hpp +++ b/include/mapnik/value_types.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ // mapnik #include +#include // icu #include // for U_NAMESPACE_QUALIFIER @@ -42,9 +43,13 @@ namespace mapnik { #ifdef BIGINT //using value_integer = boost::long_long_type; -using value_integer = long long; +//using value_integer = long long; +using value_integer = std::int64_t; +using value_integer_pixel = gray64s_t; #else -using value_integer = int; +//using value_integer = int; +using value_integer = std::int32_t; +using value_integer_pixel = gray32s_t; #endif using value_double = double; diff --git a/include/mapnik/version.hpp b/include/mapnik/version.hpp index 8030c5c92..47a200e8f 100644 --- a/include/mapnik/version.hpp +++ b/include/mapnik/version.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,7 +23,7 @@ #ifndef MAPNIK_VERSION_HPP #define MAPNIK_VERSION_HPP -#define MAPNIK_VERSION_IS_RELEASE 0 +#define MAPNIK_VERSION_IS_RELEASE 1 #define MAPNIK_MAJOR_VERSION 3 #define MAPNIK_MINOR_VERSION 0 diff --git a/include/mapnik/vertex.hpp b/include/mapnik/vertex.hpp index 597526d7b..b05f362a5 100644 --- a/include/mapnik/vertex.hpp +++ b/include/mapnik/vertex.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/vertex_adapters.hpp b/include/mapnik/vertex_adapters.hpp new file mode 100644 index 000000000..ae5f0d4a9 --- /dev/null +++ b/include/mapnik/vertex_adapters.hpp @@ -0,0 +1,277 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_VERTEX_ADAPTERS_HPP +#define MAPNIK_VERTEX_ADAPTERS_HPP + +#include +#include +#include + +namespace mapnik { namespace geometry { + +template +struct point_vertex_adapter +{ + using value_type = typename point::value_type; + + point_vertex_adapter(point const& pt) + : pt_(pt), + first_(true) {} + + unsigned vertex(value_type * x, value_type * y) const + { + if (first_) + { + *x = pt_.x; + *y = pt_.y; + first_ = false; + return mapnik::SEG_MOVETO; + } + return mapnik::SEG_END; + } + + void rewind(unsigned) const + { + first_ = true; + } + + inline geometry_types type () const + { + return geometry_types::Point; + } + + point const& pt_; + mutable bool first_; +}; + +template +struct line_string_vertex_adapter +{ + using value_type = typename point::value_type; + line_string_vertex_adapter(line_string const& line) + : line_(line), + current_index_(0), + end_index_(line.size()) + {} + + unsigned vertex(value_type * x, value_type * y) const + { + if (current_index_ != end_index_) + { + point const& coord = line_[current_index_++]; + *x = coord.x; + *y = coord.y; + if (current_index_ == 1) + { + return mapnik::SEG_MOVETO; + } + else + { + return mapnik::SEG_LINETO; + } + } + return mapnik::SEG_END; + } + + void rewind(unsigned) const + { + current_index_ = 0; + } + + inline geometry_types type () const + { + return geometry_types::LineString; + } + + line_string const& line_; + mutable std::size_t current_index_; + const std::size_t end_index_; + +}; + +template +struct polygon_vertex_adapter +{ + using value_type = typename point::value_type; + polygon_vertex_adapter(polygon const& poly) + : poly_(poly), + rings_itr_(0), + rings_end_(poly_.interior_rings.size() + 1), + current_index_(0), + end_index_((rings_itr_ < rings_end_) ? poly_.exterior_ring.size() : 0), + start_loop_(true) {} + + void rewind(unsigned) const + { + rings_itr_ = 0; + rings_end_ = poly_.interior_rings.size() + 1; + current_index_ = 0; + end_index_ = (rings_itr_ < rings_end_) ? poly_.exterior_ring.size() : 0; + start_loop_ = true; + } + + unsigned vertex(value_type * x, value_type * y) const + { + if (rings_itr_ == rings_end_) + { + return mapnik::SEG_END; + } + if (current_index_ < end_index_) + { + point const& coord = (rings_itr_ == 0) ? + poly_.exterior_ring[current_index_++] : poly_.interior_rings[rings_itr_- 1][current_index_++]; + *x = coord.x; + *y = coord.y; + if (start_loop_) + { + start_loop_= false; + return mapnik::SEG_MOVETO; + } + if (current_index_ == end_index_) + { + *x = 0; + *y = 0; + return mapnik::SEG_CLOSE; + } + return mapnik::SEG_LINETO; + } + else if (++rings_itr_ != rings_end_) + { + current_index_ = 0; + end_index_ = poly_.interior_rings[rings_itr_ - 1].size(); + point const& coord = poly_.interior_rings[rings_itr_ - 1][current_index_++]; + *x = coord.x; + *y = coord.y; + return mapnik::SEG_MOVETO; + } + return mapnik::SEG_END; + } + + inline geometry_types type () const + { + return geometry_types::Polygon; + } + +private: + polygon const& poly_; + mutable std::size_t rings_itr_; + mutable std::size_t rings_end_; + mutable std::size_t current_index_; + mutable std::size_t end_index_; + mutable bool start_loop_; +}; + +template +struct ring_vertex_adapter +{ + using value_type = typename point::value_type; + ring_vertex_adapter(linear_ring const& ring) + : ring_(ring), + current_index_(0), + end_index_(ring_.size()), + start_loop_(true) {} + + void rewind(unsigned) const + { + current_index_ = 0; + end_index_ = ring_.size(); + start_loop_ = true; + } + + unsigned vertex(value_type * x, value_type * y) const + { + if (current_index_ < end_index_) + { + auto const& coord = ring_[current_index_++]; + *x = coord.x; + *y = coord.y; + if (start_loop_) + { + start_loop_= false; + return mapnik::SEG_MOVETO; + } + if (current_index_ == end_index_) + { + *x = 0; + *y = 0; + return mapnik::SEG_CLOSE; + } + return mapnik::SEG_LINETO; + } + return mapnik::SEG_END; + } + + inline geometry_types type () const + { + return geometry_types::Polygon; + } + +private: + linear_ring const& ring_; + mutable std::size_t current_index_; + mutable std::size_t end_index_; + mutable bool start_loop_; +}; + +template +struct vertex_adapter_traits {}; + +template <> +struct vertex_adapter_traits > +{ + using type = point_vertex_adapter; +}; + +template <> +struct vertex_adapter_traits > +{ + using type = line_string_vertex_adapter; +}; + +template <> +struct vertex_adapter_traits > +{ + using type = polygon_vertex_adapter; +}; + +template <> +struct vertex_adapter_traits > +{ + using type = point_vertex_adapter; +}; + +template <> +struct vertex_adapter_traits > +{ + using type = line_string_vertex_adapter; +}; + +template <> +struct vertex_adapter_traits > +{ + using type = polygon_vertex_adapter; +}; + +}} + +#endif //MAPNIK_VERTEX_ADAPTERS_HPP diff --git a/include/mapnik/vertex_cache.hpp b/include/mapnik/vertex_cache.hpp index e557d4b30..a0a32e96b 100644 --- a/include/mapnik/vertex_cache.hpp +++ b/include/mapnik/vertex_cache.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -47,7 +47,7 @@ class MAPNIK_DECL vertex_cache : util::noncopyable { struct segment { - segment(double x, double y, double length) : pos(x, y), length(length) {} + segment(double x, double y, double _length) : pos(x, y), length(_length) {} pixel_position pos; //Last point of this segment, first point is implicitly defined by the previous segement in this vector double length; }; @@ -208,7 +208,7 @@ vertex_cache::vertex_cache(T & path) current_subpath_->add_segment(new_x, new_y, 0); first = false; } - if (agg::is_line_to(cmd)) + else if (agg::is_line_to(cmd)) { if (first) { @@ -220,6 +220,14 @@ vertex_cache::vertex_cache(T & path) double segment_length = std::sqrt(dx*dx + dy*dy); current_subpath_->add_segment(new_x, new_y, segment_length); } + else if (agg::is_closed(cmd) && !current_subpath_->vector.empty()) + { + segment const & first_segment = current_subpath_->vector[0]; + double dx = old_x - first_segment.pos.x; + double dy = old_y - first_segment.pos.y; + double segment_length = std::sqrt(dx*dx + dy*dy); + current_subpath_->add_segment(first_segment.pos.x, first_segment.pos.y, segment_length); + } old_x = new_x; old_y = new_y; } diff --git a/include/mapnik/vertex_converters.hpp b/include/mapnik/vertex_converters.hpp index 8207af6d0..f10f720dc 100644 --- a/include/mapnik/vertex_converters.hpp +++ b/include/mapnik/vertex_converters.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,7 +23,6 @@ #ifndef MAPNIK_VERTEX_CONVERTERS_HPP #define MAPNIK_VERTEX_CONVERTERS_HPP - // mapnik #include #include @@ -37,13 +36,12 @@ #include #include #include -#include + // agg #include "agg_math_stroke.h" #include "agg_trans_affine.h" #include "agg_conv_clip_polygon.h" #include "agg_conv_clip_polyline.h" -#include "agg_conv_close_polygon.h" #include "agg_conv_smooth_poly1.h" #include "agg_conv_stroke.h" #include "agg_conv_dash.h" @@ -59,7 +57,6 @@ namespace mapnik { struct transform_tag {}; struct clip_line_tag {}; struct clip_poly_tag {}; -struct close_poly_tag {}; struct smooth_tag {}; struct simplify_tag {}; struct stroke_tag {}; @@ -70,14 +67,10 @@ struct offset_transform_tag {}; namespace detail { template -struct converter_traits -{ - using geometry_type = T0; - using conv_type = geometry_type; -}; +struct converter_traits {}; template -struct converter_traits +struct converter_traits { using geometry_type = T; using conv_type = typename agg::conv_smooth_poly1_curve; @@ -210,15 +203,6 @@ struct converter_traits } }; -template -struct converter_traits -{ - using geometry_type = T; - using conv_type = typename agg::conv_close_polygon; - template - static void setup(geometry_type & , Args const&) {} -}; - template struct converter_traits { @@ -268,6 +252,25 @@ struct converter_traits } }; + +template +struct is_switchable +{ + static constexpr bool value = true; +}; + +template +struct is_switchable +{ + static constexpr bool value = false; +}; + +template +struct is_switchable +{ + static constexpr bool value = false; +}; + template struct converters_helper; @@ -275,7 +278,7 @@ template struct converters_helper { template - static void set(Dispatcher & disp, int state) + static void set(Dispatcher & disp, std::size_t state) { if (std::is_same::value) { @@ -288,8 +291,9 @@ struct converters_helper } } - template - static void forward(Dispatcher & disp, Geometry & geom) + template + static void forward(Dispatcher & disp, Geometry & geom, Processor & proc, + typename std::enable_if::value>::type* = 0) { constexpr std::size_t index = sizeof...(ConverterTypes); if (disp.vec_[index] == 1) @@ -297,63 +301,68 @@ struct converters_helper using conv_type = typename detail::converter_traits::conv_type; conv_type conv(geom); detail::converter_traits::setup(conv,disp.args_); - converters_helper::forward(disp, conv); + converters_helper::forward(disp, conv, proc); } else { - converters_helper::forward(disp, geom); + converters_helper::forward(disp, geom, proc); } } + template + static void forward(Dispatcher & disp, Geometry & geom, Processor & proc, + typename std::enable_if::value>::type* = 0) + { + using conv_type = typename detail::converter_traits::conv_type; + conv_type conv(geom); + detail::converter_traits::setup(conv,disp.args_); + converters_helper::forward(disp, conv, proc); + } }; template struct converters_helper { template - static void set(Dispatcher &, int) {} - template - static void forward(Dispatcher & disp, Geometry & geom) + static void set(Dispatcher &, std::size_t) {} + template + static void forward(Dispatcher &, Geometry & geom, Processor & proc) { - disp.args_.proc.add_path(geom); + proc.add_path(geom); } }; -template +template struct dispatcher : util::noncopyable { using this_type = dispatcher; using args_type = Args; - dispatcher(typename Args::processor_type & proc, box2d const& bbox, symbolizer_base const& sym, view_transform const& tr, + dispatcher(box2d const& bbox, symbolizer_base const& sym, view_transform const& tr, proj_transform const& prj_trans, agg::trans_affine const& affine_trans, feature_impl const& feature, attributes const& vars, double scale_factor) - : args_(proc,bbox,sym,tr,prj_trans,affine_trans,feature,vars,scale_factor) + : args_(bbox,sym,tr,prj_trans,affine_trans,feature,vars,scale_factor) { std::fill(vec_.begin(), vec_.end(), 0); } - std::array vec_; + std::array vec_; args_type args_; }; -template struct arguments : util::noncopyable { - using processor_type = Processor; - arguments(Processor & proc, box2d const& bbox, symbolizer_base const& sym, view_transform const& tr, - proj_transform const& prj_trans, agg::trans_affine const& affine_trans, feature_impl const& feature, - attributes const& vars, double scale_factor) - : proc(proc), - bbox(bbox), - sym(sym), - tr(tr), - prj_trans(prj_trans), - affine_trans(affine_trans), - feature(feature), - vars(vars), - scale_factor(scale_factor) {} + arguments(box2d const& _bbox, symbolizer_base const& _sym, view_transform const& _tr, + proj_transform const& _prj_trans, agg::trans_affine const& _affine_trans, feature_impl const& _feature, + attributes const& _vars, double _scale_factor) + : bbox(_bbox), + sym(_sym), + tr(_tr), + prj_trans(_prj_trans), + affine_trans(_affine_trans), + feature(_feature), + vars(_vars), + scale_factor(_scale_factor) {} - Processor & proc; box2d const& bbox; symbolizer_base const& sym; view_transform const& tr; @@ -366,21 +375,19 @@ struct arguments : util::noncopyable } -template +template struct vertex_converter : private util::noncopyable { using bbox_type = box2d; - using processor_type = Processor; using symbolizer_type = symbolizer_base; using trans_type = view_transform; using proj_trans_type = proj_transform; using affine_trans_type = agg::trans_affine; using feature_type = feature_impl; - using args_type = detail::arguments; - using dispatcher_type = detail::dispatcher; + using args_type = detail::arguments; + using dispatcher_type = detail::dispatcher; vertex_converter(bbox_type const& bbox, - processor_type & proc, symbolizer_type const& sym, trans_type const& tr, proj_trans_type const& prj_trans, @@ -388,11 +395,12 @@ struct vertex_converter : private util::noncopyable feature_type const& feature, attributes const& vars, double scale_factor) - : disp_(proc,bbox,sym,tr,prj_trans,affine_trans,feature,vars,scale_factor) {} + : disp_(bbox,sym,tr,prj_trans,affine_trans,feature,vars,scale_factor) {} - void apply(geometry_type & geom) + template + void apply(VertexAdapter & geom, Processor & proc) { - detail::converters_helper:: template forward(disp_, geom); + detail::converters_helper:: template forward(disp_, geom, proc); } template diff --git a/include/mapnik/vertex_processor.hpp b/include/mapnik/vertex_processor.hpp new file mode 100644 index 000000000..a3b63c133 --- /dev/null +++ b/include/mapnik/vertex_processor.hpp @@ -0,0 +1,111 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_VERTEX_PROCESSOR_HPP +#define MAPNIK_VERTEX_PROCESSOR_HPP + +#include + +namespace mapnik { namespace geometry { + +template +struct vertex_processor +{ + using processor_type = T; + vertex_processor(processor_type& proc) + : proc_(proc) {} + + template + void operator() (Geometry const& geom) + { + util::apply_visitor(*this, geom); + } + void operator() (geometry_empty const&) + { + // no-op + } + + template + void operator() (point const& pt) + { + point_vertex_adapter va(pt); + proc_(va); + } + + template + void operator() (line_string const& line) + { + line_string_vertex_adapter va(line); + proc_(va); + } + + template + void operator() (polygon const& poly) + { + polygon_vertex_adapter va(poly); + proc_(va); + } + + template + void operator() (multi_point const& multi_pt) + { + for (auto const& pt : multi_pt) + { + point_vertex_adapter va(pt); + proc_(va); + } + } + + template + void operator() (multi_line_string const& multi_line) + { + for (auto const& line : multi_line) + { + line_string_vertex_adapter va(line); + proc_(va); + } + } + + template + void operator() (multi_polygon const& multi_poly) + { + for ( auto const& poly : multi_poly) + { + polygon_vertex_adapter va(poly); + proc_(va); + } + } + + template + void operator() (geometry_collection const& collection) + { + for (auto const& geom : collection) + { + operator()(geom); + } + } + processor_type & proc_; +}; + +}} + +#endif // MAPNIK_VERTEX_PROCESSOR_HPP diff --git a/include/mapnik/vertex_vector.hpp b/include/mapnik/vertex_vector.hpp index a25afc22e..67e30fc54 100644 --- a/include/mapnik/vertex_vector.hpp +++ b/include/mapnik/vertex_vector.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/view_strategy.hpp b/include/mapnik/view_strategy.hpp new file mode 100644 index 000000000..0d1125b97 --- /dev/null +++ b/include/mapnik/view_strategy.hpp @@ -0,0 +1,95 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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_VIEW_STRATEGY_HPP +#define MAPNIK_VIEW_STRATEGY_HPP + +// mapnik +#include +#include +// boost +#include +#include + + +namespace mapnik +{ + +struct view_strategy +{ + view_strategy(view_transform const& tr) + : tr_(tr) {} + + template + inline bool apply(P1 const& p1, P2 & p2) const + { + using coordinate_type = typename boost::geometry::coordinate_type::type; + double x = boost::geometry::get<0>(p1); + double y = boost::geometry::get<1>(p1); + tr_.forward(&x,&y); + boost::geometry::set<0>(p2, safe_cast(x)); + boost::geometry::set<1>(p2, safe_cast(y)); + return true; + } + + template + inline P2 execute(P1 const& p1, bool & status) const + { + P2 p2; + status = apply(p1, p2); + return p2; + } + + view_transform const& tr_; +}; + +struct unview_strategy +{ + unview_strategy(view_transform const& tr) + : tr_(tr) {} + + template + inline bool apply(P1 const& p1, P2 & p2) const + { + using coordinate_type = typename boost::geometry::coordinate_type::type; + double x = boost::geometry::get<0>(p1); + double y = boost::geometry::get<1>(p1); + tr_.backward(&x,&y); + boost::geometry::set<0>(p2, static_cast(x)); + boost::geometry::set<1>(p2, static_cast(y)); + return true; + } + + template + inline P2 execute(P1 const& p1, bool & status) const + { + P2 p2; + status = apply(p1, p2); + return p2; + } + + view_transform const& tr_; +}; + +} + +#endif // MAPNIK_VIEW_STRATEGY_HPP diff --git a/include/mapnik/view_transform.hpp b/include/mapnik/view_transform.hpp index d692c7ce1..2f5108c5f 100644 --- a/include/mapnik/view_transform.hpp +++ b/include/mapnik/view_transform.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -178,6 +178,7 @@ public: return extent_; } }; + } #endif // MAPNIK_VIEW_TRANSFORM_HPP diff --git a/include/mapnik/warp.hpp b/include/mapnik/warp.hpp index 262164ea7..0bf3332b6 100644 --- a/include/mapnik/warp.hpp +++ b/include/mapnik/warp.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/webp_io.hpp b/include/mapnik/webp_io.hpp index eecd65e70..4b5c54105 100644 --- a/include/mapnik/webp_io.hpp +++ b/include/mapnik/webp_io.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,7 @@ #define MAPNIK_WEBP_IO_HPP // mapnik -#include +#include #include // webp @@ -73,69 +73,71 @@ std::string webp_encoding_error(WebPEncodingError error) } template -inline int import_image_data(T2 const& image, +inline int import_image(T2 const& im_in, WebPPicture & pic, bool alpha) { - image_data const& data = image.data(); - int stride = sizeof(typename T2::pixel_type) * image.width(); - if (data.width() == image.width() && - data.height() == image.height()) + image const& data = im_in.data(); + std::size_t width = im_in.width(); + std::size_t height = im_in.height(); + int stride = sizeof(typename T2::pixel_type) * width; + if (data.width() == width && + data.height() == height) { if (alpha) { - return WebPPictureImportRGBA(&pic, data.getBytes(), stride); + return WebPPictureImportRGBA(&pic, data.bytes(), stride); } else { #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 1 - return WebPPictureImportRGBX(&pic, data.getBytes(), stride); + return WebPPictureImportRGBX(&pic, data.bytes(), stride); #else - return WebPPictureImportRGBA(&pic, data.getBytes(), stride); + return WebPPictureImportRGBA(&pic, data.bytes(), stride); #endif } } else { // need to copy: https://github.com/mapnik/mapnik/issues/2024 - image_data_rgba8 im(image.width(),image.height()); - for (unsigned y = 0; y < image.height(); ++y) + image_rgba8 im(width,height); + for (unsigned y = 0; y < height; ++y) { - typename T2::pixel_type const * row_from = image.getRow(y); - image_data_rgba8::pixel_type * row_to = im.getRow(y); - std::copy(row_from, row_from + stride, row_to); + typename T2::pixel_type const * row_from = im_in.get_row(y); + image_rgba8::pixel_type * row_to = im.get_row(y); + std::copy(row_from, row_from + width, row_to); } if (alpha) { - return WebPPictureImportRGBA(&pic, im.getBytes(), stride); + return WebPPictureImportRGBA(&pic, im.bytes(), stride); } else { #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 1 - return WebPPictureImportRGBX(&pic, im.getBytes(), stride); + return WebPPictureImportRGBX(&pic, im.bytes(), stride); #else - return WebPPictureImportRGBA(&pic, im.getBytes(), stride); + return WebPPictureImportRGBA(&pic, im.bytes(), stride); #endif } } } template <> -inline int import_image_data(image_data_rgba8 const& im, +inline int import_image(image_rgba8 const& im, WebPPicture & pic, bool alpha) { - int stride = sizeof(image_data_rgba8::pixel_type) * im.width(); + int stride = sizeof(image_rgba8::pixel_type) * im.width(); if (alpha) { - return WebPPictureImportRGBA(&pic, im.getBytes(), stride); + return WebPPictureImportRGBA(&pic, im.bytes(), stride); } else { #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 1 - return WebPPictureImportRGBX(&pic, im.getBytes(), stride); + return WebPPictureImportRGBX(&pic, im.bytes(), stride); #else - return WebPPictureImportRGBA(&pic, im.getBytes(), stride); + return WebPPictureImportRGBA(&pic, im.bytes(), stride); #endif } } @@ -170,7 +172,7 @@ void save_as_webp(T1& file, const int width = pic.width; const int height = pic.height; for (int y = 0; y < height; ++y) { - typename T2::pixel_type const * row = image.getRow(y); + typename T2::pixel_type const * row = image.get_row(y); for (int x = 0; x < width; ++x) { const unsigned rgba = row[x]; unsigned a = (rgba >> 24) & 0xff; @@ -187,10 +189,10 @@ void save_as_webp(T1& file, { // different approach for lossy since ImportYUVAFromRGBA is needed // to prepare WebPPicture and working with view pixels is not viable - ok = import_image_data(image,pic,alpha); + ok = import_image(image,pic,alpha); } #else - ok = import_image_data(image,pic,alpha); + ok = import_image(image,pic,alpha); #endif if (!ok) { diff --git a/include/mapnik/well_known_srs.hpp b/include/mapnik/well_known_srs.hpp index 2c0d40e1e..eeb478ee3 100644 --- a/include/mapnik/well_known_srs.hpp +++ b/include/mapnik/well_known_srs.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,6 +26,7 @@ // mapnik #include // for M_PI on windows #include +#include // boost #include @@ -89,6 +90,36 @@ static inline bool merc2lonlat(double * x, double * y , int point_count) return true; } +static inline bool lonlat2merc(geometry::line_string & ls) +{ + for(auto & p : ls) + { + if (p.x > 180) p.x = 180; + else if (p.x < -180) p.x = -180; + if (p.y > MAX_LATITUDE) p.y = MAX_LATITUDE; + else if (p.y < -MAX_LATITUDE) p.y = -MAX_LATITUDE; + p.x = p.x * MAXEXTENTby180; + p.y = std::log(std::tan((90 + p.y) * M_PIby360)) * R2D; + p.y = p.y * MAXEXTENTby180; + } + return true; +} + +static inline bool merc2lonlat(geometry::line_string & ls) +{ + for (auto & p : ls) + { + if (p.x > MAXEXTENT) p.x = MAXEXTENT; + else if (p.x < -MAXEXTENT) p.x = -MAXEXTENT; + if (p.y > MAXEXTENT) p.y = MAXEXTENT; + else if (p.y < -MAXEXTENT) p.y = -MAXEXTENT; + p.x = (p.x / MAXEXTENT) * 180; + p.y = (p.y / MAXEXTENT) * 180; + p.y = R2D * (2 * std::atan(std::exp(p.y * D2R)) - M_PI_by2); + } + return true; +} + } #endif // MAPNIK_WELL_KNOWN_SRS_HPP diff --git a/include/mapnik/wkb.hpp b/include/mapnik/wkb.hpp index fe6a36b25..ac90df7b3 100644 --- a/include/mapnik/wkb.hpp +++ b/include/mapnik/wkb.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,6 @@ // mapnik #include -#include #include namespace mapnik @@ -42,6 +41,7 @@ namespace mapnik * the Open Geospatial Consortium (OGC) and described in their Simple Feature * Access and Coordinate Transformation Service specifications. */ + enum wkbFormat : std::uint8_t { wkbAuto=1, @@ -49,15 +49,21 @@ enum wkbFormat : std::uint8_t wkbSpatiaLite=3 }; +enum wkbByteOrder : std::uint8_t +{ + wkbXDR=0, + wkbNDR=1 +}; + class MAPNIK_DECL geometry_utils : private util::noncopyable { public: - static bool from_wkb(mapnik::geometry_container& paths, - const char* wkb, - unsigned size, - wkbFormat format = wkbGeneric); + static mapnik::geometry::geometry from_wkb(const char* wkb, + std::size_t size, + wkbFormat format = wkbGeneric); }; + } #endif // MAPNIK_WKB_HPP diff --git a/include/mapnik/wkt/wkt_factory.hpp b/include/mapnik/wkt/wkt_factory.hpp index 01949eb0f..14f509dda 100644 --- a/include/mapnik/wkt/wkt_factory.hpp +++ b/include/mapnik/wkt/wkt_factory.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,35 +25,25 @@ // mapnik #include -#include + #include #include -#include // stl #include namespace mapnik { -inline bool from_wkt(std::string const& wkt, mapnik::geometry_container & paths) +inline bool from_wkt(std::string const& wkt, mapnik::geometry::geometry & geom) { using namespace boost::spirit; - static const mapnik::wkt::wkt_collection_grammar g; + static const mapnik::wkt::wkt_grammar g; ascii::space_type space; std::string::const_iterator first = wkt.begin(); std::string::const_iterator last = wkt.end(); - return qi::phrase_parse(first, last, g, space, paths); + return qi::phrase_parse(first, last, (g)(boost::phoenix::ref(geom)), space); } -inline bool to_wkt(mapnik::geometry_container const& paths, std::string& wkt) -{ - using sink_type = std::back_insert_iterator; - static const mapnik::wkt::wkt_multi_generator generator; - sink_type sink(wkt); - return boost::spirit::karma::generate(sink, generator, paths); -} - - } #endif // MAPNIK_WKT_FACTORY_HPP diff --git a/include/mapnik/wkt/wkt_generator_grammar.hpp b/include/mapnik/wkt/wkt_generator_grammar.hpp index e2ea7df14..e4a396959 100644 --- a/include/mapnik/wkt/wkt_generator_grammar.hpp +++ b/include/mapnik/wkt/wkt_generator_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,27 +26,22 @@ // mapnik #include #include -#include // for CommandType::SEG_MOVETO -#include +#include +#include // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include -#include -#include -#include #include -#include -#include #include // for vc++ and android whose c++11 libs lack std::trunc +#include #pragma GCC diagnostic pop -// stl -#include -#include - namespace mapnik { namespace wkt { namespace karma = boost::spirit::karma; @@ -57,67 +52,15 @@ namespace detail { template struct get_type { - using result_type = int; - - int operator() (Geometry const& geom) const + using result_type = mapnik::geometry::geometry_types; + template + result_type operator() (T const& geom) const { - return static_cast(geom.type()); + auto type = mapnik::geometry::geometry_type(geom); + return type; } }; -template -struct get_first -{ - using result_type = const typename Geometry::value_type; - typename geometry_type::value_type const operator() (Geometry const& geom) const - { - typename Geometry::value_type coord; - geom.rewind(0); - std::get<0>(coord) = geom.vertex(&std::get<1>(coord),&std::get<2>(coord)); - return coord; - } -}; - -template -struct multi_geometry_ -{ - using result_type = bool; - bool operator() (GeometryContainer const& geom) const - { - return geom.size() > 1 ? true : false; - } -}; - -template -struct get_x -{ - using value_type = T; - using result_type = double; - double operator() (value_type const& val) const - { - return std::get<1>(val); - } -}; - -template -struct get_y -{ - using value_type = T; - using result_type = double; - double operator() (value_type const& val) const - { - return std::get<2>(val); - } -}; - -template -struct multi_geometry_type -{ - using result_type = std::tuple; - std::tuple operator() (GeometryContainer const& geom) const; -}; - - template struct wkt_coordinate_policy : karma::real_policies { @@ -146,56 +89,52 @@ struct wkt_coordinate_policy : karma::real_policies } }; +template +struct coordinate_generator; + +template <> +struct coordinate_generator +{ + using generator = karma::real_generator >; +}; + +template <> +struct coordinate_generator +{ + using generator = karma::int_generator; +}; + } template -struct wkt_generator : +struct wkt_generator_grammar : karma::grammar { - using geometry_type = Geometry; - using coord_type = typename std::remove_pointer::type; - - wkt_generator(bool single = false); + using coord_type = typename Geometry::value_type; + wkt_generator_grammar(); // rules - karma::rule wkt; - karma::rule point; - karma::rule linestring; - karma::rule polygon; - - karma::rule coords; - karma::rule, geometry_type const& ()> coords2; - karma::rule point_coord; - karma::rule, coord_type (unsigned&, double&, double& )> polygon_coord; - - // phoenix functions - phoenix::function > _type; - phoenix::function > _first; - phoenix::function > _x; - phoenix::function > _y; + karma::rule geometry; + karma::rule, Geometry const&() > geometry_dispatch; + karma::rule const&()> point; + karma::rule const&()> point_coord; + karma::rule const&()> linestring; + karma::rule const&()> linestring_coord; + karma::rule const&()> polygon; + karma::rule const&()> polygon_coord; + karma::rule const&()> exterior_ring_coord; + karma::rule > const&()> interior_ring_coord; + karma::rule const& ()> multi_point; + karma::rule const& ()> multi_point_coord; + karma::rule const& ()> multi_linestring; + karma::rule const& ()> multi_linestring_coord; + karma::rule const& ()> multi_polygon; + karma::rule const& ()> multi_polygon_coord; + karma::rule const& ()> geometry_collection; + karma::rule const& ()> geometries; + boost::phoenix::function > geometry_type; + karma::symbols empty; // - karma::real_generator > coordinate; -}; - - -template -struct wkt_multi_generator : - karma::grammar >, GeometryContainer const& ()> -{ - using geometry_type = typename std::remove_pointer::type; - - wkt_multi_generator(); - // rules - karma::rule >, GeometryContainer const& ()> wkt; - karma::rule geometry; - karma::rule single_geometry; - karma::rule multi_geometry; - wkt_generator path; - // phoenix - phoenix::function > is_multi; - phoenix::function > _multi_type; - phoenix::function > _type; - // - karma::symbols geometry_types; + typename detail::coordinate_generator::generator coordinate; }; }} diff --git a/include/mapnik/wkt/wkt_generator_grammar_impl.hpp b/include/mapnik/wkt/wkt_generator_grammar_impl.hpp index d1d339dc9..7205db6d8 100644 --- a/include/mapnik/wkt/wkt_generator_grammar_impl.hpp +++ b/include/mapnik/wkt/wkt_generator_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,124 +22,93 @@ #include #include -#include -#include +#include +// boost +#include namespace mapnik { namespace wkt { -template -std::tuple detail::multi_geometry_type::operator() (T const& geom) const -{ - using geometry_container = T; - unsigned type = 0u; - bool collection = false; - - typename geometry_container::const_iterator itr = geom.begin(); - typename geometry_container::const_iterator end = geom.end(); - - for ( ; itr != end; ++itr) - { - if (type != 0 && itr->type() != type) - { - collection = true; - break; - } - type = itr->type(); - } - return std::tuple(type, collection); -} - template -wkt_generator::wkt_generator(bool single) - : wkt_generator::base_type(wkt) +wkt_generator_grammar::wkt_generator_grammar() + : wkt_generator_grammar::base_type(geometry) { + boost::spirit::karma::_val_type _val; + boost::spirit::karma::_1_type _1; + boost::spirit::karma::_a_type _a; + boost::spirit::karma::lit_type lit; boost::spirit::karma::uint_type uint_; - boost::spirit::karma::_val_type _val; - boost::spirit::karma::_1_type _1; - boost::spirit::karma::lit_type lit; - boost::spirit::karma::_a_type _a; - boost::spirit::karma::_b_type _b; - boost::spirit::karma::_c_type _c; - boost::spirit::karma::_r1_type _r1; boost::spirit::karma::eps_type eps; - boost::spirit::karma::string_type kstring; - wkt = point | linestring | polygon + empty.add + (geometry::geometry_types::Point, "POINT EMPTY") + (geometry::geometry_types::LineString, "LINESTRING EMPTY") + (geometry::geometry_types::Polygon, "POLYGON EMPTY") + (geometry::geometry_types::MultiPoint, "MULTIPOINT EMPTY") + (geometry::geometry_types::MultiLineString, "MULTILINESTRING EMPTY") + (geometry::geometry_types::MultiPolygon, "MULTIPOLYGON EMPTY") + (geometry::geometry_types::GeometryCollection, "GEOMETRYCOLLECTION EMPTY") ; - point = &uint_(mapnik::geometry_type::types::Point)[_1 = _type(_val)] - << kstring[ phoenix::if_ (single) [_1 = "Point("] - .else_[_1 = "("]] - << point_coord [_1 = _first(_val)] << lit(')') + geometry = geometry_dispatch.alias() ; - linestring = &uint_(mapnik::geometry_type::types::LineString)[_1 = _type(_val)] - << kstring[ phoenix::if_ (single) [_1 = "LineString("] - .else_[_1 = "("]] - << coords - << lit(')') + geometry_dispatch = eps[_a = geometry_type(_val)] << + (&uint_(geometry::geometry_types::Point)[_1 = _a] + << point) + | + (&uint_(geometry::geometry_types::LineString)[_1 = _a] + << (linestring | empty[_1 = _a])) + | + (&uint_(geometry::geometry_types::Polygon)[_1 = _a] + << (polygon | empty[_1 = _a])) + | + (&uint_(geometry::geometry_types::MultiPoint)[_1 = _a] + << ( multi_point | empty[_1 = _a])) + | + (&uint_(geometry::geometry_types::MultiLineString)[_1 = _a] + << (multi_linestring | empty[_1 = _a])) + | + (&uint_(geometry::geometry_types::MultiPolygon)[_1 = _a] + << (multi_polygon | empty[_1 = _a])) + | + (&uint_(geometry::geometry_types::GeometryCollection)[_1 = _a] + << (geometry_collection | empty[_1 = _a])) + | + (&uint_(geometry::geometry_types::Unknown)[_1 = _a] + << lit("POINT EMPTY")) // special case for geometry_empty as mapnik::geometry::point can't be empty ; - polygon = &uint_(mapnik::geometry_type::types::Polygon)[_1 = _type(_val)] - << kstring[ phoenix::if_ (single) [_1 = "Polygon("] - .else_[_1 = "("]] - << coords2 - << lit("))") + point = lit("POINT(") << point_coord << lit(")") ; - - point_coord = &uint_ << coordinate << lit(' ') << coordinate + linestring = lit("LINESTRING(") << linestring_coord << lit(")") ; - - polygon_coord %= ( &uint_(mapnik::SEG_MOVETO) - << eps[_r1 += 1][_a = _x(_val)][ _b = _y(_val)] - << kstring[ if_ (_r1 > 1u) [_1 = "),("] - .else_[_1 = "("]] - | - &uint_(mapnik::SEG_LINETO) - << lit(',') << eps[_a = _x(_val)][_b = _y(_val)] - ) - << coordinate[_1 = _a] - << lit(' ') - << coordinate[_1 = _b] + polygon = lit("POLYGON(") << polygon_coord << lit(")") ; - - coords2 %= *polygon_coord(_a,_b,_c) + multi_point = lit("MULTIPOINT(") << multi_point_coord << lit(")") ; - - coords = point_coord % lit(',') + multi_linestring = lit("MULTILINESTRING(") << multi_linestring_coord << lit(")") ; -} - -template -wkt_multi_generator::wkt_multi_generator() - : wkt_multi_generator::base_type(wkt) -{ - boost::spirit::karma::lit_type lit; - boost::spirit::karma::eps_type eps; - boost::spirit::karma::_val_type _val; - boost::spirit::karma::_1_type _1; - boost::spirit::karma::_a_type _a; - - geometry_types.add - (mapnik::geometry_type::types::Point,"Point") - (mapnik::geometry_type::types::LineString,"LineString") - (mapnik::geometry_type::types::Polygon,"Polygon") + multi_polygon = lit("MULTIPOLYGON(") << multi_polygon_coord << lit(")") ; - - wkt = eps(phoenix::at_c<1>(_a))[_a = _multi_type(_val)] - << lit("GeometryCollection(") << geometry << lit(")") - | eps(is_multi(_val)) << lit("Multi") << geometry_types[_1 = phoenix::at_c<0>(_a)] - << "(" << multi_geometry << ")" - | geometry + geometry_collection = lit("GEOMETRYCOLLECTION(") << geometries << lit(")") ; - - geometry = -(single_geometry % lit(',')) + point_coord = coordinate << lit(' ') << coordinate ; - - single_geometry = geometry_types[_1 = _type(_val)] << path + linestring_coord = point_coord % lit(',') ; - - multi_geometry = -(path % lit(',')) + polygon_coord = lit('(') << exterior_ring_coord << lit(')') << interior_ring_coord + ; + exterior_ring_coord = linestring_coord.alias() + ; + interior_ring_coord = *(lit(",(") << exterior_ring_coord << lit(')')) + ; + multi_point_coord = linestring_coord.alias() + ; + multi_linestring_coord = (lit('(') << linestring_coord << lit(')')) % lit(',') + ; + multi_polygon_coord = (lit('(') << polygon_coord << lit(')')) % lit(',') + ; + geometries = geometry % lit(',') ; } diff --git a/include/mapnik/wkt/wkt_grammar.hpp b/include/mapnik/wkt/wkt_grammar.hpp index 072d4a986..43c5334a1 100644 --- a/include/mapnik/wkt/wkt_grammar.hpp +++ b/include/mapnik/wkt/wkt_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,101 +23,98 @@ #ifndef MAPNIK_WKT_GRAMMAR_HPP #define MAPNIK_WKT_GRAMMAR_HPP +// mapnik +#include +#include #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include #pragma GCC diagnostic pop -// mapnik -#include -#include -#include namespace mapnik { namespace wkt { using namespace boost::spirit; -struct push_vertex -{ - template - struct result - { - using type = void; - }; +namespace detail { - template - void operator() (T0 c, T1 path, T2 x, T3 y) const +struct assign +{ + using result_type = void; + template + void operator() (T0 & geom, T1 && obj) const { - BOOST_ASSERT( path!=0 ); - path->push_vertex(x,y,c); + geom = std::move(obj); } }; -struct close_path +struct move_part { - template - struct result + using result_type = void; + template + void operator() (Geometry & geom, Part && part) const { - using type = void; - }; - - template - void operator() (T path) const - { - BOOST_ASSERT( path!=0 ); - path->close_path(); + geom.push_back(std::move(part)); } }; -struct cleanup +struct set_exterior { - template - struct result + using result_type = void; + template + void operator() (Polygon & poly, Ring && ring) const { - using type = void; - }; - - template - void operator() (T0 & path) const - { - if (path) delete path,path=0; + poly.set_exterior_ring(std::move(ring)); } }; +struct add_hole +{ + using result_type = void; + template + void operator() (Polygon & poly, Ring && ring) const + { + poly.add_hole(std::move(ring)); + } +}; + +} + template -struct wkt_grammar : qi::grammar +struct wkt_grammar : qi::grammar &) , ascii::space_type> { wkt_grammar(); - qi::rule geometry_tagged_text; - qi::rule,mapnik::geometry_container(),ascii::space_type> point_tagged_text; - qi::rule,mapnik::geometry_container(),ascii::space_type> linestring_tagged_text; - qi::rule,mapnik::geometry_container(),ascii::space_type> polygon_tagged_text; - qi::rule multipoint_tagged_text; - qi::rule multilinestring_tagged_text; - qi::rule multipolygon_tagged_text; - qi::rule point_text; - qi::rule linestring_text; - qi::rule polygon_text; - qi::rule, mapnik::geometry_container(),ascii::space_type> multipoint_text; - qi::rule, mapnik::geometry_container(),ascii::space_type> multilinestring_text; - qi::rule, mapnik::geometry_container(),ascii::space_type> multipolygon_text; - qi::rule point; - qi::rule,void(geometry_type*),ascii::space_type> points; + qi::rule &), ascii::space_type> geometry_tagged_text; + qi::rule &), ascii::space_type> point_tagged_text; + qi::rule &), ascii::space_type> linestring_tagged_text; + qi::rule &), ascii::space_type> polygon_tagged_text; + qi::rule &), ascii::space_type> multipoint_tagged_text; + qi::rule &), ascii::space_type> multilinestring_tagged_text; + qi::rule &), ascii::space_type> multipolygon_tagged_text; + qi::rule &), ascii::space_type> geometrycollection_tagged_text; + qi::rule(), ascii::space_type> point_text; + qi::rule(), ascii::space_type> linestring_text; + qi::rule(), ascii::space_type> linearring_text; + qi::rule(), ascii::space_type> polygon_text; + qi::rule(), ascii::space_type> multipoint_text; + qi::rule(), ascii::space_type> multilinestring_text; + qi::rule(), ascii::space_type> multipolygon_text; + qi::rule >, + mapnik::geometry::geometry_collection(), ascii::space_type> geometrycollection_text; + qi::rule(), ascii::space_type> point; + qi::rule(), ascii::space_type> points; + qi::rule(), ascii::space_type> ring_points; qi::rule empty_set; - boost::phoenix::function push_vertex_; - boost::phoenix::function close_path_; - boost::phoenix::function cleanup_; -}; - -template -struct wkt_collection_grammar : qi::grammar -{ - wkt_collection_grammar(); - qi::rule start; - wkt_grammar wkt; + boost::phoenix::function assign; + boost::phoenix::function move_part; + boost::phoenix::function set_exterior; + boost::phoenix::function add_hole; }; }} diff --git a/include/mapnik/wkt/wkt_grammar_impl.hpp b/include/mapnik/wkt/wkt_grammar_impl.hpp index 5ebee461f..85a927451 100644 --- a/include/mapnik/wkt/wkt_grammar_impl.hpp +++ b/include/mapnik/wkt/wkt_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,11 +22,12 @@ #include #include +#include #include -#include #include #include #include +#include namespace mapnik { namespace wkt { @@ -36,115 +37,119 @@ template wkt_grammar::wkt_grammar() : wkt_grammar::base_type(geometry_tagged_text) { - qi::_r1_type _r1; - qi::_r2_type _r2; - qi::_pass_type _pass; qi::eps_type eps; + qi::_r1_type _r1; qi::_val_type _val; qi::lit_type lit; qi::no_case_type no_case; qi::double_type double_; qi::_1_type _1; - qi::_2_type _2; qi::_a_type _a; - using boost::phoenix::push_back; - using boost::phoenix::new_; - - geometry_tagged_text = point_tagged_text - | linestring_tagged_text - | polygon_tagged_text - | multipoint_tagged_text - | multilinestring_tagged_text - | multipolygon_tagged_text + using boost::phoenix::construct; + using boost::phoenix::at_c; + geometry_tagged_text = point_tagged_text(_r1) + | linestring_tagged_text(_r1) + | polygon_tagged_text(_r1) + | multipoint_tagged_text(_r1) + | multilinestring_tagged_text(_r1) + | multipolygon_tagged_text(_r1) + | geometrycollection_tagged_text(_r1) ; // ::= point - point_tagged_text = no_case[lit("POINT")] [ _a = new_(geometry_type::types::Point) ] - >> ( point_text(_a) [push_back(_val,_a)] - | eps[cleanup_(_a)][_pass = false]) + point_tagged_text = no_case[lit("POINT")] + >> (point_text[assign(_r1,_1)] | empty_set[assign(_r1,construct())]) ; - // ::= | - point_text = (lit("(") >> point(SEG_MOVETO,_r1) >> lit(')')) - | empty_set + point_text = (lit("(") >> point >> lit(')')) + //| empty_set - we're catching 'POINT EMPTY' case in point_tagged_text rule ^^ by creating geometry_empty + // because our geometry::point can't be empty ; - // ::= linestring - linestring_tagged_text = no_case[lit("LINESTRING")] [ _a = new_(geometry_type::types::LineString) ] - >> (linestring_text(_a)[push_back(_val,_a)] - | eps[cleanup_(_a)][_pass = false]) + // ::= linestring + linestring_tagged_text = no_case[lit("LINESTRING")] + >> linestring_text[assign(_r1,_1)] ; // ::= | { }* - linestring_text = points(_r1) | empty_set + linestring_text = points | empty_set ; // ::= polygon - polygon_tagged_text = no_case[lit("POLYGON")] [ _a = new_(geometry_type::types::Polygon) ] - >> ( polygon_text(_a)[push_back(_val,_a)] - | eps[cleanup_(_a)][_pass = false]) + polygon_tagged_text = no_case[lit("POLYGON")] + >> polygon_text[assign(_r1,_1)] ; // ::= | { }* - polygon_text = (lit('(') >> linestring_text(_r1)[close_path_(_r1)] % lit(',') >> lit(')')) | empty_set; - + polygon_text = + (lit('(') >> linearring_text[set_exterior(_val,_1)] >> *(lit(',') >> linearring_text[add_hole(_val,_1)]) >> lit(')')) + | + empty_set + ; + linearring_text = ring_points | empty_set + ; // ::= multipoint multipoint_tagged_text = no_case[lit("MULTIPOINT")] - >> multipoint_text + >> multipoint_text[assign(_r1,_1)] ; // ::= | { }* multipoint_text = (lit('(') - >> ((eps[_a = new_(geometry_type::types::Point)] - >> (point_text(_a) | empty_set) [push_back(_val,_a)] - | eps[cleanup_(_a)][_pass = false]) % lit(',')) - >> lit(')')) | empty_set + >> point_text % lit(',') + >> lit(')')) + | + (lit('(') + >> point % lit(',') + >> lit(')')) + | + empty_set ; // ::= multilinestring multilinestring_tagged_text = no_case[lit("MULTILINESTRING")] - >> multilinestring_text ; + >> multilinestring_text[assign(_r1,_1)] ; // ::= | { }* multilinestring_text = (lit('(') - >> ((eps[_a = new_(geometry_type::types::LineString)] - >> ( points(_a)[push_back(_val,_a)] - | eps[cleanup_(_a)][_pass = false])) - % lit(',')) + >> points[move_part(_val,_1)] % lit(',') >> lit(')')) | empty_set; // ::= multipolygon multipolygon_tagged_text = no_case[lit("MULTIPOLYGON")] - >> multipolygon_text ; - - // ::= | { }* + >> multipolygon_text[assign(_r1,_1)] ; + // ::= | { }* multipolygon_text = (lit('(') - >> ((eps[_a = new_(geometry_type::types::Polygon)] - >> ( polygon_text(_a)[push_back(_val,_a)] - | eps[cleanup_(_a)][_pass = false])) - % lit(',')) - >> lit(')')) | empty_set; + >> polygon_text[move_part(_val,_1)] % lit(',') + >> lit(')')) + | + empty_set; + // geometry collection tagged text + geometrycollection_tagged_text = no_case[lit("GEOMETRYCOLLECTION")] + >> geometrycollection_text[assign(_r1,_1)] + ; + + // geometry collection text + geometrycollection_text = (lit('(') + >> ( eps[_a = construct >()] + >> geometry_tagged_text(_a)[move_part(_val,_a)] % lit(',')) + >> lit(')')) + | + empty_set; // points - points = lit('(')[_a = SEG_MOVETO] >> point (_a,_r1) % lit(',') [_a = SEG_LINETO] >> lit(')'); + points = lit('(') >> point % lit(',') >> lit(')') + ; + // ring points + ring_points = lit('(') >> point % lit(',') >> lit(')') + ; // point - point = (double_ >> double_) [push_vertex_(_r1,_r2,_1,_2)]; + point = double_ >> double_ + ; // empty_set = no_case[lit("EMPTY")]; - -} - -template -wkt_collection_grammar::wkt_collection_grammar() - : wkt_collection_grammar::base_type(start) -{ - qi::lit_type lit; - qi::no_case_type no_case; - start = wkt | no_case[lit("GEOMETRYCOLLECTION")] - >> (lit("(") >> wkt % lit(",") >> lit(")")); } }} diff --git a/include/mapnik/xml_attribute_cast.hpp b/include/mapnik/xml_attribute_cast.hpp index 6d2e4ae25..5140fde3c 100644 --- a/include/mapnik/xml_attribute_cast.hpp +++ b/include/mapnik/xml_attribute_cast.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ //mapnik #include +#include #include #include #include @@ -36,7 +37,10 @@ #include // boost +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" #include +#pragma GCC diagnostic pop // stl #include @@ -87,14 +91,14 @@ struct do_xml_attribute_cast #ifdef BIGINT // specialization for long long template <> -struct do_xml_attribute_cast +struct do_xml_attribute_cast { - static inline boost::optional xml_attribute_cast_impl(xml_tree const& /*tree*/, std::string const& source) + static inline boost::optional xml_attribute_cast_impl(xml_tree const& /*tree*/, std::string const& source) { int result; if (mapnik::util::string2int(source, result)) - return boost::optional(result); - return boost::optional(); + return boost::optional(result); + return boost::optional(); } }; @@ -108,8 +112,8 @@ struct do_xml_attribute_cast static inline boost::optional xml_attribute_cast_impl(xml_tree const& /*tree*/, std::string const& source) { int result; - if (mapnik::util::string2int(source, result)) - return boost::optional(result); + if (mapnik::util::string2int(source, result) && result >= 0) + return boost::optional(static_cast(result)); return boost::optional(); } }; @@ -165,7 +169,7 @@ struct do_xml_attribute_cast > template <> struct do_xml_attribute_cast { - static inline boost::optional xml_attribute_cast_impl(xml_tree const& tree, std::string const& source) + static inline boost::optional xml_attribute_cast_impl(xml_tree const&, std::string const& source) { return parse_color(source); } @@ -175,7 +179,7 @@ struct do_xml_attribute_cast template <> struct do_xml_attribute_cast { - static inline boost::optional xml_attribute_cast_impl(xml_tree const& /*tree*/, std::string const& source) + static inline boost::optional xml_attribute_cast_impl(xml_tree const&, std::string const& source) { return boost::optional(source); } @@ -205,7 +209,7 @@ struct do_xml_attribute_cast template <> struct do_xml_attribute_cast { - static inline boost::optional xml_attribute_cast_impl(xml_tree const& tree, std::string const& source) + static inline boost::optional xml_attribute_cast_impl(xml_tree const&, std::string const& source) { return mapnik::font_feature_settings(source); } diff --git a/include/mapnik/xml_loader.hpp b/include/mapnik/xml_loader.hpp index 2bc8f4af3..5fe98af0c 100644 --- a/include/mapnik/xml_loader.hpp +++ b/include/mapnik/xml_loader.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,14 +23,17 @@ #ifndef MAPNIK_LIBXML2_LOADER_HPP #define MAPNIK_LIBXML2_LOADER_HPP +// mapnik +#include // for MAPNIK_DECL + // stl #include namespace mapnik { -class xml_node; -void read_xml(std::string const & filename, xml_node &node); -void read_xml_string(std::string const & str, xml_node &node, std::string const & base_path=""); +class MAPNIK_DECL xml_node; +MAPNIK_DECL void read_xml(std::string const & filename, xml_node &node); +MAPNIK_DECL void read_xml_string(std::string const & str, xml_node &node, std::string const & base_path=""); } #endif // MAPNIK_LIBXML2_LOADER_HPP diff --git a/include/mapnik/xml_node.hpp b/include/mapnik/xml_node.hpp index 28be9ff0c..1c3602134 100644 --- a/include/mapnik/xml_node.hpp +++ b/include/mapnik/xml_node.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,6 +23,9 @@ #ifndef MAPNIK_XML_NODE_H #define MAPNIK_XML_NODE_H +//mapnik +#include // for MAPNIK_DECL + //boost #include @@ -34,9 +37,9 @@ namespace mapnik { -class xml_tree; +class MAPNIK_DECL xml_tree; -class xml_attribute +class MAPNIK_DECL xml_attribute { public: xml_attribute(const char * value_); @@ -44,7 +47,7 @@ public: mutable bool processed; }; -class node_not_found: public std::exception +class MAPNIK_DECL node_not_found: public std::exception { public: node_not_found(std::string const& node_name); @@ -56,7 +59,7 @@ protected: mutable std::string msg_; }; -class attribute_not_found: public std::exception +class MAPNIK_DECL attribute_not_found: public std::exception { public: attribute_not_found(std::string const& node_name, std::string const& attribute_name); @@ -69,7 +72,7 @@ protected: mutable std::string msg_; }; -class more_than_one_child: public std::exception +class MAPNIK_DECL more_than_one_child: public std::exception { public: more_than_one_child(std::string const& node_name); @@ -81,7 +84,7 @@ protected: mutable std::string msg_; }; -class xml_node +class MAPNIK_DECL xml_node { public: using const_iterator = std::list::const_iterator; diff --git a/include/mapnik/xml_tree.hpp b/include/mapnik/xml_tree.hpp index 9cb29a8cc..535d96763 100644 --- a/include/mapnik/xml_tree.hpp +++ b/include/mapnik/xml_tree.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,10 +33,10 @@ namespace mapnik { -class xml_tree +class MAPNIK_DECL xml_tree { public: - xml_tree(std::string const& encoding="utf8"); + xml_tree(); void set_filename(std::string const& fn); std::string const& filename() const; xml_node &root(); diff --git a/localize.sh b/localize.sh index 4f227e73c..ee62e5987 100755 --- a/localize.sh +++ b/localize.sh @@ -1,13 +1,21 @@ #!/bin/bash -UNAME=$(uname -s) +# TODO - use rpath to avoid needing this to run tests locally export CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -if [ ${UNAME} = 'Darwin' ]; then +if [ $(uname -s) = 'Darwin' ]; then export DYLD_LIBRARY_PATH="${CURRENT_DIR}/src/":${DYLD_LIBRARY_PATH} else export LD_LIBRARY_PATH="${CURRENT_DIR}/src/":${LD_LIBRARY_PATH} fi -export PYTHONPATH="${CURRENT_DIR}/bindings/python/":$PYTHONPATH -export MAPNIK_FONT_DIRECTORY="${CURRENT_DIR}/fonts/dejavu-fonts-ttf-2.34/ttf/" -export MAPNIK_INPUT_PLUGINS_DIRECTORY="${CURRENT_DIR}/plugins/input/" -export PATH="${CURRENT_DIR}/utils/mapnik-config":${PATH} -export PATH="${CURRENT_DIR}/utils/nik2img":${PATH} \ No newline at end of file + +export PATH=$(pwd)/utils/nik2img/:${PATH} + +# mapnik-settings.env is an optional file to store +# environment variables that should be used before +# running tests like PROJ_LIB, GDAL_DATA, and ICU_DATA +# These do not normally need to be set except when +# building against binary versions of dependencies like +# done via bootstrap.sh +if [[ -f mapnik-settings.env ]]; then + echo "Inheriting from mapnik-settings.env" + source mapnik-settings.env +fi diff --git a/mason_latest.sh b/mason_latest.sh new file mode 100755 index 000000000..62a0c94f0 --- /dev/null +++ b/mason_latest.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +MASON_NAME=mapnik +MASON_VERSION=latest +MASON_LIB_FILE=lib/libmapnik-wkt.a + +. ${MASON_DIR:-~/.mason}/mason.sh + +function mason_load_source { + export MASON_BUILD_PATH=$(pwd) +} + +function mason_compile { + HERE=$(pwd) + make install + if [[ `uname` == 'Darwin' ]]; then + install_name_tool -id @loader_path/libmapnik.dylib ${MASON_PREFIX}"/lib/libmapnik.dylib"; + PLUGINDIR=${MASON_PREFIX}"/lib/mapnik/input/*.input"; + for f in $PLUGINDIR; do + echo $f; + echo `basename $f`; + install_name_tool -id plugins/input/`basename $f` $f; + install_name_tool -change ${MASON_PREFIX}"/lib/libmapnik.dylib" @loader_path/../../libmapnik.dylib $f; + done; + fi; + python -c "data=open('$MASON_PREFIX/bin/mapnik-config','r').read();open('$MASON_PREFIX/bin/mapnik-config','w').write(data.replace('$HERE','.'))" + mkdir -p ${MASON_PREFIX}/share/icu + cp -r $GDAL_DATA ${MASON_PREFIX}/share/ + cp -r $PROJ_LIB ${MASON_PREFIX}/share/ + cp -r $ICU_DATA/*dat ${MASON_PREFIX}/share/icu/ + find ${MASON_PREFIX} -name "*.pyc" -exec rm {} \; +} + +function mason_cflags { + "" +} + +function mason_ldflags { + "" +} + +function mason_clean { + echo "Done" +} + +mason_run "$@" diff --git a/plugins/input/csv/build.py b/plugins/input/csv/build.py index 174deda55..d1f3716d5 100644 --- a/plugins/input/csv/build.py +++ b/plugins/input/csv/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/csv/csv_datasource.cpp b/plugins/input/csv/csv_datasource.cpp index 5cbc8d336..fef1a5195 100644 --- a/plugins/input/csv/csv_datasource.cpp +++ b/plugins/input/csv/csv_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,18 +29,19 @@ // mapnik #include -#include +#include #include #include #include #include +#include #include #include #include -#include #include #include #include +#include #include // stl @@ -265,21 +266,21 @@ void csv_datasource::parse_csv(T & stream, using Tokenizer = boost::tokenizer< escape_type >; - int line_number(1); + int line_number = 1; bool has_wkt_field = false; bool has_json_field = false; bool has_lat_field = false; bool has_lon_field = false; - unsigned wkt_idx(0); - unsigned json_idx(0); - unsigned lat_idx(0); - unsigned lon_idx(0); + unsigned wkt_idx = 0; + unsigned json_idx = 0; + unsigned lat_idx = 0; + unsigned lon_idx = 0; if (!manual_headers_.empty()) { Tokenizer tok(manual_headers_, grammer); Tokenizer::iterator beg = tok.begin(); - unsigned idx(0); + unsigned idx = 0; for (; beg != tok.end(); ++beg) { std::string val = mapnik::util::trim_copy(*beg); @@ -412,15 +413,13 @@ void csv_datasource::parse_csv(T & stream, throw mapnik::datasource_exception("CSV Plugin: could not detect column headers with the name of wkt, geojson, x/y, or latitude/longitude - this is required for reading geometry data"); } - mapnik::value_integer feature_count(0); + mapnik::value_integer feature_count = 0; bool extent_started = false; std::size_t num_headers = headers_.size(); - for (std::size_t i = 0; i < headers_.size(); ++i) - { - ctx_->push(headers_[i]); - } + std::for_each(headers_.begin(), headers_.end(), + [ & ](std::string const& header){ ctx_->push(header); }); mapnik::transcoder tr(desc_.get_encoding()); @@ -497,8 +496,8 @@ void csv_datasource::parse_csv(T & stream, // NOTE: we use ++feature_count here because feature id's should start at 1; mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,++feature_count)); - double x(0); - double y(0); + double x = 0; + double y = 0; bool parsed_x = false; bool parsed_y = false; bool parsed_wkt = false; @@ -540,9 +539,13 @@ void csv_datasource::parse_csv(T & stream, { break; } - - if (mapnik::from_wkt(value, feature->paths())) + mapnik::geometry::geometry geom; + if (mapnik::from_wkt(value, geom)) { + // correct orientations etc + mapnik::geometry::correct(geom); + // set geometry + feature->set_geometry(std::move(geom)); parsed_wkt = true; } else @@ -576,8 +579,10 @@ void csv_datasource::parse_csv(T & stream, { break; } - if (mapnik::json::from_geojson(value, feature->paths())) + mapnik::geometry::geometry geom; + if (mapnik::json::from_geojson(value, geom)) { + feature->set_geometry(std::move(geom)); parsed_json = true; } else @@ -809,9 +814,8 @@ void csv_datasource::parse_csv(T & stream, { if (parsed_x && parsed_y) { - mapnik::geometry_type * pt = new mapnik::geometry_type(mapnik::geometry_type::types::Point); - pt->move_to(x,y); - feature->add_geometry(pt); + mapnik::geometry::point pt(x,y); + feature->set_geometry(std::move(pt)); features_.push_back(feature); null_geom = false; if (!extent_initialized_) @@ -926,20 +930,25 @@ mapnik::box2d csv_datasource::envelope() const return extent_; } -boost::optional csv_datasource::get_geometry_type() const +mapnik::layer_descriptor csv_datasource::get_descriptor() const { - boost::optional result; + return desc_; +} + +boost::optional csv_datasource::get_geometry_type() const +{ + boost::optional result; int multi_type = 0; unsigned num_features = features_.size(); for (unsigned i = 0; i < num_features && i < 5; ++i) { - mapnik::util::to_ds_type(features_[i]->paths(),result); + result = mapnik::util::to_ds_type(features_[i]->get_geometry()); if (result) { int type = static_cast(*result); if (multi_type > 0 && multi_type != type) { - result.reset(mapnik::datasource::Collection); + result.reset(mapnik::datasource_geometry_t::Collection); return result; } multi_type = type; @@ -948,11 +957,6 @@ boost::optional csv_datasource::get_geometry_typ return result; } -mapnik::layer_descriptor csv_datasource::get_descriptor() const -{ - return desc_; -} - mapnik::featureset_ptr csv_datasource::features(mapnik::query const& q) const { const std::set& attribute_names = q.property_names(); diff --git a/plugins/input/csv/csv_datasource.hpp b/plugins/input/csv/csv_datasource.hpp index f433b17a9..7881af858 100644 --- a/plugins/input/csv/csv_datasource.hpp +++ b/plugins/input/csv/csv_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -51,9 +51,8 @@ public: mapnik::featureset_ptr features(mapnik::query const& q) const; mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt, double tol = 0) const; mapnik::box2d envelope() const; - boost::optional get_geometry_type() const; mapnik::layer_descriptor get_descriptor() const; - + boost::optional get_geometry_type() const; template void parse_csv(T & stream, std::string const& escape, diff --git a/plugins/input/csv/csv_utils.hpp b/plugins/input/csv/csv_utils.hpp index 3ec8c9fcb..c55065e9a 100644 --- a/plugins/input/csv/csv_utils.hpp +++ b/plugins/input/csv/csv_utils.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,6 +26,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #pragma GCC diagnostic pop diff --git a/plugins/input/gdal/build.py b/plugins/input/gdal/build.py index 506385a99..6c80de24b 100644 --- a/plugins/input/gdal/build.py +++ b/plugins/input/gdal/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# Import ('plugin_base') Import ('env') diff --git a/plugins/input/gdal/gdal_datasource.cpp b/plugins/input/gdal/gdal_datasource.cpp index 48577dac5..8a06a92c4 100644 --- a/plugins/input/gdal/gdal_datasource.cpp +++ b/plugins/input/gdal/gdal_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -45,37 +45,9 @@ using mapnik::layer_descriptor; using mapnik::datasource_exception; -/* - * Opens a GDALDataset and returns a pointer to it. - * Caller is responsible for calling GDALClose on it - */ -inline GDALDataset* gdal_datasource::open_dataset() const -{ - MAPNIK_LOG_DEBUG(gdal) << "gdal_datasource: Opening " << dataset_name_; - - GDALDataset *dataset; -#if GDAL_VERSION_NUM >= 1600 - if (shared_dataset_) - { - dataset = reinterpret_cast(GDALOpenShared((dataset_name_).c_str(), GA_ReadOnly)); - } - else -#endif - { - dataset = reinterpret_cast(GDALOpen((dataset_name_).c_str(), GA_ReadOnly)); - } - - if (! dataset) - { - throw datasource_exception(CPLGetLastErrorMsg()); - } - - return dataset; -} - - gdal_datasource::gdal_datasource(parameters const& params) : datasource(params), + dataset_(nullptr), desc_(gdal_datasource::name(), "utf-8"), nodata_value_(params.get("nodata")), nodata_tolerance_(*params.get("nodata_tolerance",1e-12)) @@ -104,11 +76,27 @@ gdal_datasource::gdal_datasource(parameters const& params) shared_dataset_ = *params.get("shared", false); band_ = *params.get("band", -1); - GDALDataset *dataset = open_dataset(); +#if GDAL_VERSION_NUM >= 1600 + if (shared_dataset_) + { + dataset_ = reinterpret_cast(GDALOpenShared((dataset_name_).c_str(), GA_ReadOnly)); + } + else +#endif + { + dataset_ = reinterpret_cast(GDALOpen((dataset_name_).c_str(), GA_ReadOnly)); + } - nbands_ = dataset->GetRasterCount(); - width_ = dataset->GetRasterXSize(); - height_ = dataset->GetRasterYSize(); + if (! dataset_) + { + throw datasource_exception(CPLGetLastErrorMsg()); + } + + MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: opened Dataset=" << dataset_; + + nbands_ = dataset_->GetRasterCount(); + width_ = dataset_->GetRasterXSize(); + height_ = dataset_->GetRasterYSize(); desc_.add_descriptor(mapnik::attribute_descriptor("nodata", mapnik::Double)); double tr[6]; @@ -140,7 +128,7 @@ gdal_datasource::gdal_datasource(parameters const& params) } else { - if (dataset->GetGeoTransform(tr) != CPLE_None) + if (dataset_->GetGeoTransform(tr) != CPLE_None) { MAPNIK_LOG_DEBUG(gdal) << "gdal_datasource GetGeotransform failure gives=" << tr[0] << "," << tr[1] << "," @@ -187,8 +175,6 @@ gdal_datasource::gdal_datasource(parameters const& params) extent_.init(x0, y0, x1, y1); } - GDALClose(dataset); - MAPNIK_LOG_DEBUG(gdal) << "gdal_datasource: Raster Size=" << width_ << "," << height_; MAPNIK_LOG_DEBUG(gdal) << "gdal_datasource: Raster Extent=" << extent_; @@ -196,6 +182,8 @@ gdal_datasource::gdal_datasource(parameters const& params) gdal_datasource::~gdal_datasource() { + MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Closing Dataset=" << dataset_; + GDALClose(dataset_); } datasource::datasource_t gdal_datasource::type() const @@ -213,9 +201,9 @@ box2d gdal_datasource::envelope() const return extent_; } -boost::optional gdal_datasource::get_geometry_type() const +boost::optional gdal_datasource::get_geometry_type() const { - return boost::optional(); + return boost::optional(); } layer_descriptor gdal_datasource::get_descriptor() const @@ -232,7 +220,7 @@ featureset_ptr gdal_datasource::features(query const& q) const gdal_query gq = q; // TODO - move to std::make_shared, but must reduce # of args to <= 9 - return featureset_ptr(new gdal_featureset(*open_dataset(), + return featureset_ptr(new gdal_featureset(*dataset_, band_, gq, extent_, @@ -254,7 +242,7 @@ featureset_ptr gdal_datasource::features_at_point(coord2d const& pt, double tol) gdal_query gq = pt; // TODO - move to std::make_shared, but must reduce # of args to <= 9 - return featureset_ptr(new gdal_featureset(*open_dataset(), + return featureset_ptr(new gdal_featureset(*dataset_, band_, gq, extent_, diff --git a/plugins/input/gdal/gdal_datasource.hpp b/plugins/input/gdal/gdal_datasource.hpp index 68536b2d8..7e7b22164 100644 --- a/plugins/input/gdal/gdal_datasource.hpp +++ b/plugins/input/gdal/gdal_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -52,10 +52,11 @@ public: mapnik::featureset_ptr features(mapnik::query const& q) const; mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt, double tol = 0) const; mapnik::box2d envelope() const; - boost::optional get_geometry_type() const; + boost::optional get_geometry_type() const; mapnik::layer_descriptor get_descriptor() const; private: GDALDataset* open_dataset() const; + GDALDataset* dataset_; mapnik::box2d extent_; std::string dataset_name_; int band_; diff --git a/plugins/input/gdal/gdal_featureset.cpp b/plugins/input/gdal/gdal_featureset.cpp index 1e276cc2a..968fc6df1 100644 --- a/plugins/input/gdal/gdal_featureset.cpp +++ b/plugins/input/gdal/gdal_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -44,7 +44,6 @@ using mapnik::coord2d; using mapnik::box2d; using mapnik::feature_ptr; using mapnik::view_transform; -using mapnik::geometry_type; using mapnik::datasource_exception; using mapnik::feature_factory; @@ -80,7 +79,6 @@ gdal_featureset::~gdal_featureset() { MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Closing Dataset=" << &dataset_; - GDALClose(&dataset_); } feature_ptr gdal_featureset::next() @@ -203,33 +201,99 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Reading band=" << band_; if (band_ > 0) // we are querying a single band { - mapnik::image_data_gray16 image(im_width, im_height); - image.set(std::numeric_limits::max()); + GDALRasterBand * band = dataset_.GetRasterBand(band_); if (band_ > nbands_) { std::ostringstream s; s << "GDAL Plugin: " << band_ << " is an invalid band, dataset only has " << nbands_ << "bands"; throw datasource_exception(s.str()); } - - GDALRasterBand * band = dataset_.GetRasterBand(band_); - raster_nodata = band->GetNoDataValue(&raster_has_nodata); - raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height, - image.getData(), image.width(), image.height(), - GDT_Int16, 0, 0); - if (raster_io_error == CE_Failure) + GDALDataType band_type = band->GetRasterDataType(); + switch (band_type) { - throw datasource_exception(CPLGetLastErrorMsg()); + case GDT_Byte: + { + mapnik::image_gray8 image(im_width, im_height); + image.set(std::numeric_limits::max()); + raster_nodata = band->GetNoDataValue(&raster_has_nodata); + raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height, + image.data(), image.width(), image.height(), + GDT_Byte, 0, 0); + if (raster_io_error == CE_Failure) + { + throw datasource_exception(CPLGetLastErrorMsg()); + } + mapnik::raster_ptr raster = std::make_shared(intersect, image, filter_factor); + // set nodata value to be used in raster colorizer + if (nodata_value_) raster->set_nodata(*nodata_value_); + else raster->set_nodata(raster_nodata); + feature->set_raster(raster); + break; + } + case GDT_Float64: + case GDT_Float32: + { + mapnik::image_gray32f image(im_width, im_height); + image.set(std::numeric_limits::max()); + raster_nodata = band->GetNoDataValue(&raster_has_nodata); + raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height, + image.data(), image.width(), image.height(), + GDT_Float32, 0, 0); + if (raster_io_error == CE_Failure) + { + throw datasource_exception(CPLGetLastErrorMsg()); + } + mapnik::raster_ptr raster = std::make_shared(intersect, image, filter_factor); + // set nodata value to be used in raster colorizer + if (nodata_value_) raster->set_nodata(*nodata_value_); + else raster->set_nodata(raster_nodata); + feature->set_raster(raster); + break; + } + case GDT_UInt16: + { + mapnik::image_gray16 image(im_width, im_height); + image.set(std::numeric_limits::max()); + raster_nodata = band->GetNoDataValue(&raster_has_nodata); + raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height, + image.data(), image.width(), image.height(), + GDT_UInt16, 0, 0); + if (raster_io_error == CE_Failure) + { + throw datasource_exception(CPLGetLastErrorMsg()); + } + mapnik::raster_ptr raster = std::make_shared(intersect, image, filter_factor); + // set nodata value to be used in raster colorizer + if (nodata_value_) raster->set_nodata(*nodata_value_); + else raster->set_nodata(raster_nodata); + feature->set_raster(raster); + break; + } + default: + case GDT_Int16: + { + mapnik::image_gray16s image(im_width, im_height); + image.set(std::numeric_limits::max()); + raster_nodata = band->GetNoDataValue(&raster_has_nodata); + raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height, + image.data(), image.width(), image.height(), + GDT_Int16, 0, 0); + if (raster_io_error == CE_Failure) + { + throw datasource_exception(CPLGetLastErrorMsg()); + } + mapnik::raster_ptr raster = std::make_shared(intersect, image, filter_factor); + // set nodata value to be used in raster colorizer + if (nodata_value_) raster->set_nodata(*nodata_value_); + else raster->set_nodata(raster_nodata); + feature->set_raster(raster); + break; + } } - mapnik::raster_ptr raster = std::make_shared(intersect, image, filter_factor); - // set nodata value to be used in raster colorizer - if (nodata_value_) raster->set_nodata(*nodata_value_); - else raster->set_nodata(raster_nodata); - feature->set_raster(raster); } else // working with all bands { - mapnik::image_data_rgba8 image(im_width, im_height); + mapnik::image_rgba8 image(im_width, im_height); image.set(std::numeric_limits::max()); for (int i = 0; i < nbands_; ++i) { @@ -310,13 +374,16 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) raster_nodata = red->GetNoDataValue(&raster_has_nodata); GDALColorTable *color_table = red->GetColorTable(); bool has_nodata = nodata_value_ || raster_has_nodata; - if (has_nodata && !color_table) + + // we can deduce the alpha channel from nodata in the Byte case + // by reusing the reading of R,G,B bands directly + if (has_nodata && !color_table && red->GetRasterDataType() == GDT_Byte) { double apply_nodata = nodata_value_ ? *nodata_value_ : raster_nodata; // read the data in and create an alpha channel from the nodata values // TODO - we assume here the nodata value for the red band applies to all bands // more details about this at http://trac.osgeo.org/gdal/ticket/2734 - float* imageData = (float*)image.getBytes(); + float* imageData = (float*)image.bytes(); raster_io_error = red->RasterIO(GF_Read, x_off, y_off, width, height, imageData, image.width(), image.height(), GDT_Float32, 0, 0); @@ -336,20 +403,62 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) } } } - raster_io_error = red->RasterIO(GF_Read, x_off, y_off, width, height, image.getBytes() + 0, - image.width(), image.height(), GDT_Byte, 4, 4 * image.width()); - if (raster_io_error == CE_Failure) { - throw datasource_exception(CPLGetLastErrorMsg()); + + /* Use dataset RasterIO in priority in 99.9% of the cases */ + if( red->GetBand() == 1 && green->GetBand() == 2 && blue->GetBand() == 3 ) + { + int nBandsToRead = 3; + if( alpha != NULL && alpha->GetBand() == 4 && !raster_has_nodata ) + { + nBandsToRead = 4; + alpha = NULL; // to avoid reading it again afterwards + } + raster_io_error = dataset_.RasterIO(GF_Read, x_off, y_off, width, height, + image.bytes(), + image.width(), image.height(), GDT_Byte, + nBandsToRead, NULL, + 4, 4 * image.width(), 1); + if (raster_io_error == CE_Failure) { + throw datasource_exception(CPLGetLastErrorMsg()); + } } - raster_io_error = green->RasterIO(GF_Read, x_off, y_off, width, height, image.getBytes() + 1, - image.width(), image.height(), GDT_Byte, 4, 4 * image.width()); - if (raster_io_error == CE_Failure) { - throw datasource_exception(CPLGetLastErrorMsg()); + else + { + raster_io_error = red->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 0, + image.width(), image.height(), GDT_Byte, 4, 4 * image.width()); + if (raster_io_error == CE_Failure) { + throw datasource_exception(CPLGetLastErrorMsg()); + } + raster_io_error = green->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 1, + image.width(), image.height(), GDT_Byte, 4, 4 * image.width()); + if (raster_io_error == CE_Failure) { + throw datasource_exception(CPLGetLastErrorMsg()); + } + raster_io_error = blue->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 2, + image.width(), image.height(), GDT_Byte, 4, 4 * image.width()); + if (raster_io_error == CE_Failure) { + throw datasource_exception(CPLGetLastErrorMsg()); + } } - raster_io_error = blue->RasterIO(GF_Read, x_off, y_off, width, height, image.getBytes() + 2, - image.width(), image.height(), GDT_Byte, 4, 4 * image.width()); - if (raster_io_error == CE_Failure) { - throw datasource_exception(CPLGetLastErrorMsg()); + + // In the case we skipped initializing the alpha channel + if (has_nodata && !color_table && red->GetRasterDataType() == GDT_Byte) + { + double apply_nodata = nodata_value_ ? *nodata_value_ : raster_nodata; + if( apply_nodata >= 0 && apply_nodata <= 255 ) + { + int len = image.width() * image.height(); + GByte* pabyBytes = (GByte*) image.bytes(); + for (int i = 0; i < len; ++i) + { + // TODO - we assume here the nodata value for the red band applies to all bands + // more details about this at http://trac.osgeo.org/gdal/ticket/2734 + if (std::fabs(apply_nodata - pabyBytes[4*i]) < nodata_tolerance_) + pabyBytes[4*i + 3] = 0; + else + pabyBytes[4*i + 3] = 255; + } + } } } else if (grey) @@ -363,7 +472,7 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) double apply_nodata = nodata_value_ ? *nodata_value_ : raster_nodata; MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: applying nodata value for layer=" << apply_nodata; // first read the data in and create an alpha channel from the nodata values - float* imageData = (float*)image.getBytes(); + float* imageData = (float*)image.bytes(); raster_io_error = grey->RasterIO(GF_Read, x_off, y_off, width, height, imageData, image.width(), image.height(), GDT_Float32, 0, 0); @@ -385,21 +494,21 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) } } - raster_io_error = grey->RasterIO(GF_Read, x_off, y_off, width, height, image.getBytes() + 0, + raster_io_error = grey->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 0, image.width(), image.height(), GDT_Byte, 4, 4 * image.width()); if (raster_io_error == CE_Failure) { throw datasource_exception(CPLGetLastErrorMsg()); } - raster_io_error = grey->RasterIO(GF_Read,x_off, y_off, width, height, image.getBytes() + 1, + raster_io_error = grey->RasterIO(GF_Read,x_off, y_off, width, height, image.bytes() + 1, image.width(), image.height(), GDT_Byte, 4, 4 * image.width()); if (raster_io_error == CE_Failure) { throw datasource_exception(CPLGetLastErrorMsg()); } - raster_io_error = grey->RasterIO(GF_Read,x_off, y_off, width, height, image.getBytes() + 2, + raster_io_error = grey->RasterIO(GF_Read,x_off, y_off, width, height, image.bytes() + 2, image.width(), image.height(), GDT_Byte, 4, 4 * image.width()); if (raster_io_error == CE_Failure) @@ -412,7 +521,7 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Loading color table..."; for (unsigned y = 0; y < image.height(); ++y) { - unsigned int* row = image.getRow(y); + unsigned int* row = image.get_row(y); for (unsigned x = 0; x < image.width(); ++x) { unsigned value = row[x] & 0xff; @@ -436,7 +545,7 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: processing alpha band..."; if (!raster_has_nodata) { - raster_io_error = alpha->RasterIO(GF_Read, x_off, y_off, width, height, image.getBytes() + 3, + raster_io_error = alpha->RasterIO(GF_Read, x_off, y_off, width, height, image.bytes() + 3, image.width(), image.height(), GDT_Byte, 4, 4 * image.width()); if (raster_io_error == CE_Failure) { throw datasource_exception(CPLGetLastErrorMsg()); @@ -504,9 +613,7 @@ feature_ptr gdal_featureset::get_feature_at_point(mapnik::coord2d const& pt) { // construct feature feature_ptr feature = feature_factory::create(ctx_,1); - std::unique_ptr point = std::make_unique(mapnik::geometry_type::types::Point); - point->move_to(pt.x, pt.y); - feature->add_geometry(point.release()); + feature->set_geometry(mapnik::geometry::point(pt.x,pt.y)); feature->put_new("value",value); if (raster_has_nodata) { diff --git a/plugins/input/gdal/gdal_featureset.hpp b/plugins/input/gdal/gdal_featureset.hpp index 04f24ed0f..b90921149 100644 --- a/plugins/input/gdal/gdal_featureset.hpp +++ b/plugins/input/gdal/gdal_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/geojson/build.py b/plugins/input/geojson/build.py index faa3e9ff4..7435be5fa 100644 --- a/plugins/input/geojson/build.py +++ b/plugins/input/geojson/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/geojson/geojson_datasource.cpp b/plugins/input/geojson/geojson_datasource.cpp index d1b35d54e..739ef733e 100644 --- a/plugins/input/geojson/geojson_datasource.cpp +++ b/plugins/input/geojson/geojson_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,13 +27,20 @@ #include // boost +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #include -#include +#pragma GCC diagnostic pop + // mapnik #include #include -#include +#include #include #include #include @@ -42,15 +49,22 @@ #include #include #include -#include #include #include +#include #include +#include #include #include -#include // boost.geometry - register box2d +#if defined(SHAPE_MEMORY_MAPPED_FILE) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#include +#pragma GCC diagnostic pop #include +#endif using mapnik::datasource; using mapnik::parameters; @@ -131,7 +145,7 @@ geojson_datasource::geojson_datasource(parameters const& params) else { cache_features_ = *params.get("cache_features", true); -#if 0 +#if !defined(SHAPE_MEMORY_MAPPED_FILE) mapnik::util::file file(filename_); if (!file.open()) { @@ -175,18 +189,19 @@ geojson_datasource::geojson_datasource(parameters const& params) namespace { using base_iterator_type = char const*; -const mapnik::transcoder tr("utf8"); -const mapnik::json::feature_collection_grammar fc_grammar(tr); +const mapnik::transcoder geojson_datasource_static_tr("utf8"); +const mapnik::json::feature_collection_grammar geojson_datasource_static_fc_grammar(geojson_datasource_static_tr); +const mapnik::json::feature_grammar geojson_datasource_static_feature_grammar(geojson_datasource_static_tr); +const mapnik::json::extract_bounding_box_grammar geojson_datasource_static_bbox_grammar; } template void geojson_datasource::initialise_index(Iterator start, Iterator end) { mapnik::json::boxes boxes; - mapnik::json::extract_bounding_box_grammar bbox_grammar; - boost::spirit::ascii::space_type space; + boost::spirit::standard::space_type space; Iterator itr = start; - if (!boost::spirit::qi::phrase_parse(itr, end, (bbox_grammar)(boost::phoenix::ref(boxes)) , space)) + if (!boost::spirit::qi::phrase_parse(itr, end, (geojson_datasource_static_bbox_grammar)(boost::phoenix::ref(boxes)) , space)) { throw mapnik::datasource_exception("GeoJSON Plugin: could not parse: '" + filename_ + "'"); } @@ -202,14 +217,11 @@ void geojson_datasource::initialise_index(Iterator start, Iterator end) extent_ = box; // parse first feature to extract attributes schema. // NOTE: this doesn't yield correct answer for geoJSON in general, just an indication - Iterator itr = start + geometry_index.first; - Iterator end = itr + geometry_index.second; + Iterator itr2 = start + geometry_index.first; + Iterator end2 = itr + geometry_index.second; mapnik::context_ptr ctx = std::make_shared(); mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx,1)); - static const mapnik::transcoder tr("utf8"); - static const mapnik::json::feature_grammar grammar(tr); - boost::spirit::ascii::space_type space; - if (!boost::spirit::qi::phrase_parse(itr, end, (grammar)(boost::phoenix::ref(*feature)), space)) + if (!boost::spirit::qi::phrase_parse(itr2, end2, (geojson_datasource_static_feature_grammar)(boost::phoenix::ref(*feature)), space)) { throw std::runtime_error("Failed to parse geojson feature"); } @@ -230,13 +242,13 @@ void geojson_datasource::initialise_index(Iterator start, Iterator end) template void geojson_datasource::parse_geojson(Iterator start, Iterator end) { - boost::spirit::ascii::space_type space; + boost::spirit::standard::space_type space; mapnik::context_ptr ctx = std::make_shared(); std::size_t start_id = 1; mapnik::json::default_feature_callback callback(features_); - bool result = boost::spirit::qi::phrase_parse(start, end, (fc_grammar) + bool result = boost::spirit::qi::phrase_parse(start, end, (geojson_datasource_static_fc_grammar) (boost::phoenix::ref(ctx),boost::phoenix::ref(start_id), boost::phoenix::ref(callback)), space); if (!result) @@ -286,28 +298,6 @@ const char * geojson_datasource::name() return "geojson"; } -boost::optional geojson_datasource::get_geometry_type() const -{ - boost::optional result; - int multi_type = 0; - unsigned num_features = features_.size(); - for (unsigned i = 0; i < num_features && i < 5; ++i) - { - mapnik::util::to_ds_type(features_[i]->paths(),result); - if (result) - { - int type = static_cast(*result); - if (multi_type > 0 && multi_type != type) - { - result.reset(mapnik::datasource::Collection); - return result; - } - multi_type = type; - } - } - return result; -} - mapnik::datasource::datasource_t geojson_datasource::type() const { return type_; @@ -323,6 +313,76 @@ mapnik::layer_descriptor geojson_datasource::get_descriptor() const return desc_; } +boost::optional geojson_datasource::get_geometry_type() const +{ + boost::optional result; + int multi_type = 0; + if (cache_features_) + { + unsigned num_features = features_.size(); + for (unsigned i = 0; i < num_features && i < 5; ++i) + { + result = mapnik::util::to_ds_type(features_[i]->get_geometry()); + if (result) + { + int type = static_cast(*result); + if (multi_type > 0 && multi_type != type) + { + result.reset(mapnik::datasource_geometry_t::Collection); + return result; + } + multi_type = type; + } + } + } + else + { + mapnik::util::file file(filename_); + if (!file.open()) + { + throw mapnik::datasource_exception("GeoJSON Plugin: could not open: '" + filename_ + "'"); + } + auto itr = tree_->qbegin(boost::geometry::index::intersects(extent_)); + auto end = tree_->qend(); + mapnik::context_ptr ctx = std::make_shared(); + for (std::size_t count = 0; itr !=end && count < 5; ++itr,++count) + { + geojson_datasource::item_type const& item = *itr; + std::size_t file_offset = item.second.first; + std::size_t size = item.second.second; + + std::fseek(file.get(), file_offset, SEEK_SET); + std::vector json; + json.resize(size); + std::fread(json.data(), size, 1, file.get()); + + using chr_iterator_type = char const*; + chr_iterator_type start2 = json.data(); + chr_iterator_type end2 = start2 + json.size(); + + using namespace boost::spirit; + standard::space_type space; + mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx,1)); + if (!qi::phrase_parse(start2, end2, (geojson_datasource_static_feature_grammar)(boost::phoenix::ref(*feature)), space)) + { + throw std::runtime_error("Failed to parse geojson feature"); + } + result = mapnik::util::to_ds_type(feature->get_geometry()); + if (result) + { + int type = static_cast(*result); + if (multi_type > 0 && multi_type != type) + { + result.reset(mapnik::datasource_geometry_t::Collection); + return result; + } + multi_type = type; + } + } + } + return result; +} + mapnik::featureset_ptr geojson_datasource::features(mapnik::query const& q) const { // if the query box intersects our world extent then query for features diff --git a/plugins/input/geojson/geojson_datasource.hpp b/plugins/input/geojson/geojson_datasource.hpp index 04f1421b8..870f64985 100644 --- a/plugins/input/geojson/geojson_datasource.hpp +++ b/plugins/input/geojson/geojson_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -39,10 +39,9 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wunused-local-typedef" -#include -#include -#include -#include +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop @@ -94,8 +93,7 @@ public: mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt, double tol = 0) const; mapnik::box2d envelope() const; mapnik::layer_descriptor get_descriptor() const; - boost::optional get_geometry_type() const; - // + boost::optional get_geometry_type() const; template void parse_geojson(Iterator start, Iterator end); template diff --git a/plugins/input/geojson/geojson_featureset.cpp b/plugins/input/geojson/geojson_featureset.cpp index 20fb415f1..1976f03ba 100644 --- a/plugins/input/geojson/geojson_featureset.cpp +++ b/plugins/input/geojson/geojson_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/geojson/geojson_featureset.hpp b/plugins/input/geojson/geojson_featureset.hpp index 1af2da7ae..e055b9777 100644 --- a/plugins/input/geojson/geojson_featureset.hpp +++ b/plugins/input/geojson/geojson_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/geojson/large_geojson_featureset.cpp b/plugins/input/geojson/large_geojson_featureset.cpp index 043d3fe5a..1df7dce4a 100644 --- a/plugins/input/geojson/large_geojson_featureset.cpp +++ b/plugins/input/geojson/large_geojson_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,9 +23,9 @@ // mapnik #include #include -#include -#include -#include +#include +#include +#include // stl #include #include @@ -62,14 +62,15 @@ mapnik::feature_ptr large_geojson_featureset::next() std::vector json; json.resize(size); std::fread(json.data(), size, 1, file_.get()); - using chr_iterator_type = std::vector::const_iterator; - chr_iterator_type start = json.begin(); - chr_iterator_type end = json.end(); + + using chr_iterator_type = char const*; + chr_iterator_type start = json.data(); + chr_iterator_type end = start + json.size(); static const mapnik::transcoder tr("utf8"); static const mapnik::json::feature_grammar grammar(tr); using namespace boost::spirit; - ascii::space_type space; + standard::space_type space; mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,1)); if (!qi::phrase_parse(start, end, (grammar)(boost::phoenix::ref(*feature)), space)) { diff --git a/plugins/input/geojson/large_geojson_featureset.hpp b/plugins/input/geojson/large_geojson_featureset.hpp index 71116aee1..a67eec5bf 100644 --- a/plugins/input/geojson/large_geojson_featureset.hpp +++ b/plugins/input/geojson/large_geojson_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/occi/build.py b/plugins/input/occi/build.py index 87cb844cb..e0aeb7b4b 100644 --- a/plugins/input/occi/build.py +++ b/plugins/input/occi/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -36,13 +36,23 @@ plugin_sources = Split( """ % locals() ) -libraries = [ 'clntsh' ] +libraries = [ 'clntsh', 'occi' ] libraries.append('boost_system%s' % env['BOOST_APPEND']) libraries.append(env['ICU_LIB_NAME']) if env['PLUGIN_LINKING'] == 'shared': libraries.append(env['MAPNIK_NAME']) + # libocci.dylib, at least for 11.2 links to libstdc++ + # so we defer symbol resolution to runtime in order to + # dodge linking errors like + # Undefined symbols for architecture x86_64: + # "std::string::_Rep::_M_destroy(std::allocator const&)", referenced from: + # RegisterClasses(oracle::occi::Environment*) in spatial_classesm.os + + if env['PLATFORM'] == 'Darwin': + plugin_env.Append(LINKFLAGS='-undefined dynamic_lookup') + TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME, SHLIBPREFIX='', SHLIBSUFFIX='.input', diff --git a/plugins/input/occi/occi_datasource.cpp b/plugins/input/occi/occi_datasource.cpp index a39c6b259..1c2809239 100644 --- a/plugins/input/occi/occi_datasource.cpp +++ b/plugins/input/occi/occi_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -79,7 +79,7 @@ occi_datasource::occi_datasource(parameters const& params) desc_(occi_datasource::name(), *params.get("encoding", "utf-8")), use_wkb_(*params.get("use_wkb", false)), row_limit_(*params.get("row_limit", 0)), - row_prefetch_(*params.get("row_prefetch", 100)), + row_prefetch_(*params.get("row_prefetch", 100)), pool_(0), conn_(0) { @@ -107,7 +107,7 @@ occi_datasource::occi_datasource(parameters const& params) boost::optional ext = params.get("extent"); if (ext) extent_initialized_ = extent_.from_string(*ext); - boost::optional srid = params.get("srid"); + boost::optional srid = params.get("srid"); if (srid) { srid_ = *srid; @@ -123,8 +123,8 @@ occi_datasource::occi_datasource(parameters const& params) *params.get("user"), *params.get("password"), *params.get("host"), - *params.get("max_size", 5), - *params.get("initial_size", 1), + *params.get("max_size", 5), + *params.get("initial_size", 1), 1); } catch (SQLException& ex) @@ -443,9 +443,9 @@ box2d occi_datasource::envelope() const } -boost::optional occi_datasource::get_geometry_type() const +boost::optional occi_datasource::get_geometry_type() const { - return boost::optional(); + return boost::optional(); } layer_descriptor occi_datasource::get_descriptor() const diff --git a/plugins/input/occi/occi_datasource.hpp b/plugins/input/occi/occi_datasource.hpp index 8601fb4de..0affc339e 100644 --- a/plugins/input/occi/occi_datasource.hpp +++ b/plugins/input/occi/occi_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -54,7 +54,7 @@ public: mapnik::featureset_ptr features(mapnik::query const& q) const; mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt, double tol = 0) const; mapnik::box2d envelope() const; - boost::optional get_geometry_type() const; + boost::optional get_geometry_type() const; mapnik::layer_descriptor get_descriptor() const; private: diff --git a/plugins/input/occi/occi_featureset.cpp b/plugins/input/occi/occi_featureset.cpp index e2d2ecd52..0a0b942eb 100644 --- a/plugins/input/occi/occi_featureset.cpp +++ b/plugins/input/occi/occi_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,13 +24,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include // ogr #include "occi_featureset.hpp" @@ -259,7 +259,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature) SDOPointType* sdopoint = geom->getSdo_point(); if (sdopoint && ! sdopoint->isNull()) { - std::unique_ptr point = std::make_unique(mapnik::geometry_type::types::Point); + std::unique_ptr point = std::make_unique(mapnik::geometry::geometry_types::Point); point->move_to(sdopoint->getX(), sdopoint->getY()); feature->add_geometry(point.release()); } @@ -272,7 +272,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature) const bool is_single_geom = true; const bool is_point_type = false; convert_ordinates(feature, - mapnik::geometry_type::types::LineString, + mapnik::geometry::geometry_types::LineString, elem_info, ordinates, dimensions, @@ -288,7 +288,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature) const bool is_single_geom = true; const bool is_point_type = false; convert_ordinates(feature, - mapnik::geometry_type::types::Polygon, + mapnik::geometry::geometry_types::Polygon, elem_info, ordinates, dimensions, @@ -304,7 +304,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature) const bool is_single_geom = false; const bool is_point_type = true; convert_ordinates(feature, - mapnik::geometry_type::types::Point, + mapnik::geometry::geometry_types::Point, elem_info, ordinates, dimensions, @@ -321,7 +321,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature) const bool is_point_type = false; convert_ordinates(feature, - mapnik::geometry_type::types::LineString, + mapnik::geometry::geometry_types::LineString, elem_info, ordinates, dimensions, @@ -338,7 +338,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature) const bool is_point_type = false; convert_ordinates(feature, - mapnik::geometry_type::types::Polygon, + mapnik::geometry::geometry_types::Polygon, elem_info, ordinates, dimensions, @@ -356,7 +356,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature) const bool is_point_type = false; convert_ordinates(feature, - mapnik::geometry_type::types::Polygon, + mapnik::geometry::geometry_types::Polygon, elem_info, ordinates, dimensions, @@ -404,20 +404,20 @@ void occi_featureset::convert_ordinates(mapnik::feature_ptr feature, int next_interp = elem_info[i + 2]; bool is_linear_element = true; bool is_unknown_etype = false; - mapnik::geometry_type::types gtype = mapnik::geometry_type::types::Point; + mapnik::geometry_type::types gtype = mapnik::geometry::geometry_types::Point; switch (etype) { case SDO_ETYPE_POINT: if (interp == SDO_INTERPRETATION_POINT) {} if (interp > SDO_INTERPRETATION_POINT) {} - gtype = mapnik::geometry_type::types::Point; + gtype = mapnik::geometry::geometry_types::Point; break; case SDO_ETYPE_LINESTRING: if (interp == SDO_INTERPRETATION_STRAIGHT) {} if (interp == SDO_INTERPRETATION_CIRCULAR) {} - gtype = mapnik::geometry_type::types::LineString; + gtype = mapnik::geometry::geometry_types::LineString; break; case SDO_ETYPE_POLYGON: @@ -426,7 +426,7 @@ void occi_featureset::convert_ordinates(mapnik::feature_ptr feature, if (interp == SDO_INTERPRETATION_CIRCULAR) {} if (interp == SDO_INTERPRETATION_RECTANGLE) {} if (interp == SDO_INTERPRETATION_CIRCLE) {} - gtype = mapnik::geometry_type::types::Polygon; + gtype = mapnik::geometry::geometry_types::Polygon; break; case SDO_ETYPE_COMPOUND_LINESTRING: @@ -434,7 +434,7 @@ void occi_featureset::convert_ordinates(mapnik::feature_ptr feature, case SDO_ETYPE_COMPOUND_POLYGON_INTERIOR: // interp = next ETYPE to consider is_linear_element = false; - gtype = mapnik::geometry_type::types::Polygon; + gtype = mapnik::geometry::geometry_types::Polygon; break; case SDO_ETYPE_UNKNOWN: // unknown diff --git a/plugins/input/occi/occi_featureset.hpp b/plugins/input/occi/occi_featureset.hpp index abe21716c..13445dd96 100644 --- a/plugins/input/occi/occi_featureset.hpp +++ b/plugins/input/occi/occi_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,11 +26,8 @@ // mapnik #include #include -#include #include - -// boost - +// stl #include // oci diff --git a/plugins/input/occi/occi_types.cpp b/plugins/input/occi/occi_types.cpp index 6fb69aa3e..439670680 100644 --- a/plugins/input/occi/occi_types.cpp +++ b/plugins/input/occi/occi_types.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software, you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/occi/occi_types.hpp b/plugins/input/occi/occi_types.hpp index 752246abd..cc8cd41fa 100644 --- a/plugins/input/occi/occi_types.hpp +++ b/plugins/input/occi/occi_types.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software, you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,7 @@ // mapnik #include -#include +#include // occi #include diff --git a/plugins/input/ogr/build.py b/plugins/input/ogr/build.py index 9c4101bc2..908cf1940 100644 --- a/plugins/input/ogr/build.py +++ b/plugins/input/ogr/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/ogr/ogr_converter.cpp b/plugins/input/ogr/ogr_converter.cpp index 7a64d87d7..f2eb60294 100644 --- a/plugins/input/ogr/ogr_converter.cpp +++ b/plugins/input/ogr/ogr_converter.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,151 +21,151 @@ *****************************************************************************/ // mapnik -#include #include -#include #include -#include -#include -#include -#include // ogr #include "ogr_converter.hpp" +#include +#include -using mapnik::feature_ptr; -using mapnik::geometry_utils; -using mapnik::geometry_type; - -void ogr_converter::convert_geometry(OGRGeometry* geom, feature_ptr feature) +mapnik::geometry::geometry ogr_converter::convert_geometry(OGRGeometry* ogr_geom) { // NOTE: wkbFlatten macro in ogr flattens 2.5d types into base 2d type - switch (wkbFlatten(geom->getGeometryType())) + switch (wkbFlatten(ogr_geom->getGeometryType())) { case wkbPoint: - convert_point(static_cast(geom), feature); + return convert_point(static_cast(ogr_geom)); break; case wkbMultiPoint: - convert_multipoint(static_cast(geom), feature); + return convert_multipoint(static_cast(ogr_geom)); break; case wkbLinearRing: - convert_linestring(static_cast(geom), feature); + return convert_linestring(static_cast(ogr_geom)); break; case wkbLineString: - convert_linestring(static_cast(geom), feature); + return convert_linestring(static_cast(ogr_geom)); break; case wkbMultiLineString: - convert_multilinestring(static_cast(geom), feature); + return convert_multilinestring(static_cast(ogr_geom)); break; case wkbPolygon: - convert_polygon(static_cast(geom), feature); + return convert_polygon(static_cast(ogr_geom)); break; case wkbMultiPolygon: - convert_multipolygon(static_cast(geom), feature); + return convert_multipolygon(static_cast(ogr_geom)); break; case wkbGeometryCollection: - convert_collection(static_cast(geom), feature); + return convert_collection(static_cast(ogr_geom)); break; case wkbNone: case wkbUnknown: default: { MAPNIK_LOG_WARN(ogr) << "ogr_converter: unknown geometry_type=" - << wkbFlatten(geom->getGeometryType()); + << wkbFlatten(ogr_geom->getGeometryType()); } + return mapnik::geometry::geometry(); break; } } -void ogr_converter::convert_point(OGRPoint* geom, feature_ptr feature) +mapnik::geometry::point ogr_converter::convert_point(OGRPoint* ogr_geom) { - std::unique_ptr point(new geometry_type(mapnik::geometry_type::types::Point)); - point->move_to(geom->getX(), geom->getY()); - feature->paths().push_back(point.release()); + return mapnik::geometry::point(ogr_geom->getX(), ogr_geom->getY()); } -void ogr_converter::convert_linestring(OGRLineString* geom, feature_ptr feature) +mapnik::geometry::multi_point ogr_converter::convert_multipoint(OGRMultiPoint* ogr_geom) { - int num_points = geom->getNumPoints(); - std::unique_ptr line(new geometry_type(mapnik::geometry_type::types::LineString)); - line->move_to(geom->getX(0), geom->getY(0)); - for (int i = 1; i < num_points; ++i) + mapnik::geometry::multi_point geom; + int num_geometries = ogr_geom->getNumGeometries(); + geom.reserve(num_geometries); + for (int i = 0; i < num_geometries; ++i) { - line->line_to (geom->getX(i), geom->getY(i)); + OGRPoint const* pt = static_cast(ogr_geom->getGeometryRef(i)); + geom.emplace_back(pt->getX(), pt->getY()); } - feature->paths().push_back(line.release()); + return geom; } -void ogr_converter::convert_polygon(OGRPolygon* geom, feature_ptr feature) +mapnik::geometry::line_string ogr_converter::convert_linestring(OGRLineString* ogr_geom) { - OGRLinearRing* exterior = geom->getExteriorRing(); - int num_points = exterior->getNumPoints(); - int num_interior = geom->getNumInteriorRings(); - int capacity = 0; + mapnik::geometry::line_string geom; + int num_points = ogr_geom->getNumPoints(); + geom.reserve(num_points); + for (int i = 0; i < num_points; ++i) + { + geom.add_coord(ogr_geom->getX(i), ogr_geom->getY(i)); + } + return geom; +} + +mapnik::geometry::multi_line_string ogr_converter::convert_multilinestring(OGRMultiLineString* ogr_geom) +{ + mapnik::geometry::multi_line_string geom; + int num_geometries = ogr_geom->getNumGeometries(); + geom.reserve(num_geometries); + for (int i = 0; i < num_geometries; ++i) + { + geom.emplace_back(convert_linestring(static_cast(ogr_geom->getGeometryRef(i)))); + } + return geom; +} + + +mapnik::geometry::polygon ogr_converter::convert_polygon(OGRPolygon* ogr_geom) +{ + mapnik::geometry::polygon geom; + mapnik::geometry::linear_ring exterior; + OGRLinearRing* ogr_exterior = ogr_geom->getExteriorRing(); + int num_points = ogr_exterior->getNumPoints(); + exterior.reserve(num_points); + for (int i = 0; i < num_points; ++i) + { + exterior.emplace_back(ogr_exterior->getX(i), ogr_exterior->getY(i)); + } + geom.set_exterior_ring(std::move(exterior)); + + int num_interior = ogr_geom->getNumInteriorRings(); for (int r = 0; r < num_interior; ++r) { - OGRLinearRing* interior = geom->getInteriorRing(r); - capacity += interior->getNumPoints(); - } - - std::unique_ptr poly(new geometry_type(mapnik::geometry_type::types::Polygon)); - - poly->move_to(exterior->getX(0), exterior->getY(0)); - for (int i = 1; i < num_points; ++i) - { - poly->line_to(exterior->getX(i), exterior->getY(i)); - } - poly->close_path(); - for (int r = 0; r < num_interior; ++r) - { - OGRLinearRing* interior = geom->getInteriorRing(r); - num_points = interior->getNumPoints(); - poly->move_to(interior->getX(0), interior->getY(0)); - for (int i = 1; i < num_points; ++i) + OGRLinearRing* ogr_interior = ogr_geom->getInteriorRing(r); + mapnik::geometry::linear_ring interior; + int num_interior_points = ogr_interior->getNumPoints(); + interior.reserve(num_interior_points); + for (int i = 0; i < num_interior_points; ++i) { - poly->line_to(interior->getX(i), interior->getY(i)); + interior.emplace_back(ogr_interior->getX(i), ogr_interior->getY(i)); } - poly->close_path(); + geom.add_hole(std::move(interior)); } - feature->paths().push_back(poly.release()); + return geom; } -void ogr_converter::convert_multipoint(OGRMultiPoint* geom, feature_ptr feature) +mapnik::geometry::multi_polygon ogr_converter::convert_multipolygon(OGRMultiPolygon* ogr_geom) { - int num_geometries = geom->getNumGeometries(); + mapnik::geometry::multi_polygon geom; + int num_geometries = ogr_geom->getNumGeometries(); + geom.reserve(num_geometries); for (int i = 0; i < num_geometries; ++i) { - convert_point(static_cast(geom->getGeometryRef(i)), feature); + geom.emplace_back(convert_polygon(static_cast(ogr_geom->getGeometryRef(i)))); } + return geom; } -void ogr_converter::convert_multilinestring(OGRMultiLineString* geom, feature_ptr feature) +mapnik::geometry::geometry_collection ogr_converter::convert_collection(OGRGeometryCollection* ogr_geom) { - int num_geometries = geom->getNumGeometries(); + mapnik::geometry::geometry_collection geom; + int num_geometries = ogr_geom->getNumGeometries(); + geom.reserve(num_geometries); for (int i = 0; i < num_geometries; ++i) { - convert_linestring(static_cast(geom->getGeometryRef(i)), feature); - } -} - -void ogr_converter::convert_multipolygon(OGRMultiPolygon* geom, feature_ptr feature) -{ - int num_geometries = geom->getNumGeometries(); - for (int i = 0; i < num_geometries; ++i) - { - convert_polygon(static_cast(geom->getGeometryRef(i)), feature); - } -} - -void ogr_converter::convert_collection(OGRGeometryCollection* geom, feature_ptr feature) -{ - int num_geometries = geom->getNumGeometries(); - for (int i = 0; i < num_geometries; ++i) - { - OGRGeometry* g = geom->getGeometryRef(i); + OGRGeometry* g = ogr_geom->getGeometryRef(i); if (g != nullptr) { - convert_geometry(g, feature); + geom.emplace_back(convert_geometry(g)); } } + return geom; } diff --git a/plugins/input/ogr/ogr_converter.hpp b/plugins/input/ogr/ogr_converter.hpp index a633784e2..8b7f909af 100644 --- a/plugins/input/ogr/ogr_converter.hpp +++ b/plugins/input/ogr/ogr_converter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,24 +24,29 @@ #define OGR_CONVERTER_HPP // mapnik -#include -#include +#include -// ogr -#include +class OGRGeometry; +class OGRGeometryCollection; +class OGRLineString; +class OGRMultiLineString; +class OGRMultiPoint; +class OGRMultiPolygon; +class OGRPoint; +class OGRPolygon; class ogr_converter { public: - static void convert_geometry (OGRGeometry* geom, mapnik::feature_ptr feature); - static void convert_collection (OGRGeometryCollection* geom, mapnik::feature_ptr feature); - static void convert_point (OGRPoint* geom, mapnik::feature_ptr feature); - static void convert_linestring (OGRLineString* geom, mapnik::feature_ptr feature); - static void convert_polygon (OGRPolygon* geom, mapnik::feature_ptr feature); - static void convert_multipoint (OGRMultiPoint* geom, mapnik::feature_ptr feature); - static void convert_multilinestring (OGRMultiLineString* geom, mapnik::feature_ptr feature); - static void convert_multipolygon (OGRMultiPolygon* geom, mapnik::feature_ptr feature); + static mapnik::geometry::geometry convert_geometry (OGRGeometry* ogr_geom); + static mapnik::geometry::point convert_point (OGRPoint* ogr_geom); + static mapnik::geometry::multi_point convert_multipoint (OGRMultiPoint* ogr_geom); + static mapnik::geometry::line_string convert_linestring (OGRLineString* ogr_geom); + static mapnik::geometry::multi_line_string convert_multilinestring (OGRMultiLineString* ogr_geom); + static mapnik::geometry::polygon convert_polygon (OGRPolygon* ogr_geom); + static mapnik::geometry::multi_polygon convert_multipolygon (OGRMultiPolygon* ogr_geom); + static mapnik::geometry::geometry_collection convert_collection (OGRGeometryCollection* ogr_geom); }; #endif // OGR_CONVERTER_HPP diff --git a/plugins/input/ogr/ogr_datasource.cpp b/plugins/input/ogr/ogr_datasource.cpp index c317b75dc..9e2b081bb 100644 --- a/plugins/input/ogr/ogr_datasource.cpp +++ b/plugins/input/ogr/ogr_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,7 +31,8 @@ #include #include #include -#include +#include +#include // boost #pragma GCC diagnostic push @@ -329,10 +330,12 @@ void ogr_datasource::init(mapnik::parameters const& params) const std::string fld_name = fld->GetNameRef(); const OGRFieldType type_oid = fld->GetType(); - switch (type_oid) { case OFTInteger: +#if GDAL_VERSION_MAJOR >= 2 + case OFTInteger64: +#endif desc_.add_descriptor(attribute_descriptor(fld_name, mapnik::Integer)); break; @@ -350,6 +353,9 @@ void ogr_datasource::init(mapnik::parameters const& params) break; case OFTIntegerList: +#if GDAL_VERSION_MAJOR >= 2 + case OFTInteger64List: +#endif case OFTRealList: case OFTStringList: case OFTWideStringList: // deprecated ! @@ -365,6 +371,13 @@ void ogr_datasource::init(mapnik::parameters const& params) } } } + mapnik::parameters & extra_params = desc_.get_extra_parameters(); + OGRSpatialReference * srs_ref = layer->GetSpatialRef(); + char * srs_output = NULL; + if (srs_ref && srs_ref->exportToProj4( &srs_output ) == OGRERR_NONE ) { + extra_params["proj4"] = mapnik::util::trim_copy(srs_output); + } + CPLFree(srs_output); } const char * ogr_datasource::name() @@ -382,9 +395,9 @@ box2d ogr_datasource::envelope() const return extent_; } -boost::optional ogr_datasource::get_geometry_type() const +boost::optional ogr_datasource::get_geometry_type() const { - boost::optional result; + boost::optional result; if (dataset_ && layer_.is_valid()) { OGRLayer* layer = layer_.layer(); @@ -397,19 +410,19 @@ boost::optional ogr_datasource::get_geometry_typ { case wkbPoint: case wkbMultiPoint: - result.reset(mapnik::datasource::Point); + result.reset(mapnik::datasource_geometry_t::Point); break; case wkbLinearRing: case wkbLineString: case wkbMultiLineString: - result.reset(mapnik::datasource::LineString); + result.reset(mapnik::datasource_geometry_t::LineString); break; case wkbPolygon: case wkbMultiPolygon: - result.reset(mapnik::datasource::Polygon); + result.reset(mapnik::datasource_geometry_t::Polygon); break; case wkbGeometryCollection: - result.reset(mapnik::datasource::Collection); + result.reset(mapnik::datasource_geometry_t::Collection); break; case wkbNone: case wkbUnknown: @@ -432,19 +445,19 @@ boost::optional ogr_datasource::get_geometry_typ { case wkbPoint: case wkbMultiPoint: - result.reset(mapnik::datasource::Point); + result.reset(mapnik::datasource_geometry_t::Point); break; case wkbLinearRing: case wkbLineString: case wkbMultiLineString: - result.reset(mapnik::datasource::LineString); + result.reset(mapnik::datasource_geometry_t::LineString); break; case wkbPolygon: case wkbMultiPolygon: - result.reset(mapnik::datasource::Polygon); + result.reset(mapnik::datasource_geometry_t::Polygon); break; case wkbGeometryCollection: - result.reset(mapnik::datasource::Collection); + result.reset(mapnik::datasource_geometry_t::Collection); break; default: break; diff --git a/plugins/input/ogr/ogr_datasource.hpp b/plugins/input/ogr/ogr_datasource.hpp index 853e2f447..f98aebfaa 100644 --- a/plugins/input/ogr/ogr_datasource.hpp +++ b/plugins/input/ogr/ogr_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -41,7 +41,10 @@ #include // ogr +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #include +#pragma GCC diagnostic pop #include "ogr_layer_ptr.hpp" class ogr_datasource : public mapnik::datasource @@ -54,7 +57,7 @@ public: mapnik::featureset_ptr features(mapnik::query const& q) const; mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt, double tol = 0) const; mapnik::box2d envelope() const; - boost::optional get_geometry_type() const; + boost::optional get_geometry_type() const; mapnik::layer_descriptor get_descriptor() const; private: diff --git a/plugins/input/ogr/ogr_featureset.cpp b/plugins/input/ogr/ogr_featureset.cpp index a0a6a112f..3d46fcf87 100644 --- a/plugins/input/ogr/ogr_featureset.cpp +++ b/plugins/input/ogr/ogr_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,13 +25,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include // ogr #include "ogr_featureset.hpp" @@ -101,7 +101,9 @@ feature_ptr ogr_featureset::next() OGRGeometry* geom = poFeature->GetGeometryRef(); if (geom && ! geom->IsEmpty()) { - ogr_converter::convert_geometry(geom, feature); + auto geom_corrected = ogr_converter::convert_geometry(geom); + mapnik::geometry::correct(geom_corrected); + feature->set_geometry(std::move(geom_corrected)); } else { @@ -123,6 +125,9 @@ feature_ptr ogr_featureset::next() switch (type_oid) { case OFTInteger: +#if GDAL_VERSION_MAJOR >= 2 + case OFTInteger64: +#endif { feature->put( fld_name, poFeature->GetFieldAsInteger(i)); break; @@ -142,6 +147,9 @@ feature_ptr ogr_featureset::next() } case OFTIntegerList: +#if GDAL_VERSION_MAJOR >= 2 + case OFTInteger64List: +#endif case OFTRealList: case OFTStringList: case OFTWideStringList: // deprecated ! diff --git a/plugins/input/ogr/ogr_featureset.hpp b/plugins/input/ogr/ogr_featureset.hpp index 9dfd7290c..ca7a57ab6 100644 --- a/plugins/input/ogr/ogr_featureset.hpp +++ b/plugins/input/ogr/ogr_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,11 +29,11 @@ #include #include -// boost - - // ogr +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #include +#pragma GCC diagnostic pop class ogr_featureset : public mapnik::Featureset { diff --git a/plugins/input/ogr/ogr_index.hpp b/plugins/input/ogr/ogr_index.hpp index b30c92a35..e661d21b0 100644 --- a/plugins/input/ogr/ogr_index.hpp +++ b/plugins/input/ogr/ogr_index.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/ogr/ogr_index_featureset.cpp b/plugins/input/ogr/ogr_index_featureset.cpp index e095ed1ea..c59ef29fa 100644 --- a/plugins/input/ogr/ogr_index_featureset.cpp +++ b/plugins/input/ogr/ogr_index_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,18 +25,22 @@ #include #include #include -#include #include #include #include #include #include +#include // boost #ifdef SHAPE_MEMORY_MAPPED_FILE #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #include +#pragma GCC diagnostic pop #endif // ogr @@ -44,6 +48,8 @@ #include "ogr_converter.hpp" #include "ogr_index.hpp" +#include + using mapnik::query; using mapnik::box2d; using mapnik::feature_ptr; @@ -120,7 +126,9 @@ feature_ptr ogr_index_featureset::next() geom->getEnvelope(&feature_envelope_); if (!filter_.pass(mapnik::box2d(feature_envelope_.MinX,feature_envelope_.MinY, feature_envelope_.MaxX,feature_envelope_.MaxY))) continue; - ogr_converter::convert_geometry (geom, feature); + auto geom_corrected = ogr_converter::convert_geometry(geom); + mapnik::geometry::correct(geom_corrected); + feature->set_geometry(std::move(geom_corrected)); } else { @@ -140,6 +148,9 @@ feature_ptr ogr_index_featureset::next() switch (type_oid) { case OFTInteger: +#if GDAL_VERSION_MAJOR >= 2 + case OFTInteger64: +#endif { feature->put(fld_name,poFeature->GetFieldAsInteger (i)); break; @@ -159,6 +170,9 @@ feature_ptr ogr_index_featureset::next() } case OFTIntegerList: +#if GDAL_VERSION_MAJOR >= 2 + case OFTInteger64List: +#endif case OFTRealList: case OFTStringList: case OFTWideStringList: // deprecated ! diff --git a/plugins/input/ogr/ogr_index_featureset.hpp b/plugins/input/ogr/ogr_index_featureset.hpp index 440743e31..93d3a327f 100644 --- a/plugins/input/ogr/ogr_index_featureset.hpp +++ b/plugins/input/ogr/ogr_index_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/ogr/ogr_layer_ptr.hpp b/plugins/input/ogr/ogr_layer_ptr.hpp index 07c55c352..28df28b21 100644 --- a/plugins/input/ogr/ogr_layer_ptr.hpp +++ b/plugins/input/ogr/ogr_layer_ptr.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/osm/basiccurl.cpp b/plugins/input/osm/basiccurl.cpp index 77cab5eba..fd8361453 100755 --- a/plugins/input/osm/basiccurl.cpp +++ b/plugins/input/osm/basiccurl.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/osm/build.py b/plugins/input/osm/build.py index 3a0dffe4e..061fc859c 100644 --- a/plugins/input/osm/build.py +++ b/plugins/input/osm/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/osm/dataset_deliverer.cpp b/plugins/input/osm/dataset_deliverer.cpp index 4920cab90..6d7fe31d9 100644 --- a/plugins/input/osm/dataset_deliverer.cpp +++ b/plugins/input/osm/dataset_deliverer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/osm/osm.cpp b/plugins/input/osm/osm.cpp index f822a3177..76d3bac18 100644 --- a/plugins/input/osm/osm.cpp +++ b/plugins/input/osm/osm.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/osm/osm_datasource.cpp b/plugins/input/osm/osm_datasource.cpp index 4dd4c348e..4bbe1bfde 100644 --- a/plugins/input/osm/osm_datasource.cpp +++ b/plugins/input/osm/osm_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -153,7 +153,7 @@ box2d osm_datasource::envelope() const return extent_; } -boost::optional osm_datasource::get_geometry_type() const +boost::optional osm_datasource::get_geometry_type() const { - return boost::optional(mapnik::datasource::Collection); + return boost::optional(mapnik::datasource_geometry_t::Collection); } diff --git a/plugins/input/osm/osm_datasource.hpp b/plugins/input/osm/osm_datasource.hpp index 2662dedec..1bd8bb387 100644 --- a/plugins/input/osm/osm_datasource.hpp +++ b/plugins/input/osm/osm_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -60,7 +60,7 @@ public: featureset_ptr features(const query& q) const; featureset_ptr features_at_point(coord2d const& pt, double tol = 0) const; box2d envelope() const; - boost::optional get_geometry_type() const; + boost::optional get_geometry_type() const; layer_descriptor get_descriptor() const; private: diff --git a/plugins/input/osm/osm_featureset.cpp b/plugins/input/osm/osm_featureset.cpp index ca81575d2..46e796681 100644 --- a/plugins/input/osm/osm_featureset.cpp +++ b/plugins/input/osm/osm_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,13 +27,11 @@ #include #include #include - -// boost +#include #include "osm_featureset.hpp" using mapnik::feature_ptr; -using mapnik::geometry_type; using mapnik::feature_factory; template @@ -64,9 +62,7 @@ feature_ptr osm_featureset::next() feature = feature_factory::create(ctx_, cur_item->id); double lat = static_cast(cur_item)->lat; double lon = static_cast(cur_item)->lon; - std::unique_ptr point = std::make_unique(mapnik::geometry_type::types::Point); - point->move_to(lon, lat); - feature->add_geometry(point.release()); + feature->set_geometry(mapnik::geometry::point(lon,lat)); } else if (dataset_->current_item_is_way()) { @@ -82,24 +78,33 @@ feature_ptr osm_featureset::next() if (!cur_item) return feature_ptr(); feature = feature_factory::create(ctx_, cur_item->id); - mapnik::geometry_type::types geom_type = mapnik::geometry_type::types::LineString; if (static_cast(cur_item)->is_polygon()) { - geom_type = mapnik::geometry_type::types::Polygon; + mapnik::geometry::linear_ring ring; + for (unsigned int count = 0; + count < static_cast(cur_item)->nodes.size(); + count++) + { + ring.add_coord(static_cast(cur_item)->nodes[count]->lon, + static_cast(cur_item)->nodes[count]->lat); + } + mapnik::geometry::polygon geom; + geom.set_exterior_ring(std::move(ring)); + mapnik::geometry::correct(geom); + feature->set_geometry(std::move(geom)); } - std::unique_ptr geom = std::make_unique(geom_type); - - geom->move_to(static_cast(cur_item)->nodes[0]->lon, - static_cast(cur_item)->nodes[0]->lat); - - for (unsigned int count = 1; - count < static_cast(cur_item)->nodes.size(); - count++) + else { - geom->line_to(static_cast(cur_item)->nodes[count]->lon, - static_cast(cur_item)->nodes[count]->lat); + mapnik::geometry::line_string geom; + for (unsigned int count = 0; + count < static_cast(cur_item)->nodes.size(); + count++) + { + geom.add_coord(static_cast(cur_item)->nodes[count]->lon, + static_cast(cur_item)->nodes[count]->lat); + } + feature->set_geometry(std::move(geom)); } - feature->add_geometry(geom.release()); } else { diff --git a/plugins/input/osm/osm_featureset.hpp b/plugins/input/osm/osm_featureset.hpp index 48c0ff508..7eed2e636 100644 --- a/plugins/input/osm/osm_featureset.hpp +++ b/plugins/input/osm/osm_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/pgraster/build.py b/plugins/input/pgraster/build.py index 9f1f40fe2..9d2666588 100644 --- a/plugins/input/pgraster/build.py +++ b/plugins/input/pgraster/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/pgraster/pgraster_datasource.cpp b/plugins/input/pgraster/pgraster_datasource.cpp index 7a144dca0..fb2c4b0ea 100644 --- a/plugins/input/pgraster/pgraster_datasource.cpp +++ b/plugins/input/pgraster/pgraster_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -357,7 +357,7 @@ pgraster_datasource::pgraster_datasource(parameters const& params) { pgraster_overview ov = pgraster_overview(); - ov.schema = rs->getValue("sch"); + ov.schema = rs->getValue("sch"); ov.table = rs->getValue("tab"); ov.column = rs->getValue("col"); ov.scale = atof(rs->getValue("scl")); @@ -1201,7 +1201,7 @@ box2d pgraster_datasource::envelope() const return extent_; } -boost::optional pgraster_datasource::get_geometry_type() const +boost::optional pgraster_datasource::get_geometry_type() const { - return boost::optional(); + return boost::optional(); } diff --git a/plugins/input/pgraster/pgraster_datasource.hpp b/plugins/input/pgraster/pgraster_datasource.hpp index dc012c84c..221f196e4 100644 --- a/plugins/input/pgraster/pgraster_datasource.hpp +++ b/plugins/input/pgraster/pgraster_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -85,7 +85,7 @@ public: featureset_ptr features(query const& q) const; featureset_ptr features_at_point(coord2d const& pt, double tol = 0) const; mapnik::box2d envelope() const; - boost::optional get_geometry_type() const; + boost::optional get_geometry_type() const; layer_descriptor get_descriptor() const; private: diff --git a/plugins/input/pgraster/pgraster_featureset.cpp b/plugins/input/pgraster/pgraster_featureset.cpp index 497652561..e2d4ccb50 100644 --- a/plugins/input/pgraster/pgraster_featureset.cpp +++ b/plugins/input/pgraster/pgraster_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include // for int2net @@ -47,8 +47,6 @@ #include #include -using mapnik::geometry_type; -using mapnik::byte; using mapnik::feature_factory; using mapnik::context_ptr; diff --git a/plugins/input/pgraster/pgraster_featureset.hpp b/plugins/input/pgraster/pgraster_featureset.hpp index 55aba597a..25319b31a 100644 --- a/plugins/input/pgraster/pgraster_featureset.hpp +++ b/plugins/input/pgraster/pgraster_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/pgraster/pgraster_wkb_reader.cpp b/plugins/input/pgraster/pgraster_wkb_reader.cpp index d2e77048c..0320fe106 100644 --- a/plugins/input/pgraster/pgraster_wkb_reader.cpp +++ b/plugins/input/pgraster/pgraster_wkb_reader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,13 +32,11 @@ #include #include #include -#include +#include #include #include #include // for box2d - -// boost -#include +#include #include @@ -183,13 +181,8 @@ mapnik::raster_ptr read_data_band(mapnik::box2d const& bbox, uint16_t width, uint16_t height, bool hasnodata, T reader) { - mapnik::image_data_gray32f image(width, height); - //image.set(std::numeric_limits::max()); - // Start with plain white (ABGR or RGBA depending on endiannes) - // TODO: set to transparent instead? - image.set(0xffffffff); - - float* data = image.getData(); + mapnik::image_gray32f image(width, height); + float* data = image.data(); double val; val = reader(); // nodata value, need to read anyway for (int y=0; y const& bbox, data[off] = val; } } - mapnik::raster_ptr raster = std::make_shared(bbox, image, 1.0, true); + mapnik::raster_ptr raster = std::make_shared(bbox, image, 1.0); if ( hasnodata ) raster->set_nodata(val); return raster; } @@ -234,27 +227,27 @@ mapnik::raster_ptr pgraster_wkb_reader::read_indexed(mapnik::box2d const // mapnik does not support signed anyway case PT_8BUI: return read_data_band(bbox, width_, height_, hasnodata, - boost::bind(read_uint8, &ptr_)); + std::bind(read_uint8, &ptr_)); break; case PT_16BSI: // mapnik does not support signed anyway case PT_16BUI: return read_data_band(bbox, width_, height_, hasnodata, - boost::bind(read_uint16, &ptr_, endian_)); + std::bind(read_uint16, &ptr_, endian_)); break; case PT_32BSI: // mapnik does not support signed anyway case PT_32BUI: return read_data_band(bbox, width_, height_, hasnodata, - boost::bind(read_uint32, &ptr_, endian_)); + std::bind(read_uint32, &ptr_, endian_)); break; case PT_32BF: return read_data_band(bbox, width_, height_, hasnodata, - boost::bind(read_float32, &ptr_, endian_)); + std::bind(read_float32, &ptr_, endian_)); break; case PT_64BF: return read_data_band(bbox, width_, height_, hasnodata, - boost::bind(read_float64, &ptr_, endian_)); + std::bind(read_float64, &ptr_, endian_)); break; default: std::ostringstream err; @@ -271,15 +264,15 @@ mapnik::raster_ptr read_grayscale_band(mapnik::box2d const& bbox, uint16_t width, uint16_t height, bool hasnodata, T reader) { - mapnik::image_data_rgba8 image(width,height); + mapnik::image_rgba8 image(width,height, true, true); // Start with plain white (ABGR or RGBA depending on endiannes) // TODO: set to transparent instead? image.set(0xffffffff); int val; - uint8_t * data = image.getBytes(); - int ps = 4; // sizeof(image_data::pixel_type) + uint8_t * data = image.bytes(); + int ps = 4; // sizeof(image::pixel_type) int off; val = reader(); // nodata value, need to read anyway for (int y=0; y const& bbox, data[off+2] = val; } } - mapnik::raster_ptr raster = std::make_shared(bbox, image, 1.0, true); + mapnik::raster_ptr raster = std::make_shared(bbox, image, 1.0); if ( hasnodata ) raster->set_nodata(val); return raster; } @@ -325,19 +318,19 @@ mapnik::raster_ptr pgraster_wkb_reader::read_grayscale(mapnik::box2d con // mapnik does not support signed anyway case PT_8BUI: return read_grayscale_band(bbox, width_, height_, hasnodata, - boost::bind(read_uint8, &ptr_)); + std::bind(read_uint8, &ptr_)); break; case PT_16BSI: // mapnik does not support signed anyway case PT_16BUI: return read_grayscale_band(bbox, width_, height_, hasnodata, - boost::bind(read_uint16, &ptr_, endian_)); + std::bind(read_uint16, &ptr_, endian_)); break; case PT_32BSI: // mapnik does not support signed anyway case PT_32BUI: return read_grayscale_band(bbox, width_, height_, hasnodata, - boost::bind(read_uint32, &ptr_, endian_)); + std::bind(read_uint32, &ptr_, endian_)); break; default: std::ostringstream err; @@ -352,9 +345,9 @@ mapnik::raster_ptr pgraster_wkb_reader::read_grayscale(mapnik::box2d con mapnik::raster_ptr pgraster_wkb_reader::read_rgba(mapnik::box2d const& bbox, uint16_t width, uint16_t height) { - mapnik::image_data_rgba8 image(width, height); + mapnik::image_rgba8 im(width, height, true, true); // Start with plain white (ABGR or RGBA depending on endiannes) - image.set(0xffffffff); + im.set(0xffffffff); uint8_t nodataval; for (int bn=0; bn const& b << " nodataval " << tmp << " != band 0 nodataval " << nodataval; } - int ps = 4; // sizeof(image_data::pixel_type) - uint8_t * image_data = image.getBytes(); + int ps = 4; // sizeof(image::pixel_type) + uint8_t * image_data = im.bytes(); for (int y=0; y const& b } } } - mapnik::raster_ptr raster = std::make_shared(bbox, image, 1.0, true); + mapnik::raster_ptr raster = std::make_shared(bbox, im, 1.0); raster->set_nodata(0xffffffff); return raster; } diff --git a/plugins/input/pgraster/pgraster_wkb_reader.hpp b/plugins/input/pgraster/pgraster_wkb_reader.hpp index b0ec7f8f9..02a22bc4a 100644 --- a/plugins/input/pgraster/pgraster_wkb_reader.hpp +++ b/plugins/input/pgraster/pgraster_wkb_reader.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/asyncresultset.hpp b/plugins/input/postgis/asyncresultset.hpp index b1bc9126d..9c30d57f3 100644 --- a/plugins/input/postgis/asyncresultset.hpp +++ b/plugins/input/postgis/asyncresultset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/build.py b/plugins/input/postgis/build.py index 676fbf29c..9b8ecd9a9 100644 --- a/plugins/input/postgis/build.py +++ b/plugins/input/postgis/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/connection.hpp b/plugins/input/postgis/connection.hpp index 8f3e6bfbb..3d33a2d67 100644 --- a/plugins/input/postgis/connection.hpp +++ b/plugins/input/postgis/connection.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -58,7 +58,7 @@ public: { std::string err_msg = "Postgis Plugin: "; err_msg += status(); - err_msg += "\nConnection string: '"; + err_msg += "Connection string: '"; err_msg += connection_str; err_msg += "'\n"; MAPNIK_LOG_DEBUG(postgis) << "postgis_connection: creation failed, closing connection - " << this; @@ -71,7 +71,7 @@ public: if ( ! ok ) { std::string err_msg = "Postgis Plugin: "; err_msg += status(); - err_msg += "\nConnection string: '"; + err_msg += "Connection string: '"; err_msg += connection_str; err_msg += "'\n"; close(); @@ -127,7 +127,7 @@ public: { std::string err_msg = "Postgis Plugin: "; err_msg += status(); - err_msg += "\nin executeQuery Full sql was: '"; + err_msg += "in executeQuery Full sql was: '"; err_msg += sql; err_msg += "'\n"; if ( result ) PQclear(result); @@ -142,12 +142,19 @@ public: std::string status; if (conn_) { - if ( isOK() ) return PQerrorMessage(conn_); - else return "Bad connection"; + char * err_msg = PQerrorMessage(conn_); + if (err_msg == nullptr) + { + status = "Bad connection\n"; + } + else + { + status = std::string(err_msg); + } } else { - status = "Uninitialized connection"; + status = "Uninitialized connection\n"; } return status; } @@ -167,7 +174,7 @@ public: { std::string err_msg = "Postgis Plugin: "; err_msg += status(); - err_msg += "\nin executeAsyncQuery Full sql was: '"; + err_msg += "in executeAsyncQuery Full sql was: '"; err_msg += sql; err_msg += "'\n"; clearAsyncResult(PQgetResult(conn_)); @@ -191,7 +198,7 @@ public: { std::string err_msg = "Postgis Plugin: "; err_msg += status(); - err_msg += "\nin getNextAsyncResult"; + err_msg += "in getNextAsyncResult"; clearAsyncResult(result); // We need to guarde against losing the connection // (i.e db restart) so here we invalidate the full connection @@ -208,7 +215,7 @@ public: { std::string err_msg = "Postgis Plugin: "; err_msg += status(); - err_msg += "\nin getAsyncResult"; + err_msg += "in getAsyncResult"; clearAsyncResult(result); // We need to be guarded against losing the connection // (i.e db restart), we invalidate the full connection diff --git a/plugins/input/postgis/connection_manager.hpp b/plugins/input/postgis/connection_manager.hpp index 64271900a..37c547f02 100644 --- a/plugins/input/postgis/connection_manager.hpp +++ b/plugins/input/postgis/connection_manager.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,7 +27,7 @@ // mapnik #include -#include +#include // boost #include diff --git a/plugins/input/postgis/cursorresultset.hpp b/plugins/input/postgis/cursorresultset.hpp index fa071b3a5..63bb9429c 100644 --- a/plugins/input/postgis/cursorresultset.hpp +++ b/plugins/input/postgis/cursorresultset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/numeric2string.hpp b/plugins/input/postgis/numeric2string.hpp index 0f988c9c6..76c204f0c 100644 --- a/plugins/input/postgis/numeric2string.hpp +++ b/plugins/input/postgis/numeric2string.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/postgis_datasource.cpp b/plugins/input/postgis/postgis_datasource.cpp index 9e6cba390..9477c0488 100644 --- a/plugins/input/postgis/postgis_datasource.cpp +++ b/plugins/input/postgis/postgis_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -154,10 +154,10 @@ postgis_datasource::postgis_datasource(parameters const& params) schema_ = geometry_table_.substr(0, idx); geometry_table_ = geometry_table_.substr(idx + 1); } - else - { - geometry_table_ = geometry_table_.substr(0); - } + + // NOTE: geometry_table_ how should ideally be a table name, but + // there are known edge cases where this will break down and + // geometry_table_ may even be empty: https://github.com/mapnik/mapnik/issues/2718 // If we do not know both the geometry_field and the srid // then first attempt to fetch the geometry name from a geometry_columns entry. @@ -166,7 +166,7 @@ postgis_datasource::postgis_datasource(parameters const& params) // the table parameter references a table, view, or subselect not // registered in the geometry columns. geometryColumn_ = geometry_field_; - if (geometryColumn_.empty() || srid_ == 0) + if (!geometry_table_.empty() && (geometryColumn_.empty() || srid_ == 0)) { #ifdef MAPNIK_STATS mapnik::progress_timer __stats2__(std::clog, "postgis_datasource::init(get_srid_and_geometry_column)"); @@ -223,12 +223,24 @@ postgis_datasource::postgis_datasource(parameters const& params) // If we still do not know the srid then we can try to fetch // it from the 'geometry_table_' parameter, which should work even if it is // a subselect as long as we know the geometry_field to query - if (! geometryColumn_.empty() && srid_ <= 0) + if (!geometryColumn_.empty() && srid_ <= 0) { std::ostringstream s; - s << "SELECT ST_SRID(\"" << geometryColumn_ << "\") AS srid FROM " - << populate_tokens(geometry_table_) << " WHERE \"" << geometryColumn_ << "\" IS NOT NULL LIMIT 1;"; + s << "SELECT ST_SRID(\"" << geometryColumn_ << "\") AS srid FROM "; + if (!geometry_table_.empty()) + { + if (!schema_.empty()) + { + s << schema_ << '.'; + } + s << geometry_table_; + } + else + { + s << populate_tokens(table_); + } + s << " WHERE \"" << geometryColumn_ << "\" IS NOT NULL LIMIT 1;"; shared_ptr rs = conn->executeQuery(s.str()); if (rs->next()) @@ -1021,9 +1033,9 @@ box2d postgis_datasource::envelope() const return extent_; } -boost::optional postgis_datasource::get_geometry_type() const +boost::optional postgis_datasource::get_geometry_type() const { - boost::optional result; + boost::optional result; CnxPool_ptr pool = ConnectionManager::instance().getPool(creator_.id()); if (pool) @@ -1058,17 +1070,17 @@ boost::optional postgis_datasource::get_geometry g_type = rs->getValue("type"); if (boost::algorithm::contains(g_type, "line")) { - result.reset(mapnik::datasource::LineString); + result.reset(mapnik::datasource_geometry_t::LineString); return result; } else if (boost::algorithm::contains(g_type, "point")) { - result.reset(mapnik::datasource::Point); + result.reset(mapnik::datasource_geometry_t::Point); return result; } else if (boost::algorithm::contains(g_type, "polygon")) { - result.reset(mapnik::datasource::Polygon); + result.reset(mapnik::datasource_geometry_t::Polygon); return result; } else // geometry @@ -1109,26 +1121,26 @@ boost::optional postgis_datasource::get_geometry if (boost::algorithm::icontains(data, "line")) { g_type = "linestring"; - result.reset(mapnik::datasource::LineString); + result.reset(mapnik::datasource_geometry_t::LineString); } else if (boost::algorithm::icontains(data, "point")) { g_type = "point"; - result.reset(mapnik::datasource::Point); + result.reset(mapnik::datasource_geometry_t::Point); } else if (boost::algorithm::icontains(data, "polygon")) { g_type = "polygon"; - result.reset(mapnik::datasource::Polygon); + result.reset(mapnik::datasource_geometry_t::Polygon); } else // geometry { - result.reset(mapnik::datasource::Collection); + result.reset(mapnik::datasource_geometry_t::Collection); return result; } if (! prev_type.empty() && g_type != prev_type) { - result.reset(mapnik::datasource::Collection); + result.reset(mapnik::datasource_geometry_t::Collection); return result; } prev_type = g_type; diff --git a/plugins/input/postgis/postgis_datasource.hpp b/plugins/input/postgis/postgis_datasource.hpp index 0fb8e11ad..84bcfe555 100644 --- a/plugins/input/postgis/postgis_datasource.hpp +++ b/plugins/input/postgis/postgis_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -74,7 +74,7 @@ public: featureset_ptr features(query const& q) const; featureset_ptr features_at_point(coord2d const& pt, double tol = 0) const; mapnik::box2d envelope() const; - boost::optional get_geometry_type() const; + boost::optional get_geometry_type() const; layer_descriptor get_descriptor() const; private: diff --git a/plugins/input/postgis/postgis_featureset.cpp b/plugins/input/postgis/postgis_featureset.cpp index 7d9f47589..9dda45db9 100644 --- a/plugins/input/postgis/postgis_featureset.cpp +++ b/plugins/input/postgis/postgis_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -41,8 +41,6 @@ #include #include -using mapnik::geometry_type; -using mapnik::byte; using mapnik::geometry_utils; using mapnik::feature_factory; using mapnik::context_ptr; @@ -123,8 +121,8 @@ feature_ptr postgis_featureset::next() int size = rs_->getFieldLength(0); const char *data = rs_->getValue(0); - if (!geometry_utils::from_wkb(feature->paths(), data, size)) - continue; + mapnik::geometry::geometry geometry = geometry_utils::from_wkb(data, size); + feature->set_geometry(std::move(geometry)); totalGeomSize_ += size; unsigned num_attrs = ctx_->size() + 1; diff --git a/plugins/input/postgis/postgis_featureset.hpp b/plugins/input/postgis/postgis_featureset.hpp index 6f5fff44a..1dc2b3ff8 100644 --- a/plugins/input/postgis/postgis_featureset.hpp +++ b/plugins/input/postgis/postgis_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/resultset.hpp b/plugins/input/postgis/resultset.hpp index b93ce64dd..915a5962d 100644 --- a/plugins/input/postgis/resultset.hpp +++ b/plugins/input/postgis/resultset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/python/README.md b/plugins/input/python/README.md deleted file mode 100644 index f1a4c57e3..000000000 --- a/plugins/input/python/README.md +++ /dev/null @@ -1,241 +0,0 @@ -# Python plugin - -This plugin allows you to write data sources in the Python programming language. -This is useful if you want to rapidly prototype a plugin, perform some custom -manipulation on data or if you want to bind mapnik to a datasource which is most -conveniently accessed through Python. - -The plugin may be used from the existing mapnik Python bindings or it can embed -the Python interpreter directly allowing it to be used from C++, XML or even -JavaScript. - -## Rationale - -Mapnik already has excellent Python bindings but they only directly support -calling *into* mapnik *from* Python. This forces mapnik and its input plugins to -be the lowest layer of the stack. The role of this plugin is to allow mapnik to -call *into* Python itself. This allows mapnik to sit as rendering middleware -between a custom Python frontend and a custom Python datasource. This increases -the utility of mapnik as a component in a larger system. - -There already exists MemoryDatasource which can be used to dynamically create -geometry in Python. It suffers from the problem that it does not allow -generating only the geometry which is seen by a particular query. Similarly the -entire geometry must exist in memory before rendering can progress. By using a -custom iterator object or by using generator expressions this plugin allows -geometry to be created on demand and to be destroyed after use. This can have a -great impact on memory efficiency. Since geometry is generated on-demand as -rendering progresses there can be arbitrarily complex 'cleverness' optimising -the geometry generated for a particular query. Obvious examples of this would -be generating only geometry within the query bounding box and generating -geometry with an appropriate level of detail for the output resolution. - -## Initialization - -Only the `factory` parameter is required. This is of the form -`[module:]callable`. If `module` is present then `module` will be imported and -its attribute named `callable` will be used as a factory callable. If `module` -is omitted, then `__main__` is used. Any other parameter aside from `factory` or -`type` will be passed directly to the callable as keyword arguments. Note that -these will always be passed as strings even if the parameter can be parsed as an -integer of floating point value. - -The callable should return an object with the following required attributes: - -* `envelope` - a 4-tuple giving the (minx, miny, maxx, maxy) extent of the - datasource; - -* `data_type` - a `mapnik.DataType` instance giving the type of data stored in - this datasource. This will usually be one of `mapnik.DataType.Vector` or - `mapnik.DataType.Raster`. - -The following attributes are optional: - -* `geometry_type` - if the dataset is a vector dataset, this is an instance of - `mapnik.DataGeometryType` giving the type of geometry returned by the - datasource. - -The following methods must be present: - -* `features(query)` - takes a single argument which is an instance of - `mapnik.Query` and returns an iterable of `mapnik.Feature` instances for that - query. - -* `features_at_point(point)` - almost never used. Takes a single argument which - is an instance of `mapnik.Point` (I think) and returns an iterable of - features associated with that point. - -## Convenience classes - -The standard `mapnik` module provides a convenience class called -`mapnik.PythonDatasource` which has default implementations for the required -methods and accepts the geometry type, data type and envelope as constructor -arguments. It also provides some convenience class methods which take care of -constructing features for you: - -* `mapnik.PythonDatasource.wkb_features` - constructs features from - well-known-binary (WKB) format geometry. Takes two keyword arguments: `keys` - which is a sequence of keys associated with each feature and `features` which - is a sequence of pairs. The first element in each pair is the WKB - representation of the feature and the second element is a dictionary mapping - keys to values. - -# Caveats - -* If used directly from C++, `Py_Initialize()` must have been called before the - plugin is loaded to initialise the interpreter correctly. - -* When inside the interpreter the global interpreter lock is held each time a - feature is fetched and so multi-threaded rendering performance may suffer. You - can mitigate this by making sure that the feature iterator yields its value as - quickly as possible, potentially from an in-memory buffer filled fom another - process over IPC. - -# Examples - -In XML: - -```xml - - - - - style - - python - test:TestDatasource - - - -``` - -In Python using the shapely geometry library: - -```python -import mapnik -from shapely.geometry import * - -class TestDatasource(mapnik.PythonDatasource): - def __init__(self): - super(TestDatasource, self).__init__() - - def features(self, query): - return mapnik.PythonDatasource.wkb_features( - keys = ('label',), - features = ( - ( Point(5,6).wkb, { 'label': 'foo-bar'} ), - ( Point(100,60).wkb, { 'label': 'buzz-quux'} ), - ) - ) - -if __name__ == '__main__': - m = mapnik.Map(1280,1024) - m.background = mapnik.Color('white') - s = mapnik.Style() - r = mapnik.Rule() - r.symbols.append(mapnik.PointSymbolizer()) - t = mapnik.TextSymbolizer(mapnik.Expression("[label]"),"DejaVu Sans Book",10,mapnik.Color('black')) - t.displacement = (5,5) - r.symbols.append(t) - s.rules.append(r) - m.append_style('point_style',s) - ds = mapnik.Python(factory='TestDatasource') - layer = mapnik.Layer('python') - layer.datasource = ds - layer.styles.append('point_style') - m.layers.append(layer) - m.zoom_all() - mapnik.render_to_file(m,'map.png', 'png') -``` - -A more complex Python example which makes use of iterators to generate geometry -dynamically: - -```python -"""A more complex example which renders an infinite series of concentric -circles centred on a point. - -The circles are represented by a Python iterator which will yield only the -circles which intersect the query's bounding box. The advantage of this -approach over a MemoryDatasource is that a) only those circles which intersect -the viewport are actually generated and b) only the memory for the largest -circle need be available since each circle is created on demand and destroyed -when finished with. -""" -import math -import mapnik -from shapely.geometry import * - -def box2d_to_shapely(box): - import shapely.geometry - return shapely.geometry.box(box.minx, box.miny, box.maxx, box.maxy) - -class ConcentricCircles(object): - def __init__(self, centre, bounds, step=1): - self.centre = centre - self.bounds = bounds - self.step = step - - class Iterator(object): - def __init__(self, container): - self.container = container - - centre = self.container.centre - bounds = self.container.bounds - step = self.container.step - - if centre.within(bounds): - self.radius = 0 - else: - self.radius = math.ceil(centre.distance(bounds) / float(step)) * step - - def next(self): - circle = self.container.centre.buffer(self.radius) - self.radius += self.container.step - - # has the circle grown so large that the boundary is entirely within it? - if circle.contains(self.container.bounds): - raise StopIteration() - - return ( circle.wkb, { } ) - - def __iter__(self): - return ConcentricCircles.Iterator(self) - -class TestDatasource(mapnik.PythonDatasource): - def __init__(self): - super(TestDatasource, self).__init__(geometry_type=mapnik.DataGeometryType.Polygon) - - def features(self, query): - # Get the query bounding-box as a shapely bounding box - bounding_box = box2d_to_shapely(query.bbox) - centre = Point(-20, 0) - - return mapnik.PythonDatasource.wkb_features( - keys = (), - features = ConcentricCircles(centre, bounding_box, 0.5) - ) - -if __name__ == '__main__': - m = mapnik.Map(640, 320) - - m.background = mapnik.Color('white') - s = mapnik.Style() - r = mapnik.Rule() - r.symbols.append(mapnik.LineSymbolizer()) - s.rules.append(r) - m.append_style('point_style',s) - ds = mapnik.Python(factory='TestDatasource') - layer = mapnik.Layer('python') - layer.datasource = ds - layer.styles.append('point_style') - m.layers.append(layer) - box = mapnik.Box2d(-60, -60, 0, -30) - m.zoom_to_box(box) - mapnik.render_to_file(m,'map.png', 'png') -``` diff --git a/plugins/input/python/build.py b/plugins/input/python/build.py deleted file mode 100644 index e5d20ec5b..000000000 --- a/plugins/input/python/build.py +++ /dev/null @@ -1,97 +0,0 @@ -# -# This file is part of Mapnik (c++ mapping toolkit) -# -# Copyright (C) 2013 Artem Pavlenko -# -# Mapnik 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 -# -# - -import os -import copy -Import ('plugin_base') -Import ('env') - -PLUGIN_NAME = 'python' - -plugin_env = plugin_base.Clone() - -plugin_sources = Split( - """ - %(PLUGIN_NAME)s_datasource.cpp - %(PLUGIN_NAME)s_featureset.cpp - %(PLUGIN_NAME)s_utils.cpp - """ % locals() -) - -# Link Library to Dependencies -libraries = [] -libraries.append('boost_system%s' % env['BOOST_APPEND']) -libraries.append(env['BOOST_PYTHON_LIB']) -libraries.append(env['ICU_LIB_NAME']) - -python_cpppath = env['PYTHON_INCLUDES'] -allcpp_paths = copy.copy(env['CPPPATH']) -allcpp_paths.extend(python_cpppath) -# NOTE: explicit linking to libpython is uneeded on most linux version if the -# python plugin is used by a app in python using mapnik's python bindings -# we explicitly link to libpython here so that this plugin -# can be used from a pure C++ calling application or a different binding language -if env['PLATFORM'] == 'Darwin' and env['FRAMEWORK_PYTHON']: - if env['FRAMEWORK_SEARCH_PATH']: - python_link_flag = '-F%s -framework Python -Z' % env['FRAMEWORK_SEARCH_PATH'] - else: - link_prefix = env['PYTHON_SYS_PREFIX'] - if '.framework' in link_prefix: - python_link_flag = '-F%s -framework Python -Z' % os.path.dirname(link_prefix.split('.')[0]) - elif '/System' in link_prefix: - python_link_flag = '-F/System/Library/Frameworks/ -framework Python -Z' - else: - python_link_flag = '-F/ -framework Python' -else: - # on linux the linkflags end up to early in the compile flags to work correctly - python_link_flag = '-L%s' % env['PYTHON_SYS_PREFIX'] + os.path.sep + env['LIBDIR_SCHEMA'] - # so instead add to libraries - libraries.append('python%s' % env['PYTHON_VERSION']) - -plugin_env.Append(LINKFLAGS=python_link_flag) - -if env['PLUGIN_LINKING'] == 'shared': - libraries.append(env['MAPNIK_NAME']) - TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME, - SHLIBPREFIX='', - SHLIBSUFFIX='.input', - source=plugin_sources, - CPPPATH=allcpp_paths, - LIBS=libraries) - - # if the plugin links to libmapnik ensure it is built first - Depends(TARGET, env.subst('../../../src/%s' % env['MAPNIK_LIB_NAME'])) - - # if 'uninstall' is not passed on the command line - # then we actually create the install targets that - # scons will install if 'install' is passed as an arg - if 'uninstall' not in COMMAND_LINE_TARGETS: - env.Install(env['MAPNIK_INPUT_PLUGINS_DEST'], TARGET) - env.Alias('install', env['MAPNIK_INPUT_PLUGINS_DEST']) - -plugin_obj = { - 'LIBS': libraries, - 'SOURCES': plugin_sources, - 'CPPPATH': python_cpppath, - 'LINKFLAGS': python_link_flag.replace('-Z','').split(' '), -} - -Return('plugin_obj') diff --git a/plugins/input/python/examples/concentric_circles.py b/plugins/input/python/examples/concentric_circles.py deleted file mode 100644 index b80531251..000000000 --- a/plugins/input/python/examples/concentric_circles.py +++ /dev/null @@ -1,83 +0,0 @@ -"""A more complex example which renders an infinite series of concentric -circles centred on a point. - -The circles are represented by a Python iterator which will yield only the -circles which intersect the query's bounding box. The advantage of this -approach over a MemoryDatasource is that a) only those circles which intersect -the viewport are actually generated and b) only the memory for the largest -circle need be available since each circle is created on demand and destroyed -when finished with. -""" -import math -import mapnik -from shapely.geometry import * - -def box2d_to_shapely(box): - import shapely.geometry - return shapely.geometry.box(box.minx, box.miny, box.maxx, box.maxy) - -class ConcentricCircles(object): - def __init__(self, centre, bounds, step=1): - self.centre = centre - self.bounds = bounds - self.step = step - - class Iterator(object): - def __init__(self, container): - self.container = container - - centre = self.container.centre - bounds = self.container.bounds - step = self.container.step - - if centre.within(bounds): - self.radius = 0 - else: - self.radius = math.ceil(centre.distance(bounds) / float(step)) * step - - def next(self): - circle = self.container.centre.buffer(self.radius) - self.radius += self.container.step - - # has the circle grown so large that the boundary is entirely within it? - if circle.contains(self.container.bounds): - raise StopIteration() - - return ( circle.wkb, { } ) - - def __iter__(self): - return ConcentricCircles.Iterator(self) - -class TestDatasource(mapnik.PythonDatasource): - def __init__(self): - super(TestDatasource, self).__init__( - geometry_type=mapnik.DataGeometryType.Polygon - ) - - def features(self, query): - # Get the query bounding-box as a shapely bounding box - bounding_box = box2d_to_shapely(query.bbox) - centre = Point(-20, 0) - - return mapnik.PythonDatasource.wkb_features( - keys = (), - features = ConcentricCircles(centre, bounding_box, 0.5) - ) - -if __name__ == '__main__': - m = mapnik.Map(640, 320) - - m.background = mapnik.Color('white') - s = mapnik.Style() - r = mapnik.Rule() - r.symbols.append(mapnik.LineSymbolizer()) - s.rules.append(r) - m.append_style('point_style',s) - ds = mapnik.Python(factory='TestDatasource') - layer = mapnik.Layer('python') - layer.datasource = ds - layer.styles.append('point_style') - m.layers.append(layer) - box = mapnik.Box2d(-60, -60, 0, -30) - m.zoom_to_box(box) - mapnik.render_to_file(m,'map.png', 'png') diff --git a/plugins/input/python/examples/simple_points.py b/plugins/input/python/examples/simple_points.py deleted file mode 100644 index 1a51fc3cd..000000000 --- a/plugins/input/python/examples/simple_points.py +++ /dev/null @@ -1,34 +0,0 @@ -import mapnik -from shapely.geometry import * - -class TestDatasource(mapnik.PythonDatasource): - def __init__(self): - super(TestDatasource, self).__init__() - - def features(self, query): - return mapnik.PythonDatasource.wkb_features( - keys = ('label',), - features = ( - ( Point(5,6).wkb, { 'label': 'foo-bar'} ), - ( Point(100,60).wkb, { 'label': 'buzz-quux'} ), - ) - ) - -if __name__ == '__main__': - m = mapnik.Map(1280,1024) - m.background = mapnik.Color('white') - s = mapnik.Style() - r = mapnik.Rule() - r.symbols.append(mapnik.PointSymbolizer()) - t = mapnik.TextSymbolizer(mapnik.Expression("[label]"),"DejaVu Sans Book",10,mapnik.Color('black')) - t.displacement = (5,5) - r.symbols.append(t) - s.rules.append(r) - m.append_style('point_style',s) - ds = mapnik.Python(factory='TestDatasource') - layer = mapnik.Layer('python') - layer.datasource = ds - layer.styles.append('point_style') - m.layers.append(layer) - m.zoom_all() - mapnik.render_to_file(m,'map.png', 'png') diff --git a/plugins/input/python/examples/simple_xml.py b/plugins/input/python/examples/simple_xml.py deleted file mode 100644 index 8dbe3261b..000000000 --- a/plugins/input/python/examples/simple_xml.py +++ /dev/null @@ -1,8 +0,0 @@ -import mapnik -stylesheet = 'simple_xml.xml' -image = 'simple_xml.png' -m = mapnik.Map(600, 300) -mapnik.load_map(m, stylesheet) -m.zoom_all() -mapnik.render_to_file(m, image) -print "rendered image to '%s'" % image diff --git a/plugins/input/python/examples/simple_xml.xml b/plugins/input/python/examples/simple_xml.xml deleted file mode 100644 index a745f5f55..000000000 --- a/plugins/input/python/examples/simple_xml.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - style - - python - test:TestDatasource - - - diff --git a/plugins/input/python/python_datasource.cpp b/plugins/input/python/python_datasource.cpp deleted file mode 100644 index f100d67c9..000000000 --- a/plugins/input/python/python_datasource.cpp +++ /dev/null @@ -1,238 +0,0 @@ -// file plugin -#include "python_datasource.hpp" -#include "python_featureset.hpp" - -// stl -#include -#include - -// boost -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" -#include -#include -#include -#pragma GCC diagnostic pop - - -#include "python_utils.hpp" - -using mapnik::datasource; -using mapnik::parameters; - -DATASOURCE_PLUGIN(python_datasource) - -python_datasource::python_datasource(parameters const& params) - : datasource(params), - desc_(python_datasource::name(), *params.get("encoding","utf-8")), - factory_(*params.get("factory", "")) -{ - // extract any remaining parameters as keyword args for the factory - for (const mapnik::parameters::value_type& kv : params) - { - if((kv.first != "type") && (kv.first != "factory")) - { - kwargs_.emplace(kv.first, *params.get(kv.first)); - } - } - - // The following methods call into the Python interpreter and hence require, unfortunately, that the GIL be held. - using namespace boost; - - if (factory_.empty()) - { - throw mapnik::datasource_exception("Python: 'factory' option must be defined"); - } - - try - { - // split factory at ':' to parse out module and callable - std::vector factory_split; - split(factory_split, factory_, is_any_of(":")); - if ((factory_split.size() < 1) || (factory_split.size() > 2)) - { - throw mapnik::datasource_exception( - std::string("python: factory string must be of the form '[module:]callable' when parsing \"") - + factory_ + '"'); - } - // extract the module and the callable - boost::python::str module_name("__main__"), callable_name; - if (factory_split.size() == 1) - { - callable_name = boost::python::str(factory_split[0]); - } - else - { - module_name = boost::python::str(factory_split[0]); - callable_name = boost::python::str(factory_split[1]); - } - ensure_gil lock; - // import the main module from Python (in case we're embedding the - // interpreter directly) and also import the callable. - boost::python::object main_module = boost::python::import("__main__"); - boost::python::object callable_module = boost::python::import(module_name); - boost::python::object callable = callable_module.attr(callable_name); - // prepare the arguments - boost::python::dict kwargs; - using kv_type = std::map::value_type; - for (kv_type const& kv : kwargs_) - { - kwargs[boost::python::str(kv.first)] = boost::python::str(kv.second); - } - - // get our wrapped data source - datasource_ = callable(*boost::python::make_tuple(), **kwargs); - } - catch ( boost::python::error_already_set ) - { - throw mapnik::datasource_exception(extractException()); - } -} - -python_datasource::~python_datasource() { } - -// This name must match the plugin filename, eg 'python.input' -const char* python_datasource::name_="python"; - -const char* python_datasource::name() -{ - return name_; -} - -mapnik::layer_descriptor python_datasource::get_descriptor() const -{ - return desc_; -} - -mapnik::datasource::datasource_t python_datasource::type() const -{ - try - { - ensure_gil lock; - boost::python::object data_type = datasource_.attr("data_type"); - long data_type_integer = boost::python::extract(data_type); - return mapnik::datasource::datasource_t(data_type_integer); - } - catch ( boost::python::error_already_set ) - { - throw mapnik::datasource_exception(extractException()); - } - -} - -mapnik::box2d python_datasource::envelope() const -{ - mapnik::box2d box; - try - { - ensure_gil lock; - if (!PyObject_HasAttrString(datasource_.ptr(), "envelope")) - { - throw mapnik::datasource_exception("Python: could not access envelope property"); - } - else - { - boost::python::object py_envelope = datasource_.attr("envelope"); - if (py_envelope.ptr() == boost::python::object().ptr()) - { - throw mapnik::datasource_exception("Python: could not access envelope property"); - } - else - { - boost::python::extract ex(py_envelope.attr("minx")); - if (!ex.check()) throw mapnik::datasource_exception("Python: could not convert envelope.minx"); - box.set_minx(ex()); - boost::python::extract ex1(py_envelope.attr("miny")); - if (!ex1.check()) throw mapnik::datasource_exception("Python: could not convert envelope.miny"); - box.set_miny(ex1()); - boost::python::extract ex2(py_envelope.attr("maxx")); - if (!ex2.check()) throw mapnik::datasource_exception("Python: could not convert envelope.maxx"); - box.set_maxx(ex2()); - boost::python::extract ex3(py_envelope.attr("maxy")); - if (!ex3.check()) throw mapnik::datasource_exception("Python: could not convert envelope.maxy"); - box.set_maxy(ex3()); - } - } - } - catch ( boost::python::error_already_set ) - { - throw mapnik::datasource_exception(extractException()); - } - return box; -} - -boost::optional python_datasource::get_geometry_type() const -{ - using return_type = boost::optional; - - try - { - ensure_gil lock; - // if the datasource object has no geometry_type attribute, return a 'none' value - if (!PyObject_HasAttrString(datasource_.ptr(), "geometry_type")) - { - return return_type(); - } - boost::python::object py_geometry_type = datasource_.attr("geometry_type"); - // if the attribute value is 'None', return a 'none' value - if (py_geometry_type.ptr() == boost::python::object().ptr()) - { - return return_type(); - } - long geom_type_integer = boost::python::extract(py_geometry_type); - return mapnik::datasource::geometry_t(geom_type_integer); - } - catch ( boost::python::error_already_set ) - { - throw mapnik::datasource_exception(extractException()); - } -} - -mapnik::featureset_ptr python_datasource::features(mapnik::query const& q) const -{ - try - { - // if the query box intersects our world extent then query for features - if (envelope().intersects(q.get_bbox())) - { - ensure_gil lock; - boost::python::object features(datasource_.attr("features")(q)); - // if 'None' was returned, return an empty feature set - if(features.ptr() == boost::python::object().ptr()) - { - return mapnik::featureset_ptr(); - } - return std::make_shared(features); - } - // otherwise return an empty featureset pointer - return mapnik::featureset_ptr(); - } - catch ( boost::python::error_already_set ) - { - throw mapnik::datasource_exception(extractException()); - } -} - -mapnik::featureset_ptr python_datasource::features_at_point(mapnik::coord2d const& pt, double tol) const -{ - - try - { - ensure_gil lock; - boost::python::object features(datasource_.attr("features_at_point")(pt)); - // if we returned none, return an empty set - if(features.ptr() == boost::python::object().ptr()) - { - return mapnik::featureset_ptr(); - } - // otherwise, return a feature set which can iterate over the iterator - return std::make_shared(features); - } - catch ( boost::python::error_already_set ) - { - throw mapnik::datasource_exception(extractException()); - } - -} diff --git a/plugins/input/python/python_datasource.hpp b/plugins/input/python/python_datasource.hpp deleted file mode 100644 index 599f4c60b..000000000 --- a/plugins/input/python/python_datasource.hpp +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef PYTHON_DATASOURCE_HPP -#define PYTHON_DATASOURCE_HPP - -// mapnik -#include - -// boost -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" -#include -#pragma GCC diagnostic pop - -class python_datasource : public mapnik::datasource -{ -public: - // constructor - // arguments must not change - python_datasource(mapnik::parameters const& params); - - // destructor - virtual ~python_datasource (); - - // mandatory: type of the plugin, used to match at runtime - mapnik::datasource::datasource_t type() const; - - // mandatory: name of the plugin - static const char* name(); - - // mandatory: function to query features by box2d - // this is called when rendering, specifically in feature_style_processor.hpp - mapnik::featureset_ptr features(mapnik::query const& q) const; - - // mandatory: function to query features by point (coord2d) - // not used by rendering, but available to calling applications - mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt, double tol = 0) const; - - // mandatory: return the box2d of the datasource - // called during rendering to determine if the layer should be processed - mapnik::box2d envelope() const; - - // mandatory: optionally return the overal geometry type of the datasource - boost::optional get_geometry_type() const; - - // mandatory: return the layer descriptor - mapnik::layer_descriptor get_descriptor() const; - -private: - static const char* name_; - mapnik::layer_descriptor desc_; - const std::string factory_; - std::map kwargs_; - boost::python::object datasource_; -}; - - -#endif // PYTHON_DATASOURCE_HPP diff --git a/plugins/input/python/python_featureset.cpp b/plugins/input/python/python_featureset.cpp deleted file mode 100644 index bbd5939e9..000000000 --- a/plugins/input/python/python_featureset.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "python_featureset.hpp" -#include "python_utils.hpp" - -// boost -#include - -python_featureset::python_featureset(boost::python::object iterator) -{ - ensure_gil lock; - begin_ = boost::python::stl_input_iterator(iterator); -} - -python_featureset::~python_featureset() -{ - ensure_gil lock; - begin_ = end_; -} - -mapnik::feature_ptr python_featureset::next() -{ - // checking to see if we've reached the end does not require the GIL. - if(begin_ == end_) - return mapnik::feature_ptr(); - - // getting the next feature might call into the interpreter and so the GIL must be held. - ensure_gil lock; - - return *(begin_++); -} - diff --git a/plugins/input/python/python_featureset.hpp b/plugins/input/python/python_featureset.hpp deleted file mode 100644 index af024beab..000000000 --- a/plugins/input/python/python_featureset.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef PYTHON_FEATURESET_HPP -#define PYTHON_FEATURESET_HPP - -// mapnik -#include -#include - -// boost -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" -#include -#include -#pragma GCC diagnostic pop - -// mapnik -#include - -class python_featureset : public mapnik::Featureset -{ -public: - // this constructor can have any arguments you need - python_featureset(boost::python::object iterator); - - // desctructor - virtual ~python_featureset(); - - // mandatory: you must expose a next() method, called when rendering - mapnik::feature_ptr next(); - -private: - using feature_iter = boost::python::stl_input_iterator; - - feature_iter begin_, end_; -}; - -#endif // PYTHON_FEATURESET_HPP diff --git a/plugins/input/python/python_utils.cpp b/plugins/input/python/python_utils.cpp deleted file mode 100644 index 159bf70e1..000000000 --- a/plugins/input/python/python_utils.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "python_utils.hpp" - -std::string extractException() -{ - using namespace boost::python; - - PyObject *exc,*val,*tb; - PyErr_Fetch(&exc,&val,&tb); - PyErr_NormalizeException(&exc,&val,&tb); - handle<> hexc(exc),hval(allow_null(val)),htb(allow_null(tb)); - if(!hval) - { - return extract(str(hexc)); - } - else - { - object traceback(import("traceback")); - object format_exception(traceback.attr("format_exception")); - object formatted_list(format_exception(hexc,hval,htb)); - object formatted(str("").join(formatted_list)); - return extract(formatted); - } -} diff --git a/plugins/input/python/python_utils.hpp b/plugins/input/python/python_utils.hpp deleted file mode 100644 index 5ddc3800b..000000000 --- a/plugins/input/python/python_utils.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef PYTHON_UTILS_HPP -#define PYTHON_UTILS_HPP - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" -#include -#pragma GCC diagnostic pop - -// Use RAII to acquire and release the GIL as needed. -class ensure_gil -{ - public: - ensure_gil() : gil_state_(PyGILState_Ensure()) {} - ~ensure_gil() { PyGILState_Release( gil_state_ ); } - protected: - PyGILState_STATE gil_state_; -}; - -std::string extractException(); - -#endif // PYTHON_UTILS_HPP diff --git a/plugins/input/raster/build.py b/plugins/input/raster/build.py index 20f65b2d2..324a2a908 100644 --- a/plugins/input/raster/build.py +++ b/plugins/input/raster/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/raster/raster_datasource.cpp b/plugins/input/raster/raster_datasource.cpp index b70b6f25a..96f59387d 100644 --- a/plugins/input/raster/raster_datasource.cpp +++ b/plugins/input/raster/raster_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -171,9 +171,9 @@ mapnik::box2d raster_datasource::envelope() const return extent_; } -boost::optional raster_datasource::get_geometry_type() const +boost::optional raster_datasource::get_geometry_type() const { - return boost::optional(); + return boost::optional(); } layer_descriptor raster_datasource::get_descriptor() const diff --git a/plugins/input/raster/raster_datasource.hpp b/plugins/input/raster/raster_datasource.hpp index 435f8e5c7..7ff099086 100644 --- a/plugins/input/raster/raster_datasource.hpp +++ b/plugins/input/raster/raster_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -51,7 +51,7 @@ public: mapnik::featureset_ptr features(const mapnik::query& q) const; mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt, double tol = 0) const; mapnik::box2d envelope() const; - boost::optional get_geometry_type() const; + boost::optional get_geometry_type() const; mapnik::layer_descriptor get_descriptor() const; bool log_enabled() const; diff --git a/plugins/input/raster/raster_featureset.cpp b/plugins/input/raster/raster_featureset.cpp index 6f5fa0376..93f4b8d36 100644 --- a/plugins/input/raster/raster_featureset.cpp +++ b/plugins/input/raster/raster_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,7 +22,7 @@ // mapnik #include -#include +#include #include #include #include @@ -43,7 +43,7 @@ using mapnik::query; using mapnik::image_reader; using mapnik::feature_ptr; -using mapnik::image_data_rgba8; +using mapnik::image_rgba8; using mapnik::raster; using mapnik::feature_factory; @@ -114,9 +114,8 @@ feature_ptr raster_featureset::next() rem.maxx() + x_off + width, rem.maxy() + y_off + height); intersect = t.backward(feature_raster_extent); - mapnik::image_data_any data = reader->read(x_off, y_off, width, height); + mapnik::image_any data = reader->read(x_off, y_off, width, height); mapnik::raster_ptr raster = std::make_shared(intersect, std::move(data), 1.0); - raster->premultiplied_alpha_ = reader->premultiplied_alpha(); feature->set_raster(raster); } } diff --git a/plugins/input/raster/raster_featureset.hpp b/plugins/input/raster/raster_featureset.hpp index fed7bbaea..007689275 100644 --- a/plugins/input/raster/raster_featureset.hpp +++ b/plugins/input/raster/raster_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/raster/raster_info.cpp b/plugins/input/raster/raster_info.cpp index 9b04983e7..54b17c412 100644 --- a/plugins/input/raster/raster_info.cpp +++ b/plugins/input/raster/raster_info.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/raster/raster_info.hpp b/plugins/input/raster/raster_info.hpp index 2bf5ba96c..f0208425a 100644 --- a/plugins/input/raster/raster_info.hpp +++ b/plugins/input/raster/raster_info.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/rasterlite/build.py b/plugins/input/rasterlite/build.py index 7100b1e5f..779a48908 100644 --- a/plugins/input/rasterlite/build.py +++ b/plugins/input/rasterlite/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/rasterlite/rasterlite_datasource.cpp b/plugins/input/rasterlite/rasterlite_datasource.cpp index b851bebd3..026101865 100644 --- a/plugins/input/rasterlite/rasterlite_datasource.cpp +++ b/plugins/input/rasterlite/rasterlite_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -168,9 +168,9 @@ box2d rasterlite_datasource::envelope() const return extent_; } -boost::optional rasterlite_datasource::get_geometry_type() const +boost::optional rasterlite_datasource::get_geometry_type() const { - return boost::optional(); + return boost::optional(); } layer_descriptor rasterlite_datasource::get_descriptor() const diff --git a/plugins/input/rasterlite/rasterlite_datasource.hpp b/plugins/input/rasterlite/rasterlite_datasource.hpp index df6c03d91..dd304465b 100644 --- a/plugins/input/rasterlite/rasterlite_datasource.hpp +++ b/plugins/input/rasterlite/rasterlite_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -52,7 +52,7 @@ public: mapnik::featureset_ptr features(mapnik::query const& q) const; mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt, double tol = 0) const; mapnik::box2d envelope() const; - boost::optional get_geometry_type() const; + boost::optional get_geometry_type() const; mapnik::layer_descriptor get_descriptor() const; private: diff --git a/plugins/input/rasterlite/rasterlite_featureset.cpp b/plugins/input/rasterlite/rasterlite_featureset.cpp index 2e3c6bb40..270a87e53 100644 --- a/plugins/input/rasterlite/rasterlite_featureset.cpp +++ b/plugins/input/rasterlite/rasterlite_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,7 @@ // mapnik #include -#include +#include #include #include #include @@ -36,7 +36,6 @@ using mapnik::coord2d; using mapnik::box2d; using mapnik::feature_ptr; -using mapnik::geometry_type; using mapnik::query; using mapnik::feature_factory; @@ -114,10 +113,9 @@ feature_ptr rasterlite_featureset::get_feature(mapnik::query const& q) { if (size > 0) { - mapnik::image_data_rgba8 image(width,height); + mapnik::image_rgba8 image(width,height); unsigned char* raster_data = static_cast(raster); - unsigned char* image_data = image.getBytes(); - std::memcpy(image_data, raster_data, size); + std::memcpy(image.bytes(), raster_data, size); feature->set_raster(std::make_shared(intersect, std::move(image), 1.0)); MAPNIK_LOG_DEBUG(rasterlite) << "rasterlite_featureset: Done"; } diff --git a/plugins/input/rasterlite/rasterlite_featureset.hpp b/plugins/input/rasterlite/rasterlite_featureset.hpp index cf7973f15..cb251c86a 100644 --- a/plugins/input/rasterlite/rasterlite_featureset.hpp +++ b/plugins/input/rasterlite/rasterlite_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/rasterlite/rasterlite_include.hpp b/plugins/input/rasterlite/rasterlite_include.hpp index 4662e845d..b6a9dd274 100644 --- a/plugins/input/rasterlite/rasterlite_include.hpp +++ b/plugins/input/rasterlite/rasterlite_include.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/build.py b/plugins/input/shape/build.py index 4ef33687a..097d602e6 100644 --- a/plugins/input/shape/build.py +++ b/plugins/input/shape/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/dbf_test.cpp b/plugins/input/shape/dbf_test.cpp index b9917a931..c5e22f576 100644 --- a/plugins/input/shape/dbf_test.cpp +++ b/plugins/input/shape/dbf_test.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/dbfile.cpp b/plugins/input/shape/dbfile.cpp index 5b1c76e46..921165757 100644 --- a/plugins/input/shape/dbfile.cpp +++ b/plugins/input/shape/dbfile.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,7 +22,7 @@ // mapnik #include #include -#include +#include #include #include @@ -32,6 +32,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #ifdef SHAPE_MEMORY_MAPPED_FILE #include @@ -190,7 +193,7 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, mapnik::feat const char *itr = record_+fields_[col].offset_; const char *end = itr + fields_[col].length_; ascii::space_type space; - qi::double_type double_; + static qi::double_type double_; if (qi::phrase_parse(itr,end,double_,space,val)) { f.put(name,val); @@ -202,8 +205,8 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, mapnik::feat const char *itr = record_+fields_[col].offset_; const char *end = itr + fields_[col].length_; ascii::space_type space; - qi::int_type int_; - if (qi::phrase_parse(itr,end,int_,space,val)) + static qi::int_parser numeric_parser; + if (qi::phrase_parse(itr, end, numeric_parser, space, val)) { f.put(name,val); } diff --git a/plugins/input/shape/dbfile.hpp b/plugins/input/shape/dbfile.hpp index 75e77d323..358d737f7 100644 --- a/plugins/input/shape/dbfile.hpp +++ b/plugins/input/shape/dbfile.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,11 +29,11 @@ #include #ifdef SHAPE_MEMORY_MAPPED_FILE #include -#endif - - -// boost +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #include +#pragma GCC diagnostic pop +#endif // stl #include diff --git a/plugins/input/shape/shape_datasource.cpp b/plugins/input/shape/shape_datasource.cpp index dbf8edd4f..05e24a48e 100644 --- a/plugins/input/shape/shape_datasource.cpp +++ b/plugins/input/shape/shape_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -301,13 +301,13 @@ box2d shape_datasource::envelope() const return extent_; } -boost::optional shape_datasource::get_geometry_type() const +boost::optional shape_datasource::get_geometry_type() const { #ifdef MAPNIK_STATS mapnik::progress_timer __stats__(std::clog, "shape_datasource::get_geometry_type"); #endif - boost::optional result; + boost::optional result; switch (shape_type_) { case shape_io::shape_point: @@ -317,21 +317,21 @@ boost::optional shape_datasource::get_geometry_t case shape_io::shape_multipointm: case shape_io::shape_multipointz: { - result.reset(mapnik::datasource::Point); + result.reset(mapnik::datasource_geometry_t::Point); break; } case shape_io::shape_polyline: case shape_io::shape_polylinem: case shape_io::shape_polylinez: { - result.reset(mapnik::datasource::LineString); + result.reset(mapnik::datasource_geometry_t::LineString); break; } case shape_io::shape_polygon: case shape_io::shape_polygonm: case shape_io::shape_polygonz: { - result.reset(mapnik::datasource::Polygon); + result.reset(mapnik::datasource_geometry_t::Polygon); break; } default: diff --git a/plugins/input/shape/shape_datasource.hpp b/plugins/input/shape/shape_datasource.hpp index 9795370a4..f702036eb 100644 --- a/plugins/input/shape/shape_datasource.hpp +++ b/plugins/input/shape/shape_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -60,9 +60,8 @@ public: featureset_ptr features(query const& q) const; featureset_ptr features_at_point(coord2d const& pt, double tol = 0) const; box2d envelope() const; - boost::optional get_geometry_type() const; + boost::optional get_geometry_type() const; layer_descriptor get_descriptor() const; - private: void init(shape_io& shape); diff --git a/plugins/input/shape/shape_featureset.cpp b/plugins/input/shape/shape_featureset.cpp index 2c4d90cd4..8a2b164f6 100644 --- a/plugins/input/shape/shape_featureset.cpp +++ b/plugins/input/shape/shape_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,7 +33,6 @@ #include "shape_featureset.hpp" #include "shape_utils.hpp" -using mapnik::geometry_type; using mapnik::feature_factory; using mapnik::context_ptr; @@ -88,9 +87,7 @@ feature_ptr shape_featureset::next() double y = record.read_double(); if (!filter_.pass(mapnik::box2d(x,y,x,y))) continue; - std::unique_ptr point(new geometry_type(mapnik::geometry_type::types::Point)); - point->move_to(x, y); - feature->paths().push_back(point.release()); + feature->set_geometry(mapnik::geometry::point(x,y)); break; } case shape_io::shape_multipoint: @@ -100,14 +97,14 @@ feature_ptr shape_featureset::next() shape_io::read_bbox(record, feature_bbox_); if (!filter_.pass(feature_bbox_)) continue; int num_points = record.read_ndr_integer(); + mapnik::geometry::multi_point multi_point; for (int i = 0; i < num_points; ++i) { double x = record.read_double(); double y = record.read_double(); - std::unique_ptr point(new geometry_type(mapnik::geometry_type::types::Point)); - point->move_to(x, y); - feature->paths().push_back(point.release()); + multi_point.emplace_back(mapnik::geometry::point(x, y)); } + feature->set_geometry(std::move(multi_point)); break; } @@ -117,7 +114,7 @@ feature_ptr shape_featureset::next() { shape_io::read_bbox(record, feature_bbox_); if (!filter_.pass(feature_bbox_)) continue; - shape_io::read_polyline(record, feature->paths()); + feature->set_geometry(shape_io::read_polyline(record)); break; } case shape_io::shape_polygon: @@ -126,7 +123,7 @@ feature_ptr shape_featureset::next() { shape_io::read_bbox(record, feature_bbox_); if (!filter_.pass(feature_bbox_)) continue; - shape_io::read_polygon(record, feature->paths()); + feature->set_geometry(shape_io::read_polygon(record)); break; } default : diff --git a/plugins/input/shape/shape_featureset.hpp b/plugins/input/shape/shape_featureset.hpp index 4ce235e8e..a047bae80 100644 --- a/plugins/input/shape/shape_featureset.hpp +++ b/plugins/input/shape/shape_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/shape_index_featureset.cpp b/plugins/input/shape/shape_index_featureset.cpp index c05d9ee79..fdd75137c 100644 --- a/plugins/input/shape/shape_index_featureset.cpp +++ b/plugins/input/shape/shape_index_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -42,7 +42,6 @@ #include "shp_index.hpp" using mapnik::feature_factory; -using mapnik::geometry_type; template shape_index_featureset::shape_index_featureset(filterT const& filter, @@ -104,9 +103,7 @@ feature_ptr shape_index_featureset::next() { double x = record.read_double(); double y = record.read_double(); - std::unique_ptr point(new geometry_type(mapnik::geometry_type::types::Point)); - point->move_to(x, y); - feature->paths().push_back(point.release()); + feature->set_geometry(mapnik::geometry::point(x,y)); break; } case shape_io::shape_multipoint: @@ -116,14 +113,14 @@ feature_ptr shape_index_featureset::next() shape_io::read_bbox(record, feature_bbox_); if (!filter_.pass(feature_bbox_)) continue; int num_points = record.read_ndr_integer(); + mapnik::geometry::multi_point multi_point; for (int i = 0; i < num_points; ++i) { double x = record.read_double(); double y = record.read_double(); - std::unique_ptr point(new geometry_type(mapnik::geometry_type::types::Point)); - point->move_to(x, y); - feature->paths().push_back(point.release()); + multi_point.emplace_back(mapnik::geometry::point(x, y)); } + feature->set_geometry(std::move(multi_point)); break; } case shape_io::shape_polyline: @@ -132,7 +129,7 @@ feature_ptr shape_index_featureset::next() { shape_io::read_bbox(record, feature_bbox_); if (!filter_.pass(feature_bbox_)) continue; - shape_io::read_polyline(record,feature->paths()); + feature->set_geometry(shape_io::read_polyline(record)); break; } case shape_io::shape_polygon: @@ -141,7 +138,7 @@ feature_ptr shape_index_featureset::next() { shape_io::read_bbox(record, feature_bbox_); if (!filter_.pass(feature_bbox_)) continue; - shape_io::read_polygon(record,feature->paths()); + feature->set_geometry(shape_io::read_polygon(record)); break; } default : diff --git a/plugins/input/shape/shape_index_featureset.hpp b/plugins/input/shape/shape_index_featureset.hpp index d62d8ed6a..cf52aa0c2 100644 --- a/plugins/input/shape/shape_index_featureset.hpp +++ b/plugins/input/shape/shape_index_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/shape_io.cpp b/plugins/input/shape/shape_io.cpp index d05b6416b..7f149823c 100644 --- a/plugins/input/shape/shape_io.cpp +++ b/plugins/input/shape/shape_io.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,12 +26,10 @@ #include #include #include -#include -// boost +#include +#include using mapnik::datasource_exception; -using mapnik::geometry_type; -using mapnik::hit_test_first; const std::string shape_io::SHP = ".shp"; const std::string shape_io::DBF = ".dbf"; const std::string shape_io::INDEX = ".index"; @@ -90,37 +88,34 @@ void shape_io::read_bbox(shape_file::record_type & record, mapnik::box2d bbox.init(lox, loy, hix, hiy); } -void shape_io::read_polyline( shape_file::record_type & record, mapnik::geometry_container & geom) +mapnik::geometry::geometry shape_io::read_polyline(shape_file::record_type & record) { + mapnik::geometry::geometry geom; // default empty int num_parts = record.read_ndr_integer(); int num_points = record.read_ndr_integer(); + if (num_parts == 1) { - std::unique_ptr line(new geometry_type(mapnik::geometry_type::types::LineString)); + mapnik::geometry::line_string line; + line.reserve(num_points); record.skip(4); - double x = record.read_double(); - double y = record.read_double(); - line->move_to(x, y); - for (int i = 1; i < num_points; ++i) + for (int i = 0; i < num_points; ++i) { - x = record.read_double(); - y = record.read_double(); - line->line_to(x, y); + double x = record.read_double(); + double y = record.read_double(); + line.add_coord(x, y); } - geom.push_back(line.release()); + geom = std::move(line); } else { - std::vector parts(num_parts); - for (int i = 0; i < num_parts; ++i) - { - parts[i] = record.read_ndr_integer(); - } - + std::vector parts; + parts.resize(num_parts); + std::for_each(parts.begin(), parts.end(), [&](int & part) { part = record.read_ndr_integer();}); int start, end; + mapnik::geometry::multi_line_string multi_line; for (int k = 0; k < num_parts; ++k) { - std::unique_ptr line(new geometry_type(mapnik::geometry_type::types::LineString)); start = parts[k]; if (k == num_parts - 1) { @@ -131,81 +126,73 @@ void shape_io::read_polyline( shape_file::record_type & record, mapnik::geometry end = parts[k + 1]; } - double x = record.read_double(); - double y = record.read_double(); - line->move_to(x, y); - - for (int j = start + 1; j < end; ++j) + mapnik::geometry::line_string line; + line.reserve(end - start); + for (int j = start; j < end; ++j) { - x = record.read_double(); - y = record.read_double(); - line->line_to(x, y); + double x = record.read_double(); + double y = record.read_double(); + line.add_coord(x, y); } - geom.push_back(line.release()); + multi_line.push_back(std::move(line)); } + geom = std::move(multi_line); } + return geom; } -template -bool is_clockwise(T const& points, int start, int end) -{ - int num_points = end - start; - double area = 0.0; - for (int i = 0; i < num_points; ++i) - { - auto const& p0 = points[start + i]; - auto const& p1 = points[start + (i + 1) % num_points]; - area += std::get<0>(p0) * std::get<1>(p1) - std::get<1>(p0) * std::get<0>(p1); - } - return ( area < 0.0) ? true : false; -} -void shape_io::read_polygon(shape_file::record_type & record, mapnik::geometry_container & geom) +mapnik::geometry::geometry shape_io::read_polygon(shape_file::record_type & record) { + mapnik::geometry::geometry geom; // default empty int num_parts = record.read_ndr_integer(); int num_points = record.read_ndr_integer(); - std::vector parts(num_parts); - using points_cont = std::vector >; - points_cont points; - points.reserve(num_points); - - for (int i = 0; i < num_parts; ++i) - { - parts[i] = record.read_ndr_integer(); - } - - for (int k = 0; k < num_points; ++k) - { - double x = record.read_double(); - double y = record.read_double(); - points.emplace_back(x,y); - } - - std::unique_ptr poly(new geometry_type(mapnik::geometry_type::types::Polygon)); + std::vector parts; + parts.resize(num_parts); + std::for_each(parts.begin(), parts.end(), [&](int & part) { part = record.read_ndr_integer();}); + mapnik::geometry::polygon poly; + mapnik::geometry::multi_polygon multi_poly; for (int k = 0; k < num_parts; ++k) { int start = parts[k]; int end; if (k == num_parts - 1) end = num_points; else end = parts[k + 1]; - auto const& pt = points[start]; - double x = std::get<0>(pt); - double y = std::get<1>(pt); - if ( k > 0 && is_clockwise(points, start, end)) + + mapnik::geometry::linear_ring ring; + ring.reserve(end - start); + for (int j = start; j < end; ++j) { - geom.push_back(poly.release()); - poly.reset(new geometry_type(mapnik::geometry_type::types::Polygon)); + double x = record.read_double(); + double y = record.read_double(); + ring.emplace_back(x, y); } - poly->move_to(x, y); - for (int j = start + 1; j < end; ++j) + if (k == 0) { - auto const& pt = points[j]; - x = std::get<0>(pt); - y = std::get<1>(pt); - poly->line_to(x, y); + poly.set_exterior_ring(std::move(ring)); + } + else if (mapnik::util::is_clockwise(ring)) + { + multi_poly.emplace_back(std::move(poly)); + poly.interior_rings.clear(); + poly.set_exterior_ring(std::move(ring)); + } + else + { + poly.add_hole(std::move(ring)); } - poly->close_path(); } - geom.push_back(poly.release()); + + if (multi_poly.size() > 0) // multi + { + multi_poly.emplace_back(std::move(poly)); + geom = std::move(multi_poly); + } + else + { + geom = std::move(poly); + } + mapnik::geometry::correct(geom); + return geom; } diff --git a/plugins/input/shape/shape_io.hpp b/plugins/input/shape/shape_io.hpp index 15797e9fb..497dbdabd 100644 --- a/plugins/input/shape/shape_io.hpp +++ b/plugins/input/shape/shape_io.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,6 @@ #define SHAPE_IO_HPP // mapnik -#include #include #include @@ -77,8 +76,8 @@ public: void move_to(std::streampos pos); static void read_bbox(shape_file::record_type & record, mapnik::box2d & bbox); - static void read_polyline(shape_file::record_type & record,mapnik::geometry_container & geom); - static void read_polygon(shape_file::record_type & record,mapnik::geometry_container & geom); + static mapnik::geometry::geometry read_polyline(shape_file::record_type & record); + static mapnik::geometry::geometry read_polygon(shape_file::record_type & record); shapeType type_; shape_file shp_; diff --git a/plugins/input/shape/shape_utils.cpp b/plugins/input/shape/shape_utils.cpp index 9495fda87..af7aa536c 100644 --- a/plugins/input/shape/shape_utils.cpp +++ b/plugins/input/shape/shape_utils.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/shape_utils.hpp b/plugins/input/shape/shape_utils.hpp index eda62a8b2..edb22225b 100644 --- a/plugins/input/shape/shape_utils.hpp +++ b/plugins/input/shape/shape_utils.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/shapefile.hpp b/plugins/input/shape/shapefile.hpp index c53d467b7..3f70e3a7f 100644 --- a/plugins/input/shape/shapefile.hpp +++ b/plugins/input/shape/shapefile.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,12 +31,16 @@ // mapnik #include -#include +#include #include #ifdef SHAPE_MEMORY_MAPPED_FILE +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include -#include #include +#pragma GCC diagnostic pop +#include #endif #include @@ -72,8 +76,8 @@ template struct shape_record { typename Tag::data_type data; - size_t size; - mutable size_t pos; + std::size_t size; + mutable std::size_t pos; explicit shape_record(size_t size_) : data(Tag::alloc(size_)), @@ -129,6 +133,8 @@ struct shape_record { return (size - pos); } + + std::size_t length() {return size;} }; class shape_file : mapnik::util::noncopyable @@ -220,30 +226,13 @@ public: inline double read_double() { double val; -#ifndef MAPNIK_BIG_ENDIAN file_.read(reinterpret_cast(&val), 8); -#else - char b[8]; - file_.read(b, 8); - read_double_ndr(b, val); -#endif return val; } inline void read_envelope(box2d& envelope) { -#ifndef MAPNIK_BIG_ENDIAN file_.read(reinterpret_cast(&envelope), sizeof(envelope)); -#else - char data[4 * 8]; - file_.read(data,4 * 8); - double minx, miny, maxx, maxy; - read_double_ndr(data + 0 * 8, minx); - read_double_ndr(data + 1 * 8, miny); - read_double_ndr(data + 2 * 8, maxx); - read_double_ndr(data + 3 * 8, maxy); - envelope.init(minx, miny, maxx, maxy); -#endif } inline void skip(std::streampos bytes) diff --git a/plugins/input/shape/shp_index.hpp b/plugins/input/shape/shp_index.hpp index bb033e95f..6c32305b8 100644 --- a/plugins/input/shape/shp_index.hpp +++ b/plugins/input/shape/shp_index.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/build.py b/plugins/input/sqlite/build.py index 3136dcae7..b3a4a3e8b 100644 --- a/plugins/input/sqlite/build.py +++ b/plugins/input/sqlite/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/sqlite_connection.hpp b/plugins/input/sqlite/sqlite_connection.hpp index c7bd11fb7..27a2fe210 100644 --- a/plugins/input/sqlite/sqlite_connection.hpp +++ b/plugins/input/sqlite/sqlite_connection.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/sqlite_datasource.cpp b/plugins/input/sqlite/sqlite_datasource.cpp index 21db6edfe..036e31aa2 100644 --- a/plugins/input/sqlite/sqlite_datasource.cpp +++ b/plugins/input/sqlite/sqlite_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -34,6 +34,7 @@ #include #include #include +#include // boost #include @@ -417,16 +418,16 @@ box2d sqlite_datasource::envelope() const return extent_; } -boost::optional sqlite_datasource::get_geometry_type() const +boost::optional sqlite_datasource::get_geometry_type() const { #ifdef MAPNIK_STATS mapnik::progress_timer __stats__(std::clog, "sqlite_datasource::get_geometry_type"); #endif - boost::optional result; + boost::optional result; if (dataset_) { - // finally, get geometry type by querying first feature + // get geometry type by querying first features std::ostringstream s; s << "SELECT " << geometry_field_ << " FROM " << geometry_table_; @@ -446,20 +447,22 @@ boost::optional sqlite_datasource::get_geometry_ const char* data = (const char*) rs->column_blob(0, size); if (data) { - mapnik::geometry_container paths; - if (mapnik::geometry_utils::from_wkb(paths, data, size, format_)) + + mapnik::geometry::geometry geom = mapnik::geometry_utils::from_wkb(data, size, format_); + if (mapnik::geometry::is_empty(geom)) { - mapnik::util::to_ds_type(paths,result); - if (result) + continue; + } + result = mapnik::util::to_ds_type(geom); + if (result) + { + int type = static_cast(*result); + if (multi_type > 0 && multi_type != type) { - int type = static_cast(*result); - if (multi_type > 0 && multi_type != type) - { - result.reset(mapnik::datasource::Collection); - return result; - } - multi_type = type; + result.reset(mapnik::datasource_geometry_t::Collection); + return result; } + multi_type = type; } } } diff --git a/plugins/input/sqlite/sqlite_datasource.hpp b/plugins/input/sqlite/sqlite_datasource.hpp index 4461c962e..eab71e9e3 100644 --- a/plugins/input/sqlite/sqlite_datasource.hpp +++ b/plugins/input/sqlite/sqlite_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -55,7 +55,7 @@ public: mapnik::featureset_ptr features(mapnik::query const& q) const; mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt, double tol = 0) const; mapnik::box2d envelope() const; - boost::optional get_geometry_type() const; + boost::optional get_geometry_type() const; mapnik::layer_descriptor get_descriptor() const; private: diff --git a/plugins/input/sqlite/sqlite_featureset.cpp b/plugins/input/sqlite/sqlite_featureset.cpp index 39b37aff8..99a44db54 100644 --- a/plugins/input/sqlite/sqlite_featureset.cpp +++ b/plugins/input/sqlite/sqlite_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,13 +24,14 @@ #include #include #include -#include #include #include #include #include #include #include +#include +#include // ogr #include "sqlite_featureset.hpp" @@ -80,15 +81,20 @@ feature_ptr sqlite_featureset::next() } feature_ptr feature = feature_factory::create(ctx_,rs_->column_integer64(1)); - if (!geometry_utils::from_wkb(feature->paths(), data, size, format_)) + mapnik::geometry::geometry geom = geometry_utils::from_wkb(data, size, format_); + if (mapnik::geometry::is_empty(geom)) + { continue; + } if (!spatial_index_) { // we are not using r-tree index, check if feature intersects bounding box - if (!bbox_.intersects(feature->envelope())) + box2d bbox = mapnik::geometry::envelope(geom); + if (!bbox_.intersects(bbox)) continue; } + feature->set_geometry(std::move(geom)); for (int i = 2; i < rs_->column_count(); ++i) { diff --git a/plugins/input/sqlite/sqlite_featureset.hpp b/plugins/input/sqlite/sqlite_featureset.hpp index 12f3ee0ee..dc168676e 100644 --- a/plugins/input/sqlite/sqlite_featureset.hpp +++ b/plugins/input/sqlite/sqlite_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/sqlite_prepared.hpp b/plugins/input/sqlite/sqlite_prepared.hpp index cf81842ab..db1355d67 100644 --- a/plugins/input/sqlite/sqlite_prepared.hpp +++ b/plugins/input/sqlite/sqlite_prepared.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/sqlite_resultset.hpp b/plugins/input/sqlite/sqlite_resultset.hpp index aebd031a1..6046387f9 100644 --- a/plugins/input/sqlite/sqlite_resultset.hpp +++ b/plugins/input/sqlite/sqlite_resultset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/sqlite_utils.hpp b/plugins/input/sqlite/sqlite_utils.hpp index 0d63e82bb..c96f64005 100644 --- a/plugins/input/sqlite/sqlite_utils.hpp +++ b/plugins/input/sqlite/sqlite_utils.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,12 +31,12 @@ // mapnik #include -#include #include #include -#include #include #include +#include +#include // boost #pragma GCC diagnostic push @@ -195,23 +195,20 @@ public: const char* data = static_cast(rs->column_blob(0, size)); if (data) { - mapnik::geometry_container paths; - if (mapnik::geometry_utils::from_wkb(paths, data, size, mapnik::wkbAuto)) + mapnik::geometry::geometry geom = mapnik::geometry_utils::from_wkb(data, size, mapnik::wkbAuto); + if (!mapnik::geometry::is_empty(geom)) { - for (unsigned i=0; i bbox = mapnik::geometry::envelope(geom); + if (bbox.valid()) { - mapnik::box2d const& bbox = paths[i].envelope(); - if (bbox.valid()) + if (first) { - if (first) - { - first = false; - extent = bbox; - } - else - { - extent.expand_to_include(bbox); - } + first = false; + extent = bbox; + } + else + { + extent.expand_to_include(bbox); } } } @@ -282,43 +279,32 @@ public: const char* data = (const char*) rs->column_blob(0, size); if (data) { - mapnik::geometry_container paths; - mapnik::box2d bbox; - if (mapnik::geometry_utils::from_wkb(paths, data, size, mapnik::wkbAuto)) + mapnik::geometry::geometry geom = mapnik::geometry_utils::from_wkb(data, size, mapnik::wkbAuto); + if (!mapnik::geometry::is_empty(geom)) { - for (unsigned i=0; i bbox = mapnik::geometry::envelope(geom); + if (bbox.valid()) { - if (i==0) + ps.bind(bbox); + const int type_oid = rs->column_type(1); + if (type_oid != SQLITE_INTEGER) { - bbox = paths[i].envelope(); - } - else - { - bbox.expand_to_include(paths[i].envelope()); + std::ostringstream error_msg; + error_msg << "Sqlite Plugin: invalid type for key field '" + << rs->column_name(1) << "' when creating index '" << index_table + << "' type was: " << type_oid << ""; + throw mapnik::datasource_exception(error_msg.str()); } + const sqlite_int64 pkid = rs->column_integer64(1); + ps.bind(pkid); } - } - if (bbox.valid()) - { - ps.bind(bbox); - const int type_oid = rs->column_type(1); - if (type_oid != SQLITE_INTEGER) + else { std::ostringstream error_msg; - error_msg << "Sqlite Plugin: invalid type for key field '" - << rs->column_name(1) << "' when creating index '" << index_table - << "' type was: " << type_oid << ""; + error_msg << "SQLite Plugin: encountered invalid bbox at '" + << rs->column_name(1) << "' == " << rs->column_integer64(1); throw mapnik::datasource_exception(error_msg.str()); } - const sqlite_int64 pkid = rs->column_integer64(1); - ps.bind(pkid); - } - else - { - std::ostringstream error_msg; - error_msg << "SQLite Plugin: encountered invalid bbox at '" - << rs->column_name(1) << "' == " << rs->column_integer64(1); - throw mapnik::datasource_exception(error_msg.str()); } ps.step_next(); one_success = true; @@ -369,36 +355,33 @@ public: const char* data = static_cast(rs->column_blob(0, size)); if (data) { - mapnik::geometry_container paths; - if (mapnik::geometry_utils::from_wkb(paths, data, size, mapnik::wkbAuto)) + mapnik::geometry::geometry geom = mapnik::geometry_utils::from_wkb(data, size, mapnik::wkbAuto); + if (!mapnik::geometry::is_empty(geom)) { - for (unsigned i=0; i bbox = mapnik::geometry::envelope(geom); + if (bbox.valid()) { - mapnik::box2d const& bbox = paths[i].envelope(); - if (bbox.valid()) - { - const int type_oid = rs->column_type(1); - if (type_oid != SQLITE_INTEGER) - { - std::ostringstream error_msg; - error_msg << "Sqlite Plugin: invalid type for key field '" - << rs->column_name(1) << "' when creating index " - << "type was: " << type_oid << ""; - throw mapnik::datasource_exception(error_msg.str()); - } - const sqlite_int64 pkid = rs->column_integer64(1); - rtree_type entry = rtree_type(); - entry.pkid = pkid; - entry.bbox = bbox; - rtree_list.push_back(entry); - } - else + const int type_oid = rs->column_type(1); + if (type_oid != SQLITE_INTEGER) { std::ostringstream error_msg; - error_msg << "SQLite Plugin: encountered invalid bbox at '" - << rs->column_name(1) << "' == " << rs->column_integer64(1); + error_msg << "Sqlite Plugin: invalid type for key field '" + << rs->column_name(1) << "' when creating index " + << "type was: " << type_oid << ""; throw mapnik::datasource_exception(error_msg.str()); } + const sqlite_int64 pkid = rs->column_integer64(1); + rtree_type entry = rtree_type(); + entry.pkid = pkid; + entry.bbox = bbox; + rtree_list.push_back(entry); + } + else + { + std::ostringstream error_msg; + error_msg << "SQLite Plugin: encountered invalid bbox at '" + << rs->column_name(1) << "' == " << rs->column_integer64(1); + throw mapnik::datasource_exception(error_msg.str()); } } } diff --git a/plugins/input/templates/README.md b/plugins/input/templates/README.md deleted file mode 100644 index d4232f0c6..000000000 --- a/plugins/input/templates/README.md +++ /dev/null @@ -1,16 +0,0 @@ -## template plugins - -Directory to hold sample plugin templates. - -These are NOT intended to be used except for testing by developers. - -Build these plugins with the Mapnik build system: - - ./configure SAMPLE_INPUT_PLUGINS=True - make install - -Or develop them locally using the `Makefile` provided. - -Only an ultra-simple hello world is available currently, -but planned are example plugins templates for file-based -and sql-based datasources. diff --git a/plugins/input/templates/helloworld/Makefile b/plugins/input/templates/helloworld/Makefile deleted file mode 100644 index 962f176fe..000000000 --- a/plugins/input/templates/helloworld/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# To use clang, run: make CXX=clang++ - -CXXFLAGS = $(shell mapnik-config --cflags) -fPIC - -LIBS = $(shell mapnik-config --libs --ldflags --dep-libs) - -SRC = $(wildcard *.cpp) - -OBJ = $(SRC:.cpp=.o) - -BIN = hello.input - -all : $(SRC) $(BIN) - -$(BIN) : $(OBJ) - $(CXX) -shared $(OBJ) $(LIBS) -o $@ - -.cpp.o : - $(CXX) -c $(CXXFLAGS) $< -o $@ - -.PHONY : clean - -clean: - rm -f $(OBJ) - rm -f $(BIN) - -deploy : all - cp hello.input $(shell mapnik-config --input-plugins) - -install: all deploy diff --git a/plugins/input/templates/helloworld/README.md b/plugins/input/templates/helloworld/README.md deleted file mode 100644 index b940a8084..000000000 --- a/plugins/input/templates/helloworld/README.md +++ /dev/null @@ -1,40 +0,0 @@ -## hello world plugin - -This is a very simple sample plugin. It is designed to help developers -see the skeletal basics needed to achieve a functional datasource plugin. - -It is not a model plugin of best practices as much as a model of the bare -minimum you need to have a working plugin that returns a single feature. - -Code comments attempt to highlight which code is mandatory, which is -simply recommended, and which is purely fluff used to get the plugin to -actually show some data. - -When added to a map it provides a single point geometry representing -the center of any query. This means that it should place a point in -the middle of any map tile and display a "hello world!" label if used like: - -```xml - - - - - style - - hello - - - -``` - -Or used in python like: - -``` -import mapnik -ds = mapnik.Datasource(type="hello") -``` diff --git a/plugins/input/templates/helloworld/build.py b/plugins/input/templates/helloworld/build.py deleted file mode 100644 index a36aa1ddb..000000000 --- a/plugins/input/templates/helloworld/build.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env python - -# Mapnik uses the build tool SCons. - -# This python file is run to compile a plugin -# It must be called from the main 'SConstruct' file like: - -# SConscript('path/to/this/file.py') - -# see docs at: http://www.scons.org/wiki/SConscript() - -import os - -# Here we pull from the SCons environment exported from the main instance -Import ('plugin_base') -Import ('env') - -# Give this plugin a name -# here this happens to be the same as the directory -PLUGIN_NAME = 'hello' - -# the below install details are also pulled from the -# main SConstruct file where configuration happens - -# clone the environment here -# so that if we modify the env it in this file -# those changes to not pollute other builds later on... -plugin_env = plugin_base.Clone() - -# Add the cpp files that need to be compiled -plugin_sources = Split( - """ - %(PLUGIN_NAME)s_datasource.cpp - %(PLUGIN_NAME)s_featureset.cpp - """ % locals() - ) - -# Add any external libraries this plugin should -# directly link to -libraries = [ '' ] # eg 'libfoo' - -libraries.append('boost_system%s' % env['BOOST_APPEND']) -# link libicuuc, but ICU_LIB_NAME is used custom builds of icu can -# have different library names like osx which offers /usr/lib/libicucore.dylib -libraries.append(env['ICU_LIB_NAME']) - -# this is valid if we are building an external plugin as shared library -if env['PLUGIN_LINKING'] == 'shared': - # plugins can go anywhere, and be registered in custom locations by Mapnik - # but the standard location is '/usr/local/lib/mapnik/input' - install_dest = env['MAPNIK_INPUT_PLUGINS_DEST'] - - # only link mapnik if we are build an external shared object - libraries.append(env['MAPNIK_NAME']) - - TARGET = plugin_env.SharedLibrary( - # the name of the target to build, eg 'sqlite.input' - '../%s' % PLUGIN_NAME, - # prefix - normally none used - SHLIBPREFIX='', - # extension, mapnik expects '.input' - SHLIBSUFFIX='.input', - # list of source files to compile - source=plugin_sources, - # libraries to link to - LIBS=libraries - ) - - # if the plugin links to libmapnik ensure it is built first - Depends(TARGET, env.subst('../../../../src/%s' % env['MAPNIK_LIB_NAME'])) - - # if 'uninstall' is not passed on the command line - # then we actually create the install targets that - # scons will install if 'install' is passed as an arg - if 'uninstall' not in COMMAND_LINE_TARGETS: - env.Install(install_dest, TARGET) - env.Alias('install', install_dest) - -# Return the plugin building options to scons -# This is used when statically linking the plugin with mapnik) -plugin_obj = { - 'LIBS': libraries, - 'SOURCES': plugin_sources, -} - -Return('plugin_obj') diff --git a/plugins/input/templates/helloworld/hello_datasource.cpp b/plugins/input/templates/helloworld/hello_datasource.cpp deleted file mode 100644 index 96307409f..000000000 --- a/plugins/input/templates/helloworld/hello_datasource.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// file plugin -#include "hello_datasource.hpp" -#include "hello_featureset.hpp" - -// boost - - -using mapnik::datasource; -using mapnik::parameters; - -DATASOURCE_PLUGIN(hello_datasource) - -hello_datasource::hello_datasource(parameters const& params) - : datasource(params), - desc_(hello_datasource::name(), *params.get("encoding","utf-8")), - extent_() -{ - this->init(params); -} - -void hello_datasource::init(mapnik::parameters const& params) -{ - // every datasource must have some way of reporting its extent - // in this case we are not actually reading from any data so for fun - // let's just create a world extent in Mapnik's default srs: - // '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' (equivalent to +init=epsg:4326) - // see http://spatialreference.org/ref/epsg/4326/ for more details - extent_.init(-180,-90,180,90); -} - -hello_datasource::~hello_datasource() { } - -// This name must match the plugin filename, eg 'hello.input' -const char * hello_datasource::name() -{ - return "hello"; -} - -mapnik::datasource::datasource_t hello_datasource::type() const -{ - return datasource::Vector; -} - -mapnik::box2d hello_datasource::envelope() const -{ - return extent_; -} - -boost::optional hello_datasource::get_geometry_type() const -{ - return mapnik::datasource::Point; -} - -mapnik::layer_descriptor hello_datasource::get_descriptor() const -{ - return desc_; -} - -mapnik::featureset_ptr hello_datasource::features(mapnik::query const& q) const -{ - // if the query box intersects our world extent then query for features - if (extent_.intersects(q.get_bbox())) - { - return std::make_shared(q.get_bbox(),desc_.get_encoding()); - } - - // otherwise return an empty featureset pointer - return mapnik::featureset_ptr(); -} - -mapnik::featureset_ptr hello_datasource::features_at_point(mapnik::coord2d const& pt, double tol) const -{ - // features_at_point is rarely used - only by custom applications, - // so for this sample plugin let's do nothing... - return mapnik::featureset_ptr(); -} diff --git a/plugins/input/templates/helloworld/hello_datasource.hpp b/plugins/input/templates/helloworld/hello_datasource.hpp deleted file mode 100644 index 432489dbe..000000000 --- a/plugins/input/templates/helloworld/hello_datasource.hpp +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef FILE_DATASOURCE_HPP -#define FILE_DATASOURCE_HPP - -// mapnik -#include -#include -#include -#include -#include -#include -#include - -// boost -#include -#include - -// stl -#include - -class hello_datasource : public mapnik::datasource -{ -public: - // constructor - // arguments must not change - hello_datasource(mapnik::parameters const& params); - - // destructor - virtual ~hello_datasource (); - - // mandatory: type of the plugin, used to match at runtime - mapnik::datasource::datasource_t type() const; - - // mandatory: name of the plugin - static const char * name(); - - // mandatory: function to query features by box2d - // this is called when rendering, specifically in feature_style_processor.hpp - mapnik::featureset_ptr features(mapnik::query const& q) const; - - // mandatory: function to query features by point (coord2d) - // not used by rendering, but available to calling applications - mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt, double tol = 0) const; - - // mandatory: return the box2d of the datasource - // called during rendering to determine if the layer should be processed - mapnik::box2d envelope() const; - - // mandatory: optionally return the overal geometry type of the datasource - boost::optional get_geometry_type() const; - - // mandatory: return the layer descriptor - mapnik::layer_descriptor get_descriptor() const; - -private: - // recommended - do intialization in a so-named init function - // to reduce code in constructor - void init(mapnik::parameters const& params); - // recommended naming convention of datasource members: - // name_, type_, extent_, and desc_ - static const std::string name_; - mapnik::layer_descriptor desc_; - mapnik::box2d extent_; -}; - - -#endif // FILE_DATASOURCE_HPP diff --git a/plugins/input/templates/helloworld/hello_featureset.cpp b/plugins/input/templates/helloworld/hello_featureset.cpp deleted file mode 100644 index 1f2cb507f..000000000 --- a/plugins/input/templates/helloworld/hello_featureset.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// mapnik -#include -#include -#include - -// boost - -#include "hello_featureset.hpp" - -hello_featureset::hello_featureset(mapnik::box2d const& box, std::string const& encoding) - : box_(box), - feature_id_(1), - tr_(new mapnik::transcoder(encoding)), - ctx_(std::make_shared()) { } - -hello_featureset::~hello_featureset() { } - -mapnik::feature_ptr hello_featureset::next() -{ - if (feature_id_ == 1) - { - // let us pretend it just has one column/attribute name - std::string attribute("key"); - - // the featureset context needs to know the field schema - ctx_->push(attribute); - - // create a new feature - mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,feature_id_)); - - // increment the count so that we only return one feature - ++feature_id_; - - // create an attribute pair of key:value - mapnik::value_unicode_string ustr = tr_->transcode("hello world!"); - feature->put(attribute,ustr); - - // we need a geometry to display so just for fun here - // we take the center of the bbox that was used to query - // since we don't actually have any data to pull from... - mapnik::coord2d center = box_.center(); - - // create a new point geometry - mapnik::geometry_type * pt = new mapnik::geometry_type(mapnik::geometry_type::types::Point); - - // we use path type geometries in Mapnik to fit nicely with AGG and Cairo - // here we stick an x,y pair into the geometry using move_to() - pt->move_to(center.x,center.y); - - // add the geometry to the feature - feature->add_geometry(pt); - - // A feature usually will have just one geometry of a given type - // but mapnik does support many geometries per feature of any type - // so here we draw a line around the point - mapnik::geometry_type * line = new mapnik::geometry_type(mapnik::geometry_type::types::LineString); - line->move_to(box_.minx(),box_.miny()); - line->line_to(box_.minx(),box_.maxy()); - line->line_to(box_.maxx(),box_.maxy()); - line->line_to(box_.maxx(),box_.miny()); - line->line_to(box_.minx(),box_.miny()); - feature->add_geometry(line); - - // return the feature! - return feature; - } - - // otherwise return an empty feature - return mapnik::feature_ptr(); -} diff --git a/plugins/input/templates/helloworld/hello_featureset.hpp b/plugins/input/templates/helloworld/hello_featureset.hpp deleted file mode 100644 index 43f338fad..000000000 --- a/plugins/input/templates/helloworld/hello_featureset.hpp +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef HELLO_FEATURESET_HPP -#define HELLO_FEATURESET_HPP - -// mapnik -#include -#include -#include - -// boost - // needed for wrapping the transcoder - -class hello_featureset : public mapnik::Featureset -{ -public: - // this constructor can have any arguments you need - hello_featureset(mapnik::box2d const& box, std::string const& encoding); - - // desctructor - virtual ~hello_featureset(); - - // mandatory: you must expose a next() method, called when rendering - mapnik::feature_ptr next(); - -private: - // members are up to you, but these are recommended - mapnik::box2d box_; - mapnik::value_integer feature_id_; - const std::unique_ptr tr_; - mapnik::context_ptr ctx_; -}; - -#endif // HELLO_FEATURESET_HPP diff --git a/plugins/input/templates/helloworld/test.xml b/plugins/input/templates/helloworld/test.xml deleted file mode 100644 index 3bfe7754d..000000000 --- a/plugins/input/templates/helloworld/test.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - style - - - hello - - - \ No newline at end of file diff --git a/plugins/input/topojson/build.py b/plugins/input/topojson/build.py index 19abd869d..9f7b95529 100644 --- a/plugins/input/topojson/build.py +++ b/plugins/input/topojson/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/topojson/topojson_datasource.cpp b/plugins/input/topojson/topojson_datasource.cpp index 5c1c8d4af..225a767a1 100644 --- a/plugins/input/topojson/topojson_datasource.cpp +++ b/plugins/input/topojson/topojson_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -86,27 +87,27 @@ struct geometry_type_visitor { int operator() (mapnik::topojson::point const&) const { - return static_cast(mapnik::datasource::Point); + return static_cast(mapnik::datasource_geometry_t::Point); } int operator() (mapnik::topojson::multi_point const&) const { - return static_cast(mapnik::datasource::Point); + return static_cast(mapnik::datasource_geometry_t::Point); } int operator() (mapnik::topojson::linestring const&) const { - return static_cast(mapnik::datasource::LineString); + return static_cast(mapnik::datasource_geometry_t::LineString); } int operator() (mapnik::topojson::multi_linestring const&) const { - return static_cast(mapnik::datasource::LineString); + return static_cast(mapnik::datasource_geometry_t::LineString); } int operator() (mapnik::topojson::polygon const&) const { - return static_cast(mapnik::datasource::Polygon); + return static_cast(mapnik::datasource_geometry_t::Polygon); } int operator() (mapnik::topojson::multi_polygon const&) const { - return static_cast(mapnik::datasource::Polygon); + return static_cast(mapnik::datasource_geometry_t::Polygon); } int operator() (mapnik::topojson::invalid const&) const { @@ -190,7 +191,7 @@ const mapnik::topojson::topojson_grammar g; template void topojson_datasource::parse_topojson(T const& buffer) { - boost::spirit::ascii::space_type space; + boost::spirit::standard::space_type space; bool result = boost::spirit::qi::phrase_parse(buffer.begin(), buffer.end(), g, space, topo_); if (!result) { @@ -218,9 +219,9 @@ void topojson_datasource::parse_topojson(T const& buffer) { extent_.expand_to_include(box); } + values.emplace_back(box, geometry_index); + ++geometry_index; } - values.emplace_back(box_type(point_type(box.minx(),box.miny()),point_type(box.maxx(),box.maxy())), geometry_index); - ++geometry_index; } // packing algorithm @@ -234,9 +235,9 @@ const char * topojson_datasource::name() return "topojson"; } -boost::optional topojson_datasource::get_geometry_type() const +boost::optional topojson_datasource::get_geometry_type() const { - boost::optional result; + boost::optional result; int multi_type = 0; std::size_t num_features = topo_.geometries.size(); for (std::size_t i = 0; i < num_features && i < 5; ++i) @@ -247,12 +248,12 @@ boost::optional topojson_datasource::get_geometr { if (multi_type > 0 && multi_type != type) { - result.reset(mapnik::datasource::Collection); + result.reset(mapnik::datasource_geometry_t::Collection); return result; } else { - result.reset(static_cast(type)); + result.reset(static_cast(type)); } multi_type = type; } @@ -278,10 +279,9 @@ mapnik::layer_descriptor topojson_datasource::get_descriptor() const mapnik::featureset_ptr topojson_datasource::features(mapnik::query const& q) const { // if the query box intersects our world extent then query for features - mapnik::box2d const& b = q.get_bbox(); - if (extent_.intersects(b)) + mapnik::box2d const& box = q.get_bbox(); + if (extent_.intersects(box)) { - box_type box(point_type(b.minx(),b.miny()),point_type(b.maxx(),b.maxy())); topojson_featureset::array_type index_array; if (tree_) { diff --git a/plugins/input/topojson/topojson_datasource.hpp b/plugins/input/topojson/topojson_datasource.hpp index d1892a75a..214d40e09 100644 --- a/plugins/input/topojson/topojson_datasource.hpp +++ b/plugins/input/topojson/topojson_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -39,8 +39,9 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wunused-local-typedef" -#include -#include +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -57,9 +58,7 @@ class topojson_datasource : public mapnik::datasource { public: - using point_type = boost::geometry::model::d2::point_xy; - using box_type = boost::geometry::model::box; - + using box_type = mapnik::box2d; using item_type = std::pair; using linear_type = boost::geometry::index::linear<16,4>; using spatial_index_type = boost::geometry::index::rtree; @@ -73,7 +72,7 @@ public: mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt, double tol = 0) const; mapnik::box2d envelope() const; mapnik::layer_descriptor get_descriptor() const; - boost::optional get_geometry_type() const; + boost::optional get_geometry_type() const; template void parse_topojson(T const& buffer); private: diff --git a/plugins/input/topojson/topojson_featureset.cpp b/plugins/input/topojson/topojson_featureset.cpp index 72b6f2cf0..b82304b71 100644 --- a/plugins/input/topojson/topojson_featureset.cpp +++ b/plugins/input/topojson/topojson_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,9 @@ #include #include #include +#include +#include + // stl #include #include @@ -36,18 +39,10 @@ #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wunused-local-typedef" #include -#include -#include -#include -#include -#include #pragma GCC diagnostic pop #include "topojson_featureset.hpp" -BOOST_GEOMETRY_REGISTER_POINT_2D(mapnik::topojson::coordinate, double, boost::geometry::cs::cartesian, x, y) -BOOST_GEOMETRY_REGISTER_LINESTRING(std::vector) - namespace mapnik { namespace topojson { struct attribute_value_visitor @@ -90,13 +85,12 @@ struct feature_generator : ctx_(ctx), tr_(tr), topo_(topo), + num_arcs_(topo.arcs.size()), feature_id_(feature_id) {} feature_ptr operator() (point const& pt) const { mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,feature_id_)); - std::unique_ptr point_ptr(new geometry_type(geometry_type::types::Point)); - double x = pt.coord.x; double y = pt.coord.y; if (topo_.tr) @@ -104,9 +98,8 @@ struct feature_generator x = x * (*topo_.tr).scale_x + (*topo_.tr).translate_x; y = y * (*topo_.tr).scale_y + (*topo_.tr).translate_y; } - - point_ptr->move_to(x,y); - feature->paths().push_back(point_ptr.release()); + mapnik::geometry::point point(x, y); + feature->set_geometry(std::move(point)); assign_properties(*feature, pt, tr_); return feature; } @@ -114,11 +107,10 @@ struct feature_generator feature_ptr operator() (multi_point const& multi_pt) const { mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,feature_id_)); - + mapnik::geometry::multi_point multi_point; + multi_point.reserve(multi_pt.points.size()); for (auto const& pt : multi_pt.points) { - std::unique_ptr point_ptr(new geometry_type(geometry_type::types::Point)); - double x = pt.x; double y = pt.y; if (topo_.tr) @@ -126,10 +118,9 @@ struct feature_generator x = x * (*topo_.tr).scale_x + (*topo_.tr).translate_x; y = y * (*topo_.tr).scale_y + (*topo_.tr).translate_y; } - - point_ptr->move_to(x,y); - feature->paths().push_back(point_ptr.release()); + multi_point.add_coord(x, y); } + feature->set_geometry(std::move(multi_point)); assign_properties(*feature, multi_pt, tr_); return feature; } @@ -137,207 +128,231 @@ struct feature_generator feature_ptr operator() (linestring const& line) const { mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,feature_id_)); - std::unique_ptr line_ptr(new geometry_type(geometry_type::types::LineString)); - - double px = 0, py = 0; - index_type arc_index = line.ring; - bool first = true; - for (auto pt : topo_.arcs[arc_index].coordinates) + if (num_arcs_ > 0) { - double x = pt.x; - double y = pt.y; - if (topo_.tr) + index_type index = line.ring; + index_type arc_index = index < 0 ? std::abs(index) - 1 : index; + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) { - x = (px += x) * (*topo_.tr).scale_x + (*topo_.tr).translate_x; - y = (py += y) * (*topo_.tr).scale_y + (*topo_.tr).translate_y; - } - if (first) - { - first = false; - line_ptr->move_to(x,y); - } - else - { - line_ptr->line_to(x,y); + auto const& arcs = topo_.arcs[arc_index]; + double px = 0, py = 0; + mapnik::geometry::line_string line_string; + line_string.reserve(arcs.coordinates.size()); + + for (auto pt : arcs.coordinates) + { + double x = pt.x; + double y = pt.y; + if (topo_.tr) + { + x = (px += x) * (*topo_.tr).scale_x + (*topo_.tr).translate_x; + y = (py += y) * (*topo_.tr).scale_y + (*topo_.tr).translate_y; + } + line_string.add_coord(x,y); + } + feature->set_geometry(std::move(line_string)); + assign_properties(*feature, line, tr_); } } - - feature->paths().push_back(line_ptr.release()); - assign_properties(*feature, line, tr_); return feature; } feature_ptr operator() (multi_linestring const& multi_line) const { mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,feature_id_)); - - for (auto const& index : multi_line.rings) + if (num_arcs_ > 0) { - std::unique_ptr line_ptr(new geometry_type(geometry_type::types::LineString)); - - double px = 0, py = 0; - bool first = true; - bool reverse = index < 0; - index_type arc_index = reverse ? std::abs(index) - 1 : index; - for (auto pt : topo_.arcs[arc_index].coordinates) + mapnik::geometry::multi_line_string multi_line_string; + bool hit = false; + multi_line_string.reserve(multi_line.rings.size()); + for (auto const& index : multi_line.rings) { - double x = pt.x; - double y = pt.y; - if (topo_.tr) + index_type arc_index = index < 0 ? std::abs(index) - 1 : index; + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) { - x = (px += x) * (*topo_.tr).scale_x + (*topo_.tr).translate_x; - y = (py += y) * (*topo_.tr).scale_y + (*topo_.tr).translate_y; - } - if (first) - { - first = false; - line_ptr->move_to(x,y); - } - else - { - line_ptr->line_to(x,y); + hit = true; + double px = 0, py = 0; + mapnik::geometry::line_string line_string; + auto const& arcs = topo_.arcs[arc_index]; + line_string.reserve(arcs.coordinates.size()); + for (auto pt : arcs.coordinates) + { + double x = pt.x; + double y = pt.y; + if (topo_.tr) + { + x = (px += x) * (*topo_.tr).scale_x + (*topo_.tr).translate_x; + y = (py += y) * (*topo_.tr).scale_y + (*topo_.tr).translate_y; + } + line_string.add_coord(x, y); + } + multi_line_string.push_back(std::move(line_string)); } } - feature->paths().push_back(line_ptr.release()); + if (hit) + { + feature->set_geometry(std::move(multi_line_string)); + assign_properties(*feature, multi_line, tr_); + } } - assign_properties(*feature, multi_line, tr_); return feature; } feature_ptr operator() (polygon const& poly) const { mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,feature_id_)); - std::unique_ptr poly_ptr(new geometry_type(geometry_type::types::Polygon)); - std::vector processed_coords; - - for (auto const& ring : poly.rings) + if (num_arcs_ > 0) { + std::vector processed_coords; + mapnik::geometry::polygon polygon; + if (poly.rings.size() > 1) polygon.interior_rings.reserve(poly.rings.size() - 1); bool first = true; - for (auto const& index : ring) + bool hit = false; + for (auto const& ring : poly.rings) { - double px = 0, py = 0; - bool reverse = index < 0; - index_type arc_index = reverse ? std::abs(index) - 1 : index; - auto const& coords = topo_.arcs[arc_index].coordinates; - processed_coords.clear(); - processed_coords.reserve(coords.size()); - for (auto const& pt : coords ) + mapnik::geometry::linear_ring linear_ring; + for (auto const& index : ring) { - double x = pt.x; - double y = pt.y; - - if (topo_.tr) + double px = 0, py = 0; + bool reverse = index < 0; + index_type arc_index = reverse ? std::abs(index) - 1 : index; + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) { - transform const& tr = *topo_.tr; - x = (px += x) * tr.scale_x + tr.translate_x; - y = (py += y) * tr.scale_y + tr.translate_y; - } - processed_coords.emplace_back(coordinate{x,y}); - } - - - // simplify - std::vector simplified(processed_coords.size()); - boost::geometry::simplify(processed_coords, simplified, 2); - - using namespace boost::adaptors; - - if (reverse) - { - for (auto const& c : simplified | reversed | sliced(0, simplified.size()-1)) - { - if (first) + hit = true; + auto const& arcs = topo_.arcs[arc_index]; + auto const& coords = arcs.coordinates; + processed_coords.clear(); + processed_coords.reserve(coords.size()); + for (auto const& pt : coords ) { - first = false; - poly_ptr->move_to(c.x,c.y); + double x = pt.x; + double y = pt.y; + + if (topo_.tr) + { + transform const& tr = *topo_.tr; + x = (px += x) * tr.scale_x + tr.translate_x; + y = (py += y) * tr.scale_y + tr.translate_y; + } + processed_coords.emplace_back(coordinate{x,y}); + } + + if (reverse) + { + for (auto const& c : processed_coords | boost::adaptors::reversed) + { + linear_ring.emplace_back(c.x, c.y); + } + } + else + { + for (auto const& c : processed_coords) + { + linear_ring.emplace_back(c.x, c.y); + } } - else poly_ptr->line_to(c.x,c.y); } } + if (first) + { + first = false; + polygon.set_exterior_ring(std::move(linear_ring)); + } else { - for (auto const& c : simplified | sliced(0, simplified.size()-1)) - { - if (first) - { - first = false; - poly_ptr->move_to(c.x,c.y); - } - else poly_ptr->line_to(c.x,c.y); - } + polygon.add_hole(std::move(linear_ring)); } } - poly_ptr->close_path(); + if (hit) + { + mapnik::geometry::correct(polygon); + feature->set_geometry(std::move(polygon)); + assign_properties(*feature, poly, tr_); + } } - - feature->paths().push_back(poly_ptr.release()); - assign_properties(*feature, poly, tr_); return feature; } feature_ptr operator() (multi_polygon const& multi_poly) const { mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,feature_id_)); - std::vector processed_coords; - for (auto const& poly : multi_poly.polygons) + if (num_arcs_ > 0) { - std::unique_ptr poly_ptr(new geometry_type(geometry_type::types::Polygon)); - for (auto const& ring : poly) + std::vector processed_coords; + mapnik::geometry::multi_polygon multi_polygon; + multi_polygon.reserve(multi_poly.polygons.size()); + bool hit = false; + for (auto const& poly : multi_poly.polygons) { bool first = true; - for (auto const& index : ring) + mapnik::geometry::polygon polygon; + if (poly.size() > 1) polygon.interior_rings.reserve(poly.size() - 1); + + for (auto const& ring : poly) { - double px = 0, py = 0; - bool reverse = index < 0; - index_type arc_index = reverse ? std::abs(index) - 1 : index; - auto const& coords = topo_.arcs[arc_index].coordinates; - processed_coords.clear(); - processed_coords.reserve(coords.size()); - for (auto const& pt : coords ) + mapnik::geometry::linear_ring linear_ring; + for (auto const& index : ring) { - double x = pt.x; - double y = pt.y; - - if (topo_.tr) + double px = 0, py = 0; + bool reverse = index < 0; + index_type arc_index = reverse ? std::abs(index) - 1 : index; + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) { - x = (px += x) * (*topo_.tr).scale_x + (*topo_.tr).translate_x; - y = (py += y) * (*topo_.tr).scale_y + (*topo_.tr).translate_y; - } - processed_coords.emplace_back(coordinate{x,y}); - } - - using namespace boost::adaptors; - - if (reverse) - { - for (auto const& c : (processed_coords | reversed | sliced(0,processed_coords.size() - 1))) - { - if (first) + hit = true; + auto const& arcs = topo_.arcs[arc_index]; + auto const& coords = arcs.coordinates; + processed_coords.clear(); + processed_coords.reserve(coords.size()); + for (auto const& pt : coords ) { - first = false; - poly_ptr->move_to(c.x,c.y); + double x = pt.x; + double y = pt.y; + + if (topo_.tr) + { + x = (px += x) * (*topo_.tr).scale_x + (*topo_.tr).translate_x; + y = (py += y) * (*topo_.tr).scale_y + (*topo_.tr).translate_y; + } + processed_coords.emplace_back(coordinate{x,y}); + } + + using namespace boost::adaptors; + + if (reverse) + { + for (auto const& c : (processed_coords | reversed)) + { + linear_ring.add_coord(c.x, c.y); + } + } + else + { + for (auto const& c : processed_coords) + { + linear_ring.add_coord(c.x, c.y); + } } - else poly_ptr->line_to(c.x,c.y); } } + if (first) + { + first = false; + polygon.set_exterior_ring(std::move(linear_ring)); + } else { - for (auto const& c : processed_coords | sliced(0,processed_coords.size() - 1)) - { - if (first) - { - first = false; - poly_ptr->move_to(c.x,c.y); - } - else poly_ptr->line_to(c.x,c.y); - } + polygon.add_hole(std::move(linear_ring)); } } - poly_ptr->close_path(); + multi_polygon.push_back(std::move(polygon)); + } + if (hit) + { + mapnik::geometry::correct(multi_polygon); + feature->set_geometry(std::move(multi_polygon)); + assign_properties(*feature, multi_poly, tr_); } - feature->paths().push_back(poly_ptr.release()); } - assign_properties(*feature, multi_poly, tr_); return feature; } @@ -350,6 +365,7 @@ struct feature_generator Context & ctx_; mapnik::transcoder const& tr_; topology const& topo_; + std::size_t num_arcs_; std::size_t feature_id_; }; @@ -364,7 +380,7 @@ topojson_featureset::topojson_featureset(mapnik::topojson::topology const& topo, index_array_(std::move(index_array)), index_itr_(index_array_.begin()), index_end_(index_array_.end()), - feature_id_ (0) {} + feature_id_(1) {} topojson_featureset::~topojson_featureset() {} diff --git a/plugins/input/topojson/topojson_featureset.hpp b/plugins/input/topojson/topojson_featureset.hpp index f6dc224c6..44f833512 100644 --- a/plugins/input/topojson/topojson_featureset.hpp +++ b/plugins/input/topojson/topojson_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/run_tests b/run_tests deleted file mode 100755 index 7ae774a35..000000000 --- a/run_tests +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -failures=0 - -source ./localize.sh -PYTHON=${PYTHON:-python} - -echo "*** Running Next Gen C++ tests..." -./tests/cxx/run -failures=$((failures+$?)) -echo - -echo "*** Running Old C++ tests..." -./tests/cpp_tests/run -failures=$((failures+$?)) -echo - -echo "*** Running visual tests..." -$PYTHON tests/visual_tests/test.py -q -failures=$((failures+$?)) - -echo "*** Running python tests..." -$PYTHON tests/run_tests.py -q -failures=$((failures+$?)) - -exit $failures diff --git a/scripts/check-padding b/scripts/check-padding new file mode 100755 index 000000000..b10d34b73 --- /dev/null +++ b/scripts/check-padding @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +set -eu +set -o pipefail + +cpp="/tmp/alignment.cpp" +app="/tmp/alignment" + +function usage() { + echo "Usage:" + echo "" + echo "./scripts/rebuild.sh [header] [class name]" + echo "" + echo "Please pass a header file and a class name" + echo "" + echo " ./scripts/check-padding include/mapnik/attribute.hpp mapnik::attribute" + echo "" + exit 1 + +} + +function add() { + echo $1 >> ${cpp} +} + +CXX=${CXX:-clang++} + +function compile() { + ${CXX} -o ${app} ${cpp} -Wpadded -I./ -isystem ./mason_packages/.link/include `mapnik-config --all-flags` -Ideps -Lsrc -Ideps/agg/include -Iinclude +} + +if [[ ${1:-unset} == "unset" ]] || [[ ${2:-unset} == "unset" ]] || [[ $@ == '-h' ]] || [[ $@ == '--help' ]]; then + usage +fi + +echo '' > ${cpp} + +add "#include " +add "#include " + +add "#include \"$1\"" + +add "" + +add '#define REPORT(type) std::clog << "sizeof(" #type ") " << sizeof(type) << "\n";' + +add "int main() {" +add "" + +add "REPORT(std::string)" +add "REPORT(unsigned int)" +add "REPORT(int)" +add "REPORT(bool)" +add "REPORT(std::vector)" +add "REPORT(std::size_t)" + +add "REPORT($2)" + +add "return 0;" +add "}" + +compile +${app} diff --git a/src/agg/agg_renderer.cpp b/src/agg/agg_renderer.cpp index d1ce80ca0..56e171048 100644 --- a/src/agg/agg_renderer.cpp +++ b/src/agg/agg_renderer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -43,6 +42,7 @@ #include #include #include +#include // agg #include "agg_rendering_buffer.h" #include "agg_pixfmt_rgba.h" @@ -53,8 +53,9 @@ #include "agg_span_allocator.h" #include "agg_image_accessors.h" #include "agg_span_image_filter_rgba.h" + // boost -#include +#include // stl #include @@ -108,9 +109,52 @@ agg_renderer::agg_renderer(Map const& m, T0 & pixmap, std::shared_ptr setup(m); } +template +struct setup_agg_bg_visitor +{ + setup_agg_bg_visitor(buffer_type & pixmap, + renderer_common const& common, + composite_mode_e mode, + double opacity) + : pixmap_(pixmap), + common_(common), + mode_(mode), + opacity_(opacity) {} + + void operator() (marker_null const&) {} + + void operator() (marker_svg const&) {} + + void operator() (marker_rgba8 const& marker) + { + mapnik::image_rgba8 const& bg_image = marker.get_data(); + std::size_t w = bg_image.width(); + std::size_t h = bg_image.height(); + if ( w > 0 && h > 0) + { + // repeat background-image both vertically and horizontally + std::size_t x_steps = static_cast(std::ceil(common_.width_/double(w))); + std::size_t y_steps = static_cast(std::ceil(common_.height_/double(h))); + for (std::size_t x=0;x void agg_renderer::setup(Map const &m) { + mapnik::set_premultiplied_alpha(pixmap_, true); boost::optional const& bg = m.background(); if (bg) { @@ -118,11 +162,13 @@ void agg_renderer::setup(Map const &m) { mapnik::color bg_color = *bg; bg_color.premultiply(); - pixmap_.set_background(bg_color); + mapnik::fill(pixmap_, bg_color); } else { - pixmap_.set_background(*bg); + mapnik::color bg_color = *bg; + bg_color.set_premultiplied(true); + mapnik::fill(pixmap_,bg_color); } } @@ -130,26 +176,12 @@ void agg_renderer::setup(Map const &m) if (image_filename) { // NOTE: marker_cache returns premultiplied image, if needed - boost::optional bg_marker = mapnik::marker_cache::instance().find(*image_filename,true); - if (bg_marker && (*bg_marker)->is_bitmap()) - { - mapnik::image_ptr bg_image = *(*bg_marker)->get_bitmap_data(); - int w = bg_image->width(); - int h = bg_image->height(); - if ( w > 0 && h > 0) - { - // repeat background-image both vertically and horizontally - unsigned x_steps = static_cast(std::ceil(common_.width_/double(w))); - unsigned y_steps = static_cast(std::ceil(common_.height_/double(h))); - for (unsigned x=0;x bg_marker = mapnik::marker_cache::instance().find(*image_filename,true); + setup_agg_bg_visitor visitor(pixmap_, + common_, + m.background_image_comp_op(), + m.background_image_opacity()); + util::apply_visitor(visitor, *bg_marker); } MAPNIK_LOG_DEBUG(agg_renderer) << "agg_renderer: Scale=" << m.scale(); } @@ -167,10 +199,7 @@ void agg_renderer::start_map_processing(Map const& map) template void agg_renderer::end_map_processing(Map const& ) { - - agg::rendering_buffer buf(pixmap_.raw_data(),common_.width_,common_.height_, common_.width_ * 4); - agg::pixfmt_rgba32_pre pixf(buf); - pixf.demultiply(); + mapnik::demultiply_alpha(pixmap_); MAPNIK_LOG_DEBUG(agg_renderer) << "agg_renderer: End map processing"; } @@ -239,7 +268,7 @@ void agg_renderer::start_style_processing(feature_type_style const& st) } else { - internal_buffer_->set_background(color(0,0,0,0)); // fill with transparent colour + mapnik::fill(*internal_buffer_, 0); // fill with transparent colour } } else @@ -250,12 +279,13 @@ void agg_renderer::start_style_processing(feature_type_style const& st) } else { - internal_buffer_->set_background(color(0,0,0,0)); // fill with transparent colour + mapnik::fill(*internal_buffer_, 0); // fill with transparent colour } common_.t_.set_offset(0); ras_ptr->clip_box(0,0,common_.width_,common_.height_); } current_buffer_ = internal_buffer_.get(); + set_premultiplied_alpha(*current_buffer_,true); } else { @@ -274,7 +304,7 @@ void agg_renderer::end_style_processing(feature_type_style const& st) if (st.image_filters().size() > 0) { blend_from = true; - mapnik::filter::filter_visitor visitor(*current_buffer_); + mapnik::filter::filter_visitor visitor(*current_buffer_); for (mapnik::filter::filter_type const& filter_tag : st.image_filters()) { util::apply_visitor(visitor, filter_tag); @@ -282,21 +312,21 @@ void agg_renderer::end_style_processing(feature_type_style const& st) } if (st.comp_op()) { - composite(pixmap_.data(), current_buffer_->data(), + composite(pixmap_, *current_buffer_, *st.comp_op(), st.get_opacity(), -common_.t_.offset(), - -common_.t_.offset(), false); + -common_.t_.offset()); } else if (blend_from || st.get_opacity() < 1.0) { - composite(pixmap_.data(), current_buffer_->data(), + composite(pixmap_, *current_buffer_, src_over, st.get_opacity(), -common_.t_.offset(), - -common_.t_.offset(), false); + -common_.t_.offset()); } } // apply any 'direct' image filters - mapnik::filter::filter_visitor visitor(pixmap_); + mapnik::filter::filter_visitor visitor(pixmap_); for (mapnik::filter::filter_type const& filter_tag : st.direct_image_filters()) { util::apply_visitor(visitor, filter_tag); @@ -304,87 +334,126 @@ void agg_renderer::end_style_processing(feature_type_style const& st) MAPNIK_LOG_DEBUG(agg_renderer) << "agg_renderer: End processing style"; } -template -void agg_renderer::render_marker(pixel_position const& pos, - marker const& marker, - agg::trans_affine const& tr, - double opacity, - composite_mode_e comp_op) +template +struct agg_render_marker_visitor { - using color_type = agg::rgba8; - using order_type = agg::order_rgba; - using blender_type = agg::comp_op_adaptor_rgba_pre; // comp blender - using pixfmt_comp_type = agg::pixfmt_custom_blend_rgba; - using renderer_base = agg::renderer_base; - using renderer_type = agg::renderer_scanline_aa_solid; - using svg_attribute_type = agg::pod_bvector; + agg_render_marker_visitor(renderer_common & common, + buffer_type * current_buffer, + std::unique_ptr const& ras_ptr, + gamma_method_enum & gamma_method, + double & gamma, + pixel_position const& pos, + agg::trans_affine const& tr, + double opacity, + composite_mode_e comp_op) + : common_(common), + current_buffer_(current_buffer), + ras_ptr_(ras_ptr), + gamma_method_(gamma_method), + gamma_(gamma), + pos_(pos), + tr_(tr), + opacity_(opacity), + comp_op_(comp_op) {} - ras_ptr->reset(); - if (gamma_method_ != GAMMA_POWER || gamma_ != 1.0) - { - ras_ptr->gamma(agg::gamma_power()); - gamma_method_ = GAMMA_POWER; - gamma_ = 1.0; - } - agg::scanline_u8 sl; - agg::rendering_buffer buf(current_buffer_->raw_data(), - current_buffer_->width(), - current_buffer_->height(), - current_buffer_->width() * 4); - pixfmt_comp_type pixf(buf); - pixf.comp_op(static_cast(comp_op)); - renderer_base renb(pixf); + void operator() (marker_null const&) {} - if (marker.is_vector()) + void operator() (marker_svg const& marker) { - box2d const& bbox = (*marker.get_vector_data())->bounding_box(); + using color_type = agg::rgba8; + using order_type = agg::order_rgba; + using blender_type = agg::comp_op_adaptor_rgba_pre; // comp blender + using pixfmt_comp_type = agg::pixfmt_custom_blend_rgba; + using renderer_base = agg::renderer_base; + using renderer_type = agg::renderer_scanline_aa_solid; + using svg_attribute_type = agg::pod_bvector; + + ras_ptr_->reset(); + if (gamma_method_ != GAMMA_POWER || gamma_ != 1.0) + { + ras_ptr_->gamma(agg::gamma_power()); + gamma_method_ = GAMMA_POWER; + gamma_ = 1.0; + } + agg::scanline_u8 sl; + agg::rendering_buffer buf(current_buffer_->bytes(), + current_buffer_->width(), + current_buffer_->height(), + current_buffer_->row_size()); + pixfmt_comp_type pixf(buf); + pixf.comp_op(static_cast(comp_op_)); + renderer_base renb(pixf); + + box2d const& bbox = marker.get_data()->bounding_box(); coord c = bbox.center(); // center the svg marker on '0,0' agg::trans_affine mtx = agg::trans_affine_translation(-c.x,-c.y); // apply symbol transformation to get to map space - mtx *= tr; + mtx *= tr_; mtx *= agg::trans_affine_scaling(common_.scale_factor_); // render the marker at the center of the marker box - mtx.translate(pos.x, pos.y); + mtx.translate(pos_.x, pos_.y); using namespace mapnik::svg; - vertex_stl_adapter stl_storage((*marker.get_vector_data())->source()); + vertex_stl_adapter stl_storage(marker.get_data()->source()); svg_path_adapter svg_path(stl_storage); svg_renderer_agg svg_renderer(svg_path, - (*marker.get_vector_data())->attributes()); + marker.get_data()->attributes()); // https://github.com/mapnik/mapnik/issues/1316 // https://github.com/mapnik/mapnik/issues/1866 mtx.tx = std::floor(mtx.tx+.5); mtx.ty = std::floor(mtx.ty+.5); - svg_renderer.render(*ras_ptr, sl, renb, mtx, opacity, bbox); + svg_renderer.render(*ras_ptr_, sl, renb, mtx, opacity_, bbox); } - else + + void operator() (marker_rgba8 const& marker) { - double width = (*marker.get_bitmap_data())->width(); - double height = (*marker.get_bitmap_data())->height(); + using color_type = agg::rgba8; + using order_type = agg::order_rgba; + using blender_type = agg::comp_op_adaptor_rgba_pre; // comp blender + using pixfmt_comp_type = agg::pixfmt_custom_blend_rgba; + using renderer_base = agg::renderer_base; + + ras_ptr_->reset(); + if (gamma_method_ != GAMMA_POWER || gamma_ != 1.0) + { + ras_ptr_->gamma(agg::gamma_power()); + gamma_method_ = GAMMA_POWER; + gamma_ = 1.0; + } + agg::scanline_u8 sl; + agg::rendering_buffer buf(current_buffer_->bytes(), + current_buffer_->width(), + current_buffer_->height(), + current_buffer_->row_size()); + pixfmt_comp_type pixf(buf); + pixf.comp_op(static_cast(comp_op_)); + renderer_base renb(pixf); + + double width = marker.width(); + double height = marker.height(); if (std::fabs(1.0 - common_.scale_factor_) < 0.001 - && (std::fabs(1.0 - tr.sx) < agg::affine_epsilon) - && (std::fabs(0.0 - tr.shy) < agg::affine_epsilon) - && (std::fabs(0.0 - tr.shx) < agg::affine_epsilon) - && (std::fabs(1.0 - tr.sy) < agg::affine_epsilon)) + && (std::fabs(1.0 - tr_.sx) < agg::affine_epsilon) + && (std::fabs(0.0 - tr_.shy) < agg::affine_epsilon) + && (std::fabs(0.0 - tr_.shx) < agg::affine_epsilon) + && (std::fabs(1.0 - tr_.sy) < agg::affine_epsilon)) { double cx = 0.5 * width; double cy = 0.5 * height; - composite(current_buffer_->data(), **marker.get_bitmap_data(), - comp_op, opacity, - std::floor(pos.x - cx + .5), - std::floor(pos.y - cy + .5), - false); + composite(*current_buffer_, marker.get_data(), + comp_op_, opacity_, + std::floor(pos_.x - cx + .5), + std::floor(pos_.y - cy + .5)); } else { double p[8]; - double x0 = pos.x - 0.5 * width; - double y0 = pos.y - 0.5 * height; + double x0 = pos_.x - 0.5 * width; + double y0 = pos_.y - 0.5 * height; p[0] = x0; p[1] = y0; p[2] = x0 + width; p[3] = y0; p[4] = x0 + width; p[5] = y0 + height; @@ -392,31 +461,31 @@ void agg_renderer::render_marker(pixel_position const& pos, agg::trans_affine marker_tr; - marker_tr *= agg::trans_affine_translation(-pos.x,-pos.y); - marker_tr *= tr; + marker_tr *= agg::trans_affine_translation(-pos_.x,-pos_.y); + marker_tr *= tr_; marker_tr *= agg::trans_affine_scaling(common_.scale_factor_); - marker_tr *= agg::trans_affine_translation(pos.x,pos.y); + marker_tr *= agg::trans_affine_translation(pos_.x,pos_.y); marker_tr.transform(&p[0], &p[1]); marker_tr.transform(&p[2], &p[3]); marker_tr.transform(&p[4], &p[5]); marker_tr.transform(&p[6], &p[7]); - ras_ptr->move_to_d(p[0],p[1]); - ras_ptr->line_to_d(p[2],p[3]); - ras_ptr->line_to_d(p[4],p[5]); - ras_ptr->line_to_d(p[6],p[7]); + ras_ptr_->move_to_d(p[0],p[1]); + ras_ptr_->line_to_d(p[2],p[3]); + ras_ptr_->line_to_d(p[4],p[5]); + ras_ptr_->line_to_d(p[6],p[7]); agg::span_allocator sa; agg::image_filter_bilinear filter_kernel; agg::image_filter_lut filter(filter_kernel, false); - image_data_rgba8 const& src = **marker.get_bitmap_data(); - agg::rendering_buffer marker_buf((unsigned char *)src.getBytes(), + buffer_type const& src = marker.get_data(); + agg::rendering_buffer marker_buf((unsigned char *)src.bytes(), src.width(), src.height(), - src.width()*4); + src.row_size()); agg::pixfmt_rgba32_pre marker_pixf(marker_buf); using img_accessor_type = agg::image_accessor_clone; using interpolator_type = agg::span_interpolator_linear; @@ -431,10 +500,41 @@ void agg_renderer::render_marker(pixel_position const& pos, final_tr.ty = std::floor(final_tr.ty+.5); interpolator_type interpolator(final_tr); span_gen_type sg(ia, interpolator, filter); - renderer_type rp(renb,sa, sg, unsigned(opacity*255)); - agg::render_scanlines(*ras_ptr, sl, rp); + renderer_type rp(renb,sa, sg, unsigned(opacity_*255)); + agg::render_scanlines(*ras_ptr_, sl, rp); } } + + private: + renderer_common & common_; + buffer_type * current_buffer_; + std::unique_ptr const& ras_ptr_; + gamma_method_enum & gamma_method_; + double & gamma_; + pixel_position const& pos_; + agg::trans_affine const& tr_; + double opacity_; + composite_mode_e comp_op_; + +}; + +template +void agg_renderer::render_marker(pixel_position const& pos, + marker const& marker, + agg::trans_affine const& tr, + double opacity, + composite_mode_e comp_op) +{ + agg_render_marker_visitor visitor(common_, + current_buffer_, + ras_ptr, + gamma_method_, + gamma_, + pos, + tr, + opacity, + comp_op); + util::apply_visitor(visitor, marker); } template @@ -453,10 +553,10 @@ template void agg_renderer::debug_draw_box(box2d const& box, double x, double y, double angle) { - agg::rendering_buffer buf(current_buffer_->raw_data(), + agg::rendering_buffer buf(current_buffer_->bytes(), current_buffer_->width(), current_buffer_->height(), - current_buffer_->width() * 4); + current_buffer_->row_size()); debug_draw_box(buf, box, x, y, angle); } @@ -473,7 +573,7 @@ void agg_renderer::debug_draw_box(R& buf, box2d const& box, renderer_base renb(pixf); renderer_type ren(renb); - // compute tranformation matrix + // compute transformation matrix agg::trans_affine tr = agg::trans_affine_rotation(angle).translate(x, y); // prepare path agg::path_storage pbox; @@ -509,19 +609,19 @@ void agg_renderer::draw_geo_extent(box2d const& extent, mapnik::c unsigned rgba = color.rgba(); for (double x=x0; x; -template void agg_renderer::debug_draw_box( +template class agg_renderer; +template void agg_renderer::debug_draw_box( agg::rendering_buffer& buf, box2d const& box, double x, double y, double angle); -} +} // end ns diff --git a/src/agg/process_building_symbolizer.cpp b/src/agg/process_building_symbolizer.cpp index 7a693454f..aabba778d 100644 --- a/src/agg/process_building_symbolizer.cpp +++ b/src/agg/process_building_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,7 +22,7 @@ // mapnik #include -#include +#include #include #include #include @@ -54,11 +54,11 @@ void agg_renderer::process(building_symbolizer const& sym, mapnik::feature_impl & feature, proj_transform const& prj_trans) { - using path_type = transform_path_adapter; + using transform_path_type = transform_path_adapter; using ren_base = agg::renderer_base; using renderer = agg::renderer_scanline_aa_solid; - agg::rendering_buffer buf(current_buffer_->raw_data(),current_buffer_->width(),current_buffer_->height(), current_buffer_->width() * 4); + agg::rendering_buffer buf(current_buffer_->bytes(),current_buffer_->width(),current_buffer_->height(), current_buffer_->row_size()); agg::pixfmt_rgba32_pre pixf(buf); ren_base renb(pixf); @@ -85,32 +85,37 @@ void agg_renderer::process(building_symbolizer const& sym, render_building_symbolizer( feature, height, - [&,r,g,b,a,opacity](geometry_type &faces) { - path_type faces_path (this->common_.t_,faces,prj_trans); + [&,r,g,b,a,opacity](path_type const& faces) + { + vertex_adapter va(faces); + transform_path_type faces_path (this->common_.t_,va,prj_trans); ras_ptr->add_path(faces_path); ren.color(agg::rgba8_pre(int(r*0.8), int(g*0.8), int(b*0.8), int(a * opacity))); agg::render_scanlines(*ras_ptr, sl, ren); this->ras_ptr->reset(); }, - [&,r,g,b,a,opacity](geometry_type &frame) { - path_type path(common_.t_,frame,prj_trans); - agg::conv_stroke stroke(path); + [&,r,g,b,a,opacity](path_type const& frame) + { + vertex_adapter va(frame); + transform_path_type path(common_.t_,va, prj_trans); + agg::conv_stroke stroke(path); stroke.width(common_.scale_factor_); ras_ptr->add_path(stroke); ren.color(agg::rgba8_pre(int(r*0.8), int(g*0.8), int(b*0.8), int(a * opacity))); agg::render_scanlines(*ras_ptr, sl, ren); ras_ptr->reset(); }, - [&,r,g,b,a,opacity](geometry_type &roof) { - path_type roof_path (common_.t_,roof,prj_trans); + [&,r,g,b,a,opacity](path_type const& roof) + { + vertex_adapter va(roof); + transform_path_type roof_path (common_.t_,va,prj_trans); ras_ptr->add_path(roof_path); ren.color(agg::rgba8_pre(r, g, b, int(a * opacity))); agg::render_scanlines(*ras_ptr, sl, ren); }); } -template void agg_renderer::process(building_symbolizer const&, +template void agg_renderer::process(building_symbolizer const&, mapnik::feature_impl &, proj_transform const&); - } diff --git a/src/agg/process_debug_symbolizer.cpp b/src/agg/process_debug_symbolizer.cpp index fb1d2e90b..c56add951 100644 --- a/src/agg/process_debug_symbolizer.cpp +++ b/src/agg/process_debug_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,13 +23,30 @@ // mapnik #include #include -#include +#include #include #include +#include +#include +#include +#include +#include +#include + +// agg +#include "agg_basics.h" +#include "agg_rendering_buffer.h" +#include "agg_color_rgba.h" +#include "agg_pixfmt_rgba.h" +#include "agg_scanline_u.h" +#include "agg_renderer_scanline.h" +#include "agg_conv_stroke.h" namespace mapnik { -void draw_rect(image_32 &pixmap, box2d const& box) +namespace { +template +void draw_rect(T &pixmap, box2d const& box) { int x0 = static_cast(box.minx()); int x1 = static_cast(box.maxx()); @@ -38,16 +55,157 @@ void draw_rect(image_32 &pixmap, box2d const& box) unsigned color1 = 0xff0000ff; for (int x=x0; x +struct apply_vertex_mode +{ + apply_vertex_mode(Pixmap & pixmap, view_transform const& t, proj_transform const& prj_trans) + : pixmap_(pixmap), + t_(t), + prj_trans_(prj_trans) {} + + template + void operator() (Adapter const& va) const + { + double x; + double y; + double z = 0; + va.rewind(0); + unsigned cmd = SEG_END; + while ((cmd = va.vertex(&x, &y)) != mapnik::SEG_END) + { + if (cmd == SEG_CLOSE) continue; + prj_trans_.backward(x,y,z); + t_.forward(&x,&y); + mapnik::set_pixel(pixmap_,x,y,0xff0000ff); + mapnik::set_pixel(pixmap_,x-1,y-1,0xff0000ff); + mapnik::set_pixel(pixmap_,x+1,y+1,0xff0000ff); + mapnik::set_pixel(pixmap_,x-1,y+1,0xff0000ff); + mapnik::set_pixel(pixmap_,x+1,y-1,0xff0000ff); + } + } + + Pixmap & pixmap_; + view_transform const& t_; + proj_transform const& prj_trans_; +}; + + +template +struct RingRenderer { + + using color_type = agg::rgba8; + using order_type = agg::order_rgba; + using blender_type = agg::comp_op_adaptor_rgba_pre; // comp blender + using pixfmt_comp_type = agg::pixfmt_custom_blend_rgba; + using renderer_base = agg::renderer_base; + using renderer_type = agg::renderer_scanline_aa_solid; + + using path_type = transform_path_adapter >; + + RingRenderer(rasterizer & ras_ptr, + BufferType & im, + view_transform const& tr, + proj_transform const& prj_trans) : + ras_ptr_(ras_ptr), + im_(im), + tr_(tr), + prj_trans_(prj_trans), + sl_() {} + + void draw_ring(geometry::linear_ring const& ring, + agg::rgba8 const& color) + { + ras_ptr_.reset(); + agg::rendering_buffer buf(im_.bytes(),im_.width(),im_.height(),im_.row_size()); + pixfmt_comp_type pixf(buf); + renderer_base renb(pixf); + renderer_type ren(renb); + geometry::ring_vertex_adapter va(ring); + path_type path(tr_,va,prj_trans_); + ras_ptr_.add_path(path); + ras_ptr_.filling_rule(agg::fill_non_zero); + ren.color(color); + agg::render_scanlines(ras_ptr_, sl_, ren); + } + + void draw_outline(geometry::linear_ring const& ring, + agg::rgba8 const& color, + double stroke_width=3) + { + ras_ptr_.reset(); + agg::rendering_buffer buf(im_.bytes(),im_.width(),im_.height(),im_.row_size()); + pixfmt_comp_type pixf(buf); + renderer_base renb(pixf); + renderer_type ren(renb); + geometry::ring_vertex_adapter va(ring); + path_type path(tr_,va,prj_trans_); + agg::conv_stroke stroke(path); + stroke.width(stroke_width); + ras_ptr_.add_path(stroke); + ras_ptr_.filling_rule(agg::fill_non_zero); + ren.color(color); + agg::render_scanlines(ras_ptr_, sl_, ren); + } + + rasterizer & ras_ptr_; + BufferType & im_; + view_transform const& tr_; + proj_transform const& prj_trans_; + agg::scanline_u8 sl_; +}; + +template +struct render_ring_visitor { + + render_ring_visitor(RingRenderer & renderer) + : renderer_(renderer) {} + + void operator()(mapnik::geometry::multi_polygon const& geom) + { + for (auto const& poly : geom) + { + (*this)(poly); + } + } + + void operator()(mapnik::geometry::polygon const& geom) + { + agg::rgba8 red(255,0,0,255); + agg::rgba8 green(0,255,255,255); + agg::rgba8 black(0,0,0,255); + renderer_.draw_ring(geom.exterior_ring,red); + if (mapnik::util::is_clockwise(geom.exterior_ring)) + { + renderer_.draw_outline(geom.exterior_ring,black); + } + for (auto const& ring : geom.interior_rings) + { + renderer_.draw_ring(ring,green); + if (!mapnik::util::is_clockwise(ring)) + { + renderer_.draw_outline(ring,black); + } + } + } + + template + void operator()(GeomType const&) {} + + RingRenderer & renderer_; +}; + +} // anonymous namespace + template void agg_renderer::process(debug_symbolizer const& sym, mapnik::feature_impl & feature, @@ -56,40 +214,36 @@ void agg_renderer::process(debug_symbolizer const& sym, debug_symbolizer_mode_enum mode = get(sym, keys::mode, feature, common_.vars_, DEBUG_SYM_MODE_COLLISION); - if (mode == DEBUG_SYM_MODE_COLLISION) + ras_ptr->reset(); + if (gamma_method_ != GAMMA_POWER || gamma_ != 1.0) { - typename detector_type::query_iterator itr = common_.detector_->begin(); - typename detector_type::query_iterator end = common_.detector_->end(); - for ( ;itr!=end; ++itr) + ras_ptr->gamma(agg::gamma_power()); + gamma_method_ = GAMMA_POWER; + gamma_ = 1.0; + } + + if (mode == DEBUG_SYM_MODE_RINGS) + { + RingRenderer renderer(*ras_ptr,*current_buffer_,common_.t_,prj_trans); + render_ring_visitor apply(renderer); + mapnik::util::apply_visitor(apply,feature.get_geometry()); + } + else if (mode == DEBUG_SYM_MODE_COLLISION) + { + for (auto const& n : *common_.detector_) { - draw_rect(pixmap_, itr->box); + draw_rect(pixmap_, n.get().box); } } else if (mode == DEBUG_SYM_MODE_VERTEX) { - for (auto const& geom : feature.paths()) - { - double x; - double y; - double z = 0; - geom.rewind(0); - unsigned cmd = 1; - while ((cmd = geom.vertex(&x, &y)) != mapnik::SEG_END) - { - if (cmd == SEG_CLOSE) continue; - prj_trans.backward(x,y,z); - common_.t_.forward(&x,&y); - pixmap_.setPixel(x,y,0xff0000ff); - pixmap_.setPixel(x-1,y-1,0xff0000ff); - pixmap_.setPixel(x+1,y+1,0xff0000ff); - pixmap_.setPixel(x-1,y+1,0xff0000ff); - pixmap_.setPixel(x+1,y-1,0xff0000ff); - } - } + using apply_vertex_mode = apply_vertex_mode; + apply_vertex_mode apply(pixmap_, common_.t_, prj_trans); + util::apply_visitor(geometry::vertex_processor(apply), feature.get_geometry()); } } -template void agg_renderer::process(debug_symbolizer const&, +template void agg_renderer::process(debug_symbolizer const&, mapnik::feature_impl &, proj_transform const&); } diff --git a/src/agg/process_dot_symbolizer.cpp b/src/agg/process_dot_symbolizer.cpp index 4b53d3ced..322bfeaf4 100644 --- a/src/agg/process_dot_symbolizer.cpp +++ b/src/agg/process_dot_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,8 +26,9 @@ #include #include #include -#include +#include #include +#include #include #include #include @@ -41,7 +42,47 @@ #include "agg_color_rgba.h" #include "agg_renderer_base.h" -namespace mapnik { +namespace mapnik { namespace detail { + +template +struct render_dot_symbolizer : util::noncopyable +{ + render_dot_symbolizer(double rx, double ry, Rasterizer & ras, Renderer & ren, Common & common, ProjTransform const& prj_trans) + : ras_(ras), + ren_(ren), + common_(common), + prj_trans_(prj_trans), + rx_(rx), + ry_(ry), + el_(0, 0, rx, ry) {} + + template + void operator() (Adapter const& va) + { + double x,y,z = 0; + unsigned cmd = SEG_END; + va.rewind(0); + while ((cmd = va.vertex(&x, &y)) != mapnik::SEG_END) + { + if (cmd == SEG_CLOSE) continue; + prj_trans_.backward(x, y, z); + common_.t_.forward(&x, &y); + el_.init(x, y, rx_, ry_, el_.num_steps()); + ras_.add_path(el_); + agg::render_scanlines(ras_, sl_, ren_); + } + } + Rasterizer & ras_; + Renderer & ren_; + Common & common_; + ProjTransform const& prj_trans_; + double rx_; + double ry_; + agg::ellipse el_; + agg::scanline_u8 sl_; +}; + +} // ns detail template void agg_renderer::process(dot_symbolizer const& sym, @@ -70,7 +111,13 @@ void agg_renderer::process(dot_symbolizer const& sym, double opacity = get(sym, keys::opacity, feature, common_.vars_, 1.0); color const& fill = get(sym, keys::fill, feature, common_.vars_, mapnik::color(128,128,128)); ras_ptr->reset(); - agg::rendering_buffer buf(current_buffer_->raw_data(),current_buffer_->width(),current_buffer_->height(),current_buffer_->width() * 4); + if (gamma_method_ != GAMMA_POWER || gamma_ != 1.0) + { + ras_ptr->gamma(agg::gamma_power()); + gamma_method_ = GAMMA_POWER; + gamma_ = 1.0; + } + agg::rendering_buffer buf(current_buffer_->bytes(),current_buffer_->width(),current_buffer_->height(),current_buffer_->row_size()); using blender_type = agg::comp_op_adaptor_rgba_pre; using pixfmt_comp_type = agg::pixfmt_custom_blend_rgba; using renderer_base = agg::renderer_base; @@ -79,26 +126,14 @@ void agg_renderer::process(dot_symbolizer const& sym, pixf.comp_op(static_cast(get(sym, keys::comp_op, feature, common_.vars_, src_over))); renderer_base renb(pixf); renderer_type ren(renb); - agg::scanline_u8 sl; + ren.color(agg::rgba8_pre(fill.red(), fill.green(), fill.blue(), int(fill.alpha() * opacity))); - agg::ellipse el(0,0,rx,ry); - unsigned num_steps = el.num_steps(); - for (geometry_type const& geom : feature.paths()) { - double x,y,z = 0; - unsigned cmd = 1; - geom.rewind(0); - while ((cmd = geom.vertex(&x, &y)) != mapnik::SEG_END) { - if (cmd == SEG_CLOSE) continue; - prj_trans.backward(x,y,z); - common_.t_.forward(&x,&y); - el.init(x,y,rx,ry,num_steps); - ras_ptr->add_path(el); - agg::render_scanlines(*ras_ptr, sl, ren); - } - } + using render_dot_symbolizer_type = detail::render_dot_symbolizer; + render_dot_symbolizer_type apply(rx, ry, *ras_ptr, ren, common_, prj_trans); + mapnik::util::apply_visitor(geometry::vertex_processor(apply), feature.get_geometry()); } -template void agg_renderer::process(dot_symbolizer const&, +template void agg_renderer::process(dot_symbolizer const&, mapnik::feature_impl &, proj_transform const&); diff --git a/src/agg/process_group_symbolizer.cpp b/src/agg/process_group_symbolizer.cpp index d8b2d3868..836e13533 100644 --- a/src/agg/process_group_symbolizer.cpp +++ b/src/agg/process_group_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -48,9 +49,14 @@ namespace mapnik { * to render it, and the boxes themselves should already be * in the detector from the placement_finder. */ -struct thunk_renderer + +template +struct thunk_renderer; + +template <> +struct thunk_renderer { - using renderer_type = agg_renderer; + using renderer_type = agg_renderer; using buffer_type = renderer_type::buffer_type; using text_renderer_type = agg_text_renderer; @@ -75,7 +81,7 @@ struct thunk_renderer renderer_type, pixfmt_comp_type>; ras_ptr_->reset(); - buf_type render_buffer(buf_->raw_data(), buf_->width(), buf_->height(), buf_->width() * 4); + buf_type render_buffer(buf_->bytes(), buf_->width(), buf_->height(), buf_->row_size()); pixfmt_comp_type pixf(render_buffer); pixf.comp_op(static_cast(thunk.comp_op_)); renderer_base renb(pixf); @@ -96,7 +102,7 @@ struct thunk_renderer using renderer_base = agg::renderer_base; ras_ptr_->reset(); - buf_type render_buffer(buf_->raw_data(), buf_->width(), buf_->height(), buf_->width() * 4); + buf_type render_buffer(buf_->bytes(), buf_->width(), buf_->height(), buf_->row_size()); pixfmt_comp_type pixf(render_buffer); pixf.comp_op(static_cast(thunk.comp_op_)); renderer_base renb(pixf); @@ -116,11 +122,12 @@ struct thunk_renderer offset_, [&] (glyph_positions_ptr glyphs) { - if (glyphs->marker()) + marker_info_ptr mark = glyphs->get_marker(); + if (mark) { ren_.render_marker(glyphs->marker_pos(), - *(glyphs->marker()->marker), - glyphs->marker()->transform, + *mark->marker_, + mark->transform_, thunk.opacity_, thunk.comp_op_); } ren.render(*glyphs); @@ -130,7 +137,7 @@ struct thunk_renderer template void operator()(T const &) const { - // TODO: warning if unimplemented? + throw std::runtime_error("Rendering of this data type is not supported currently by the renderer"); } private: @@ -150,7 +157,7 @@ void agg_renderer::process(group_symbolizer const& sym, sym, feature, common_.vars_, prj_trans, clipping_extent(common_), common_, [&](render_thunk_list const& thunks, pixel_position const& render_offset) { - thunk_renderer ren(*this, ras_ptr, current_buffer_, common_, render_offset); + thunk_renderer ren(*this, ras_ptr, current_buffer_, common_, render_offset); for (render_thunk_ptr const& thunk : thunks) { util::apply_visitor(ren, *thunk); @@ -158,7 +165,7 @@ void agg_renderer::process(group_symbolizer const& sym, }); } -template void agg_renderer::process(group_symbolizer const&, +template void agg_renderer::process(group_symbolizer const&, mapnik::feature_impl &, proj_transform const&); diff --git a/src/agg/process_line_pattern_symbolizer.cpp b/src/agg/process_line_pattern_symbolizer.cpp index 110a52e2e..7cdd16648 100644 --- a/src/agg/process_line_pattern_symbolizer.cpp +++ b/src/agg/process_line_pattern_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,7 +23,7 @@ // mapnik #include #include -#include +#include #include #include #include @@ -31,10 +31,12 @@ #include #include #include +#include #include #include #include #include +#include // agg #include "agg_basics.h" #include "agg_pixfmt_rgba.h" @@ -52,99 +54,208 @@ namespace mapnik { +template +struct agg_renderer_process_visitor_l +{ + agg_renderer_process_visitor_l(renderer_common & common, + buffer_type & pixmap, + buffer_type * current_buffer, + std::unique_ptr const& ras_ptr, + line_pattern_symbolizer const& sym, + mapnik::feature_impl & feature, + proj_transform const& prj_trans) + : common_(common), + pixmap_(pixmap), + current_buffer_(current_buffer), + ras_ptr_(ras_ptr), + sym_(sym), + feature_(feature), + prj_trans_(prj_trans) {} + + void operator() (marker_null const&) {} + + void operator() (marker_svg const& marker) + { + using color = agg::rgba8; + using order = agg::order_rgba; + using blender_type = agg::comp_op_adaptor_rgba_pre; + using pattern_filter_type = agg::pattern_filter_bilinear_rgba8; + using pattern_type = agg::line_image_pattern; + using pixfmt_type = agg::pixfmt_custom_blend_rgba; + using renderer_base = agg::renderer_base; + using renderer_type = agg::renderer_outline_image; + using rasterizer_type = agg::rasterizer_outline_aa; + + value_double opacity = get(sym_, feature_, common_.vars_); + agg::trans_affine image_tr = agg::trans_affine_scaling(common_.scale_factor_); + auto image_transform = get_optional(sym_, keys::image_transform); + if (image_transform) evaluate_transform(image_tr, feature_, common_.vars_, *image_transform); + mapnik::box2d const& bbox_image = marker.get_data()->bounding_box() * image_tr; + image_rgba8 image(bbox_image.width(), bbox_image.height()); + render_pattern(*ras_ptr_, marker, image_tr, 1.0, image); + + value_bool clip = get(sym_, feature_, common_.vars_); + value_double offset = get(sym_, feature_, common_.vars_); + value_double simplify_tolerance = get(sym_, feature_, common_.vars_); + value_double smooth = get(sym_, feature_, common_.vars_); + + agg::rendering_buffer buf(current_buffer_->bytes(),current_buffer_->width(),current_buffer_->height(), current_buffer_->row_size()); + pixfmt_type pixf(buf); + pixf.comp_op(static_cast(get(sym_, feature_, common_.vars_))); + renderer_base ren_base(pixf); + agg::pattern_filter_bilinear_rgba8 filter; + + pattern_source source(image, opacity); + pattern_type pattern (filter,source); + renderer_type ren(ren_base, pattern); + double half_stroke = std::max(marker.width()/2.0,marker.height()/2.0); + int rast_clip_padding = static_cast(std::round(half_stroke)); + ren.clip_box(-rast_clip_padding,-rast_clip_padding,common_.width_+rast_clip_padding,common_.height_+rast_clip_padding); + rasterizer_type ras(ren); + + agg::trans_affine tr; + auto transform = get_optional(sym_, keys::geometry_transform); + if (transform) evaluate_transform(tr, feature_, common_.vars_, *transform, common_.scale_factor_); + + box2d clip_box = clipping_extent(common_); + if (clip) + { + double padding = (double)(common_.query_extent_.width()/pixmap_.width()); + if (half_stroke > 1) + padding *= half_stroke; + if (std::fabs(offset) > 0) + padding *= std::fabs(offset) * 1.2; + padding *= common_.scale_factor_; + clip_box.pad(padding); + } + using vertex_converter_type = vertex_converter; + + vertex_converter_type converter(clip_box,sym_,common_.t_,prj_trans_,tr,feature_,common_.vars_,common_.scale_factor_); + + if (clip) converter.set(); //optional clip (default: true) + converter.set(); //always transform + if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter + if (std::fabs(offset) > 0.0) converter.set(); // parallel offset + converter.set(); // optional affine transform + if (smooth > 0.0) converter.set(); // optional smooth converter + + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = geometry::vertex_processor; + apply_vertex_converter_type apply(converter, ras); + mapnik::util::apply_visitor(vertex_processor_type(apply),feature_.get_geometry()); + } + + void operator() (marker_rgba8 const& marker) + { + using color = agg::rgba8; + using order = agg::order_rgba; + using blender_type = agg::comp_op_adaptor_rgba_pre; + using pattern_filter_type = agg::pattern_filter_bilinear_rgba8; + using pattern_type = agg::line_image_pattern; + using pixfmt_type = agg::pixfmt_custom_blend_rgba; + using renderer_base = agg::renderer_base; + using renderer_type = agg::renderer_outline_image; + using rasterizer_type = agg::rasterizer_outline_aa; + + value_double opacity = get(sym_, feature_, common_.vars_); + mapnik::image_rgba8 const& image = marker.get_data(); + + value_bool clip = get(sym_, feature_, common_.vars_); + value_double offset = get(sym_, feature_, common_.vars_); + value_double simplify_tolerance = get(sym_, feature_, common_.vars_); + value_double smooth = get(sym_, feature_, common_.vars_); + + agg::rendering_buffer buf(current_buffer_->bytes(),current_buffer_->width(), + current_buffer_->height(), current_buffer_->row_size()); + pixfmt_type pixf(buf); + pixf.comp_op(static_cast(get(sym_, feature_, common_.vars_))); + renderer_base ren_base(pixf); + agg::pattern_filter_bilinear_rgba8 filter; + + pattern_source source(image, opacity); + pattern_type pattern (filter,source); + renderer_type ren(ren_base, pattern); + double half_stroke = std::max(marker.width()/2.0,marker.height()/2.0); + int rast_clip_padding = static_cast(std::round(half_stroke)); + ren.clip_box(-rast_clip_padding,-rast_clip_padding,common_.width_+rast_clip_padding,common_.height_+rast_clip_padding); + rasterizer_type ras(ren); + + agg::trans_affine tr; + auto transform = get_optional(sym_, keys::geometry_transform); + if (transform) evaluate_transform(tr, feature_, common_.vars_, *transform, common_.scale_factor_); + + box2d clip_box = clipping_extent(common_); + if (clip) + { + double padding = (double)(common_.query_extent_.width()/pixmap_.width()); + if (half_stroke > 1) + padding *= half_stroke; + if (std::fabs(offset) > 0) + padding *= std::fabs(offset) * 1.2; + padding *= common_.scale_factor_; + clip_box.pad(padding); + } + using vertex_converter_type = vertex_converter; + + vertex_converter_type converter(clip_box,sym_,common_.t_,prj_trans_,tr,feature_,common_.vars_,common_.scale_factor_); + + if (clip) converter.set(); //optional clip (default: true) + converter.set(); //always transform + if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter + if (std::fabs(offset) > 0.0) converter.set(); // parallel offset + converter.set(); // optional affine transform + if (smooth > 0.0) converter.set(); // optional smooth converter + + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = geometry::vertex_processor; + apply_vertex_converter_type apply(converter, ras); + mapnik::util::apply_visitor(vertex_processor_type(apply),feature_.get_geometry()); + } + + private: + renderer_common & common_; + buffer_type & pixmap_; + buffer_type * current_buffer_; + std::unique_ptr const& ras_ptr_; + line_pattern_symbolizer const& sym_; + mapnik::feature_impl & feature_; + proj_transform const& prj_trans_; +}; + template void agg_renderer::process(line_pattern_symbolizer const& sym, mapnik::feature_impl & feature, proj_transform const& prj_trans) { - using color = agg::rgba8; - using order = agg::order_rgba; - using blender_type = agg::comp_op_adaptor_rgba_pre; - using pattern_filter_type = agg::pattern_filter_bilinear_rgba8; - using pattern_type = agg::line_image_pattern; - using pixfmt_type = agg::pixfmt_custom_blend_rgba; - using renderer_base = agg::renderer_base; - using renderer_type = agg::renderer_outline_image; - using rasterizer_type = agg::rasterizer_outline_aa; std::string filename = get(sym, feature, common_.vars_); if (filename.empty()) return; - boost::optional marker_ptr = marker_cache::instance().find(filename, true); - if (!marker_ptr || !(*marker_ptr)) return; - boost::optional pat; - // TODO - re-implement at renderer level like polygon_pattern symbolizer - value_double opacity = get(sym, feature, common_.vars_); - if ((*marker_ptr)->is_bitmap()) + ras_ptr->reset(); + if (gamma_method_ != GAMMA_POWER || gamma_ != 1.0) { - pat = (*marker_ptr)->get_bitmap_data(); - } - else - { - agg::trans_affine image_tr = agg::trans_affine_scaling(common_.scale_factor_); - auto image_transform = get_optional(sym, keys::image_transform); - if (image_transform) evaluate_transform(image_tr, feature, common_.vars_, *image_transform); - pat = render_pattern(*ras_ptr, **marker_ptr, image_tr, 1.0); - } - - if (!pat) return; - - value_bool clip = get(sym, feature, common_.vars_); - value_double offset = get(sym, feature, common_.vars_); - value_double simplify_tolerance = get(sym, feature, common_.vars_); - value_double smooth = get(sym, feature, common_.vars_); - - agg::rendering_buffer buf(current_buffer_->raw_data(),current_buffer_->width(),current_buffer_->height(), current_buffer_->width() * 4); - pixfmt_type pixf(buf); - pixf.comp_op(static_cast(get(sym, feature, common_.vars_))); - renderer_base ren_base(pixf); - agg::pattern_filter_bilinear_rgba8 filter; - - pattern_source source(*(*pat), opacity); - pattern_type pattern (filter,source); - renderer_type ren(ren_base, pattern); - rasterizer_type ras(ren); - - agg::trans_affine tr; - auto transform = get_optional(sym, keys::geometry_transform); - if (transform) evaluate_transform(tr, feature, common_.vars_, *transform, common_.scale_factor_); - - box2d clip_box = clipping_extent(common_); - if (clip) - { - double padding = (double)(common_.query_extent_.width()/pixmap_.width()); - double half_stroke = (*marker_ptr)->width()/2.0; - if (half_stroke > 1) - padding *= half_stroke; - if (std::fabs(offset) > 0) - padding *= std::fabs(offset) * 1.2; - padding *= common_.scale_factor_; - clip_box.pad(padding); - } - - vertex_converter - converter(clip_box,ras,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); - - if (clip) converter.set(); //optional clip (default: true) - converter.set(); //always transform - if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter - if (std::fabs(offset) > 0.0) converter.set(); // parallel offset - converter.set(); // optional affine transform - if (smooth > 0.0) converter.set(); // optional smooth converter - - for (geometry_type & geom : feature.paths()) - { - if (geom.size() > 1) - { - converter.apply(geom); - } + ras_ptr->gamma(agg::gamma_power()); + gamma_method_ = GAMMA_POWER; + gamma_ = 1.0; } + std::shared_ptr marker = marker_cache::instance().find(filename, true); + agg_renderer_process_visitor_l visitor(common_, + pixmap_, + current_buffer_, + ras_ptr, + sym, + feature, + prj_trans); + util::apply_visitor(visitor, *marker); } -template void agg_renderer::process(line_pattern_symbolizer const&, +template void agg_renderer::process(line_pattern_symbolizer const&, mapnik::feature_impl &, proj_transform const&); diff --git a/src/agg/process_line_symbolizer.cpp b/src/agg/process_line_symbolizer.cpp index e35f1000b..e2004e921 100644 --- a/src/agg/process_line_symbolizer.cpp +++ b/src/agg/process_line_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,13 +22,15 @@ // mapnik #include -#include +#include #include #include #include #include #include +#include #include +#include // agg #include "agg_basics.h" #include "agg_rendering_buffer.h" @@ -43,9 +45,6 @@ #include "agg_renderer_outline_aa.h" #include "agg_rasterizer_outline_aa.h" -// boost - - // stl #include #include @@ -109,7 +108,7 @@ void agg_renderer::process(line_symbolizer const& sym, gamma_ = gamma; } - agg::rendering_buffer buf(current_buffer_->raw_data(),current_buffer_->width(),current_buffer_->height(), current_buffer_->width() * 4); + agg::rendering_buffer buf(current_buffer_->bytes(),current_buffer_->width(),current_buffer_->height(), current_buffer_->row_size()); using color_type = agg::rgba8; using order_type = agg::order_rgba; @@ -165,12 +164,11 @@ void agg_renderer::process(line_symbolizer const& sym, rasterizer_type ras(ren); set_join_caps_aa(sym, ras, feature, common_.vars_); - vertex_converter - converter(clip_box,ras,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); + using vertex_converter_type = vertex_converter; + vertex_converter_type converter(clip_box,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform if (std::fabs(offset) > 0.0) converter.set(); // parallel offset @@ -178,22 +176,19 @@ void agg_renderer::process(line_symbolizer const& sym, if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - for (geometry_type & geom : feature.paths()) - { - if (geom.size() > 1) - { - converter.apply(geom); - } - } + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = geometry::vertex_processor; + apply_vertex_converter_type apply(converter, ras); + mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); } else { - vertex_converter - converter(clip_box,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); + using vertex_converter_type = vertex_converter; + vertex_converter_type converter(clip_box, sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform @@ -205,13 +200,10 @@ void agg_renderer::process(line_symbolizer const& sym, converter.set(); converter.set(); //always stroke - for (geometry_type & geom : feature.paths()) - { - if (geom.size() > 1) - { - converter.apply(geom); - } - } + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = geometry::vertex_processor; + apply_vertex_converter_type apply(converter, *ras_ptr); + mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); using renderer_type = agg::renderer_scanline_aa_solid; renderer_type ren(renb); @@ -223,7 +215,7 @@ void agg_renderer::process(line_symbolizer const& sym, } -template void agg_renderer::process(line_symbolizer const&, +template void agg_renderer::process(line_symbolizer const&, mapnik::feature_impl &, proj_transform const&); diff --git a/src/agg/process_markers_symbolizer.cpp b/src/agg/process_markers_symbolizer.cpp index 31555bc6e..ab06ed30c 100644 --- a/src/agg/process_markers_symbolizer.cpp +++ b/src/agg/process_markers_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,7 +21,6 @@ *****************************************************************************/ // mapnik -#include #include #include #include @@ -125,7 +124,7 @@ struct raster_markers_rasterizer_dispatch : public raster_markers_dispatch; using renderer_base = agg::renderer_base; - raster_markers_rasterizer_dispatch(image_data_rgba8 & src, + raster_markers_rasterizer_dispatch(image_rgba8 const& src, agg::trans_affine const& marker_trans, symbolizer_base const& sym, Detector & detector, @@ -148,6 +147,8 @@ struct raster_markers_rasterizer_dispatch : public raster_markers_dispatchsrc_ provided that converts + // the destination pixel type required. render_raster_marker(renb_, ras_, this->src_, marker_tr, opacity, this->scale_factor_, snap_to_pixels_); } @@ -191,7 +192,7 @@ void agg_renderer::process(markers_symbolizer const& sym, gamma_ = gamma; } - buf_type render_buffer(current_buffer_->raw_data(), current_buffer_->width(), current_buffer_->height(), current_buffer_->width() * 4); + buf_type render_buffer(current_buffer_->bytes(), current_buffer_->width(), current_buffer_->height(), current_buffer_->row_size()); box2d clip_box = clipping_extent(common_); auto renderer_context = std::tie(render_buffer,*ras_ptr,pixmap_); @@ -203,7 +204,7 @@ void agg_renderer::process(markers_symbolizer const& sym, sym, feature, prj_trans, common_, clip_box, renderer_context); } -template void agg_renderer::process(markers_symbolizer const&, +template void agg_renderer::process(markers_symbolizer const&, mapnik::feature_impl &, proj_transform const&); } diff --git a/src/agg/process_point_symbolizer.cpp b/src/agg/process_point_symbolizer.cpp index 950e9cb58..8dc40f1af 100644 --- a/src/agg/process_point_symbolizer.cpp +++ b/src/agg/process_point_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +60,7 @@ void agg_renderer::process(point_symbolizer const& sym, }); } -template void agg_renderer::process(point_symbolizer const&, +template void agg_renderer::process(point_symbolizer const&, mapnik::feature_impl &, proj_transform const&); diff --git a/src/agg/process_polygon_pattern_symbolizer.cpp b/src/agg/process_polygon_pattern_symbolizer.cpp index abcbdf7bd..386adee16 100644 --- a/src/agg/process_polygon_pattern_symbolizer.cpp +++ b/src/agg/process_polygon_pattern_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,13 +23,13 @@ // mapnik #include #include -#include #include #include #include #include #include #include +#include #include #include #include @@ -37,7 +37,8 @@ #include #include #include - +#include +#include // agg #include "agg_basics.h" #include "agg_rendering_buffer.h" @@ -54,134 +55,264 @@ namespace mapnik { +template +struct agg_renderer_process_visitor_p +{ + agg_renderer_process_visitor_p(renderer_common & common, + buffer_type * current_buffer, + std::unique_ptr const& ras_ptr, + gamma_method_enum & gamma_method, + double & gamma, + polygon_pattern_symbolizer const& sym, + mapnik::feature_impl & feature, + proj_transform const& prj_trans) + : common_(common), + current_buffer_(current_buffer), + ras_ptr_(ras_ptr), + gamma_method_(gamma_method), + gamma_(gamma), + sym_(sym), + feature_(feature), + prj_trans_(prj_trans) {} + + void operator() (marker_null const&) {} + + void operator() (marker_svg const& marker) + { + agg::trans_affine image_tr = agg::trans_affine_scaling(common_.scale_factor_); + auto image_transform = get_optional(sym_, keys::image_transform); + if (image_transform) evaluate_transform(image_tr, feature_, common_.vars_, *image_transform); + mapnik::box2d const& bbox_image = marker.get_data()->bounding_box() * image_tr; + mapnik::image_rgba8 image(bbox_image.width(), bbox_image.height()); + render_pattern(*ras_ptr_, marker, image_tr, 1.0, image); + + agg::rendering_buffer buf(current_buffer_->bytes(), current_buffer_->width(), + current_buffer_->height(), current_buffer_->row_size()); + ras_ptr_->reset(); + value_double gamma = get(sym_, feature_, common_.vars_); + gamma_method_enum gamma_method = get(sym_, feature_, common_.vars_); + if (gamma != gamma_ || gamma_method != gamma_method_) + { + set_gamma_method(ras_ptr_, gamma, gamma_method); + gamma_method_ = gamma_method; + gamma_ = gamma; + } + + value_bool clip = get(sym_, feature_, common_.vars_); + value_double opacity = get(sym_, feature_, common_.vars_); + value_double simplify_tolerance = get(sym_, feature_, common_.vars_); + value_double smooth = get(sym_, feature_, common_.vars_); + + box2d clip_box = clipping_extent(common_); + + using color = agg::rgba8; + using order = agg::order_rgba; + using blender_type = agg::comp_op_adaptor_rgba_pre; + using pixfmt_type = agg::pixfmt_custom_blend_rgba; + + using wrap_x_type = agg::wrap_mode_repeat; + using wrap_y_type = agg::wrap_mode_repeat; + using img_source_type = agg::image_accessor_wrap; + + using span_gen_type = agg::span_pattern_rgba; + using ren_base = agg::renderer_base; + + using renderer_type = agg::renderer_scanline_aa_alpha, + span_gen_type>; + + pixfmt_type pixf(buf); + pixf.comp_op(static_cast(get(sym_, feature_, common_.vars_))); + ren_base renb(pixf); + + unsigned w = image.width(); + unsigned h = image.height(); + agg::rendering_buffer pattern_rbuf((agg::int8u*)image.bytes(),w,h,w*4); + agg::pixfmt_rgba32_pre pixf_pattern(pattern_rbuf); + img_source_type img_src(pixf_pattern); + + pattern_alignment_enum alignment = get(sym_, feature_, common_.vars_); + unsigned offset_x=0; + unsigned offset_y=0; + + if (alignment == LOCAL_ALIGNMENT) + { + double x0 = 0; + double y0 = 0; + using apply_local_alignment = detail::apply_local_alignment; + apply_local_alignment apply(common_.t_,prj_trans_, clip_box, x0, y0); + util::apply_visitor(geometry::vertex_processor(apply), feature_.get_geometry()); + offset_x = unsigned(current_buffer_->width() - x0); + offset_y = unsigned(current_buffer_->height() - y0); + } + + span_gen_type sg(img_src, offset_x, offset_y); + + agg::span_allocator sa; + renderer_type rp(renb,sa, sg, unsigned(opacity * 255)); + + agg::trans_affine tr; + auto transform = get_optional(sym_, keys::geometry_transform); + if (transform) evaluate_transform(tr, feature_, common_.vars_, *transform, common_.scale_factor_); + using vertex_converter_type = vertex_converter; + + vertex_converter_type converter(clip_box,sym_,common_.t_,prj_trans_,tr,feature_,common_.vars_,common_.scale_factor_); + + + if (prj_trans_.equal() && clip) converter.set(); //optional clip (default: true) + converter.set(); //always transform + converter.set(); // optional affine transform + if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter + if (smooth > 0.0) converter.set(); // optional smooth converter + + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = geometry::vertex_processor; + apply_vertex_converter_type apply(converter, *ras_ptr_); + mapnik::util::apply_visitor(vertex_processor_type(apply),feature_.get_geometry()); + agg::scanline_u8 sl; + ras_ptr_->filling_rule(agg::fill_even_odd); + agg::render_scanlines(*ras_ptr_, sl, rp); + } + + void operator() (marker_rgba8 const& marker) + { + using color = agg::rgba8; + using order = agg::order_rgba; + using blender_type = agg::comp_op_adaptor_rgba_pre; + using pixfmt_type = agg::pixfmt_custom_blend_rgba; + + using wrap_x_type = agg::wrap_mode_repeat; + using wrap_y_type = agg::wrap_mode_repeat; + using img_source_type = agg::image_accessor_wrap; + + using span_gen_type = agg::span_pattern_rgba; + using ren_base = agg::renderer_base; + + using renderer_type = agg::renderer_scanline_aa_alpha, + span_gen_type>; + mapnik::image_rgba8 const& image = marker.get_data(); + + + agg::rendering_buffer buf(current_buffer_->bytes(), current_buffer_->width(), + current_buffer_->height(), current_buffer_->row_size()); + ras_ptr_->reset(); + value_double gamma = get(sym_, feature_, common_.vars_); + gamma_method_enum gamma_method = get(sym_, feature_, common_.vars_); + if (gamma != gamma_ || gamma_method != gamma_method_) + { + set_gamma_method(ras_ptr_, gamma, gamma_method); + gamma_method_ = gamma_method; + gamma_ = gamma; + } + + value_bool clip = get(sym_, feature_, common_.vars_); + value_double opacity = get(sym_, feature_, common_.vars_); + value_double simplify_tolerance = get(sym_, feature_, common_.vars_); + value_double smooth = get(sym_, feature_, common_.vars_); + + box2d clip_box = clipping_extent(common_); + + + pixfmt_type pixf(buf); + pixf.comp_op(static_cast(get(sym_, feature_, common_.vars_))); + ren_base renb(pixf); + + unsigned w = image.width(); + unsigned h = image.height(); + agg::rendering_buffer pattern_rbuf((agg::int8u*)image.bytes(),w,h,w*4); + agg::pixfmt_rgba32_pre pixf_pattern(pattern_rbuf); + img_source_type img_src(pixf_pattern); + + pattern_alignment_enum alignment = get(sym_, feature_, common_.vars_); + unsigned offset_x=0; + unsigned offset_y=0; + + if (alignment == LOCAL_ALIGNMENT) + { + double x0 = 0; + double y0 = 0; + using apply_local_alignment = detail::apply_local_alignment; + apply_local_alignment apply(common_.t_,prj_trans_, clip_box, x0, y0); + util::apply_visitor(geometry::vertex_processor(apply), feature_.get_geometry()); + + offset_x = unsigned(current_buffer_->width() - x0); + offset_y = unsigned(current_buffer_->height() - y0); + } + + span_gen_type sg(img_src, offset_x, offset_y); + + agg::span_allocator sa; + renderer_type rp(renb,sa, sg, unsigned(opacity * 255)); + + agg::trans_affine tr; + auto transform = get_optional(sym_, keys::geometry_transform); + if (transform) evaluate_transform(tr, feature_, common_.vars_, *transform, common_.scale_factor_); + using vertex_converter_type = vertex_converter; + + vertex_converter_type converter(clip_box, sym_,common_.t_,prj_trans_,tr,feature_,common_.vars_,common_.scale_factor_); + + if (prj_trans_.equal() && clip) converter.set(); //optional clip (default: true) + converter.set(); //always transform + converter.set(); // optional affine transform + if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter + if (smooth > 0.0) converter.set(); // optional smooth converter + + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = geometry::vertex_processor; + apply_vertex_converter_type apply(converter, *ras_ptr_); + mapnik::util::apply_visitor(vertex_processor_type(apply),feature_.get_geometry()); + agg::scanline_u8 sl; + ras_ptr_->filling_rule(agg::fill_even_odd); + agg::render_scanlines(*ras_ptr_, sl, rp); + } + +private: + renderer_common & common_; + buffer_type * current_buffer_; + std::unique_ptr const& ras_ptr_; + gamma_method_enum & gamma_method_; + double & gamma_; + polygon_pattern_symbolizer const& sym_; + mapnik::feature_impl & feature_; + proj_transform const& prj_trans_; +}; + template void agg_renderer::process(polygon_pattern_symbolizer const& sym, - mapnik::feature_impl & feature, - proj_transform const& prj_trans) + mapnik::feature_impl & feature, + proj_transform const& prj_trans) { std::string filename = get(sym, feature, common_.vars_); if (filename.empty()) return; - boost::optional marker_ptr = marker_cache::instance().find(filename, true); - if (!marker_ptr || !(*marker_ptr)) return; - - boost::optional pat; - - if ((*marker_ptr)->is_bitmap()) - { - pat = (*marker_ptr)->get_bitmap_data(); - } - else - { - agg::trans_affine image_tr = agg::trans_affine_scaling(common_.scale_factor_); - auto image_transform = get_optional(sym, keys::image_transform); - if (image_transform) evaluate_transform(image_tr, feature, common_.vars_, *image_transform); - pat = render_pattern(*ras_ptr, **marker_ptr, image_tr, 1.0); - } - - if (!pat) return; - - using clipped_geometry_type = agg::conv_clip_polygon; - using path_type = transform_path_adapter; - - agg::rendering_buffer buf(current_buffer_->raw_data(), current_buffer_->width(), - current_buffer_->height(), current_buffer_->width() * 4); - ras_ptr->reset(); - value_double gamma = get(sym, feature, common_.vars_); - gamma_method_enum gamma_method = get(sym, feature, common_.vars_); - if (gamma != gamma_ || gamma_method != gamma_method_) - { - set_gamma_method(ras_ptr, gamma, gamma_method); - gamma_method_ = gamma_method; - gamma_ = gamma; - } - - value_bool clip = get(sym, feature, common_.vars_); - value_double opacity = get(sym, feature, common_.vars_); - value_double simplify_tolerance = get(sym, feature, common_.vars_); - value_double smooth = get(sym, feature, common_.vars_); - - box2d clip_box = clipping_extent(common_); - - using color = agg::rgba8; - using order = agg::order_rgba; - using blender_type = agg::comp_op_adaptor_rgba_pre; - using pixfmt_type = agg::pixfmt_custom_blend_rgba; - - using wrap_x_type = agg::wrap_mode_repeat; - using wrap_y_type = agg::wrap_mode_repeat; - using img_source_type = agg::image_accessor_wrap; - - using span_gen_type = agg::span_pattern_rgba; - using ren_base = agg::renderer_base; - - using renderer_type = agg::renderer_scanline_aa_alpha, - span_gen_type>; - - pixfmt_type pixf(buf); - pixf.comp_op(static_cast(get(sym, feature, common_.vars_))); - ren_base renb(pixf); - - unsigned w=(*pat)->width(); - unsigned h=(*pat)->height(); - agg::rendering_buffer pattern_rbuf((agg::int8u*)(*pat)->getBytes(),w,h,w*4); - agg::pixfmt_rgba32_pre pixf_pattern(pattern_rbuf); - img_source_type img_src(pixf_pattern); - - pattern_alignment_enum alignment = get(sym, feature, common_.vars_); - unsigned offset_x=0; - unsigned offset_y=0; - - if (alignment == LOCAL_ALIGNMENT) - { - double x0 = 0; - double y0 = 0; - if (feature.num_geometries() > 0) - { - clipped_geometry_type clipped(feature.get_geometry(0)); - clipped.clip_box(clip_box.minx(),clip_box.miny(),clip_box.maxx(),clip_box.maxy()); - path_type path(common_.t_,clipped,prj_trans); - path.vertex(&x0,&y0); - } - offset_x = unsigned(current_buffer_->width() - x0); - offset_y = unsigned(current_buffer_->height() - y0); - } - - span_gen_type sg(img_src, offset_x, offset_y); - - agg::span_allocator sa; - renderer_type rp(renb,sa, sg, unsigned(opacity * 255)); - - agg::trans_affine tr; - auto transform = get_optional(sym, keys::geometry_transform); - if (transform) evaluate_transform(tr, feature, common_.vars_, *transform, common_.scale_factor_); - - vertex_converter - converter(clip_box,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); - - if (prj_trans.equal() && clip) converter.set(); //optional clip (default: true) - converter.set(); //always transform - converter.set(); // optional affine transform - if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter - if (smooth > 0.0) converter.set(); // optional smooth converter - - for ( geometry_type & geom : feature.paths()) - { - if (geom.size() > 2) - { - converter.apply(geom); - } - } - agg::scanline_u8 sl; - ras_ptr->filling_rule(agg::fill_even_odd); - agg::render_scanlines(*ras_ptr, sl, rp); -} - - -template void agg_renderer::process(polygon_pattern_symbolizer const&, - mapnik::feature_impl &, - proj_transform const&); + std::shared_ptr marker = marker_cache::instance().find(filename, true); + agg_renderer_process_visitor_p visitor(common_, + current_buffer_, + ras_ptr, + gamma_method_, + gamma_, + sym, + feature, + prj_trans); + util::apply_visitor(visitor, *marker); + +} + + +template void agg_renderer::process(polygon_pattern_symbolizer const&, + mapnik::feature_impl &, + proj_transform const&); } diff --git a/src/agg/process_polygon_symbolizer.cpp b/src/agg/process_polygon_symbolizer.cpp index d02ead68c..9af6d4ac5 100644 --- a/src/agg/process_polygon_symbolizer.cpp +++ b/src/agg/process_polygon_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,7 +26,6 @@ // mapnik #include #include -#include #include #include #include @@ -49,7 +48,7 @@ void agg_renderer::process(polygon_symbolizer const& sym, mapnik::feature_impl & feature, proj_transform const& prj_trans) { - using vertex_converter_type = vertex_converter; + using vertex_converter_type = vertex_converter; ras_ptr->reset(); double gamma = get(sym, keys::gamma, feature, common_.vars_, 1.0); @@ -62,7 +61,7 @@ void agg_renderer::process(polygon_symbolizer const& sym, } box2d clip_box = clipping_extent(common_); - agg::rendering_buffer buf(current_buffer_->raw_data(),current_buffer_->width(),current_buffer_->height(), current_buffer_->width() * 4); + agg::rendering_buffer buf(current_buffer_->bytes(),current_buffer_->width(),current_buffer_->height(), current_buffer_->row_size()); render_polygon_symbolizer( sym, feature, prj_trans, common_, clip_box, *ras_ptr, @@ -88,7 +87,7 @@ void agg_renderer::process(polygon_symbolizer const& sym, }); } -template void agg_renderer::process(polygon_symbolizer const&, +template void agg_renderer::process(polygon_symbolizer const&, mapnik::feature_impl &, proj_transform const&); diff --git a/src/agg/process_raster_symbolizer.cpp b/src/agg/process_raster_symbolizer.cpp index 4af75bbd6..0105e9bc3 100644 --- a/src/agg/process_raster_symbolizer.cpp +++ b/src/agg/process_raster_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,11 +25,10 @@ #include #include #include -#include #include #include #include -#include +#include #include #include #include @@ -52,15 +51,15 @@ void agg_renderer::process(raster_symbolizer const& sym, { render_raster_symbolizer( sym, feature, prj_trans, common_, - [&](image_data_rgba8 & target, composite_mode_e comp_op, double opacity, + [&](image_rgba8 const & target, composite_mode_e comp_op, double opacity, int start_x, int start_y) { - composite(current_buffer_->data(), target, - comp_op, opacity, start_x, start_y, false); + composite(*current_buffer_, target, + comp_op, opacity, start_x, start_y); } ); } -template void agg_renderer::process(raster_symbolizer const&, +template void agg_renderer::process(raster_symbolizer const&, mapnik::feature_impl &, proj_transform const&); diff --git a/src/agg/process_shield_symbolizer.cpp b/src/agg/process_shield_symbolizer.cpp index cd039d9b7..e8d1cc5c5 100644 --- a/src/agg/process_shield_symbolizer.cpp +++ b/src/agg/process_shield_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,7 +23,6 @@ // mapnik #include #include -#include #include #include #include @@ -63,17 +62,20 @@ void agg_renderer::process(shield_symbolizer const& sym, placements_list const& placements = helper.get(); for (glyph_positions_ptr glyphs : placements) { - if (glyphs->marker()) + marker_info_ptr mark = glyphs->get_marker(); + if (mark) + { render_marker(glyphs->marker_pos(), - *(glyphs->marker()->marker), - glyphs->marker()->transform, + *mark->marker_, + mark->transform_, opacity, comp_op); + } ren.render(*glyphs); } } -template void agg_renderer::process(shield_symbolizer const&, +template void agg_renderer::process(shield_symbolizer const&, mapnik::feature_impl &, proj_transform const&); diff --git a/src/agg/process_text_symbolizer.cpp b/src/agg/process_text_symbolizer.cpp index b7ed299d4..c30566d61 100644 --- a/src/agg/process_text_symbolizer.cpp +++ b/src/agg/process_text_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,7 +23,7 @@ // mapnik #include #include -#include +#include #include #include #include @@ -58,14 +58,12 @@ void agg_renderer::process(text_symbolizer const& sym, common_.scale_factor_, common_.font_manager_.get_stroker()); - { // halo transform - agg::trans_affine halo_transform; - auto transform = get_optional(sym, keys::halo_transform); - if (transform) - { - evaluate_transform(halo_transform, feature, common_.vars_, *transform); - ren.set_halo_transform(halo_transform); - } + auto halo_transform = get_optional(sym, keys::halo_transform); + if (halo_transform) + { + agg::trans_affine halo_affine_transform; + evaluate_transform(halo_affine_transform, feature, common_.vars_, *halo_transform); + ren.set_halo_transform(halo_affine_transform); } placements_list const& placements = helper.get(); @@ -75,7 +73,7 @@ void agg_renderer::process(text_symbolizer const& sym, } } -template void agg_renderer::process(text_symbolizer const&, +template void agg_renderer::process(text_symbolizer const&, mapnik::feature_impl &, proj_transform const&); diff --git a/src/box2d.cpp b/src/box2d.cpp index a812042f0..a39857d24 100644 --- a/src/box2d.cpp +++ b/src/box2d.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,7 +22,7 @@ // mapnik #include -#include +#include // stl #include @@ -33,6 +33,8 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -44,10 +46,10 @@ BOOST_FUSION_ADAPT_TPL_ADT( (T), (mapnik::box2d)(T), - (T, T, obj.minx(), obj.set_minx(val)) - (T, T, obj.miny(), obj.set_miny(val)) - (T, T, obj.maxx(), obj.set_maxx(val)) - (T, T, obj.maxy(), obj.set_maxy(val))) + (T, T, obj.minx(), obj.set_minx(mapnik::safe_cast(val))) + (T, T, obj.miny(), obj.set_miny(mapnik::safe_cast(val))) + (T, T, obj.maxx(), obj.set_maxx(mapnik::safe_cast(val))) + (T, T, obj.maxy(), obj.set_maxy(mapnik::safe_cast(val)))) namespace mapnik { diff --git a/src/build.py b/src/build.py index dd2ee353d..520a34710 100644 --- a/src/build.py +++ b/src/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -113,6 +113,9 @@ if env['RUNTIME_LINK'] != 'static': lib_env['LIBS'].append('z') +if env['PLATFORM'] == 'FreeBSD': + lib_env['LIBS'].append('pthread') + if env['PLATFORM'] == 'Darwin': mapnik_libname = env.subst(env['MAPNIK_LIB_NAME']) if env['FULL_LIB_PATH']: @@ -132,7 +135,8 @@ else: # unix, non-macos else: mapnik_lib_link_flag += ' -Wl,-h,%s' % mapnik_libname else: # Linux and others - lib_env['LIBS'].append('dl') + if env['PLATFORM'] != 'FreeBSD': + lib_env['LIBS'].append('dl') mapnik_lib_link_flag += ' -Wl,-rpath-link,.' if env['ENABLE_SONAME']: mapnik_lib_link_flag += ' -Wl,-soname,%s' % mapnik_libname @@ -152,12 +156,14 @@ source = Split( miniz_png.cpp color.cpp conversions.cpp + image_copy.cpp image_compositing.cpp image_scaling.cpp box2d.cpp datasource_cache.cpp datasource_cache_static.cpp debug.cpp + geometry_reprojection.cpp expression_node.cpp expression_string.cpp expression.cpp @@ -170,17 +176,26 @@ source = Split( font_set.cpp function_call.cpp gradient.cpp - graphics.cpp parse_path.cpp image_reader.cpp + cairo_io.cpp + image.cpp + image_view.cpp + image_view_any.cpp + image_any.cpp + image_options.cpp image_util.cpp + image_util_jpeg.cpp + image_util_png.cpp + image_util_tiff.cpp + image_util_webp.cpp layer.cpp map.cpp load_map.cpp - memory.cpp palette.cpp marker_helpers.cpp transform_expression_grammar.cpp + geometry_envelope.cpp plugin.cpp rule.cpp save_map.cpp @@ -238,6 +253,7 @@ source = Split( renderer_common.cpp renderer_common/render_pattern.cpp renderer_common/process_group_symbolizer.cpp + math.cpp """ ) @@ -246,7 +262,7 @@ if env['PLUGIN_LINKING'] == 'static': lib_env.AppendUnique(CPPPATH='../plugins/') for plugin in env['REQUESTED_PLUGINS']: details = env['PLUGINS'][plugin] - if details['lib'] in env['LIBS'] or not details['lib']: + if not details['lib'] or details['lib'] in env['LIBS']: plugin_env = SConscript('../plugins/input/%s/build.py' % plugin) if not plugin_env: print("Notice: no 'plugin_env' variable found for plugin: '%s'" % plugin) @@ -324,12 +340,6 @@ source += Split( """ ) -# clipper -source += Split( - """ - ../deps/clipper/src/clipper.cpp - """) - if env['RUNTIME_LINK'] == "static": source += glob.glob('../deps/agg/src/' + '*.cpp') diff --git a/src/cairo/cairo_context.cpp b/src/cairo/cairo_context.cpp index 8f2c60a61..1a20e90f0 100644 --- a/src/cairo/cairo_context.cpp +++ b/src/cairo/cairo_context.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -230,7 +230,7 @@ void cairo_context::set_dash(dash_array const& dashes, double scale_factor) std::valarray d(dashes.size() * 2); dash_array::const_iterator itr = dashes.begin(); dash_array::const_iterator end = dashes.end(); - int index = 0; + std::size_t index = 0; for (; itr != end; ++itr) { @@ -337,7 +337,7 @@ void cairo_context::set_gradient(cairo_gradient const& pattern, const box2dhalo_fill, glyph.format->halo_opacity); @@ -486,9 +486,9 @@ void cairo_context::add_text(glyph_positions const& pos, matrix.y0 = 0; set_font_matrix(matrix); set_font_face(manager, glyph.face); - pixel_position pos = glyph_pos.pos + glyph.offset.rotate(glyph_pos.rot); + pixel_position new_pos = glyph_pos.pos + glyph.offset.rotate(glyph_pos.rot); set_color(glyph.format->fill, glyph.format->text_opacity); - show_glyph(glyph.glyph_index, pixel_position(sx + pos.x, sy - pos.y)); + show_glyph(glyph.glyph_index, pixel_position(sx + new_pos.x, sy - new_pos.y)); } } diff --git a/src/cairo/cairo_render_vector.cpp b/src/cairo/cairo_render_vector.cpp index cfe86d6a4..160002dd2 100644 --- a/src/cairo/cairo_render_vector.cpp +++ b/src/cairo/cairo_render_vector.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/cairo/cairo_renderer.cpp b/src/cairo/cairo_renderer.cpp index 7f20f2b28..17723071c 100644 --- a/src/cairo/cairo_renderer.cpp +++ b/src/cairo/cairo_renderer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -99,6 +99,42 @@ cairo_renderer::cairo_renderer(Map const& m, template cairo_renderer::~cairo_renderer() {} +struct setup_marker_visitor +{ + setup_marker_visitor(cairo_context & context, renderer_common const& common) + : context_(context), common_(common) {} + + void operator() (marker_null const &) {} + void operator() (marker_svg const &) {} + + void operator() (marker_rgba8 const& marker) + { + mapnik::image_rgba8 const& bg_image = marker.get_data(); + std::size_t w = bg_image.width(); + std::size_t h = bg_image.height(); + if ( w > 0 && h > 0) + { + // repeat background-image both vertically and horizontally + std::size_t x_steps = std::size_t(std::ceil(common_.width_/double(w))); + std::size_t y_steps = std::size_t(std::ceil(common_.height_/double(h))); + for (std::size_t x=0;x void cairo_renderer::setup(Map const& map) { @@ -113,29 +149,8 @@ void cairo_renderer::setup(Map const& map) if (image_filename) { // NOTE: marker_cache returns premultiplied image, if needed - boost::optional bg_marker = mapnik::marker_cache::instance().find(*image_filename,true); - if (bg_marker && (*bg_marker)->is_bitmap()) - { - mapnik::image_ptr bg_image = *(*bg_marker)->get_bitmap_data(); - int w = bg_image->width(); - int h = bg_image->height(); - if ( w > 0 && h > 0) - { - // repeat background-image both vertically and horizontally - unsigned x_steps = unsigned(std::ceil(common_.width_/double(w))); - unsigned y_steps = unsigned(std::ceil(common_.height_/double(h))); - for (unsigned x=0;x bg_marker = mapnik::marker_cache::instance().find(*image_filename,true); + util::apply_visitor(setup_marker_visitor(context_, common_), *bg_marker); } MAPNIK_LOG_DEBUG(cairo_renderer) << "cairo_renderer: Scale=" << map.scale(); } @@ -176,17 +191,79 @@ void cairo_renderer::end_layer_processing(layer const&) } template -void cairo_renderer::start_style_processing(feature_type_style const& st) +void cairo_renderer::start_style_processing(feature_type_style const&) { MAPNIK_LOG_DEBUG(cairo_renderer) << "cairo_renderer:start style processing"; } template -void cairo_renderer::end_style_processing(feature_type_style const& st) +void cairo_renderer::end_style_processing(feature_type_style const&) { MAPNIK_LOG_DEBUG(cairo_renderer) << "cairo_renderer:end style processing"; } +struct cairo_render_marker_visitor +{ + cairo_render_marker_visitor(cairo_context & context, + renderer_common const& common, + pixel_position const& pos, + agg::trans_affine const& tr, + double opacity, + bool recenter) + : context_(context), + common_(common), + pos_(pos), + tr_(tr), + opacity_(opacity), + recenter_(recenter) {} + + void operator() (marker_null const&) {} + + void operator() (marker_svg const& marker) + { + mapnik::svg_path_ptr vmarker = marker.get_data(); + if (vmarker) + { + box2d bbox = vmarker->bounding_box(); + agg::trans_affine marker_tr = tr_; + if (recenter_) + { + coord c = bbox.center(); + marker_tr = agg::trans_affine_translation(-c.x,-c.y); + marker_tr *= tr_; + } + marker_tr *= agg::trans_affine_scaling(common_.scale_factor_); + agg::pod_bvector const & attributes = vmarker->attributes(); + svg::vertex_stl_adapter stl_storage(vmarker->source()); + svg::svg_path_adapter svg_path(stl_storage); + marker_tr.translate(pos_.x, pos_.y); + render_vector_marker(context_, svg_path, attributes, bbox, marker_tr, opacity_); + } + } + + void operator() (marker_rgba8 const& marker) + { + double width = marker.get_data().width(); + double height = marker.get_data().height(); + double cx = 0.5 * width; + double cy = 0.5 * height; + agg::trans_affine marker_tr; + marker_tr *= agg::trans_affine_translation(-cx,-cy); + marker_tr *= tr_; + marker_tr *= agg::trans_affine_scaling(common_.scale_factor_); + marker_tr *= agg::trans_affine_translation(pos_.x,pos_.y); + context_.add_image(marker_tr, marker.get_data(), opacity_); + } + + private: + cairo_context & context_; + renderer_common const& common_; + pixel_position const& pos_; + agg::trans_affine const& tr_; + double opacity_; + bool recenter_; +}; + template void cairo_renderer::render_marker(pixel_position const& pos, marker const& marker, @@ -196,40 +273,13 @@ void cairo_renderer::render_marker(pixel_position const& pos, { cairo_save_restore guard(context_); - if (marker.is_vector()) - { - mapnik::svg_path_ptr vmarker = *marker.get_vector_data(); - if (vmarker) - { - box2d bbox = vmarker->bounding_box(); - agg::trans_affine marker_tr = tr; - if (recenter) - { - coord c = bbox.center(); - marker_tr = agg::trans_affine_translation(-c.x,-c.y); - marker_tr *= tr; - } - marker_tr *= agg::trans_affine_scaling(common_.scale_factor_); - agg::pod_bvector const & attributes = vmarker->attributes(); - svg::vertex_stl_adapter stl_storage(vmarker->source()); - svg::svg_path_adapter svg_path(stl_storage); - marker_tr.translate(pos.x, pos.y); - render_vector_marker(context_, svg_path, attributes, bbox, marker_tr, opacity); - } - } - else if (marker.is_bitmap()) - { - double width = (*marker.get_bitmap_data())->width(); - double height = (*marker.get_bitmap_data())->height(); - double cx = 0.5 * width; - double cy = 0.5 * height; - agg::trans_affine marker_tr; - marker_tr *= agg::trans_affine_translation(-cx,-cy); - marker_tr *= tr; - marker_tr *= agg::trans_affine_scaling(common_.scale_factor_); - marker_tr *= agg::trans_affine_translation(pos.x,pos.y); - context_.add_image(marker_tr, **marker.get_bitmap_data(), opacity); - } + cairo_render_marker_visitor visitor(context_, + common_, + pos, + tr, + opacity, + recenter); + util::apply_visitor(visitor, marker); } template class cairo_renderer; diff --git a/src/cairo/process_building_symbolizer.cpp b/src/cairo/process_building_symbolizer.cpp index 060adb060..544414374 100644 --- a/src/cairo/process_building_symbolizer.cpp +++ b/src/cairo/process_building_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -43,7 +43,7 @@ void cairo_renderer::process(building_symbolizer const& sym, mapnik::feature_impl & feature, proj_transform const& prj_trans) { - using path_type = transform_path_adapter; + using transform_path_type = transform_path_adapter; cairo_save_restore guard(context_); composite_mode_e comp_op = get(sym, feature, common_.vars_); mapnik::color fill = get(sym, feature, common_.vars_); @@ -54,23 +54,29 @@ void cairo_renderer::process(building_symbolizer const& sym, render_building_symbolizer( feature, height, - [&](geometry_type &faces) { - path_type faces_path(common_.t_, faces, prj_trans); + [&](path_type const& faces) + { + vertex_adapter va(faces); + transform_path_type faces_path(common_.t_, va, prj_trans); context_.set_color(fill.red() * 0.8 / 255.0, fill.green() * 0.8 / 255.0, fill.blue() * 0.8 / 255.0, fill.alpha() * opacity / 255.0); context_.add_path(faces_path); context_.fill(); }, - [&](geometry_type &frame) { - path_type path(common_.t_, frame, prj_trans); + [&](path_type const& frame) + { + vertex_adapter va(frame); + transform_path_type path(common_.t_, va, prj_trans); context_.set_color(fill.red() * 0.8 / 255.0, fill.green() * 0.8/255.0, fill.blue() * 0.8 / 255.0, fill.alpha() * opacity / 255.0); context_.set_line_width(common_.scale_factor_); context_.add_path(path); context_.stroke(); }, - [&](geometry_type &roof) { - path_type roof_path(common_.t_, roof, prj_trans); + [&](path_type const& roof) + { + vertex_adapter va(roof); + transform_path_type roof_path(common_.t_, va, prj_trans); context_.set_color(fill, opacity); context_.add_path(roof_path); context_.fill(); diff --git a/src/cairo/process_debug_symbolizer.cpp b/src/cairo/process_debug_symbolizer.cpp index e3a55b96c..c60794b78 100644 --- a/src/cairo/process_debug_symbolizer.cpp +++ b/src/cairo/process_debug_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ // mapnik #include #include +#include #include #include #include @@ -50,6 +51,40 @@ inline void render_debug_box(cairo_context &context, box2d const& b) context.stroke(); } +template +struct apply_vertex_mode +{ + apply_vertex_mode(Context & context, view_transform const& t, proj_transform const& prj_trans) + : context_(context), + t_(t), + prj_trans_(prj_trans) {} + + template + void operator() (Adapter const& va) const + { + double x; + double y; + double z = 0; + va.rewind(0); + unsigned cmd = SEG_END; + while ((cmd = va.vertex(&x, &y)) != mapnik::SEG_END) + { + if (cmd == SEG_CLOSE) continue; + prj_trans_.backward(x,y,z); + t_.forward(&x,&y); + context_.move_to(std::floor(x) - 0.5, std::floor(y) + 0.5); + context_.line_to(std::floor(x) + 1.5, std::floor(y) + 0.5); + context_.move_to(std::floor(x) + 0.5, std::floor(y) - 0.5); + context_.line_to(std::floor(x) + 0.5, std::floor(y) + 1.5); + context_.stroke(); + } + } + + Context & context_; + view_transform const& t_; + proj_transform const& prj_trans_; +}; + } // anonymous namespace template @@ -71,34 +106,16 @@ void cairo_renderer::process(debug_symbolizer const& sym, if (mode == DEBUG_SYM_MODE_COLLISION) { - typename detector_type::query_iterator itr = common_.detector_->begin(); - typename detector_type::query_iterator end = common_.detector_->end(); - for ( ;itr!=end; ++itr) + for (auto & n : *common_.detector_) { - render_debug_box(context_, itr->box); + render_debug_box(context_, n.get().box); } } else if (mode == DEBUG_SYM_MODE_VERTEX) { - for (auto const& geom : feature.paths()) - { - double x; - double y; - double z = 0; - geom.rewind(0); - unsigned cmd = 1; - while ((cmd = geom.vertex(&x, &y)) != mapnik::SEG_END) - { - if (cmd == SEG_CLOSE) continue; - prj_trans.backward(x,y,z); - common_.t_.forward(&x,&y); - context_.move_to(std::floor(x) - 0.5, std::floor(y) + 0.5); - context_.line_to(std::floor(x) + 1.5, std::floor(y) + 0.5); - context_.move_to(std::floor(x) + 0.5, std::floor(y) - 0.5); - context_.line_to(std::floor(x) + 0.5, std::floor(y) + 1.5); - context_.stroke(); - } - } + using apply_vertex_mode = apply_vertex_mode; + apply_vertex_mode apply(context_, common_.t_, prj_trans); + util::apply_visitor(geometry::vertex_processor(apply), feature.get_geometry()); } } diff --git a/src/cairo/process_group_symbolizer.cpp b/src/cairo/process_group_symbolizer.cpp index 37ba4c789..79338664d 100644 --- a/src/cairo/process_group_symbolizer.cpp +++ b/src/cairo/process_group_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -77,7 +77,7 @@ struct thunk_renderer thunk.opacity_); } - void operator()(raster_marker_render_thunk const &thunk) const + void operator()(raster_marker_render_thunk const& thunk) const { cairo_save_restore guard(context_); context_.set_operator(thunk.comp_op_); @@ -97,11 +97,12 @@ struct thunk_renderer offset_, [&] (glyph_positions_ptr glyphs) { - if (glyphs->marker()) + marker_info_ptr mark = glyphs->get_marker(); + if (mark) { ren_.render_marker(glyphs->marker_pos(), - *(glyphs->marker()->marker), - glyphs->marker()->transform, + *mark->marker_, + mark->transform_, thunk.opacity_, thunk.comp_op_); } context_.add_text(*glyphs, face_manager_, src_over, src_over, common_.scale_factor_); @@ -111,7 +112,7 @@ struct thunk_renderer template void operator()(T0 const &) const { - // TODO: warning if unimplemented? + throw std::runtime_error("Rendering of this type is not supported by the cairo renderer."); } private: diff --git a/src/cairo/process_line_pattern_symbolizer.cpp b/src/cairo/process_line_pattern_symbolizer.cpp index e14348e42..4ec63570a 100644 --- a/src/cairo/process_line_pattern_symbolizer.cpp +++ b/src/cairo/process_line_pattern_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,13 +29,62 @@ #include #include #include +#include #include #include #include +#include namespace mapnik { +struct cairo_renderer_process_visitor_l +{ + cairo_renderer_process_visitor_l(renderer_common const& common, + line_pattern_symbolizer const& sym, + mapnik::feature_impl & feature, + std::size_t & width, + std::size_t & height) + : common_(common), + sym_(sym), + feature_(feature), + width_(width), + height_(height) {} + + std::shared_ptr operator() (mapnik::marker_null const&) + { + throw std::runtime_error("This should not have been reached."); + } + + std::shared_ptr operator() (mapnik::marker_svg const& marker) + { + double opacity = get(sym_, feature_, common_.vars_); + mapnik::rasterizer ras; + agg::trans_affine image_tr = agg::trans_affine_scaling(common_.scale_factor_); + auto image_transform = get_optional(sym_, keys::image_transform); + if (image_transform) evaluate_transform(image_tr, feature_, common_.vars_, *image_transform); + mapnik::box2d const& bbox_image = marker.get_data()->bounding_box() * image_tr; + mapnik::image_rgba8 image(bbox_image.width(), bbox_image.height()); + render_pattern(ras, marker, image_tr, 1.0, image); + width_ = image.width(); + height_ = image.height(); + return std::make_shared(image, opacity); + } + + std::shared_ptr operator() (mapnik::marker_rgba8 const& marker) + { + double opacity = get(sym_, feature_, common_.vars_); + return std::make_shared(marker.get_data(), opacity); + } + + private: + renderer_common const& common_; + line_pattern_symbolizer const& sym_; + mapnik::feature_impl & feature_; + std::size_t & width_; + std::size_t & height_; +}; + template void cairo_renderer::process(line_pattern_symbolizer const& sym, mapnik::feature_impl & feature, @@ -48,39 +97,29 @@ void cairo_renderer::process(line_pattern_symbolizer const& sym, value_double simplify_tolerance = get(sym, feature, common_.vars_); value_double smooth = get(sym, feature, common_.vars_); - boost::optional marker; - if ( !filename.empty() ) + if (filename.empty()) { - marker = marker_cache::instance().find(filename, true); + return; } - if (!marker || !(*marker)) return; - unsigned width = (*marker)->width(); - unsigned height = (*marker)->height(); + std::shared_ptr marker = marker_cache::instance().find(filename, true); + + if (marker->is()) return; + + std::size_t width = marker->width(); + std::size_t height = marker->height(); cairo_save_restore guard(context_); context_.set_operator(comp_op); - std::shared_ptr pattern; - image_ptr image = nullptr; // TODO - re-implement at renderer level like polygon_pattern symbolizer - double opacity = get(sym, feature, common_.vars_); - if ((*marker)->is_bitmap()) - { - pattern = std::make_unique(**((*marker)->get_bitmap_data()), opacity); - context_.set_line_width(height); - } - else - { - mapnik::rasterizer ras; - agg::trans_affine image_tr = agg::trans_affine_scaling(common_.scale_factor_); - auto image_transform = get_optional(sym, keys::image_transform); - if (image_transform) evaluate_transform(image_tr, feature, common_.vars_, *image_transform); - image = render_pattern(ras, **marker, image_tr, 1.0); - pattern = std::make_unique(*image, opacity); - width = image->width(); - height = image->height(); - context_.set_line_width(height); - } + cairo_renderer_process_visitor_l visit(common_, + sym, + feature, + width, + height); + std::shared_ptr pattern = util::apply_visitor(visit, *marker); + + context_.set_line_width(height); pattern->set_extend(CAIRO_EXTEND_REPEAT); pattern->set_filter(CAIRO_FILTER_BILINEAR); @@ -104,12 +143,12 @@ void cairo_renderer::process(line_pattern_symbolizer const& sym, using rasterizer_type = line_pattern_rasterizer; rasterizer_type ras(context_, *pattern, width, height); - vertex_converter - converter(clipping_extent, ras, sym, common_.t_, prj_trans, tr, feature, common_.vars_, common_.scale_factor_); + using vertex_converter_type = vertex_converter; + + vertex_converter_type converter(clipping_extent,sym, common_.t_, prj_trans, tr, feature, common_.vars_, common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform @@ -118,14 +157,10 @@ void cairo_renderer::process(line_pattern_symbolizer const& sym, if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - - for (auto & geom : feature.paths()) - { - if (geom.size() > 1) - { - converter.apply(geom); - } - } + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = geometry::vertex_processor; + apply_vertex_converter_type apply(converter, ras); + mapnik::util::apply_visitor(vertex_processor_type(apply), feature.get_geometry()); } template void cairo_renderer::process(line_pattern_symbolizer const&, diff --git a/src/cairo/process_line_symbolizer.cpp b/src/cairo/process_line_symbolizer.cpp index 1a3a87d19..1510547e4 100644 --- a/src/cairo/process_line_symbolizer.cpp +++ b/src/cairo/process_line_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,6 +27,8 @@ #include #include #include +#include +#include namespace mapnik { @@ -79,14 +81,13 @@ void cairo_renderer::process(line_symbolizer const& sym, padding *= common_.scale_factor_; clipping_extent.pad(padding); } - vertex_converter - converter(clipping_extent,context_,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); + using vertex_converter_type = vertex_converter; + + vertex_converter_type converter(clipping_extent,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform @@ -94,14 +95,10 @@ void cairo_renderer::process(line_symbolizer const& sym, converter.set(); // optional affine transform if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - - for (geometry_type & geom : feature.paths()) - { - if (geom.size() > 1) - { - converter.apply(geom); - } - } + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = geometry::vertex_processor; + apply_vertex_converter_type apply(converter, context_); + mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); // stroke context_.set_fill_rule(CAIRO_FILL_RULE_WINDING); context_.stroke(); diff --git a/src/cairo/process_markers_symbolizer.cpp b/src/cairo/process_markers_symbolizer.cpp index d741c64f1..faffd3d6a 100644 --- a/src/cairo/process_markers_symbolizer.cpp +++ b/src/cairo/process_markers_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -59,7 +59,7 @@ struct vector_markers_dispatch_cairo : public vector_markers_dispatch double scale_factor, feature_impl & feature, mapnik::attributes const& vars, - bool snap_to_pixels, + bool /* snap_to_pixels */, // only used in agg renderer currently RendererContext const& renderer_context) : vector_markers_dispatch(src, marker_trans, sym, detector, scale_factor, feature, vars), path_(path), @@ -86,7 +86,7 @@ private: template struct raster_markers_dispatch_cairo : public raster_markers_dispatch { - raster_markers_dispatch_cairo(mapnik::image_data_rgba8 & src, + raster_markers_dispatch_cairo(image_rgba8 const& src, agg::trans_affine const& marker_trans, markers_symbolizer const& sym, Detector & detector, diff --git a/src/cairo/process_point_symbolizer.cpp b/src/cairo/process_point_symbolizer.cpp index 349a198f2..b0ffefb80 100644 --- a/src/cairo/process_point_symbolizer.cpp +++ b/src/cairo/process_point_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/cairo/process_polygon_pattern_symbolizer.cpp b/src/cairo/process_polygon_pattern_symbolizer.cpp index 1394d6540..760a42524 100644 --- a/src/cairo/process_polygon_pattern_symbolizer.cpp +++ b/src/cairo/process_polygon_pattern_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,14 +29,60 @@ #include #include #include +#include #include #include #include #include +#include +#include namespace mapnik { +struct cairo_renderer_process_visitor_p +{ + cairo_renderer_process_visitor_p(cairo_context & context, + agg::trans_affine & image_tr, + unsigned offset_x, + unsigned offset_y, + float opacity) + : context_(context), + image_tr_(image_tr), + offset_x_(offset_x), + offset_y_(offset_y), + opacity_(opacity) {} + + void operator() (marker_null const&) {} + + void operator() (marker_svg const& marker) + { + mapnik::rasterizer ras; + mapnik::box2d const& bbox_image = marker.get_data()->bounding_box() * image_tr_; + mapnik::image_rgba8 image(bbox_image.width(), bbox_image.height()); + render_pattern(ras, marker, image_tr_, 1.0, image); + cairo_pattern pattern(image, opacity_); + pattern.set_extend(CAIRO_EXTEND_REPEAT); + pattern.set_origin(offset_x_, offset_y_); + context_.set_pattern(pattern); + } + + void operator() (marker_rgba8 const& marker) + { + cairo_pattern pattern(marker.get_data(), opacity_); + pattern.set_extend(CAIRO_EXTEND_REPEAT); + pattern.set_origin(offset_x_, offset_y_); + context_.set_pattern(pattern); + } + + private: + cairo_context & context_; + agg::trans_affine & image_tr_; + unsigned offset_x_; + unsigned offset_y_; + float opacity_; +}; + template void cairo_renderer::process(polygon_pattern_symbolizer const& sym, mapnik::feature_impl & feature, @@ -55,8 +101,8 @@ void cairo_renderer::process(polygon_pattern_symbolizer const& sym, cairo_save_restore guard(context_); context_.set_operator(comp_op); - boost::optional marker = mapnik::marker_cache::instance().find(filename,true); - if (!marker || !(*marker)) return; + std::shared_ptr marker = mapnik::marker_cache::instance().find(filename,true); + if (marker->is()) return; unsigned offset_x=0; unsigned offset_y=0; @@ -66,58 +112,36 @@ void cairo_renderer::process(polygon_pattern_symbolizer const& sym, { double x0 = 0.0; double y0 = 0.0; - - if (feature.num_geometries() > 0) - { - using clipped_geometry_type = agg::conv_clip_polygon; - using path_type = transform_path_adapter; - clipped_geometry_type clipped(feature.get_geometry(0)); - clipped.clip_box(clip_box.minx(), clip_box.miny(), - clip_box.maxx(), clip_box.maxy()); - path_type path(common_.t_, clipped, prj_trans); - path.vertex(&x0, &y0); - } + using apply_local_alignment = detail::apply_local_alignment; + apply_local_alignment apply(common_.t_, prj_trans, clip_box, x0, y0); + util::apply_visitor(geometry::vertex_processor(apply), feature.get_geometry()); offset_x = std::abs(clip_box.width() - x0); offset_y = std::abs(clip_box.height() - y0); } - if ((*marker)->is_bitmap()) - { - cairo_pattern pattern(**((*marker)->get_bitmap_data()), opacity); - pattern.set_extend(CAIRO_EXTEND_REPEAT); - pattern.set_origin(offset_x, offset_y); - context_.set_pattern(pattern); - } - else - { - mapnik::rasterizer ras; - image_ptr image = render_pattern(ras, **marker, image_tr, 1.0); // - cairo_pattern pattern(*image, opacity); - pattern.set_extend(CAIRO_EXTEND_REPEAT); - pattern.set_origin(offset_x, offset_y); - context_.set_pattern(pattern); - } + util::apply_visitor(cairo_renderer_process_visitor_p(context_, image_tr, offset_x, offset_y, opacity), *marker); agg::trans_affine tr; auto geom_transform = get_optional(sym, keys::geometry_transform); if (geom_transform) { evaluate_transform(tr, feature, common_.vars_, *geom_transform, common_.scale_factor_); } + using vertex_converter_type = vertex_converter< + clip_poly_tag, + transform_tag, + affine_transform_tag, + simplify_tag, + smooth_tag>; - vertex_converter - converter(clip_box, context_,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); - + vertex_converter_type converter(clip_box,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (prj_trans.equal() && clip) converter.set(); //optional clip (default: true) converter.set(); //always transform converter.set(); if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - for ( geometry_type & geom : feature.paths()) - { - if (geom.size() > 2) - { - converter.apply(geom); - } - } + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = geometry::vertex_processor; + apply_vertex_converter_type apply(converter, context_); + mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); // fill polygon context_.set_fill_rule(CAIRO_FILL_RULE_EVEN_ODD); context_.fill(); diff --git a/src/cairo/process_polygon_symbolizer.cpp b/src/cairo/process_polygon_symbolizer.cpp index bbc48e11a..b2558a46a 100644 --- a/src/cairo/process_polygon_symbolizer.cpp +++ b/src/cairo/process_polygon_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -38,7 +38,7 @@ void cairo_renderer::process(polygon_symbolizer const& sym, mapnik::feature_impl & feature, proj_transform const& prj_trans) { - using vertex_converter_type = vertex_converter; + using vertex_converter_type = vertex_converter; cairo_save_restore guard(context_); composite_mode_e comp_op = get(sym, feature, common_.vars_); context_.set_operator(comp_op); diff --git a/src/cairo/process_raster_symbolizer.cpp b/src/cairo/process_raster_symbolizer.cpp index 36daee737..2b6fdc5c2 100644 --- a/src/cairo/process_raster_symbolizer.cpp +++ b/src/cairo/process_raster_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -43,7 +43,7 @@ void cairo_renderer::process(raster_symbolizer const& sym, cairo_save_restore guard(context_); render_raster_symbolizer( sym, feature, prj_trans, common_, - [&](image_data_rgba8 &target, composite_mode_e comp_op, double opacity, + [&](image_rgba8 const & target, composite_mode_e comp_op, double opacity, int start_x, int start_y) { context_.set_operator(comp_op); context_.add_image(start_x, start_y, target, opacity); diff --git a/src/cairo/process_text_symbolizer.cpp b/src/cairo/process_text_symbolizer.cpp index 365e5f662..176b6c635 100644 --- a/src/cairo/process_text_symbolizer.cpp +++ b/src/cairo/process_text_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -57,11 +57,12 @@ void cairo_renderer::process(shield_symbolizer const& sym, placements_list const &placements = helper.get(); for (glyph_positions_ptr glyphs : placements) { - if (glyphs->marker()) { + marker_info_ptr mark = glyphs->get_marker(); + if (mark) { pixel_position pos = glyphs->marker_pos(); render_marker(pos, - *(glyphs->marker()->marker), - glyphs->marker()->transform, + *mark->marker_, + mark->transform_, opacity); } context_.add_text(*glyphs, face_manager_, comp_op, halo_comp_op, common_.scale_factor_); diff --git a/src/cairo_io.cpp b/src/cairo_io.cpp new file mode 100644 index 000000000..96152cc92 --- /dev/null +++ b/src/cairo_io.cpp @@ -0,0 +1,131 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +// mapnik +#include +#include +#include + +#ifdef HAVE_CAIRO +#include +#include +#ifdef CAIRO_HAS_PDF_SURFACE +#include +#endif +#ifdef CAIRO_HAS_PS_SURFACE +#include +#endif +#ifdef CAIRO_HAS_SVG_SURFACE +#include +#endif +#endif + +// stl +#include +#include +#include +#include + +namespace mapnik { + +#if defined(HAVE_CAIRO) +void save_to_cairo_file(mapnik::Map const& map, std::string const& filename, double scale_factor, double scale_denominator) +{ + boost::optional type = type_from_filename(filename); + if (type) + { + save_to_cairo_file(map,filename,*type,scale_factor,scale_denominator); + } + else throw image_writer_exception("Could not write file to " + filename ); +} + +void save_to_cairo_file(mapnik::Map const& map, + std::string const& filename, + std::string const& type, + double scale_factor, + double scale_denominator) +{ + std::ofstream file (filename.c_str(), std::ios::out|std::ios::trunc|std::ios::binary); + if (file) + { + cairo_surface_ptr surface; + unsigned width = map.width(); + unsigned height = map.height(); + if (type == "pdf") + { +#ifdef CAIRO_HAS_PDF_SURFACE + surface = cairo_surface_ptr(cairo_pdf_surface_create(filename.c_str(),width,height),cairo_surface_closer()); +#else + throw image_writer_exception("PDFSurface not supported in the cairo backend"); +#endif + } +#ifdef CAIRO_HAS_SVG_SURFACE + else if (type == "svg") + { + surface = cairo_surface_ptr(cairo_svg_surface_create(filename.c_str(),width,height),cairo_surface_closer()); + } +#endif +#ifdef CAIRO_HAS_PS_SURFACE + else if (type == "ps") + { + surface = cairo_surface_ptr(cairo_ps_surface_create(filename.c_str(),width,height),cairo_surface_closer()); + } +#endif +#ifdef CAIRO_HAS_IMAGE_SURFACE + else if (type == "ARGB32") + { + surface = cairo_surface_ptr(cairo_image_surface_create(CAIRO_FORMAT_ARGB32,width,height),cairo_surface_closer()); + } + else if (type == "RGB24") + { + surface = cairo_surface_ptr(cairo_image_surface_create(CAIRO_FORMAT_RGB24,width,height),cairo_surface_closer()); + } +#endif + else + { + throw image_writer_exception("unknown file type: " + type); + } + + //cairo_t * ctx = cairo_create(surface); + + // TODO - expose as user option + /* + if (type == "ARGB32" || type == "RGB24") + { + context->set_antialias(Cairo::ANTIALIAS_NONE); + } + */ + + mapnik::cairo_renderer ren(map, create_context(surface), scale_factor); + ren.apply(scale_denominator); + + if (type == "ARGB32" || type == "RGB24") + { + cairo_surface_write_to_png(&*surface, filename.c_str()); + } + cairo_surface_finish(&*surface); + } +} + +#endif + +} // end ns diff --git a/src/color.cpp b/src/color.cpp index f1146e815..b385877f5 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,6 +32,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -45,9 +48,10 @@ namespace mapnik { -color::color(std::string const& str) +color::color(std::string const& str, bool premultiplied) { *this = parse_color(str); + premultiplied_ = premultiplied; } std::string color::to_string() const @@ -95,23 +99,28 @@ std::string color::to_hex_string() const return str; } -void color::premultiply() +bool color::premultiply() { + if (premultiplied_) return false; agg::rgba8 pre_c = agg::rgba8(red_,green_,blue_,alpha_); pre_c.premultiply(); red_ = pre_c.r; green_ = pre_c.g; blue_ = pre_c.b; + premultiplied_ = true; + return true; } -void color::demultiply() +bool color::demultiply() { - // note: this darkens too much: https://github.com/mapnik/mapnik/issues/1519 + if (!premultiplied_) return false; agg::rgba8 pre_c = agg::rgba8(red_,green_,blue_,alpha_); pre_c.demultiply(); red_ = pre_c.r; green_ = pre_c.g; blue_ = pre_c.b; + premultiplied_ = false; + return true; } } diff --git a/src/color_factory.cpp b/src/color_factory.cpp index 38257ec22..d13a89562 100644 --- a/src/color_factory.cpp +++ b/src/color_factory.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/conversions.cpp b/src/conversions.cpp index 250378e0e..995d0f439 100644 --- a/src/conversions.cpp +++ b/src/conversions.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,6 +33,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #ifdef MAPNIK_KARMA_TO_STRING #include @@ -56,6 +59,33 @@ auto LONGLONG = qi::long_long_type(); auto FLOAT = qi::float_type(); auto DOUBLE = qi::double_type(); +bool string2bool(std::string const& value, bool & result) +{ + if (value.empty() || value.size() > 5) { + return false; + } else if (value == "true") { + return result = true; + } else if (value == "false") { + result = false; + return true; + } + std::string val(value); + std::transform(val.begin(), val.end(), val.begin(), ::tolower); + if (val == "true" || val == "yes" || val == "1" || val == "on") { + return result = true; + } else if (val == "false" || val == "no" || val == "0" || val == "off") { + result = false; + return true; + } + return false; +} + +bool string2bool(const char * iter, const char * end, bool & result) +{ + std::string val(iter,end); + return string2bool(val,result); +} + bool string2int(const char * iter, const char * end, int & result) { ascii::space_type space; diff --git a/src/css_color_grammar.cpp b/src/css_color_grammar.cpp index a08e12922..2e9f60c92 100644 --- a/src/css_color_grammar.cpp +++ b/src/css_color_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/dasharray_parser.cpp b/src/dasharray_parser.cpp index 6d432dea6..489931954 100644 --- a/src/dasharray_parser.cpp +++ b/src/dasharray_parser.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,6 +26,8 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/src/datasource_cache.cpp b/src/datasource_cache.cpp index 946a03d6f..eb2cfd0d7 100644 --- a/src/datasource_cache.cpp +++ b/src/datasource_cache.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,6 @@ #include #include #include -#include // boost #pragma GCC diagnostic push @@ -89,7 +88,7 @@ datasource_ptr datasource_cache::create(parameters const& params) // add scope to ensure lock is released asap { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif itr=plugins_.find(*type); if (itr == plugins_.end()) @@ -156,7 +155,7 @@ std::vector datasource_cache::plugin_names() bool datasource_cache::register_datasources(std::string const& dir, bool recurse) { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif if (!mapnik::util::exists(dir)) { diff --git a/src/datasource_cache_static.cpp b/src/datasource_cache_static.cpp index 578b2f990..ba79d1d01 100644 --- a/src/datasource_cache_static.cpp +++ b/src/datasource_cache_static.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,12 +28,12 @@ #include // boost -#include #include #endif // stl #include +#include // static plugin linkage #ifdef MAPNIK_STATIC_PLUGINS @@ -64,9 +64,6 @@ #if defined(MAPNIK_STATIC_PLUGIN_POSTGIS) #include "input/postgis/postgis_datasource.hpp" #endif - #if defined(MAPNIK_STATIC_PLUGIN_PYTHON) - #include "input/python/python_datasource.hpp" - #endif #if defined(MAPNIK_STATIC_PLUGIN_RASTER) #include "input/raster/raster_datasource.hpp" #endif @@ -91,7 +88,7 @@ datasource_ptr ds_generator(parameters const& params) } typedef datasource_ptr (*ds_generator_ptr)(parameters const& params); -using datasource_map = boost::unordered_map; +using datasource_map = std::unordered_map; static datasource_map ds_map = boost::assign::map_list_of #if defined(MAPNIK_STATIC_PLUGIN_CSV) @@ -115,9 +112,6 @@ static datasource_map ds_map = boost::assign::map_list_of #if defined(MAPNIK_STATIC_PLUGIN_POSTGIS) (std::string("postgis"), &ds_generator) #endif - #if defined(MAPNIK_STATIC_PLUGIN_PYTHON) - (std::string("python"), &ds_generator) - #endif #if defined(MAPNIK_STATIC_PLUGIN_RASTER) (std::string("raster"), &ds_generator) #endif diff --git a/src/debug.cpp b/src/debug.cpp index 4a519cd71..1a90df57f 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/expression.cpp b/src/expression.cpp index c8798774b..f4bdeeb84 100644 --- a/src/expression.cpp +++ b/src/expression.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -40,18 +40,26 @@ expression_ptr parse_expression(std::string const& str) auto node = std::make_shared(); std::string::const_iterator itr = str.begin(); std::string::const_iterator end = str.end(); - try { - bool r = boost::spirit::qi::phrase_parse(itr, end, g, space, *node); - if (r && itr == end) - { - return node; - } - else - { - throw config_error("Failed to parse expression: \"" + str + "\""); - } + bool r = false; + try + { + r = boost::spirit::qi::phrase_parse(itr, end, g, space, *node); } - catch (std::exception const&) // boost::spirit::qi::expectation_failure + catch (boost::spirit::qi::expectation_failure const& ex) + { + // no need to show "boost::spirit::qi::expectation_failure" which is a std::runtime_error + throw config_error("Failed to parse expression: \"" + str + "\""); + } + catch (std::exception const& ex) + { + // show "Could not initialize ICU resources" from boost::regex which is a std::runtime_error + throw config_error(std::string(ex.what()) + " for expression: \"" + str + "\""); + } + if (r && itr == end) + { + return node; + } + else { throw config_error("Failed to parse expression: \"" + str + "\""); } diff --git a/src/expression_grammar.cpp b/src/expression_grammar.cpp index 2aa47e66d..09234a07f 100644 --- a/src/expression_grammar.cpp +++ b/src/expression_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/expression_node.cpp b/src/expression_node.cpp index 3eef36057..43a4059b9 100644 --- a/src/expression_node.cpp +++ b/src/expression_node.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,12 +23,16 @@ #include #include #include +#include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" #if defined(BOOST_REGEX_HAS_ICU) #include #else #include #endif +#pragma GCC diagnostic pop namespace mapnik { @@ -91,7 +95,7 @@ std::string regex_match_node::to_string() const auto const& pattern = impl_.get()->pattern_; #if defined(BOOST_REGEX_HAS_ICU) std::string utf8; - value_unicode_string ustr = value_unicode_string::fromUTF32( &pattern.str()[0], pattern.str().length()); + value_unicode_string ustr = value_unicode_string::fromUTF32( &pattern.str()[0], safe_cast(pattern.str().length())); to_utf8(ustr,utf8); str_ += utf8; #else @@ -138,7 +142,7 @@ std::string regex_replace_node::to_string() const auto const& format = impl_.get()->format_; #if defined(BOOST_REGEX_HAS_ICU) std::string utf8; - value_unicode_string ustr = value_unicode_string::fromUTF32( &pattern.str()[0], pattern.str().length()); + value_unicode_string ustr = value_unicode_string::fromUTF32( &pattern.str()[0], safe_cast(pattern.str().length())); to_utf8(ustr,utf8); str_ += utf8; str_ +="','"; diff --git a/src/expression_string.cpp b/src/expression_string.cpp index 6fe39209e..0f904ee68 100644 --- a/src/expression_string.cpp +++ b/src/expression_string.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/feature_kv_iterator.cpp b/src/feature_kv_iterator.cpp index ae2543d93..8fdba826b 100644 --- a/src/feature_kv_iterator.cpp +++ b/src/feature_kv_iterator.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/feature_style_processor.cpp b/src/feature_style_processor.cpp index 42fad26a5..c041016d6 100644 --- a/src/feature_style_processor.cpp +++ b/src/feature_style_processor.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,7 @@ #include #include -#include +#include #if defined(GRID_RENDERER) #include @@ -44,17 +44,17 @@ namespace mapnik { #if defined(HAVE_CAIRO) -template class feature_style_processor >; +template class MAPNIK_DECL feature_style_processor >; #endif #if defined(SVG_RENDERER) -template class feature_style_processor > >; +template class MAPNIK_DECL feature_style_processor > >; #endif #if defined(GRID_RENDERER) -template class feature_style_processor >; +template class MAPNIK_DECL feature_style_processor >; #endif -template class feature_style_processor >; +template class MAPNIK_DECL feature_style_processor >; } diff --git a/src/feature_type_style.cpp b/src/feature_type_style.cpp index 4ee54e200..a2ddb33ba 100644 --- a/src/feature_type_style.cpp +++ b/src/feature_type_style.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/font_engine_freetype.cpp b/src/font_engine_freetype.cpp index 412b59511..8f62842cb 100644 --- a/src/font_engine_freetype.cpp +++ b/src/font_engine_freetype.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include // boost @@ -84,7 +84,7 @@ unsigned long ft_read_cb(FT_Stream stream, unsigned long offset, unsigned char * bool freetype_engine::register_font(std::string const& file_name) { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif font_library library; return register_font_impl(file_name, library, global_font_file_mapping_); @@ -136,12 +136,12 @@ bool freetype_engine::register_font_impl(std::string const& file_name, auto range = font_file_mapping.equal_range(name); if (range.first == range.second) // the key was previously absent; insert a pair { - font_file_mapping.emplace_hint(range.first,name,std::move(std::make_pair(i,file_name))); + font_file_mapping.emplace_hint(range.first, name, std::make_pair(i,file_name)); } else // the key was present, replace the associated value { /* some action with value range.first->second about to be overwritten here */ MAPNIK_LOG_WARN(font_engine_freetype) << "registering new " << name << " at '" << file_name << "'"; - range.first->second = std::move(std::make_pair(i,file_name)); // replace value + range.first->second = std::make_pair(i,file_name); // replace value } success = true; } @@ -166,7 +166,7 @@ bool freetype_engine::register_font_impl(std::string const& file_name, bool freetype_engine::register_fonts(std::string const& dir, bool recurse) { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif font_library library; return register_fonts_impl(dir, library, global_font_file_mapping_, recurse); @@ -338,9 +338,9 @@ face_ptr freetype_engine::create_face(std::string const& family_name, if (file.open()) { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif - auto result = global_memory_fonts.emplace(itr->second.second, std::make_pair(std::move(file.data()),file.size())); + auto result = global_memory_fonts.emplace(itr->second.second, std::make_pair(file.data(),file.size())); FT_Face face; FT_Error error = FT_New_Memory_Face(library.get(), reinterpret_cast(result.first->second.first.get()), // data diff --git a/src/font_set.cpp b/src/font_set.cpp index 89f46b0fb..9236cac32 100644 --- a/src/font_set.cpp +++ b/src/font_set.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/fs.cpp b/src/fs.cpp index 655472487..9c87d97be 100644 --- a/src/fs.cpp +++ b/src/fs.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,7 +21,7 @@ *****************************************************************************/ // mapnik -#include +#include #include // boost diff --git a/src/function_call.cpp b/src/function_call.cpp index 99b1435d7..e813deef7 100644 --- a/src/function_call.cpp +++ b/src/function_call.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/geometry_envelope.cpp b/src/geometry_envelope.cpp new file mode 100644 index 000000000..0aa3466f1 --- /dev/null +++ b/src/geometry_envelope.cpp @@ -0,0 +1,50 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +#include +#include +#include +namespace mapnik { +namespace geometry { + +template MAPNIK_DECL mapnik::box2d envelope(geometry const& geom); +template MAPNIK_DECL mapnik::box2d envelope(mapnik::base_symbolizer_helper::geometry_cref const& geom); +template MAPNIK_DECL mapnik::box2d envelope(geometry_empty const& geom); +template MAPNIK_DECL mapnik::box2d envelope(point const& geom); +template MAPNIK_DECL mapnik::box2d envelope(line_string const& geom); +template MAPNIK_DECL mapnik::box2d envelope(polygon const& geom); +template MAPNIK_DECL mapnik::box2d envelope(multi_point const& geom); +template MAPNIK_DECL mapnik::box2d envelope(multi_line_string const& geom); +template MAPNIK_DECL mapnik::box2d envelope(multi_polygon const& geom); +template MAPNIK_DECL mapnik::box2d envelope(geometry_collection const& geom); + +template MAPNIK_DECL mapnik::box2d envelope(geometry const& geom); +template MAPNIK_DECL mapnik::box2d envelope(point const& geom); +template MAPNIK_DECL mapnik::box2d envelope(line_string const& geom); +template MAPNIK_DECL mapnik::box2d envelope(polygon const& geom); +template MAPNIK_DECL mapnik::box2d envelope(multi_point const& geom); +template MAPNIK_DECL mapnik::box2d envelope(multi_line_string const& geom); +template MAPNIK_DECL mapnik::box2d envelope(multi_polygon const& geom); +template MAPNIK_DECL mapnik::box2d envelope(geometry_collection const& geom); + +} // end ns geometry +} // end ns mapnik diff --git a/src/geometry_reprojection.cpp b/src/geometry_reprojection.cpp new file mode 100644 index 000000000..7cd3ff08d --- /dev/null +++ b/src/geometry_reprojection.cpp @@ -0,0 +1,73 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +// mapnik +#include +#include + +namespace mapnik { + +namespace geometry { + +template MAPNIK_DECL geometry reproject_copy(geometry const& geom, proj_transform const& proj_trans, unsigned int & n_err); +template MAPNIK_DECL geometry_empty reproject_copy(geometry_empty const& geom, proj_transform const& proj_trans, unsigned int & n_err); +template MAPNIK_DECL point reproject_copy(point const& geom, proj_transform const& proj_trans, unsigned int & n_err); +template MAPNIK_DECL line_string reproject_copy(line_string const& geom, proj_transform const& proj_trans, unsigned int & n_err); +template MAPNIK_DECL polygon reproject_copy(polygon const& geom, proj_transform const& proj_trans, unsigned int & n_err); +template MAPNIK_DECL multi_point reproject_copy(multi_point const& geom, proj_transform const& proj_trans, unsigned int & n_err); +template MAPNIK_DECL multi_line_string reproject_copy(multi_line_string const& geom, proj_transform const& proj_trans, unsigned int & n_err); +template MAPNIK_DECL multi_polygon reproject_copy(multi_polygon const& geom, proj_transform const& proj_trans, unsigned int & n_err); +template MAPNIK_DECL geometry_collection reproject_copy(geometry_collection const& geom, proj_transform const& proj_trans, unsigned int & n_err); + +template MAPNIK_DECL geometry reproject_copy(geometry const& geom, projection const& source, projection const& dest, unsigned int & n_err); +template MAPNIK_DECL geometry_empty reproject_copy(geometry_empty const& geom, projection const& source, projection const& dest, unsigned int & n_err); +template MAPNIK_DECL point reproject_copy(point const& geom, projection const& source, projection const& dest, unsigned int & n_err); +template MAPNIK_DECL line_string reproject_copy(line_string const& geom, projection const& source, projection const& dest, unsigned int & n_err); +template MAPNIK_DECL polygon reproject_copy(polygon const& geom, projection const& source, projection const& dest, unsigned int & n_err); +template MAPNIK_DECL multi_point reproject_copy(multi_point const& geom, projection const& source, projection const& dest, unsigned int & n_err); +template MAPNIK_DECL multi_line_string reproject_copy(multi_line_string const& geom, projection const& source, projection const& dest, unsigned int & n_err); +template MAPNIK_DECL multi_polygon reproject_copy(multi_polygon const& geom, projection const& source, projection const& dest, unsigned int & n_err); +template MAPNIK_DECL geometry_collection reproject_copy(geometry_collection const& geom, projection const& source, projection const& dest, unsigned int & n_err); + +template MAPNIK_DECL bool reproject(geometry & geom, proj_transform const& proj_trans); +template MAPNIK_DECL bool reproject(geometry_empty & geom, proj_transform const& proj_trans); +template MAPNIK_DECL bool reproject(point & geom, proj_transform const& proj_trans); +template MAPNIK_DECL bool reproject(line_string & geom, proj_transform const& proj_trans); +template MAPNIK_DECL bool reproject(polygon & geom, proj_transform const& proj_trans); +template MAPNIK_DECL bool reproject(multi_point & geom, proj_transform const& proj_trans); +template MAPNIK_DECL bool reproject(multi_line_string & geom, proj_transform const& proj_trans); +template MAPNIK_DECL bool reproject(multi_polygon & geom, proj_transform const& proj_trans); +template MAPNIK_DECL bool reproject(geometry_collection & geom, proj_transform const& proj_trans); + +template MAPNIK_DECL bool reproject(geometry & geom, projection const& source, projection const& dest); +template MAPNIK_DECL bool reproject(geometry_empty & geom, projection const& source, projection const& dest); +template MAPNIK_DECL bool reproject(point & geom, projection const& source, projection const& dest); +template MAPNIK_DECL bool reproject(line_string & geom, projection const& source, projection const& dest); +template MAPNIK_DECL bool reproject(polygon & geom, projection const& source, projection const& dest); +template MAPNIK_DECL bool reproject(multi_point & geom, projection const& source, projection const& dest); +template MAPNIK_DECL bool reproject(multi_line_string & geom, projection const& source, projection const& dest); +template MAPNIK_DECL bool reproject(multi_polygon & geom, projection const& source, projection const& dest); +template MAPNIK_DECL bool reproject(geometry_collection & geom, projection const& source, projection const& dest); + +} // end geometry ns + +} // end mapnik ns diff --git a/src/gradient.cpp b/src/gradient.cpp index 912739eba..ddf665870 100644 --- a/src/gradient.cpp +++ b/src/gradient.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/graphics.cpp b/src/graphics.cpp deleted file mode 100644 index 850df6514..000000000 --- a/src/graphics.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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 - * - *****************************************************************************/ - -// mapnik -#include -#include -#include -#include -#include - -// agg -#include "agg_rendering_buffer.h" -#include "agg_pixfmt_rgba.h" -#include "agg_color_rgba.h" - -#ifdef HAVE_CAIRO -#include -#endif - -namespace mapnik -{ -image_32::image_32(int width,int height) - : data_(width,height), - painted_(false), - premultiplied_(false) {} - - -image_32::image_32(image_32 const& rhs) - : data_(rhs.data_), - painted_(rhs.painted_), - premultiplied_(rhs.premultiplied_) {} - -image_32::image_32(image_data_rgba8 && data) - : data_(std::move(data)), - painted_(false), - premultiplied_(false) {} - -image_32::~image_32() {} - -void image_32::set_grayscale_to_alpha() -{ - for (unsigned int y = 0; y < data_.height(); ++y) - { - unsigned int* row_from = data_.getRow(y); - for (unsigned int x = 0; x < data_.width(); ++x) - { - unsigned rgba = row_from[x]; - unsigned r = rgba & 0xff; - unsigned g = (rgba >> 8 ) & 0xff; - unsigned b = (rgba >> 16) & 0xff; - - // magic numbers for grayscale - unsigned a = static_cast(std::ceil((r * .3) + (g * .59) + (b * .11))); - - row_from[x] = (a << 24)| (255 << 16) | (255 << 8) | (255) ; - } - } -} - -void image_32::set_color_to_alpha(const color& c) -{ - for (unsigned y = 0; y < data_.height(); ++y) - { - unsigned int* row_from = data_.getRow(y); - for (unsigned x = 0; x < data_.width(); ++x) - { - unsigned rgba = row_from[x]; - unsigned r = rgba & 0xff; - unsigned g = (rgba >> 8 ) & 0xff; - unsigned b = (rgba >> 16) & 0xff; - if (r == c.red() && g == c.green() && b == c.blue()) - { - row_from[x] = 0; - } - } - } -} - -void image_32::set_alpha(float opacity) -{ - for (unsigned int y = 0; y < data_.height(); ++y) - { - unsigned int* row_to = data_.getRow(y); - for (unsigned int x = 0; x < data_.width(); ++x) - { - unsigned rgba = row_to[x]; - unsigned a0 = (rgba >> 24) & 0xff; - unsigned a1 = int( ((rgba >> 24) & 0xff) * opacity ); - //unsigned a1 = opacity; - if (a0 == a1) continue; - - unsigned r = rgba & 0xff; - unsigned g = (rgba >> 8 ) & 0xff; - unsigned b = (rgba >> 16) & 0xff; - - row_to[x] = (a1 << 24)| (b << 16) | (g << 8) | (r) ; - } - } -} - -void image_32::set_background(const color& c) -{ - background_=c; - data_.set(background_->rgba()); -} - -boost::optional const& image_32::get_background() const -{ - return background_; -} - -void image_32::premultiply() -{ - agg::rendering_buffer buffer(data_.getBytes(),data_.width(),data_.height(),data_.width() * 4); - agg::pixfmt_rgba32 pixf(buffer); - pixf.premultiply(); - premultiplied_ = true; -} - -void image_32::demultiply() -{ - agg::rendering_buffer buffer(data_.getBytes(),data_.width(),data_.height(),data_.width() * 4); - agg::pixfmt_rgba32_pre pixf(buffer); - pixf.demultiply(); - premultiplied_ = false; -} - -void image_32::composite_pixel(unsigned op, int x,int y, unsigned c, unsigned cover, double opacity) -{ - using color_type = agg::rgba8; - using value_type = color_type::value_type; - using order_type = agg::order_rgba; - using blender_type = agg::comp_op_adaptor_rgba; - - if (checkBounds(x,y)) - { - unsigned rgba = data_(x,y); - unsigned ca = (unsigned)(((c >> 24) & 0xff) * opacity); - unsigned cb = (c >> 16 ) & 0xff; - unsigned cg = (c >> 8) & 0xff; - unsigned cr = (c & 0xff); - blender_type::blend_pix(op, (value_type*)&rgba, cr, cg, cb, ca, cover); - data_(x,y) = rgba; - } -} - -} diff --git a/src/grid/grid.cpp b/src/grid/grid.cpp index 434e1bca9..b0d3d598d 100644 --- a/src/grid/grid.cpp +++ b/src/grid/grid.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -34,15 +34,14 @@ namespace mapnik { template -const typename hit_grid::value_type hit_grid::base_mask = std::numeric_limits::min(); +const typename hit_grid::value_type hit_grid::base_mask = std::numeric_limits::min(); template -hit_grid::hit_grid(int width, int height, std::string const& key, unsigned int resolution) +hit_grid::hit_grid(std::size_t width, std::size_t height, std::string const& key) : width_(width), height_(height), key_(key), data_(width,height), - resolution_(resolution), id_name_("__id__"), painted_(false), names_(), @@ -60,7 +59,6 @@ hit_grid::hit_grid(hit_grid const& rhs) height_(rhs.height_), key_(rhs.key_), data_(rhs.data_), - resolution_(rhs.resolution_), id_name_("__id__"), painted_(rhs.painted_), names_(rhs.names_), @@ -146,7 +144,7 @@ void hit_grid::add_feature(mapnik::feature_impl const& feature) } -template class hit_grid; +template class MAPNIK_DECL hit_grid; } diff --git a/src/grid/grid_renderer.cpp b/src/grid/grid_renderer.cpp index c72f9d1ca..93afb5b03 100644 --- a/src/grid/grid_renderer.cpp +++ b/src/grid/grid_renderer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -125,10 +125,27 @@ void grid_renderer::end_layer_processing(layer const&) MAPNIK_LOG_DEBUG(grid_renderer) << "grid_renderer: End layer processing"; } -template -void grid_renderer::render_marker(mapnik::feature_impl const& feature, pixel_position const& pos, marker const& marker, agg::trans_affine const& tr, double opacity, composite_mode_e /*comp_op*/) +template +struct grid_render_marker_visitor { - if (marker.is_vector()) + grid_render_marker_visitor(buffer_type & pixmap, + std::unique_ptr const& ras_ptr, + renderer_common const& common, + mapnik::feature_impl const& feature, + pixel_position const& pos, + agg::trans_affine const& tr, + double opacity) + : pixmap_(pixmap), + ras_ptr_(ras_ptr), + common_(common), + feature_(feature), + pos_(pos), + tr_(tr), + opacity_(opacity) {} + + void operator() (marker_null const&) {} + + void operator() (marker_svg const& marker) { using pixfmt_type = typename grid_renderer_base_type::pixfmt_type; using renderer_type = agg::renderer_scanline_bin_solid; @@ -140,61 +157,88 @@ void grid_renderer::render_marker(mapnik::feature_impl const& feature, pixel_ grid_renderer_base_type renb(pixf); renderer_type ren(renb); - ras_ptr->reset(); + ras_ptr_->reset(); - box2d const& bbox = (*marker.get_vector_data())->bounding_box(); + box2d const& bbox = marker.get_data()->bounding_box(); coord c = bbox.center(); // center the svg marker on '0,0' agg::trans_affine mtx = agg::trans_affine_translation(-c.x,-c.y); // apply symbol transformation to get to map space - mtx *= tr; + mtx *= tr_; mtx *= agg::trans_affine_scaling(common_.scale_factor_); // render the marker at the center of the marker box - mtx.translate(pos.x, pos.y); + mtx.translate(pos_.x, pos_.y); using namespace mapnik::svg; - vertex_stl_adapter stl_storage((*marker.get_vector_data())->source()); + vertex_stl_adapter stl_storage(marker.get_data()->source()); svg_path_adapter svg_path(stl_storage); svg_renderer_agg, renderer_type, pixfmt_type> svg_renderer(svg_path, - (*marker.get_vector_data())->attributes()); - - svg_renderer.render_id(*ras_ptr, sl, renb, feature.id(), mtx, opacity, bbox); + marker.get_data()->attributes()); + svg_renderer.render_id(*ras_ptr_, sl, renb, feature_.id(), mtx, opacity_, bbox); } - else + + void operator() (marker_rgba8 const& marker) { - image_data_rgba8 const& data = **marker.get_bitmap_data(); + image_rgba8 const& data = marker.get_data(); double width = data.width(); double height = data.height(); double cx = 0.5 * width; double cy = 0.5 * height; - if ((std::fabs(1.0 - common_.scale_factor_) < 0.001 && tr.is_identity())) + if ((std::fabs(1.0 - common_.scale_factor_) < 0.001 && tr_.is_identity())) { // TODO - support opacity - pixmap_.set_rectangle(feature.id(), data, - boost::math::iround(pos.x - cx), - boost::math::iround(pos.y - cy)); + pixmap_.set_rectangle(feature_.id(), data, + boost::math::iround(pos_.x - cx), + boost::math::iround(pos_.y - cy)); } else { - image_data_rgba8 target(data.width(), data.height()); + image_rgba8 target(data.width(), data.height()); mapnik::scale_image_agg(target, data, SCALING_NEAR, 1, 1, 0.0, 0.0, 1.0); // TODO: is 1.0 a valid default here, and do we even care in grid_renderer what the image looks like? - pixmap_.set_rectangle(feature.id(), target, - boost::math::iround(pos.x - cx), - boost::math::iround(pos.y - cy)); + pixmap_.set_rectangle(feature_.id(), target, + boost::math::iround(pos_.x - cx), + boost::math::iround(pos_.y - cy)); } } + + private: + buffer_type & pixmap_; + std::unique_ptr const& ras_ptr_; + renderer_common const& common_; + mapnik::feature_impl const& feature_; + pixel_position const& pos_; + agg::trans_affine const& tr_; + double opacity_; +}; + +template +void grid_renderer::render_marker(mapnik::feature_impl const& feature, + pixel_position const& pos, + marker const& marker, + agg::trans_affine const& tr, + double opacity, + composite_mode_e /*comp_op*/) +{ + grid_render_marker_visitor visitor(pixmap_, + ras_ptr, + common_, + feature, + pos, + tr, + opacity); + util::apply_visitor(visitor, marker); pixmap_.add_feature(feature); } -template class grid_renderer; +template class MAPNIK_DECL grid_renderer; } diff --git a/src/grid/process_building_symbolizer.cpp b/src/grid/process_building_symbolizer.cpp index cc31772a0..e6649da53 100644 --- a/src/grid/process_building_symbolizer.cpp +++ b/src/grid/process_building_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -56,7 +56,7 @@ void grid_renderer::process(building_symbolizer const& sym, using pixfmt_type = typename grid_renderer_base_type::pixfmt_type; using color_type = typename grid_renderer_base_type::pixfmt_type::color_type; using renderer_type = agg::renderer_scanline_bin_solid; - using path_type = transform_path_adapter; + using transform_path_type = transform_path_adapter; agg::scanline_bin sl; grid_rendering_buffer buf(pixmap_.raw_data(), common_.width_, common_.height_, common_.width_); @@ -71,23 +71,29 @@ void grid_renderer::process(building_symbolizer const& sym, render_building_symbolizer( feature, height, - [&](geometry_type &faces) { - path_type faces_path (common_.t_,faces,prj_trans); + [&](path_type const& faces) + { + vertex_adapter va(faces); + transform_path_type faces_path (common_.t_,va,prj_trans); ras_ptr->add_path(faces_path); ren.color(color_type(feature.id())); agg::render_scanlines(*ras_ptr, sl, ren); ras_ptr->reset(); }, - [&](geometry_type &frame) { - path_type path(common_.t_,frame,prj_trans); - agg::conv_stroke stroke(path); + [&](path_type const& frame) + { + vertex_adapter va(frame); + transform_path_type path(common_.t_,va,prj_trans); + agg::conv_stroke stroke(path); ras_ptr->add_path(stroke); ren.color(color_type(feature.id())); agg::render_scanlines(*ras_ptr, sl, ren); ras_ptr->reset(); }, - [&](geometry_type &roof) { - path_type roof_path (common_.t_,roof,prj_trans); + [&](path_type const& roof) + { + vertex_adapter va(roof); + transform_path_type roof_path (common_.t_,va,prj_trans); ras_ptr->add_path(roof_path); ren.color(color_type(feature.id())); agg::render_scanlines(*ras_ptr, sl, ren); diff --git a/src/grid/process_group_symbolizer.cpp b/src/grid/process_group_symbolizer.cpp index 8be4562c7..25c360027 100644 --- a/src/grid/process_group_symbolizer.cpp +++ b/src/grid/process_group_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -131,12 +131,13 @@ struct thunk_renderer offset_, [&] (glyph_positions_ptr glyphs) { - if (glyphs->marker()) + marker_info_ptr mark = glyphs->get_marker(); + if (mark) { ren_.render_marker(feature_, glyphs->marker_pos(), - *(glyphs->marker()->marker), - glyphs->marker()->transform, + *mark->marker_, + mark->transform_, thunk.opacity_, thunk.comp_op_); } ren.render(*glyphs, feature_id); diff --git a/src/grid/process_line_pattern_symbolizer.cpp b/src/grid/process_line_pattern_symbolizer.cpp index e46bf931d..d34f6e861 100644 --- a/src/grid/process_line_pattern_symbolizer.cpp +++ b/src/grid/process_line_pattern_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,8 +32,9 @@ #include #include #include +#include #include - +#include // agg #include "agg_rasterizer_scanline_aa.h" #include "agg_renderer_scanline.h" @@ -53,18 +54,15 @@ void grid_renderer::process(line_pattern_symbolizer const& sym, { std::string filename = get(sym, feature, common_.vars_); if (filename.empty()) return; - boost::optional mark = marker_cache::instance().find(filename, true); - if (!mark) return; + std::shared_ptr mark = marker_cache::instance().find(filename, true); + if (mark->is()) return; - if (!(*mark)->is_bitmap()) + if (!mark->is()) { MAPNIK_LOG_DEBUG(agg_renderer) << "agg_renderer: Only images (not '" << filename << "') are supported in the line_pattern_symbolizer"; return; } - boost::optional pat = (*mark)->get_bitmap_data(); - if (!pat) return; - value_bool clip = get(sym, feature, common_.vars_); value_double offset = get(sym, feature, common_.vars_); value_double simplify_tolerance = get(sym, feature, common_.vars_); @@ -84,7 +82,7 @@ void grid_renderer::process(line_pattern_symbolizer const& sym, ras_ptr->reset(); - int stroke_width = (*pat)->width(); + std::size_t stroke_width = mark->width(); agg::trans_affine tr; auto transform = get_optional(sym, keys::geometry_transform); @@ -117,11 +115,11 @@ void grid_renderer::process(line_pattern_symbolizer const& sym, put(line, keys::simplify_tolerance, value_double(simplify_tolerance)); put(line, keys::smooth, value_double(smooth)); - vertex_converter - converter(clipping_extent,*ras_ptr,line,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); + using vertex_converter_type = vertex_converter; + vertex_converter_type converter(clipping_extent,line,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform if (std::fabs(offset) > 0.0) converter.set(); // parallel offset @@ -129,14 +127,10 @@ void grid_renderer::process(line_pattern_symbolizer const& sym, if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter converter.set(); //always stroke - - for (geometry_type & geom : feature.paths()) - { - if (geom.size() > 1) - { - converter.apply(geom); - } - } + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = geometry::vertex_processor; + apply_vertex_converter_type apply(converter, *ras_ptr); + mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); // render id ren.color(color_type(feature.id())); diff --git a/src/grid/process_line_symbolizer.cpp b/src/grid/process_line_symbolizer.cpp index 2b5d03b36..0dc6f3f6a 100644 --- a/src/grid/process_line_symbolizer.cpp +++ b/src/grid/process_line_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,7 +29,8 @@ #include #include #include - +#include +#include // agg #include "agg_rasterizer_scanline_aa.h" #include "agg_renderer_scanline.h" @@ -88,11 +89,13 @@ void grid_renderer::process(line_symbolizer const& sym, padding *= common_.scale_factor_; clipping_extent.pad(padding); } + using vertex_converter_type = vertex_converter; - vertex_converter - converter(clipping_extent,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); + vertex_converter_type converter(clipping_extent,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform if (std::fabs(offset) > 0.0) converter.set(); // parallel offset @@ -102,13 +105,10 @@ void grid_renderer::process(line_symbolizer const& sym, if (has_dash) converter.set(); converter.set(); //always stroke - for ( geometry_type & geom : feature.paths()) - { - if (geom.size() > 1) - { - converter.apply(geom); - } - } + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = geometry::vertex_processor; + apply_vertex_converter_type apply(converter, *ras_ptr); + mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); // render id ren.color(color_type(feature.id())); diff --git a/src/grid/process_markers_symbolizer.cpp b/src/grid/process_markers_symbolizer.cpp index 2d7fa49f9..b79807ec0 100644 --- a/src/grid/process_markers_symbolizer.cpp +++ b/src/grid/process_markers_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -45,7 +45,6 @@ porting notes --> // mapnik #include -#include #include #include #include @@ -146,7 +145,7 @@ struct raster_markers_rasterizer_dispatch : public raster_markers_dispatch::type; using PixMapType = typename std::tuple_element<2,RendererContext>::type; - raster_markers_rasterizer_dispatch(image_data_rgba8 & src, + raster_markers_rasterizer_dispatch(image_rgba8 const& src, agg::trans_affine const& marker_trans, markers_symbolizer const& sym, Detector & detector, @@ -165,6 +164,8 @@ struct raster_markers_rasterizer_dispatch : public raster_markers_dispatchsrc_ provided that converts + // the destination pixel type required. render_raster_marker(RendererType(renb_), ras_, this->src_, this->feature_, marker_tr, opacity); if (!placed_) { diff --git a/src/grid/process_point_symbolizer.cpp b/src/grid/process_point_symbolizer.cpp index ded85034a..731291d78 100644 --- a/src/grid/process_point_symbolizer.cpp +++ b/src/grid/process_point_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/grid/process_polygon_pattern_symbolizer.cpp b/src/grid/process_polygon_pattern_symbolizer.cpp index 4fdb12bf0..604c0c253 100644 --- a/src/grid/process_polygon_pattern_symbolizer.cpp +++ b/src/grid/process_polygon_pattern_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,9 +30,11 @@ #include #include #include +#include #include #include #include +#include // agg #include "agg_rasterizer_scanline_aa.h" @@ -52,18 +54,15 @@ void grid_renderer::process(polygon_pattern_symbolizer const& sym, { std::string filename = get(sym, feature, common_.vars_); if (filename.empty()) return; - boost::optional mark = marker_cache::instance().find(filename, true); - if (!mark) return; + std::shared_ptr mark = marker_cache::instance().find(filename, true); + if (mark->is()) return; - if (!(*mark)->is_bitmap()) + if (!mark->is()) { MAPNIK_LOG_DEBUG(agg_renderer) << "agg_renderer: Only images (not '" << filename << "') are supported in the line_pattern_symbolizer"; return; } - boost::optional pat = (*mark)->get_bitmap_data(); - if (!pat) return; - ras_ptr->reset(); value_bool clip = get(sym, feature, common_.vars_); @@ -77,8 +76,8 @@ void grid_renderer::process(polygon_pattern_symbolizer const& sym, evaluate_transform(tr, feature, common_.vars_, *transform, common_.scale_factor_); } - vertex_converter - converter(common_.query_extent_,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); + using vertex_converter_type = vertex_converter; + vertex_converter_type converter(common_.query_extent_,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (prj_trans.equal() && clip) converter.set(); //optional clip (default: true) converter.set(); //always transform @@ -86,13 +85,11 @@ void grid_renderer::process(polygon_pattern_symbolizer const& sym, if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - for ( geometry_type & geom : feature.paths()) - { - if (geom.size() > 2) - { - converter.apply(geom); - } - } + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = geometry::vertex_processor; + apply_vertex_converter_type apply(converter, *ras_ptr); + mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); + using pixfmt_type = typename grid_renderer_base_type::pixfmt_type; using color_type = typename grid_renderer_base_type::pixfmt_type::color_type; using renderer_type = agg::renderer_scanline_bin_solid; diff --git a/src/grid/process_polygon_symbolizer.cpp b/src/grid/process_polygon_symbolizer.cpp index b659dc0cd..3e1f08932 100644 --- a/src/grid/process_polygon_symbolizer.cpp +++ b/src/grid/process_polygon_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -53,7 +53,7 @@ void grid_renderer::process(polygon_symbolizer const& sym, using renderer_type = agg::renderer_scanline_bin_solid; using pixfmt_type = typename grid_renderer_base_type::pixfmt_type; using color_type = typename grid_renderer_base_type::pixfmt_type::color_type; - using vertex_converter_type = vertex_converter; + using vertex_converter_type = vertex_converter; ras_ptr->reset(); diff --git a/src/grid/process_raster_symbolizer.cpp b/src/grid/process_raster_symbolizer.cpp index aff12a419..9e392a720 100644 --- a/src/grid/process_raster_symbolizer.cpp +++ b/src/grid/process_raster_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/grid/process_shield_symbolizer.cpp b/src/grid/process_shield_symbolizer.cpp index 42f42dcd2..ae4ffa2d1 100644 --- a/src/grid/process_shield_symbolizer.cpp +++ b/src/grid/process_shield_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -66,12 +66,13 @@ void grid_renderer::process(shield_symbolizer const& sym, for (glyph_positions_ptr glyphs : placements) { - if (glyphs->marker()) + marker_info_ptr mark = glyphs->get_marker(); + if (mark) { render_marker(feature, glyphs->marker_pos(), - *(glyphs->marker()->marker), - glyphs->marker()->transform, + *mark->marker_, + mark->transform_, opacity, comp_op); } ren.render(*glyphs, feature_id); diff --git a/src/grid/process_text_symbolizer.cpp b/src/grid/process_text_symbolizer.cpp index 921ce1d71..a615a5db6 100644 --- a/src/grid/process_text_symbolizer.cpp +++ b/src/grid/process_text_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -54,14 +54,13 @@ void grid_renderer::process(text_symbolizer const& sym, grid_text_renderer ren(pixmap_, comp_op, common_.scale_factor_); - { // halo transform - agg::trans_affine halo_transform; - auto transform = get_optional(sym, keys::halo_transform); - if (transform) - { - evaluate_transform(halo_transform, feature, common_.vars_, *transform); - ren.set_halo_transform(halo_transform); - } + + auto halo_transform = get_optional(sym, keys::halo_transform); + if (halo_transform) + { + agg::trans_affine halo_affine_transform; + evaluate_transform(halo_affine_transform, feature, common_.vars_, *halo_transform); + ren.set_halo_transform(halo_affine_transform); } placements_list const& placements = helper.get(); diff --git a/src/group/group_layout_manager.cpp b/src/group/group_layout_manager.cpp index 7c6f7b8c6..fe00e7d02 100644 --- a/src/group/group_layout_manager.cpp +++ b/src/group/group_layout_manager.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,6 +23,7 @@ // mapnik #include #include +#include // std #include @@ -85,7 +86,7 @@ struct process_layout } bound_box layout_box; - size_t middle_ifirst = (member_boxes_.size() - 1) >> 1; + int middle_ifirst = safe_cast((member_boxes_.size() - 1) >> 1); int top_i = 0; int bottom_i = 0; if (middle_ifirst % 2 == 0) @@ -102,8 +103,8 @@ struct process_layout while (bottom_i >= 0 && top_i >= 0 && top_i < static_cast(member_offsets_.size())) { - layout_box.expand_to_include(make_horiz_pair(top_i, layout_box.miny() - y_margin, -1, x_margin, layout.get_max_difference())); - layout_box.expand_to_include(make_horiz_pair(bottom_i, layout_box.maxy() + y_margin, 1, x_margin, layout.get_max_difference())); + layout_box.expand_to_include(make_horiz_pair(static_cast(top_i), layout_box.miny() - y_margin, -1, x_margin, layout.get_max_difference())); + layout_box.expand_to_include(make_horiz_pair(static_cast(bottom_i), layout_box.maxy() + y_margin, 1, x_margin, layout.get_max_difference())); top_i -= 2; bottom_i += 2; } diff --git a/src/group/group_rule.cpp b/src/group/group_rule.cpp index 4ea7d9c34..a1a6bf940 100644 --- a/src/group/group_rule.cpp +++ b/src/group/group_rule.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/group/group_symbolizer_helper.cpp b/src/group/group_symbolizer_helper.cpp index 56fd8a730..a8e453a69 100644 --- a/src/group/group_symbolizer_helper.cpp +++ b/src/group/group_symbolizer_helper.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,7 +23,9 @@ // mapnik #include #include -#include +//#include +#include +#include #include #include #include @@ -35,7 +37,30 @@ //agg #include "agg_conv_clip_polyline.h" -namespace mapnik { +namespace mapnik { namespace detail { + +template +struct apply_find_line_placements : util::noncopyable +{ + apply_find_line_placements(view_transform const& t, proj_transform const& prj_trans, Helper & helper) + : t_(t), + prj_trans_(prj_trans), + helper_(helper) {} + + template + void operator() (Adapter & va) const + { + using vertex_adapter_type = Adapter; + using path_type = transform_path_adapter; + path_type path(t_, va, prj_trans_); + helper_.find_line_placements(path); + } + view_transform const& t_; + proj_transform const& prj_trans_; + Helper & helper_; +}; + +} // ns detail group_symbolizer_helper::group_symbolizer_helper( group_symbolizer const& sym, feature_impl const& feature, @@ -61,13 +86,13 @@ pixel_position_list const& group_symbolizer_helper::get() } else { + using apply_find_line_placements = detail::apply_find_line_placements; for (auto const& geom : geometries_to_process_) { // TODO to support clipped geometries this needs to use // vertex_converters - using path_type = transform_path_adapter; - path_type path(t_, *geom, prj_trans_); - find_line_placements(path); + apply_find_line_placements apply(t_, prj_trans_, *this); + mapnik::util::apply_visitor(geometry::vertex_processor(apply), geom); } } @@ -146,10 +171,10 @@ bool group_symbolizer_helper::collision(box2d const& box, value_unicode_ { if (!detector_.extent().intersects(box) || - (text_props_->avoid_edges && !query_extent_.contains(box)) + (text_props_->avoid_edges && !dims_.contains(box)) || (text_props_->minimum_padding > 0 && - !query_extent_.contains(box + (scale_factor_ * text_props_->minimum_padding))) + !dims_.contains(box + (scale_factor_ * text_props_->minimum_padding))) || (!text_props_->allow_overlap && ((repeat_key.length() == 0 && !detector_.has_placement(box, text_props_->margin * scale_factor_)) diff --git a/src/image.cpp b/src/image.cpp new file mode 100644 index 000000000..caa0a8fc1 --- /dev/null +++ b/src/image.cpp @@ -0,0 +1,106 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +// mapnik +#include +#include +#include +#include +#include + +namespace mapnik +{ + +namespace detail +{ + +// BUFFER +buffer::buffer(std::size_t size) + : size_(size), + data_(static_cast(size_ != 0 ? ::operator new(size_) : nullptr)) +{} + +buffer::buffer(buffer && rhs) noexcept +: size_(std::move(rhs.size_)), + data_(std::move(rhs.data_)) +{ + rhs.size_ = 0; + rhs.data_ = nullptr; +} + +buffer::buffer(buffer const& rhs) + : size_(rhs.size_), + data_(static_cast(size_ != 0 ? ::operator new(size_) : nullptr)) +{ + if (data_) std::copy(rhs.data_, rhs.data_ + rhs.size_, data_); +} + +buffer::~buffer() +{ + ::operator delete(data_); +} + +buffer& buffer::operator=(buffer rhs) +{ + swap(rhs); + return *this; +} + +void buffer::swap(buffer & rhs) +{ + std::swap(size_, rhs.size_); + std::swap(data_, rhs.data_); +} + +unsigned char* buffer::data() +{ + return data_; +} + +unsigned char const* buffer::data() const +{ + return data_; +} + +std::size_t buffer::size() const +{ + return size_; +} + +template struct MAPNIK_DECL image_dimensions<65535>; + +} // end ns detail + +template class MAPNIK_DECL image; +template class MAPNIK_DECL image; +template class MAPNIK_DECL image; +template class MAPNIK_DECL image; +template class MAPNIK_DECL image; +template class MAPNIK_DECL image; +template class MAPNIK_DECL image; +template class MAPNIK_DECL image; +template class MAPNIK_DECL image; +template class MAPNIK_DECL image; +template class MAPNIK_DECL image; +template class MAPNIK_DECL image; + +} // end ns diff --git a/src/image_any.cpp b/src/image_any.cpp new file mode 100644 index 000000000..5ba0c3947 --- /dev/null +++ b/src/image_any.cpp @@ -0,0 +1,268 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +#include + +namespace mapnik { + +namespace detail { + +struct get_bytes_visitor +{ + template + unsigned char* operator()(T & data) const + { + return data.bytes(); + } +}; + +struct get_bytes_visitor_const +{ + template + unsigned char const* operator()(T const& data) const + { + return data.bytes(); + } +}; + +struct get_dtype_visitor +{ + template + image_dtype operator()(T const& data) const + { + return data.get_dtype(); + } +}; + +struct get_width_visitor +{ + template + std::size_t operator()(T const& data) const + { + return data.width(); + } +}; + +struct get_height_visitor +{ + template + std::size_t operator()(T const& data) const + { + return data.height(); + } +}; + +struct get_premultiplied_visitor +{ + template + bool operator()(T const& data) const + { + return data.get_premultiplied(); + } +}; + +struct get_painted_visitor +{ + template + bool operator()(T const& data) const + { + return data.painted(); + } +}; + +struct get_any_size_visitor +{ + template + std::size_t operator()(T const& data) const + { + return data.size(); + } +}; + +struct get_any_row_size_visitor +{ + template + std::size_t operator()(T const& data) const + { + return data.row_size(); + } +}; + +struct get_offset_visitor +{ + template + double operator() (T const& data) const + { + return data.get_offset(); + } +}; + +struct get_scaling_visitor +{ + template + double operator() (T const& data) const + { + return data.get_scaling(); + } +}; + +struct set_offset_visitor +{ + set_offset_visitor(double val) + : val_(val) {} + template + void operator() (T & data) const + { + data.set_offset(val_); + } +private: + double val_; +}; + +struct set_scaling_visitor +{ + set_scaling_visitor(double val) + : val_(val) {} + template + void operator() (T & data) const + { + data.set_scaling(val_); + } +private: + double val_; +}; + +} // namespace detail + +MAPNIK_DECL image_any::image_any(int width, + int height, + image_dtype type, + bool initialize, + bool premultiplied, + bool painted) + : image_base(std::move(create_image_any(width, height, type, initialize, premultiplied, painted))) {} + +MAPNIK_DECL unsigned char const* image_any::bytes() const +{ + return util::apply_visitor(detail::get_bytes_visitor_const(),*this); +} + +MAPNIK_DECL unsigned char* image_any::bytes() +{ + return util::apply_visitor(detail::get_bytes_visitor(),*this); +} + +MAPNIK_DECL std::size_t image_any::width() const +{ + return util::apply_visitor(detail::get_width_visitor(),*this); +} + +MAPNIK_DECL std::size_t image_any::height() const +{ + return util::apply_visitor(detail::get_height_visitor(),*this); +} + +MAPNIK_DECL bool image_any::get_premultiplied() const +{ + return util::apply_visitor(detail::get_premultiplied_visitor(),*this); +} + +MAPNIK_DECL bool image_any::painted() const +{ + return util::apply_visitor(detail::get_painted_visitor(),*this); +} + +MAPNIK_DECL std::size_t image_any::size() const +{ + return util::apply_visitor(detail::get_any_size_visitor(),*this); +} + +MAPNIK_DECL std::size_t image_any::row_size() const +{ + return util::apply_visitor(detail::get_any_row_size_visitor(),*this); +} + +MAPNIK_DECL double image_any::get_offset() const +{ + return util::apply_visitor(detail::get_offset_visitor(),*this); +} + +MAPNIK_DECL double image_any::get_scaling() const +{ + return util::apply_visitor(detail::get_scaling_visitor(),*this); +} + +MAPNIK_DECL image_dtype image_any::get_dtype() const +{ + return util::apply_visitor(detail::get_dtype_visitor(),*this); +} + +MAPNIK_DECL void image_any::set_offset(double val) +{ + util::apply_visitor(detail::set_offset_visitor(val),*this); +} + +MAPNIK_DECL void image_any::set_scaling(double val) +{ + util::apply_visitor(detail::set_scaling_visitor(val),*this); +} + + +MAPNIK_DECL image_any create_image_any(int width, + int height, + image_dtype type, + bool initialize, + bool premultiplied, + bool painted) +{ + switch (type) + { + case image_dtype_gray8: + return image_any(image_gray8(width, height, initialize, premultiplied, painted)); + case image_dtype_gray8s: + return image_any(image_gray8s(width, height, initialize, premultiplied, painted)); + case image_dtype_gray16: + return image_any(image_gray16(width, height, initialize, premultiplied, painted)); + case image_dtype_gray16s: + return image_any(image_gray16s(width, height, initialize, premultiplied, painted)); + case image_dtype_gray32: + return image_any(image_gray32(width, height, initialize, premultiplied, painted)); + case image_dtype_gray32s: + return image_any(image_gray32s(width, height, initialize, premultiplied, painted)); + case image_dtype_gray32f: + return image_any(image_gray32f(width, height, initialize, premultiplied, painted)); + case image_dtype_gray64: + return image_any(image_gray64(width, height, initialize, premultiplied, painted)); + case image_dtype_gray64s: + return image_any(image_gray64s(width, height, initialize, premultiplied, painted)); + case image_dtype_gray64f: + return image_any(image_gray64f(width, height, initialize, premultiplied, painted)); + case image_dtype_null: + return image_any(image_null()); + case image_dtype_rgba8: + case IMAGE_DTYPE_MAX: + default: + return image_any(image_rgba8(width, height, initialize, premultiplied, painted)); + } +} + +} // end mapnik ns diff --git a/src/image_compositing.cpp b/src/image_compositing.cpp index 75e9884d2..83684e442 100644 --- a/src/image_compositing.cpp +++ b/src/image_compositing.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,12 +22,17 @@ // mapnik #include -#include +#include +#include +#include +#include // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" #pragma GCC diagnostic ignored "-Wredeclared-class-member" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop @@ -122,68 +127,50 @@ For example, if you generate some pattern with AGG (premultiplied) and would lik */ -namespace detail { - -// non-mutable rendering_buffer implementation -template -struct rendering_buffer -{ - using image_data_type = T; - using pixel_type = typename image_data_type::pixel_type; - using row_data = agg::const_row_info; - - rendering_buffer(T const& data) - : data_(data) {} - - uint8_t const* buf() const { return data_.getBytes(); } - unsigned width() const { return data_.width();} - unsigned height() const { return data_.height();} - int stride() const { return data_.width() * sizeof(pixel_type);} - uint8_t const* row_ptr(int, int y, unsigned) {return row_ptr(y);} - uint8_t const* row_ptr(int y) const { return reinterpret_cast(data_.getRow(y)); } - row_data row (int y) const { return row_data(0, data_.width() - 1, row_ptr(y)); } - image_data_type const& data_; -}; - -} - template <> -MAPNIK_DECL void composite(image_data_rgba8 & dst, image_data_rgba8 const& src, composite_mode_e mode, +MAPNIK_DECL void composite(image_rgba8 & dst, image_rgba8 const& src, composite_mode_e mode, float opacity, int dx, - int dy, - bool premultiply_src) + int dy) { using color = agg::rgba8; using order = agg::order_rgba; - using const_rendering_buffer = detail::rendering_buffer; + using const_rendering_buffer = util::rendering_buffer; using blender_type = agg::comp_op_adaptor_rgba_pre; using pixfmt_type = agg::pixfmt_custom_blend_rgba; using renderer_type = agg::renderer_base; - agg::rendering_buffer dst_buffer(dst.getBytes(),dst.width(),dst.height(),dst.width() * 4); + agg::rendering_buffer dst_buffer(dst.bytes(),safe_cast(dst.width()),safe_cast(dst.height()),safe_cast(dst.row_size())); const_rendering_buffer src_buffer(src); pixfmt_type pixf(dst_buffer); pixf.comp_op(static_cast(mode)); - agg::pixfmt_alpha_blend_rgba pixf_mask(src_buffer); - if (premultiply_src) pixf_mask.premultiply(); + agg::pixfmt_alpha_blend_rgba pixf_mask(src_buffer); +#ifdef MAPNIK_DEBUG + if (!src.get_premultiplied()) + { + throw std::runtime_error("SOURCE MUST BE PREMULTIPLIED FOR COMPOSITING!"); + } + if (!dst.get_premultiplied()) + { + throw std::runtime_error("DESTINATION MUST BE PREMULTIPLIED FOR COMPOSITING!"); + } +#endif renderer_type ren(pixf); - ren.blend_from(pixf_mask,0,dx,dy,unsigned(255*opacity)); + ren.blend_from(pixf_mask,0,dx,dy,safe_cast(255*opacity)); } template <> -MAPNIK_DECL void composite(image_data_gray32f & dst, image_data_gray32f const& src, composite_mode_e mode, - float opacity, +MAPNIK_DECL void composite(image_gray32f & dst, image_gray32f const& src, composite_mode_e /*mode*/, + float /*opacity*/, int dx, - int dy, - bool premultiply_src) + int dy) { - using const_rendering_buffer = detail::rendering_buffer; + using const_rendering_buffer = util::rendering_buffer; using src_pixfmt_type = agg::pixfmt_alpha_blend_gray, const_rendering_buffer, 1, 0>; using dst_pixfmt_type = agg::pixfmt_alpha_blend_gray, agg::rendering_buffer, 1, 0>; using renderer_type = agg::renderer_base; - agg::rendering_buffer dst_buffer(dst.getBytes(),dst.width(),dst.height(),dst.width()); + agg::rendering_buffer dst_buffer(dst.bytes(),safe_cast(dst.width()),safe_cast(dst.height()),safe_cast(dst.width())); const_rendering_buffer src_buffer(src); dst_pixfmt_type pixf(dst_buffer); src_pixfmt_type pixf_mask(src_buffer); @@ -191,4 +178,59 @@ MAPNIK_DECL void composite(image_data_gray32f & dst, image_data_gray32f const& s ren.copy_from(pixf_mask,0,dx,dy); } +namespace detail { + +struct composite_visitor +{ + composite_visitor(image_any const& src, + composite_mode_e mode, + float opacity, + int dx, + int dy) + : src_(src), + mode_(mode), + opacity_(opacity), + dx_(dx), + dy_(dy) {} + + template + void operator() (T & dst); + + private: + image_any const& src_; + composite_mode_e mode_; + float opacity_; + int dx_; + int dy_; +}; + +template +void composite_visitor::operator() (T & dst) +{ + throw std::runtime_error("Error: Composite with " + std::string(typeid(dst).name()) + " is not supported"); +} + +template <> +void composite_visitor::operator() (image_rgba8 & dst) +{ + composite(dst, util::get(src_), mode_, opacity_, dx_, dy_); +} + +template <> +void composite_visitor::operator() (image_gray32f & dst) +{ + composite(dst, util::get(src_), mode_, opacity_, dx_, dy_); +} + +} // end ns + +template <> +MAPNIK_DECL void composite(image_any & dst, image_any const& src, composite_mode_e mode, + float opacity, + int dx, + int dy) +{ + util::apply_visitor(detail::composite_visitor(src, mode, opacity, dx, dy), dst); +} + } diff --git a/src/image_copy.cpp b/src/image_copy.cpp new file mode 100644 index 000000000..01225c25b --- /dev/null +++ b/src/image_copy.cpp @@ -0,0 +1,333 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +// mapnik +#include +#include +#include +#include + +namespace mapnik +{ + +namespace detail +{ + +template +struct visitor_image_copy +{ + using dst_type = typename T0::pixel_type; + + T0 operator() (image_null const&) + { + throw std::runtime_error("Can not cast a null image"); + } + + T0 operator() (T0 const& src) + { + return T0(src); + } + + template + T0 operator() (T1 const& src) + { + T0 dst(safe_cast(src.width()), safe_cast(src.height()), false); + for (std::size_t y = 0; y < dst.height(); ++y) + { + for (std::size_t x = 0; x < dst.width(); ++x) + { + dst(x,y) = safe_cast(src(x,y)); + } + } + return T0(std::move(dst)); + } +}; + +template +struct visitor_image_copy_so +{ + using dst_type = typename T0::pixel_type; + + visitor_image_copy_so(double offset, double scaling) + : offset_(offset), scaling_(scaling) {} + + T0 operator() (image_null const&) + { + throw std::runtime_error("Can not cast a null image"); + } + + T0 operator() (T0 const& src) + { + if (offset_ == src.get_offset() && scaling_ == src.get_scaling()) + { + return T0(src); + } + else + { + T0 dst(src); + dst.set_scaling(scaling_); + dst.set_offset(offset_); + return T0(std::move(dst)); + } + } + + template + T0 operator() (T1 const& src) + { + double src_offset = src.get_offset(); + double src_scaling = src.get_scaling(); + T0 dst(safe_cast(src.width()), safe_cast(src.height()), false); + dst.set_scaling(scaling_); + dst.set_offset(offset_); + for (std::size_t y = 0; y < dst.height(); ++y) + { + for (std::size_t x = 0; x < dst.width(); ++x) + { + double scaled_src_val = (safe_cast(src(x,y)) * src_scaling) + src_offset; + double dst_val = (scaled_src_val - offset_) / scaling_; + dst(x,y) = safe_cast(dst_val); + } + } + return T0(std::move(dst)); + } + private: + double offset_; + double scaling_; +}; + +} // end detail ns + +template +MAPNIK_DECL T image_copy(image_any const& data, double offset, double scaling) +{ + if (offset == 0.0 && scaling == 1.0 && data.get_offset() == 0.0 && data.get_scaling() == 1.0) + { + return util::apply_visitor(detail::visitor_image_copy(), data); + } + else + { + return util::apply_visitor(detail::visitor_image_copy_so(offset, scaling), data); + } +} + +template +MAPNIK_DECL T image_copy(image_rgba8 const& data, double offset, double scaling) +{ + if (offset == 0.0 && scaling == 1.0 && data.get_offset() == 0.0 && data.get_scaling() == 1.0) + { + detail::visitor_image_copy visit; + return visit(data); + } + else + { + detail::visitor_image_copy_so visit(offset, scaling); + return visit(data); + } +} + +template +MAPNIK_DECL T image_copy(image_gray8 const& data, double offset, double scaling) +{ + if (offset == 0.0 && scaling == 1.0 && data.get_offset() == 0.0 && data.get_scaling() == 1.0) + { + detail::visitor_image_copy visit; + return visit(data); + } + else + { + detail::visitor_image_copy_so visit(offset, scaling); + return visit(data); + } +} + +template +MAPNIK_DECL T image_copy(image_gray8s const& data, double offset, double scaling) +{ + if (offset == 0.0 && scaling == 1.0 && data.get_offset() == 0.0 && data.get_scaling() == 1.0) + { + detail::visitor_image_copy visit; + return visit(data); + } + else + { + detail::visitor_image_copy_so visit(offset, scaling); + return visit(data); + } +} + +template +MAPNIK_DECL T image_copy(image_gray16 const& data, double offset, double scaling) +{ + if (offset == 0.0 && scaling == 1.0 && data.get_offset() == 0.0 && data.get_scaling() == 1.0) + { + detail::visitor_image_copy visit; + return visit(data); + } + else + { + detail::visitor_image_copy_so visit(offset, scaling); + return visit(data); + } +} + +template +MAPNIK_DECL T image_copy(image_gray16s const& data, double offset, double scaling) +{ + if (offset == 0.0 && scaling == 1.0 && data.get_offset() == 0.0 && data.get_scaling() == 1.0) + { + detail::visitor_image_copy visit; + return visit(data); + } + else + { + detail::visitor_image_copy_so visit(offset, scaling); + return visit(data); + } +} + +template +MAPNIK_DECL T image_copy(image_gray32 const& data, double offset, double scaling) +{ + if (offset == 0.0 && scaling == 1.0 && data.get_offset() == 0.0 && data.get_scaling() == 1.0) + { + detail::visitor_image_copy visit; + return visit(data); + } + else + { + detail::visitor_image_copy_so visit(offset, scaling); + return visit(data); + } +} + +template +MAPNIK_DECL T image_copy(image_gray32s const& data, double offset, double scaling) +{ + if (offset == 0.0 && scaling == 1.0 && data.get_offset() == 0.0 && data.get_scaling() == 1.0) + { + detail::visitor_image_copy visit; + return visit(data); + } + else + { + detail::visitor_image_copy_so visit(offset, scaling); + return visit(data); + } +} + +template +MAPNIK_DECL T image_copy(image_gray32f const& data, double offset, double scaling) +{ + if (offset == 0.0 && scaling == 1.0 && data.get_offset() == 0.0 && data.get_scaling() == 1.0) + { + detail::visitor_image_copy visit; + return visit(data); + } + else + { + detail::visitor_image_copy_so visit(offset, scaling); + return visit(data); + } +} + +template +MAPNIK_DECL T image_copy(image_gray64 const& data, double offset, double scaling) +{ + if (offset == 0.0 && scaling == 1.0 && data.get_offset() == 0.0 && data.get_scaling() == 1.0) + { + detail::visitor_image_copy visit; + return visit(data); + } + else + { + detail::visitor_image_copy_so visit(offset, scaling); + return visit(data); + } +} + +template +MAPNIK_DECL T image_copy(image_gray64s const& data, double offset, double scaling) +{ + if (offset == 0.0 && scaling == 1.0 && data.get_offset() == 0.0 && data.get_scaling() == 1.0) + { + detail::visitor_image_copy visit; + return visit(data); + } + else + { + detail::visitor_image_copy_so visit(offset, scaling); + return visit(data); + } +} + +template +MAPNIK_DECL T image_copy(image_gray64f const& data, double offset, double scaling) +{ + if (offset == 0.0 && scaling == 1.0 && data.get_offset() == 0.0 && data.get_scaling() == 1.0) + { + detail::visitor_image_copy visit; + return visit(data); + } + else + { + detail::visitor_image_copy_so visit(offset, scaling); + return visit(data); + } +} + +MAPNIK_DECL image_any image_copy(image_any const& data, image_dtype type, double offset, double scaling) +{ + switch (type) + { + case image_dtype_rgba8: + return image_any(image_copy(data, offset, scaling)); + case image_dtype_gray8: + return image_any(image_copy(data, offset, scaling)); + case image_dtype_gray8s: + return image_any(image_copy(data, offset, scaling)); + case image_dtype_gray16: + return image_any(image_copy(data, offset, scaling)); + case image_dtype_gray16s: + return image_any(image_copy(data, offset, scaling)); + case image_dtype_gray32: + return image_any(image_copy(data, offset, scaling)); + case image_dtype_gray32s: + return image_any(image_copy(data, offset, scaling)); + case image_dtype_gray32f: + return image_any(image_copy(data, offset, scaling)); + case image_dtype_gray64: + return image_any(image_copy(data, offset, scaling)); + case image_dtype_gray64s: + return image_any(image_copy(data, offset, scaling)); + case image_dtype_gray64f: + return image_any(image_copy(data, offset, scaling)); + case image_dtype_null: + throw std::runtime_error("Can not cast a null image"); + case IMAGE_DTYPE_MAX: + default: + throw std::runtime_error("Can not cast unknown type"); + + } + throw std::runtime_error("Unknown image type passed"); +} + +} // end mapnik ns diff --git a/src/image_filter_types.cpp b/src/image_filter_types.cpp index 0b28b07c0..2212db998 100644 --- a/src/image_filter_types.cpp +++ b/src/image_filter_types.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,6 +29,9 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" #pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #pragma GCC diagnostic pop diff --git a/src/image_options.cpp b/src/image_options.cpp new file mode 100644 index 000000000..3b1b1fe07 --- /dev/null +++ b/src/image_options.cpp @@ -0,0 +1,81 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +#include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" +#include +#include +#pragma GCC diagnostic pop + +namespace mapnik { namespace detail { + +namespace qi = boost::spirit::qi; + +template +struct image_options_grammar + : qi::grammar +{ + using pair_type = std::pair>; + image_options_grammar() + : image_options_grammar::base_type(start) + { + qi::lit_type lit; + qi::char_type char_; + start = pair >> *(lit(':') >> pair) + ; + pair = key >> -('=' >> value) + ; + key = char_("a-zA-Z_") >> *char_("a-zA-Z_0-9\\.\\-") + ; + value = +char_("a-zA-Z_0-9\\.\\-") + ; + } + + qi::rule start; + qi::rule pair; + qi::rule key, value; +}; + +} // ns detail + +image_options_map parse_image_options(std::string const& str) +{ + auto const begin = str.begin(); + auto const end = str.end(); + boost::spirit::ascii::space_type space; + mapnik::detail::image_options_grammar g; + image_options_map options; + bool success = boost::spirit::qi::phrase_parse(begin, end, g, space, options); + if (!success) + { + throw std::runtime_error("Can't parse image options: " + str); + } + return options; // RVO +} + +} // ns mapnik diff --git a/src/image_reader.cpp b/src/image_reader.cpp index df876ff8f..d0ec815b9 100644 --- a/src/image_reader.cpp +++ b/src/image_reader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -84,7 +84,10 @@ image_reader* get_image_reader(std::string const& filename) { return factory::instance().create_object(*type,filename); } - return 0; + else + { + throw image_reader_exception("image_reader: can't determine type from input data"); + } } } diff --git a/src/image_scaling.cpp b/src/image_scaling.cpp index 7edf13e6e..dd3dcebf2 100644 --- a/src/image_scaling.cpp +++ b/src/image_scaling.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,7 +21,7 @@ *****************************************************************************/ // mapnik -#include +#include #include #include // does not handle alpha correctly @@ -31,6 +31,8 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" #pragma GCC diagnostic ignored "-Wredeclared-class-member" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop @@ -107,12 +109,12 @@ void scale_image_agg(T & target, T const& source, scaling_method_e scaling_metho // http://old.nabble.com/Re:--AGG--Basic-image-transformations-p1110665.html // "Yes, you need to use premultiplied images only. Only in this case the simple weighted averaging works correctly in the image fitering." // http://permalink.gmane.org/gmane.comp.graphics.agg/3443 - using image_data_type = T; - using pixel_type = typename image_data_type::pixel_type; - using pixfmt_pre = typename detail::agg_scaling_traits::pixfmt_pre; - using color_type = typename detail::agg_scaling_traits::color_type; - using img_src_type = typename detail::agg_scaling_traits::img_src_type; - using interpolator_type = typename detail::agg_scaling_traits::interpolator_type; + using image_type = T; + using pixel_type = typename image_type::pixel_type; + using pixfmt_pre = typename detail::agg_scaling_traits::pixfmt_pre; + using color_type = typename detail::agg_scaling_traits::color_type; + using img_src_type = typename detail::agg_scaling_traits::img_src_type; + using interpolator_type = typename detail::agg_scaling_traits::interpolator_type; using renderer_base_pre = agg::renderer_base; constexpr std::size_t pixel_size = sizeof(pixel_type); @@ -122,14 +124,14 @@ void scale_image_agg(T & target, T const& source, scaling_method_e scaling_metho agg::span_allocator sa; // initialize source AGG buffer - agg::rendering_buffer rbuf_src(const_cast(source.getBytes()), + agg::rendering_buffer rbuf_src(const_cast(source.bytes()), source.width(), source.height(), source.width() * pixel_size); pixfmt_pre pixf_src(rbuf_src); img_src_type img_src(pixf_src); // initialize destination AGG buffer (with transparency) - agg::rendering_buffer rbuf_dst(target.getBytes(), target.width(), target.height(), target.width() * pixel_size); + agg::rendering_buffer rbuf_dst(target.bytes(), target.width(), target.height(), target.width() * pixel_size); pixfmt_pre pixf_dst(rbuf_dst); renderer_base_pre rb_dst_pre(pixf_dst); @@ -150,13 +152,13 @@ void scale_image_agg(T & target, T const& source, scaling_method_e scaling_metho if (scaling_method == SCALING_NEAR) { - using span_gen_type = typename detail::agg_scaling_traits::span_image_filter; + using span_gen_type = typename detail::agg_scaling_traits::span_image_filter; span_gen_type sg(img_src, interpolator); agg::render_scanlines_aa(ras, sl, rb_dst_pre, sa, sg); } else { - using span_gen_type = typename detail::agg_scaling_traits::span_image_resample_affine; + using span_gen_type = typename detail::agg_scaling_traits::span_image_resample_affine; agg::image_filter_lut filter; detail::set_scaling_method(filter, scaling_method, filter_factor); span_gen_type sg(img_src, interpolator, filter); @@ -165,16 +167,36 @@ void scale_image_agg(T & target, T const& source, scaling_method_e scaling_metho } -template MAPNIK_DECL void scale_image_agg(image_data_rgba8 &, image_data_rgba8 const&, scaling_method_e, +template MAPNIK_DECL void scale_image_agg(image_rgba8 &, image_rgba8 const&, scaling_method_e, double, double , double, double , double); -template MAPNIK_DECL void scale_image_agg(image_data_gray8 &, image_data_gray8 const&, scaling_method_e, +template MAPNIK_DECL void scale_image_agg(image_gray8 &, image_gray8 const&, scaling_method_e, double, double , double, double , double); -template MAPNIK_DECL void scale_image_agg(image_data_gray16 &, image_data_gray16 const&, scaling_method_e, +template MAPNIK_DECL void scale_image_agg(image_gray8s &, image_gray8s const&, scaling_method_e, double, double , double, double , double); -template MAPNIK_DECL void scale_image_agg(image_data_gray32f &, image_data_gray32f const&, scaling_method_e, +template MAPNIK_DECL void scale_image_agg(image_gray16 &, image_gray16 const&, scaling_method_e, double, double , double, double , double); +template MAPNIK_DECL void scale_image_agg(image_gray16s &, image_gray16s const&, scaling_method_e, + double, double , double, double , double); + +template MAPNIK_DECL void scale_image_agg(image_gray32 &, image_gray32 const&, scaling_method_e, + double, double , double, double , double); + +template MAPNIK_DECL void scale_image_agg(image_gray32s &, image_gray32s const&, scaling_method_e, + double, double , double, double , double); + +template MAPNIK_DECL void scale_image_agg(image_gray32f &, image_gray32f const&, scaling_method_e, + double, double , double, double , double); + +template MAPNIK_DECL void scale_image_agg(image_gray64 &, image_gray64 const&, scaling_method_e, + double, double , double, double , double); + +template MAPNIK_DECL void scale_image_agg(image_gray64s &, image_gray64s const&, scaling_method_e, + double, double , double, double , double); + +template MAPNIK_DECL void scale_image_agg(image_gray64f &, image_gray64f const&, scaling_method_e, + double, double , double, double , double); } diff --git a/src/image_util.cpp b/src/image_util.cpp index de81f9a90..7f86fdb3c 100644 --- a/src/image_util.cpp +++ b/src/image_util.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,58 +20,34 @@ * *****************************************************************************/ -#if defined(HAVE_PNG) -extern "C" -{ -#include -} -#endif - // mapnik -#if defined(HAVE_PNG) -#include -#endif - -#if defined(HAVE_TIFF) -#include -#endif - -#if defined(HAVE_JPEG) -#include -#endif - -#if defined(HAVE_WEBP) -#include -#endif - #include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include +#include +#include +#include +#include +#include +#ifdef SSE_MATH +#include -#ifdef HAVE_CAIRO -#include -#include -#ifdef CAIRO_HAS_PDF_SURFACE -#include -#endif -#ifdef CAIRO_HAS_PS_SURFACE -#include -#endif -#ifdef CAIRO_HAS_SVG_SURFACE -#include -#endif #endif -// boost -#include +// agg +#include "agg_rendering_buffer.h" +#include "agg_pixfmt_rgba.h" +#include "agg_color_rgba.h" // stl #include -#include #include #include #include @@ -79,11 +55,10 @@ extern "C" namespace mapnik { - template -std::string save_to_string(T const& image, - std::string const& type, - rgba_palette const& palette) +MAPNIK_DECL std::string save_to_string(T const& image, + std::string const& type, + rgba_palette const& palette) { std::ostringstream ss(std::ios::out|std::ios::binary); save_to_stream(image, ss, type, palette); @@ -91,8 +66,8 @@ std::string save_to_string(T const& image, } template -std::string save_to_string(T const& image, - std::string const& type) +MAPNIK_DECL std::string save_to_string(T const& image, + std::string const& type) { std::ostringstream ss(std::ios::out|std::ios::binary); save_to_stream(image, ss, type); @@ -100,575 +75,37 @@ std::string save_to_string(T const& image, } template -void save_to_file(T const& image, - std::string const& filename, - std::string const& type, - rgba_palette const& palette) +MAPNIK_DECL void save_to_file(T const& image, + std::string const& filename, + std::string const& type, + rgba_palette const& palette) { std::ofstream file (filename.c_str(), std::ios::out| std::ios::trunc|std::ios::binary); if (file) { - save_to_stream(image, file, type, palette); + save_to_stream(image, file, type, palette); } - else throw ImageWriterException("Could not write file to " + filename ); + else throw image_writer_exception("Could not write file to " + filename ); } template -void save_to_file(T const& image, - std::string const& filename, - std::string const& type) +MAPNIK_DECL void save_to_file(T const& image, + std::string const& filename, + std::string const& type) { std::ofstream file (filename.c_str(), std::ios::out| std::ios::trunc|std::ios::binary); if (file) { - save_to_stream(image, file, type); + save_to_stream(image, file, type); } - else throw ImageWriterException("Could not write file to " + filename ); + else throw image_writer_exception("Could not write file to " + filename ); } -#if defined(HAVE_PNG) - -void handle_png_options(std::string const& type, - png_options & opts) -{ - if (type == "png" || type == "png24" || type == "png32") - { - opts.paletted = false; - return; - } - else if (type == "png8" || type == "png256") - { - opts.paletted = true; - return; - } - boost::char_separator sep(":"); - boost::tokenizer< boost::char_separator > tokens(type, sep); - bool set_colors = false; - bool set_gamma = false; - for (std::string const& t : tokens) - { - if (t == "png8" || t == "png256") - { - opts.paletted = true; - } - else if (t == "png" || t == "png24" || t == "png32") - { - opts.paletted = false; - } - else if (t == "m=o") - { - opts.use_hextree = false; - } - else if (t == "m=h") - { - opts.use_hextree = true; - } - else if (t == "e=miniz") - { - opts.use_miniz = true; - } - else if (boost::algorithm::starts_with(t, "c=")) - { - set_colors = true; - if (!mapnik::util::string2int(t.substr(2),opts.colors) || opts.colors < 1 || opts.colors > 256) - { - throw ImageWriterException("invalid color parameter: " + t.substr(2)); - } - } - else if (boost::algorithm::starts_with(t, "t=")) - { - if (!mapnik::util::string2int(t.substr(2),opts.trans_mode) || opts.trans_mode < 0 || opts.trans_mode > 2) - { - throw ImageWriterException("invalid trans_mode parameter: " + t.substr(2)); - } - } - else if (boost::algorithm::starts_with(t, "g=")) - { - set_gamma = true; - if (!mapnik::util::string2double(t.substr(2),opts.gamma) || opts.gamma < 0) - { - throw ImageWriterException("invalid gamma parameter: " + t.substr(2)); - } - } - else if (boost::algorithm::starts_with(t, "z=")) - { - /* - #define Z_NO_COMPRESSION 0 - #define Z_BEST_SPEED 1 - #define Z_BEST_COMPRESSION 9 - #define Z_DEFAULT_COMPRESSION (-1) - */ - if (!mapnik::util::string2int(t.substr(2),opts.compression) - || opts.compression < Z_DEFAULT_COMPRESSION - || opts.compression > 10) // use 10 here rather than Z_BEST_COMPRESSION (9) to allow for MZ_UBER_COMPRESSION - { - throw ImageWriterException("invalid compression parameter: " + t.substr(2) + " (only -1 through 10 are valid)"); - } - } - else if (boost::algorithm::starts_with(t, "s=")) - { - std::string s = t.substr(2); - if (s == "default") - { - opts.strategy = Z_DEFAULT_STRATEGY; - } - else if (s == "filtered") - { - opts.strategy = Z_FILTERED; - } - else if (s == "huff") - { - opts.strategy = Z_HUFFMAN_ONLY; - } - else if (s == "rle") - { - opts.strategy = Z_RLE; - } - else if (s == "fixed") - { - opts.strategy = Z_FIXED; - } - else - { - throw ImageWriterException("invalid compression strategy parameter: " + s); - } - } - else - { - throw ImageWriterException("unhandled png option: " + t); - } - } - // validation - if (!opts.paletted && set_colors) - { - throw ImageWriterException("invalid color parameter: unavailable for true color (non-paletted) images"); - } - if (!opts.paletted && set_gamma) - { - throw ImageWriterException("invalid gamma parameter: unavailable for true color (non-paletted) images"); - } - if ((opts.use_miniz == false) && opts.compression > Z_BEST_COMPRESSION) - { - throw ImageWriterException("invalid compression value: (only -1 through 9 are valid)"); - } -} -#endif - -#if defined(HAVE_TIFF) -void handle_tiff_options(std::string const& type, - tiff_config & config) -{ - if (type == "tiff") - { - return; - } - if (type.length() > 4) - { - boost::char_separator sep(":"); - boost::tokenizer< boost::char_separator > tokens(type, sep); - for (auto const& t : tokens) - { - if (t == "tiff") - { - continue; - } - else if (boost::algorithm::starts_with(t, "compression=")) - { - std::string val = t.substr(12); - if (!val.empty()) - { - if (val == "deflate") - { - config.compression = COMPRESSION_DEFLATE; - } - else if (val == "adobedeflate") - { - config.compression = COMPRESSION_ADOBE_DEFLATE; - } - else if (val == "lzw") - { - config.compression = COMPRESSION_LZW; - } - else if (val == "none") - { - config.compression = COMPRESSION_NONE; - } - else - { - throw ImageWriterException("invalid tiff compression: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "method=")) - { - std::string val = t.substr(7); - if (!val.empty()) - { - if (val == "scanline") - { - config.method = TIFF_WRITE_SCANLINE; - } - else if (val == "strip" || val == "stripped") - { - config.method = TIFF_WRITE_STRIPPED; - } - else if (val == "tiled") - { - config.method = TIFF_WRITE_TILED; - } - else - { - throw ImageWriterException("invalid tiff method: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "zlevel=")) - { - std::string val = t.substr(7); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.zlevel) || config.zlevel < 0 || config.zlevel > 9) - { - throw ImageWriterException("invalid tiff zlevel: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "tile_height=")) - { - std::string val = t.substr(12); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.tile_height) || config.tile_height < 0 ) - { - throw ImageWriterException("invalid tiff tile_height: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "tile_width=")) - { - std::string val = t.substr(11); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.tile_width) || config.tile_width < 0 ) - { - throw ImageWriterException("invalid tiff tile_width: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "rows_per_strip=")) - { - std::string val = t.substr(15); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.rows_per_strip) || config.rows_per_strip < 0 ) - { - throw ImageWriterException("invalid tiff rows_per_strip: '" + val + "'"); - } - } - } - else - { - throw ImageWriterException("unhandled tiff option: " + t); - } - } - } -} -#endif - -#if defined(HAVE_WEBP) -void handle_webp_options(std::string const& type, - WebPConfig & config, - bool & alpha) -{ - if (type == "webp") - { - return; - } - if (type.length() > 4){ - boost::char_separator sep(":"); - boost::tokenizer< boost::char_separator > tokens(type, sep); - for (auto const& t : tokens) - { - if (t == "webp") - { - continue; - } - else if (boost::algorithm::starts_with(t, "quality=")) - { - std::string val = t.substr(8); - if (!val.empty()) - { - double quality = 90; - if (!mapnik::util::string2double(val,quality) || quality < 0.0 || quality > 100.0) - { - throw ImageWriterException("invalid webp quality: '" + val + "'"); - } - config.quality = static_cast(quality); - } - } - else if (boost::algorithm::starts_with(t, "method=")) - { - std::string val = t.substr(7); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.method) || config.method < 0 || config.method > 6) - { - throw ImageWriterException("invalid webp method: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "lossless=")) - { - std::string val = t.substr(9); - if (!val.empty()) - { - #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 1 // >= v0.1.99 / 0x0100 - if (!mapnik::util::string2int(val,config.lossless) || config.lossless < 0 || config.lossless > 1) - { - throw ImageWriterException("invalid webp lossless: '" + val + "'"); - } - #else - #ifdef _MSC_VER - #pragma NOTE(compiling against webp that does not support the lossless flag) - #else - #warning "compiling against webp that does not support the lossless flag" - #endif - throw ImageWriterException("your webp version does not support the lossless option"); - #endif - } - } - else if (boost::algorithm::starts_with(t, "image_hint=")) - { - std::string val = t.substr(11); - if (!val.empty()) - { - #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 1 // >= v0.1.99 / 0x0100 - int image_hint = 0; - if (!mapnik::util::string2int(val,image_hint) || image_hint < 0 || image_hint > 3) - { - throw ImageWriterException("invalid webp image_hint: '" + val + "'"); - } - config.image_hint = static_cast(image_hint); - #else - #ifdef _MSC_VER - #pragma NOTE(compiling against webp that does not support the image_hint flag) - #else - #warning "compiling against webp that does not support the image_hint flag" - #endif - throw ImageWriterException("your webp version does not support the image_hint option"); - #endif - } - } - else if (boost::algorithm::starts_with(t, "alpha=")) - { - std::string val = t.substr(6); - if (!val.empty()) - { - if (!mapnik::util::string2bool(val,alpha)) - { - throw ImageWriterException("invalid webp alpha: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "target_size=")) - { - std::string val = t.substr(12); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.target_size)) - { - throw ImageWriterException("invalid webp target_size: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "target_psnr=")) - { - std::string val = t.substr(12); - if (!val.empty()) - { - double psnr = 0; - if (!mapnik::util::string2double(val,psnr)) - { - throw ImageWriterException("invalid webp target_psnr: '" + val + "'"); - } - config.target_PSNR = psnr; - } - } - else if (boost::algorithm::starts_with(t, "segments=")) - { - std::string val = t.substr(9); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.segments)) - { - throw ImageWriterException("invalid webp segments: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "sns_strength=")) - { - std::string val = t.substr(13); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.sns_strength)) - { - throw ImageWriterException("invalid webp sns_strength: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "filter_strength=")) - { - std::string val = t.substr(16); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.filter_strength)) - { - throw ImageWriterException("invalid webp filter_strength: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "filter_sharpness=")) - { - std::string val = t.substr(17); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.filter_sharpness)) - { - throw ImageWriterException("invalid webp filter_sharpness: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "filter_type=")) - { - std::string val = t.substr(12); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.filter_type)) - { - throw ImageWriterException("invalid webp filter_type: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "autofilter=")) - { - std::string val = t.substr(11); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.autofilter)) - { - throw ImageWriterException("invalid webp autofilter: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "alpha_compression=")) - { - std::string val = t.substr(18); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.alpha_compression)) - { - throw ImageWriterException("invalid webp alpha_compression: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "alpha_filtering=")) - { - std::string val = t.substr(16); - if (!val.empty()) - { - #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 1 // >= v0.1.99 / 0x0100 - if (!mapnik::util::string2int(val,config.alpha_filtering)) - { - throw ImageWriterException("invalid webp alpha_filtering: '" + val + "'"); - } - #else - #ifdef _MSC_VER - #pragma NOTE(compiling against webp that does not support the alpha_filtering flag) - #else - #warning "compiling against webp that does not support the alpha_filtering flag" - #endif - throw ImageWriterException("your webp version does not support the alpha_filtering option"); - #endif - } - } - else if (boost::algorithm::starts_with(t, "alpha_quality=")) - { - std::string val = t.substr(14); - if (!val.empty()) - { - #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 1 // >= v0.1.99 / 0x0100 - if (!mapnik::util::string2int(val,config.alpha_quality)) - { - throw ImageWriterException("invalid webp alpha_quality: '" + val + "'"); - } - #else - #ifdef _MSC_VER - #pragma NOTE(compiling against webp that does not support the alpha_quality flag) - #else - #warning "compiling against webp that does not support the alpha_quality flag" - #endif - throw ImageWriterException("your webp version does not support the alpha_quality option"); - #endif - } - } - else if (boost::algorithm::starts_with(t, "pass=")) - { - std::string val = t.substr(5); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.pass)) - { - throw ImageWriterException("invalid webp pass: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "preprocessing=")) - { - std::string val = t.substr(14); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.preprocessing)) - { - throw ImageWriterException("invalid webp preprocessing: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "partitions=")) - { - std::string val = t.substr(11); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.partitions)) - { - throw ImageWriterException("invalid webp partitions: '" + val + "'"); - } - } - } - else if (boost::algorithm::starts_with(t, "partition_limit=")) - { - std::string val = t.substr(16); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,config.partition_limit)) - { - throw ImageWriterException("invalid webp partition_limit: '" + val + "'"); - } - } - } - else - { - throw ImageWriterException("unhandled webp option: " + t); - } - } - } -} -#endif - template -void save_to_stream(T const& image, - std::ostream & stream, - std::string const& type, - rgba_palette const& palette) +MAPNIK_DECL void save_to_stream(T const& image, + std::ostream & stream, + std::string const& type, + rgba_palette const& palette) { if (stream && image.width() > 0 && image.height() > 0) { @@ -676,39 +113,29 @@ void save_to_stream(T const& image, std::transform(t.begin(), t.end(), t.begin(), ::tolower); if (t == "png" || boost::algorithm::starts_with(t, "png")) { -#if defined(HAVE_PNG) - if (palette.valid()) - { - png_options opts; - handle_png_options(t,opts); - save_as_png8_pal(stream, image, palette, opts); - } - else - { - save_to_stream(image,stream,type); - } -#else - throw ImageWriterException("png output is not enabled in your build of Mapnik"); -#endif + png_saver_pal visitor(stream, t, palette); + mapnik::util::apply_visitor(visitor, image); } else if (boost::algorithm::starts_with(t, "tif")) { - throw ImageWriterException("palettes are not currently supported when writing to tiff format (yet)"); + throw image_writer_exception("palettes are not currently supported when writing to tiff format (yet)"); } else if (boost::algorithm::starts_with(t, "jpeg")) { - throw ImageWriterException("palettes are not currently supported when writing to jpeg format"); + throw image_writer_exception("palettes are not currently supported when writing to jpeg format"); } - else throw ImageWriterException("unknown file type: " + type); + else throw image_writer_exception("unknown file type: " + type); } - else throw ImageWriterException("Could not write to empty stream" ); + else throw image_writer_exception("Could not write to empty stream" ); } - -template -void save_to_stream(T const& image, - std::ostream & stream, - std::string const& type) +// This can be removed once image_any and image_view_any are the only +// items using this template +template <> +MAPNIK_DECL void save_to_stream(image_rgba8 const& image, + std::ostream & stream, + std::string const& type, + rgba_palette const& palette) { if (stream && image.width() > 0 && image.height() > 0) { @@ -716,225 +143,2220 @@ void save_to_stream(T const& image, std::transform(t.begin(), t.end(), t.begin(), ::tolower); if (t == "png" || boost::algorithm::starts_with(t, "png")) { -#if defined(HAVE_PNG) - png_options opts; - handle_png_options(t,opts); - if (opts.paletted) - { - if (opts.use_hextree) - { - save_as_png8_hex(stream, image, opts); - } - else - { - save_as_png8_oct(stream, image, opts); - } - } - else - { - save_as_png(stream, image, opts); - } -#else - throw ImageWriterException("png output is not enabled in your build of Mapnik"); -#endif + png_saver_pal visitor(stream, t, palette); + visitor(image); + //mapnik::util::apply_visitor(visitor, image); } else if (boost::algorithm::starts_with(t, "tif")) { -#if defined(HAVE_TIFF) - tiff_config config; - handle_tiff_options(t, config); - save_as_tiff(stream, image, config); -#else - throw ImageWriterException("tiff output is not enabled in your build of Mapnik"); -#endif + throw image_writer_exception("palettes are not currently supported when writing to tiff format (yet)"); } else if (boost::algorithm::starts_with(t, "jpeg")) { -#if defined(HAVE_JPEG) - int quality = 85; - std::string val = t.substr(4); - if (!val.empty()) - { - if (!mapnik::util::string2int(val,quality) || quality < 0 || quality > 100) - { - throw ImageWriterException("invalid jpeg quality: '" + val + "'"); - } - } - save_as_jpeg(stream, quality, image); -#else - throw ImageWriterException("jpeg output is not enabled in your build of Mapnik"); -#endif + throw image_writer_exception("palettes are not currently supported when writing to jpeg format"); + } + else throw image_writer_exception("unknown file type: " + type); + } + else throw image_writer_exception("Could not write to empty stream" ); +} + +// This can be removed once image_any and image_view_any are the only +// items using this template +template <> +MAPNIK_DECL void save_to_stream(image_view_rgba8 const& image, + std::ostream & stream, + std::string const& type, + rgba_palette const& palette) +{ + if (stream && image.width() > 0 && image.height() > 0) + { + std::string t = type; + std::transform(t.begin(), t.end(), t.begin(), ::tolower); + if (t == "png" || boost::algorithm::starts_with(t, "png")) + { + png_saver_pal visitor(stream, t, palette); + visitor(image); + //mapnik::util::apply_visitor(visitor, image); + } + else if (boost::algorithm::starts_with(t, "tif")) + { + throw image_writer_exception("palettes are not currently supported when writing to tiff format (yet)"); + } + else if (boost::algorithm::starts_with(t, "jpeg")) + { + throw image_writer_exception("palettes are not currently supported when writing to jpeg format"); + } + else throw image_writer_exception("unknown file type: " + type); + } + else throw image_writer_exception("Could not write to empty stream" ); +} + +template +MAPNIK_DECL void save_to_stream(T const& image, + std::ostream & stream, + std::string const& type) +{ + if (stream && image.width() > 0 && image.height() > 0) + { + std::string t = type; + std::transform(t.begin(), t.end(), t.begin(), ::tolower); + if (t == "png" || boost::algorithm::starts_with(t, "png")) + { + png_saver visitor(stream, t); + util::apply_visitor(visitor, image); + } + else if (boost::algorithm::starts_with(t, "tif")) + { + tiff_saver visitor(stream, t); + util::apply_visitor(visitor, image); + } + else if (boost::algorithm::starts_with(t, "jpeg")) + { + jpeg_saver visitor(stream, t); + util::apply_visitor(visitor, image); } else if (boost::algorithm::starts_with(t, "webp")) { -#if defined(HAVE_WEBP) - WebPConfig config; - // Default values set here will be lossless=0 and quality=75 (as least as of webp v0.3.1) - if (!WebPConfigInit(&config)) - { - throw std::runtime_error("version mismatch"); - } - // see for more details: https://github.com/mapnik/mapnik/wiki/Image-IO#webp-output-options - bool alpha = true; - handle_webp_options(t,config,alpha); - save_as_webp(stream,image,config,alpha); -#else - throw ImageWriterException("webp output is not enabled in your build of Mapnik"); -#endif + webp_saver visitor(stream, t); + util::apply_visitor(visitor, image); } - else throw ImageWriterException("unknown file type: " + type); + else throw image_writer_exception("unknown file type: " + type); } - else throw ImageWriterException("Could not write to empty stream" ); + else throw image_writer_exception("Could not write to empty stream" ); +} + +// This can be removed once image_any and image_view_any are the only +// items using this template +template <> +MAPNIK_DECL void save_to_stream(image_rgba8 const& image, + std::ostream & stream, + std::string const& type) +{ + if (stream && image.width() > 0 && image.height() > 0) + { + std::string t = type; + std::transform(t.begin(), t.end(), t.begin(), ::tolower); + if (t == "png" || boost::algorithm::starts_with(t, "png")) + { + png_saver visitor(stream, t); + visitor(image); + //util::apply_visitor(visitor, image); + } + else if (boost::algorithm::starts_with(t, "tif")) + { + tiff_saver visitor(stream, t); + visitor(image); + //util::apply_visitor(visitor, image); + } + else if (boost::algorithm::starts_with(t, "jpeg")) + { + jpeg_saver visitor(stream, t); + visitor(image); + //util::apply_visitor(visitor, image); + } + else if (boost::algorithm::starts_with(t, "webp")) + { + webp_saver visitor(stream, t); + visitor(image); + //util::apply_visitor(visitor, image); + } + else throw image_writer_exception("unknown file type: " + type); + } + else throw image_writer_exception("Could not write to empty stream" ); +} + +// This can be removed once image_any and image_view_any are the only +// items using this template +template <> +MAPNIK_DECL void save_to_stream(image_view_rgba8 const& image, + std::ostream & stream, + std::string const& type) +{ + if (stream && image.width() > 0 && image.height() > 0) + { + std::string t = type; + std::transform(t.begin(), t.end(), t.begin(), ::tolower); + if (t == "png" || boost::algorithm::starts_with(t, "png")) + { + png_saver visitor(stream, t); + visitor(image); + //util::apply_visitor(visitor, image); + } + else if (boost::algorithm::starts_with(t, "tif")) + { + tiff_saver visitor(stream, t); + visitor(image); + //util::apply_visitor(visitor, image); + } + else if (boost::algorithm::starts_with(t, "jpeg")) + { + jpeg_saver visitor(stream, t); + visitor(image); + //util::apply_visitor(visitor, image); + } + else if (boost::algorithm::starts_with(t, "webp")) + { + webp_saver visitor(stream, t); + visitor(image); + //util::apply_visitor(visitor, image); + } + else throw image_writer_exception("unknown file type: " + type); + } + else throw image_writer_exception("Could not write to empty stream" ); } template -void save_to_file(T const& image, std::string const& filename) +MAPNIK_DECL void save_to_file(T const& image, std::string const& filename) { boost::optional type = type_from_filename(filename); if (type) { save_to_file(image, filename, *type); } - else throw ImageWriterException("Could not write file to " + filename ); + else throw image_writer_exception("Could not write file to " + filename ); } template -void save_to_file(T const& image, std::string const& filename, rgba_palette const& palette) +MAPNIK_DECL void save_to_file(T const& image, std::string const& filename, rgba_palette const& palette) { boost::optional type = type_from_filename(filename); if (type) { save_to_file(image, filename, *type, palette); } - else throw ImageWriterException("Could not write file to " + filename ); + else throw image_writer_exception("Could not write file to " + filename ); } -#if defined(HAVE_CAIRO) -// TODO - move to separate cairo_io.hpp -void save_to_cairo_file(mapnik::Map const& map, std::string const& filename, double scale_factor, double scale_denominator) -{ - boost::optional type = type_from_filename(filename); - if (type) - { - save_to_cairo_file(map,filename,*type,scale_factor,scale_denominator); - } - else throw ImageWriterException("Could not write file to " + filename ); -} +// image_rgba8 +template MAPNIK_DECL void save_to_file(image_rgba8 const&, + std::string const&, + std::string const&); -void save_to_cairo_file(mapnik::Map const& map, - std::string const& filename, - std::string const& type, - double scale_factor, - double scale_denominator) -{ - std::ofstream file (filename.c_str(), std::ios::out|std::ios::trunc|std::ios::binary); - if (file) - { - cairo_surface_ptr surface; - unsigned width = map.width(); - unsigned height = map.height(); - if (type == "pdf") - { -#ifdef CAIRO_HAS_PDF_SURFACE - surface = cairo_surface_ptr(cairo_pdf_surface_create(filename.c_str(),width,height),cairo_surface_closer()); -#else - throw ImageWriterException("PDFSurface not supported in the cairo backend"); -#endif - } -#ifdef CAIRO_HAS_SVG_SURFACE - else if (type == "svg") - { - surface = cairo_surface_ptr(cairo_svg_surface_create(filename.c_str(),width,height),cairo_surface_closer()); - } -#endif -#ifdef CAIRO_HAS_PS_SURFACE - else if (type == "ps") - { - surface = cairo_surface_ptr(cairo_ps_surface_create(filename.c_str(),width,height),cairo_surface_closer()); - } -#endif -#ifdef CAIRO_HAS_IMAGE_SURFACE - else if (type == "ARGB32") - { - surface = cairo_surface_ptr(cairo_image_surface_create(CAIRO_FORMAT_ARGB32,width,height),cairo_surface_closer()); - } - else if (type == "RGB24") - { - surface = cairo_surface_ptr(cairo_image_surface_create(CAIRO_FORMAT_RGB24,width,height),cairo_surface_closer()); - } -#endif - else - { - throw ImageWriterException("unknown file type: " + type); - } +template MAPNIK_DECL void save_to_file(image_rgba8 const&, + std::string const&, + std::string const&, + rgba_palette const& palette); - //cairo_t * ctx = cairo_create(surface); +template MAPNIK_DECL void save_to_file(image_rgba8 const&, + std::string const&); - // TODO - expose as user option - /* - if (type == "ARGB32" || type == "RGB24") - { - context->set_antialias(Cairo::ANTIALIAS_NONE); - } - */ +template MAPNIK_DECL void save_to_file(image_rgba8 const&, + std::string const&, + rgba_palette const& palette); - mapnik::cairo_renderer ren(map, create_context(surface), scale_factor); - ren.apply(scale_denominator); +template MAPNIK_DECL std::string save_to_string(image_rgba8 const&, + std::string const&); - if (type == "ARGB32" || type == "RGB24") - { - cairo_surface_write_to_png(&*surface, filename.c_str()); - } - cairo_surface_finish(&*surface); - } -} +template MAPNIK_DECL std::string save_to_string(image_rgba8 const&, + std::string const&, + rgba_palette const& palette); -#endif - -template void save_to_file(image_data_rgba8 const&, - std::string const&, - std::string const&); - -template void save_to_file(image_data_rgba8 const&, - std::string const&, - std::string const&, - rgba_palette const& palette); - -template void save_to_file(image_data_rgba8 const&, - std::string const&); - -template void save_to_file(image_data_rgba8 const&, - std::string const&, - rgba_palette const& palette); - -template std::string save_to_string(image_data_rgba8 const&, - std::string const&); - -template std::string save_to_string(image_data_rgba8 const&, - std::string const&, - rgba_palette const& palette); - -template void save_to_file > (image_view const&, +// image_view_any +template MAPNIK_DECL void save_to_file (image_view_any const&, std::string const&, std::string const&); -template void save_to_file > (image_view const&, +template MAPNIK_DECL void save_to_file (image_view_any const&, std::string const&, std::string const&, rgba_palette const& palette); -template void save_to_file > (image_view const&, +template MAPNIK_DECL void save_to_file (image_view_any const&, std::string const&); -template void save_to_file > (image_view const&, +template MAPNIK_DECL void save_to_file (image_view_any const&, std::string const&, rgba_palette const& palette); -template std::string save_to_string > (image_view const&, +template MAPNIK_DECL std::string save_to_string (image_view_rgba8 const&, std::string const&); -template std::string save_to_string > (image_view const&, +template MAPNIK_DECL std::string save_to_string (image_view_rgba8 const&, std::string const&, rgba_palette const& palette); +template MAPNIK_DECL std::string save_to_string (image_view_any const&, + std::string const&); + +template MAPNIK_DECL std::string save_to_string (image_view_any const&, + std::string const&, + rgba_palette const& palette); + +// image_any +template MAPNIK_DECL void save_to_file(image_any const&, + std::string const&, + std::string const&); + +template MAPNIK_DECL void save_to_file(image_any const&, + std::string const&, + std::string const&, + rgba_palette const& palette); + +template MAPNIK_DECL void save_to_file(image_any const&, + std::string const&); + +template MAPNIK_DECL void save_to_file(image_any const&, + std::string const&, + rgba_palette const& palette); + +template MAPNIK_DECL std::string save_to_string(image_any const&, + std::string const&); + +template MAPNIK_DECL std::string save_to_string(image_any const&, + std::string const&, + rgba_palette const& palette); + +namespace detail { + +struct is_solid_visitor +{ + bool operator() (image_view_null const&) const + { + return true; + } + + bool operator() (image_null const&) const + { + return true; + } + + template + bool operator() (T const & data) const + { + using pixel_type = typename T::pixel_type; + if (data.width() > 0 && data.height() > 0) + { + pixel_type const* first_row = data.get_row(0); + pixel_type const first_pixel = first_row[0]; + for (std::size_t y = 0; y < data.height(); ++y) + { + pixel_type const * row = data.get_row(y); + for (std::size_t x = 0; x < data.width(); ++x) + { + if (first_pixel != row[x]) + { + return false; + } + } + } + } + return true; + } +}; + +} // end detail ns + +MAPNIK_DECL bool is_solid(image_any const& image) +{ + return util::apply_visitor(detail::is_solid_visitor(), image); } + +MAPNIK_DECL bool is_solid(image_view_any const& image) +{ + return util::apply_visitor(detail::is_solid_visitor(), image); +} + +template +MAPNIK_DECL bool is_solid(T const& image) +{ + detail::is_solid_visitor visitor; + return visitor(image); +} + +template MAPNIK_DECL bool is_solid(image_null const&); +template MAPNIK_DECL bool is_solid(image_rgba8 const&); +template MAPNIK_DECL bool is_solid(image_gray8 const&); +template MAPNIK_DECL bool is_solid(image_gray8s const&); +template MAPNIK_DECL bool is_solid(image_gray16 const&); +template MAPNIK_DECL bool is_solid(image_gray16s const&); +template MAPNIK_DECL bool is_solid(image_gray32 const&); +template MAPNIK_DECL bool is_solid(image_gray32s const&); +template MAPNIK_DECL bool is_solid(image_gray32f const&); +template MAPNIK_DECL bool is_solid(image_gray64 const&); +template MAPNIK_DECL bool is_solid(image_gray64s const&); +template MAPNIK_DECL bool is_solid(image_gray64f const&); +template MAPNIK_DECL bool is_solid(image_view_null const&); +template MAPNIK_DECL bool is_solid(image_view_rgba8 const&); +template MAPNIK_DECL bool is_solid(image_view_gray8 const&); +template MAPNIK_DECL bool is_solid(image_view_gray8s const&); +template MAPNIK_DECL bool is_solid(image_view_gray16 const&); +template MAPNIK_DECL bool is_solid(image_view_gray16s const&); +template MAPNIK_DECL bool is_solid(image_view_gray32 const&); +template MAPNIK_DECL bool is_solid(image_view_gray32s const&); +template MAPNIK_DECL bool is_solid(image_view_gray32f const&); +template MAPNIK_DECL bool is_solid(image_view_gray64 const&); +template MAPNIK_DECL bool is_solid(image_view_gray64s const&); +template MAPNIK_DECL bool is_solid(image_view_gray64f const&); + +namespace detail { + +struct premultiply_visitor +{ + bool operator() (image_rgba8 & data) const + { + if (!data.get_premultiplied()) + { + agg::rendering_buffer buffer(data.bytes(),safe_cast(data.width()),safe_cast(data.height()),safe_cast(data.row_size())); + agg::pixfmt_rgba32 pixf(buffer); + pixf.premultiply(); + data.set_premultiplied(true); + return true; + } + return false; + } + + template + bool operator() (T &) const + { + return false; + } +}; + +struct demultiply_visitor +{ + bool operator() (image_rgba8 & data) const + { + if (data.get_premultiplied()) + { + agg::rendering_buffer buffer(data.bytes(),safe_cast(data.width()),safe_cast(data.height()),safe_cast(data.row_size())); + agg::pixfmt_rgba32_pre pixf(buffer); + pixf.demultiply(); + data.set_premultiplied(false); + return true; + } + return false; + } + + template + bool operator() (T &) const + { + return false; + } +}; + +struct set_premultiplied_visitor +{ + set_premultiplied_visitor(bool status) + : status_(status) {} + + template + void operator() (T & data) const + { + data.set_premultiplied(status_); + } +private: + bool const status_; +}; + +} // end detail ns + +MAPNIK_DECL bool premultiply_alpha(image_any & image) +{ + return util::apply_visitor(detail::premultiply_visitor(), image); +} + +template +MAPNIK_DECL bool premultiply_alpha(T & image) +{ + detail::premultiply_visitor visit; + return visit(image); +} + +template MAPNIK_DECL bool premultiply_alpha(image_rgba8 &); +template MAPNIK_DECL bool premultiply_alpha(image_gray8 &); +template MAPNIK_DECL bool premultiply_alpha(image_gray8s &); +template MAPNIK_DECL bool premultiply_alpha(image_gray16 &); +template MAPNIK_DECL bool premultiply_alpha(image_gray16s &); +template MAPNIK_DECL bool premultiply_alpha(image_gray32 &); +template MAPNIK_DECL bool premultiply_alpha(image_gray32s &); +template MAPNIK_DECL bool premultiply_alpha(image_gray32f &); +template MAPNIK_DECL bool premultiply_alpha(image_gray64 &); +template MAPNIK_DECL bool premultiply_alpha(image_gray64s &); +template MAPNIK_DECL bool premultiply_alpha(image_gray64f &); + +MAPNIK_DECL bool demultiply_alpha(image_any & image) +{ + return util::apply_visitor(detail::demultiply_visitor(), image); +} + +template +MAPNIK_DECL bool demultiply_alpha(T & image) +{ + detail::demultiply_visitor visit; + return visit(image); +} + +template MAPNIK_DECL bool demultiply_alpha(image_rgba8 &); +template MAPNIK_DECL bool demultiply_alpha(image_gray8 &); +template MAPNIK_DECL bool demultiply_alpha(image_gray8s &); +template MAPNIK_DECL bool demultiply_alpha(image_gray16 &); +template MAPNIK_DECL bool demultiply_alpha(image_gray16s &); +template MAPNIK_DECL bool demultiply_alpha(image_gray32 &); +template MAPNIK_DECL bool demultiply_alpha(image_gray32s &); +template MAPNIK_DECL bool demultiply_alpha(image_gray32f &); +template MAPNIK_DECL bool demultiply_alpha(image_gray64 &); +template MAPNIK_DECL bool demultiply_alpha(image_gray64s &); +template MAPNIK_DECL bool demultiply_alpha(image_gray64f &); + +MAPNIK_DECL void set_premultiplied_alpha(image_any & image, bool status) +{ + util::apply_visitor(detail::set_premultiplied_visitor(status), image); +} + +template +MAPNIK_DECL void set_premultiplied_alpha(T & image, bool status) +{ + detail::set_premultiplied_visitor visit(status); + visit(image); +} + +template MAPNIK_DECL void set_premultiplied_alpha(image_rgba8 &, bool); +template MAPNIK_DECL void set_premultiplied_alpha(image_gray8 &, bool); +template MAPNIK_DECL void set_premultiplied_alpha(image_gray8s &, bool); +template MAPNIK_DECL void set_premultiplied_alpha(image_gray16 &, bool); +template MAPNIK_DECL void set_premultiplied_alpha(image_gray16s &, bool); +template MAPNIK_DECL void set_premultiplied_alpha(image_gray32 &, bool); +template MAPNIK_DECL void set_premultiplied_alpha(image_gray32s &, bool); +template MAPNIK_DECL void set_premultiplied_alpha(image_gray32f &, bool); +template MAPNIK_DECL void set_premultiplied_alpha(image_gray64 &, bool); +template MAPNIK_DECL void set_premultiplied_alpha(image_gray64s &, bool); +template MAPNIK_DECL void set_premultiplied_alpha(image_gray64f &, bool); + +namespace detail { + +namespace { + +template +inline T clamp(T d, T min, T max) +{ + T const t = d < min ? min : d; + return t > max ? max : t; +} + +} +struct visitor_apply_opacity +{ + visitor_apply_opacity(float opacity) + : opacity_(clamp(opacity, 0.0f, 1.0f)) {} + + void operator() (image_rgba8 & data) const + { + using pixel_type = image_rgba8::pixel_type; + for (std::size_t y = 0; y < data.height(); ++y) + { + pixel_type* row_to = data.get_row(y); + for (std::size_t x = 0; x < data.width(); ++x) + { + pixel_type rgba = row_to[x]; + pixel_type a = static_cast(((rgba >> 24u) & 0xff) * opacity_); + pixel_type r = rgba & 0xff; + pixel_type g = (rgba >> 8u ) & 0xff; + pixel_type b = (rgba >> 16u) & 0xff; + + row_to[x] = (a << 24u) | (b << 16u) | (g << 8u) | (r) ; + } + } + } + + template + void operator() (T & data) const + { + throw std::runtime_error("Error: apply_opacity with " + std::string(typeid(data).name()) + " is not supported"); + } + +private: + float const opacity_; +}; + +} // end detail ns + +MAPNIK_DECL void apply_opacity(image_any & data, float opacity) +{ + // Prior to calling the data must not be premultiplied + bool remultiply = mapnik::demultiply_alpha(data); + util::apply_visitor(detail::visitor_apply_opacity(opacity), data); + if (remultiply) + { + mapnik::premultiply_alpha(data); + } +} + +template +MAPNIK_DECL void apply_opacity(T & data, float opacity) +{ + // Prior to calling the data must not be premultiplied + bool remultiply = mapnik::demultiply_alpha(data); + detail::visitor_apply_opacity visit(opacity); + visit(data); + if (remultiply) + { + mapnik::premultiply_alpha(data); + } +} + +template MAPNIK_DECL void apply_opacity(image_rgba8 &, float); +template MAPNIK_DECL void apply_opacity(image_gray8 &, float); +template MAPNIK_DECL void apply_opacity(image_gray8s &, float); +template MAPNIK_DECL void apply_opacity(image_gray16 &, float); +template MAPNIK_DECL void apply_opacity(image_gray16s &, float); +template MAPNIK_DECL void apply_opacity(image_gray32 &, float); +template MAPNIK_DECL void apply_opacity(image_gray32s &, float); +template MAPNIK_DECL void apply_opacity(image_gray32f &, float); +template MAPNIK_DECL void apply_opacity(image_gray64 &, float); +template MAPNIK_DECL void apply_opacity(image_gray64s &, float); +template MAPNIK_DECL void apply_opacity(image_gray64f &, float); + +namespace detail { + +struct visitor_set_grayscale_to_alpha +{ + void operator() (image_rgba8 & data) const + { + using pixel_type = image_rgba8::pixel_type; + for (std::size_t y = 0; y < data.height(); ++y) + { + pixel_type* row_from = data.get_row(y); + for (std::size_t x = 0; x < data.width(); ++x) + { + pixel_type rgba = row_from[x]; + pixel_type r = rgba & 0xff; + pixel_type g = (rgba >> 8u) & 0xff; + pixel_type b = (rgba >> 16u) & 0xff; + + // magic numbers for grayscale + pixel_type a = static_cast(std::ceil((r * .3) + (g * .59) + (b * .11))); + + row_from[x] = (a << 24u) | (255 << 16u) | (255 << 8u) | (255u) ; + } + } + } + + template + void operator() (T & data) const + { + MAPNIK_LOG_WARN(image_util) << "Warning: set_grayscale_to_alpha with " + std::string(typeid(data).name()) + " is not supported, image was not modified"; + } +}; + +struct visitor_set_grayscale_to_alpha_c +{ + visitor_set_grayscale_to_alpha_c(color const& c) + : c_(c) {} + + void operator() (image_rgba8 & data) const + { + using pixel_type = image_rgba8::pixel_type; + for (std::size_t y = 0; y < data.height(); ++y) + { + pixel_type* row_from = data.get_row(y); + for (std::size_t x = 0; x < data.width(); ++x) + { + pixel_type rgba = row_from[x]; + pixel_type r = rgba & 0xff; + pixel_type g = (rgba >> 8 ) & 0xff; + pixel_type b = (rgba >> 16) & 0xff; + + // magic numbers for grayscale + pixel_type a = static_cast(std::ceil((r * .3) + (g * .59) + (b * .11))); + + row_from[x] = static_cast(a << 24u) | + static_cast(c_.blue() << 16u) | + static_cast(c_.green() << 8u) | + static_cast(c_.red() ); + } + } + } + + template + void operator() (T & data) const + { + MAPNIK_LOG_WARN(image_util) << "Warning: set_grayscale_to_alpha with " + std::string(typeid(data).name()) + " is not supported, image was not modified"; + } + +private: + color const& c_; +}; + +} // end detail ns + +MAPNIK_DECL void set_grayscale_to_alpha(image_any & data) +{ + // Prior to calling the data must not be premultiplied + bool remultiply = mapnik::demultiply_alpha(data); + util::apply_visitor(detail::visitor_set_grayscale_to_alpha(), data); + if (remultiply) + { + mapnik::premultiply_alpha(data); + } +} + +template +MAPNIK_DECL void set_grayscale_to_alpha(T & data) +{ + // Prior to calling the data must not be premultiplied + bool remultiply = mapnik::demultiply_alpha(data); + detail::visitor_set_grayscale_to_alpha visit; + visit(data); + if (remultiply) + { + mapnik::premultiply_alpha(data); + } +} + +template MAPNIK_DECL void set_grayscale_to_alpha(image_rgba8 &); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray8 &); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray8s &); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray16 &); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray16s &); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray32 &); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray32s &); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray32f &); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray64 &); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray64s &); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray64f &); + +MAPNIK_DECL void set_grayscale_to_alpha(image_any & data, color const& c) +{ + // Prior to calling the data must not be premultiplied + bool remultiply = mapnik::demultiply_alpha(data); + util::apply_visitor(detail::visitor_set_grayscale_to_alpha_c(c), data); + if (remultiply) + { + mapnik::premultiply_alpha(data); + } +} + +template +MAPNIK_DECL void set_grayscale_to_alpha(T & data, color const& c) +{ + // Prior to calling the data must not be premultiplied + bool remultiply = mapnik::demultiply_alpha(data); + detail::visitor_set_grayscale_to_alpha_c visit(c); + visit(data); + if (remultiply) + { + mapnik::premultiply_alpha(data); + } +} + +template MAPNIK_DECL void set_grayscale_to_alpha(image_rgba8 &, color const&); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray8 &, color const&); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray8s &, color const&); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray16 &, color const&); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray16s &, color const&); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray32 &, color const&); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray32s &, color const&); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray32f &, color const&); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray64 &, color const&); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray64s &, color const&); +template MAPNIK_DECL void set_grayscale_to_alpha(image_gray64f &, color const&); + +namespace detail { + +struct visitor_set_color_to_alpha +{ + visitor_set_color_to_alpha(color const& c) + : c_(c) {} + + void operator() (image_rgba8 & data) const + { + using pixel_type = image_rgba8::pixel_type; + for (std::size_t y = 0; y < data.height(); ++y) + { + pixel_type* row_from = data.get_row(y); + for (std::size_t x = 0; x < data.width(); ++x) + { + pixel_type rgba = row_from[x]; + pixel_type r = rgba & 0xff; + pixel_type g = (rgba >> 8 ) & 0xff; + pixel_type b = (rgba >> 16) & 0xff; + if (r == c_.red() && g == c_.green() && b == c_.blue()) + { + row_from[x] = 0; + } + } + } + } + + template + void operator() (T & data) const + { + throw std::runtime_error("Error: set_color_to_alpha with " + std::string(typeid(data).name()) + " is not supported"); + } + +private: + color const& c_; + +}; + + +} // end detail ns + +MAPNIK_DECL void set_color_to_alpha (image_any & data, color const& c) +{ + // Prior to calling the data must not be premultiplied + bool remultiply = mapnik::demultiply_alpha(data); + util::apply_visitor(detail::visitor_set_color_to_alpha(c), data); + if (remultiply) + { + mapnik::premultiply_alpha(data); + } +} + +template +MAPNIK_DECL void set_color_to_alpha(T & data, color const& c) +{ + // Prior to calling the data must not be premultiplied + bool remultiply = mapnik::demultiply_alpha(data); + detail::visitor_set_color_to_alpha visit(c); + visit(data); + if (remultiply) + { + mapnik::premultiply_alpha(data); + } +} + +template MAPNIK_DECL void set_color_to_alpha(image_rgba8 &, color const&); +template MAPNIK_DECL void set_color_to_alpha(image_gray8 &, color const&); +template MAPNIK_DECL void set_color_to_alpha(image_gray8s &, color const&); +template MAPNIK_DECL void set_color_to_alpha(image_gray16 &, color const&); +template MAPNIK_DECL void set_color_to_alpha(image_gray16s &, color const&); +template MAPNIK_DECL void set_color_to_alpha(image_gray32 &, color const&); +template MAPNIK_DECL void set_color_to_alpha(image_gray32s &, color const&); +template MAPNIK_DECL void set_color_to_alpha(image_gray32f &, color const&); +template MAPNIK_DECL void set_color_to_alpha(image_gray64 &, color const&); +template MAPNIK_DECL void set_color_to_alpha(image_gray64s &, color const&); +template MAPNIK_DECL void set_color_to_alpha(image_gray64f &, color const&); + +namespace detail { + +template +struct visitor_fill +{ + visitor_fill(T1 const& val) + : val_(val) {} + + template + void operator() (T2 & data) const + { + using pixel_type = typename T2::pixel_type; + data.set(safe_cast(val_)); + } + +private: + T1 const& val_; +}; + +template<> +struct visitor_fill +{ + visitor_fill(color const& val) + : val_(val) {} + + void operator() (image_rgba8 & data) const + { + using pixel_type = image_rgba8::pixel_type; + pixel_type val = static_cast(val_.rgba()); + data.set(val); + data.set_premultiplied(val_.get_premultiplied()); + } + + template + void operator() (T2 & data) const + { + using pixel_type = typename T2::pixel_type; + pixel_type val = static_cast(val_.rgba()); + data.set(val); + } + +private: + color const& val_; +}; + +} // end detail ns + +template +MAPNIK_DECL void fill (image_any & data, T const& val) +{ + util::apply_visitor(detail::visitor_fill(val), data); +} + +template MAPNIK_DECL void fill(image_any &, color const&); +template MAPNIK_DECL void fill(image_any &, uint64_t const&); +template MAPNIK_DECL void fill(image_any &, int64_t const&); +template MAPNIK_DECL void fill(image_any &, uint32_t const&); +template MAPNIK_DECL void fill(image_any &, int32_t const&); +template MAPNIK_DECL void fill(image_any &, uint16_t const&); +template MAPNIK_DECL void fill(image_any &, int16_t const&); +template MAPNIK_DECL void fill(image_any &, uint8_t const&); +template MAPNIK_DECL void fill(image_any &, int8_t const&); +template MAPNIK_DECL void fill(image_any &, float const&); +template MAPNIK_DECL void fill(image_any &, double const&); + +template +MAPNIK_DECL void fill (image_rgba8 & data, T const& val) +{ + detail::visitor_fill visitor(val); + return visitor(data); +} + +template MAPNIK_DECL void fill(image_rgba8 &, color const&); +template MAPNIK_DECL void fill(image_rgba8 &, uint64_t const&); +template MAPNIK_DECL void fill(image_rgba8 &, int64_t const&); +template MAPNIK_DECL void fill(image_rgba8 &, uint32_t const&); +template MAPNIK_DECL void fill(image_rgba8 &, int32_t const&); +template MAPNIK_DECL void fill(image_rgba8 &, uint16_t const&); +template MAPNIK_DECL void fill(image_rgba8 &, int16_t const&); +template MAPNIK_DECL void fill(image_rgba8 &, uint8_t const&); +template MAPNIK_DECL void fill(image_rgba8 &, int8_t const&); +template MAPNIK_DECL void fill(image_rgba8 &, float const&); +template MAPNIK_DECL void fill(image_rgba8 &, double const&); + +template +MAPNIK_DECL void fill (image_gray8 & data, T const& val) +{ + detail::visitor_fill visitor(val); + return visitor(data); +} + +template MAPNIK_DECL void fill(image_gray8 &, color const&); +template MAPNIK_DECL void fill(image_gray8 &, uint64_t const&); +template MAPNIK_DECL void fill(image_gray8 &, int64_t const&); +template MAPNIK_DECL void fill(image_gray8 &, uint32_t const&); +template MAPNIK_DECL void fill(image_gray8 &, int32_t const&); +template MAPNIK_DECL void fill(image_gray8 &, uint16_t const&); +template MAPNIK_DECL void fill(image_gray8 &, int16_t const&); +template MAPNIK_DECL void fill(image_gray8 &, uint8_t const&); +template MAPNIK_DECL void fill(image_gray8 &, int8_t const&); +template MAPNIK_DECL void fill(image_gray8 &, float const&); +template MAPNIK_DECL void fill(image_gray8 &, double const&); + +template +MAPNIK_DECL void fill (image_gray8s & data, T const& val) +{ + detail::visitor_fill visitor(val); + return visitor(data); +} + +template MAPNIK_DECL void fill(image_gray8s &, color const&); +template MAPNIK_DECL void fill(image_gray8s &, uint64_t const&); +template MAPNIK_DECL void fill(image_gray8s &, int64_t const&); +template MAPNIK_DECL void fill(image_gray8s &, uint32_t const&); +template MAPNIK_DECL void fill(image_gray8s &, int32_t const&); +template MAPNIK_DECL void fill(image_gray8s &, uint16_t const&); +template MAPNIK_DECL void fill(image_gray8s &, int16_t const&); +template MAPNIK_DECL void fill(image_gray8s &, uint8_t const&); +template MAPNIK_DECL void fill(image_gray8s &, int8_t const&); +template MAPNIK_DECL void fill(image_gray8s &, float const&); +template MAPNIK_DECL void fill(image_gray8s &, double const&); + +template +MAPNIK_DECL void fill (image_gray16 & data, T const& val) +{ + detail::visitor_fill visitor(val); + return visitor(data); +} + +template MAPNIK_DECL void fill(image_gray16 &, color const&); +template MAPNIK_DECL void fill(image_gray16 &, uint64_t const&); +template MAPNIK_DECL void fill(image_gray16 &, int64_t const&); +template MAPNIK_DECL void fill(image_gray16 &, uint32_t const&); +template MAPNIK_DECL void fill(image_gray16 &, int32_t const&); +template MAPNIK_DECL void fill(image_gray16 &, uint16_t const&); +template MAPNIK_DECL void fill(image_gray16 &, int16_t const&); +template MAPNIK_DECL void fill(image_gray16 &, uint8_t const&); +template MAPNIK_DECL void fill(image_gray16 &, int8_t const&); +template MAPNIK_DECL void fill(image_gray16 &, float const&); +template MAPNIK_DECL void fill(image_gray16 &, double const&); + +template +MAPNIK_DECL void fill (image_gray16s & data, T const& val) +{ + detail::visitor_fill visitor(val); + return visitor(data); +} + +template MAPNIK_DECL void fill(image_gray16s &, color const&); +template MAPNIK_DECL void fill(image_gray16s &, uint64_t const&); +template MAPNIK_DECL void fill(image_gray16s &, int64_t const&); +template MAPNIK_DECL void fill(image_gray16s &, uint32_t const&); +template MAPNIK_DECL void fill(image_gray16s &, int32_t const&); +template MAPNIK_DECL void fill(image_gray16s &, uint16_t const&); +template MAPNIK_DECL void fill(image_gray16s &, int16_t const&); +template MAPNIK_DECL void fill(image_gray16s &, uint8_t const&); +template MAPNIK_DECL void fill(image_gray16s &, int8_t const&); +template MAPNIK_DECL void fill(image_gray16s &, float const&); +template MAPNIK_DECL void fill(image_gray16s &, double const&); + +template +MAPNIK_DECL void fill (image_gray32 & data, T const& val) +{ + detail::visitor_fill visitor(val); + return visitor(data); +} + +template MAPNIK_DECL void fill(image_gray32 &, color const&); +template MAPNIK_DECL void fill(image_gray32 &, uint64_t const&); +template MAPNIK_DECL void fill(image_gray32 &, int64_t const&); +template MAPNIK_DECL void fill(image_gray32 &, uint32_t const&); +template MAPNIK_DECL void fill(image_gray32 &, int32_t const&); +template MAPNIK_DECL void fill(image_gray32 &, uint16_t const&); +template MAPNIK_DECL void fill(image_gray32 &, int16_t const&); +template MAPNIK_DECL void fill(image_gray32 &, uint8_t const&); +template MAPNIK_DECL void fill(image_gray32 &, int8_t const&); +template MAPNIK_DECL void fill(image_gray32 &, float const&); +template MAPNIK_DECL void fill(image_gray32 &, double const&); + +template +MAPNIK_DECL void fill (image_gray32s & data, T const& val) +{ + detail::visitor_fill visitor(val); + return visitor(data); +} + +template MAPNIK_DECL void fill(image_gray32s &, color const&); +template MAPNIK_DECL void fill(image_gray32s &, uint64_t const&); +template MAPNIK_DECL void fill(image_gray32s &, int64_t const&); +template MAPNIK_DECL void fill(image_gray32s &, uint32_t const&); +template MAPNIK_DECL void fill(image_gray32s &, int32_t const&); +template MAPNIK_DECL void fill(image_gray32s &, uint16_t const&); +template MAPNIK_DECL void fill(image_gray32s &, int16_t const&); +template MAPNIK_DECL void fill(image_gray32s &, uint8_t const&); +template MAPNIK_DECL void fill(image_gray32s &, int8_t const&); +template MAPNIK_DECL void fill(image_gray32s &, float const&); +template MAPNIK_DECL void fill(image_gray32s &, double const&); + +template +MAPNIK_DECL void fill (image_gray32f & data, T const& val) +{ + detail::visitor_fill visitor(val); + return visitor(data); +} + +template MAPNIK_DECL void fill(image_gray32f &, color const&); +template MAPNIK_DECL void fill(image_gray32f &, uint64_t const&); +template MAPNIK_DECL void fill(image_gray32f &, int64_t const&); +template MAPNIK_DECL void fill(image_gray32f &, uint32_t const&); +template MAPNIK_DECL void fill(image_gray32f &, int32_t const&); +template MAPNIK_DECL void fill(image_gray32f &, uint16_t const&); +template MAPNIK_DECL void fill(image_gray32f &, int16_t const&); +template MAPNIK_DECL void fill(image_gray32f &, uint8_t const&); +template MAPNIK_DECL void fill(image_gray32f &, int8_t const&); +template MAPNIK_DECL void fill(image_gray32f &, float const&); +template MAPNIK_DECL void fill(image_gray32f &, double const&); + +template +MAPNIK_DECL void fill (image_gray64 & data, T const& val) +{ + detail::visitor_fill visitor(val); + return visitor(data); +} + +template MAPNIK_DECL void fill(image_gray64 &, color const&); +template MAPNIK_DECL void fill(image_gray64 &, uint64_t const&); +template MAPNIK_DECL void fill(image_gray64 &, int64_t const&); +template MAPNIK_DECL void fill(image_gray64 &, uint32_t const&); +template MAPNIK_DECL void fill(image_gray64 &, int32_t const&); +template MAPNIK_DECL void fill(image_gray64 &, uint16_t const&); +template MAPNIK_DECL void fill(image_gray64 &, int16_t const&); +template MAPNIK_DECL void fill(image_gray64 &, uint8_t const&); +template MAPNIK_DECL void fill(image_gray64 &, int8_t const&); +template MAPNIK_DECL void fill(image_gray64 &, float const&); +template MAPNIK_DECL void fill(image_gray64 &, double const&); + +template +MAPNIK_DECL void fill (image_gray64s & data, T const& val) +{ + detail::visitor_fill visitor(val); + return visitor(data); +} + +template MAPNIK_DECL void fill(image_gray64s &, color const&); +template MAPNIK_DECL void fill(image_gray64s &, uint64_t const&); +template MAPNIK_DECL void fill(image_gray64s &, int64_t const&); +template MAPNIK_DECL void fill(image_gray64s &, uint32_t const&); +template MAPNIK_DECL void fill(image_gray64s &, int32_t const&); +template MAPNIK_DECL void fill(image_gray64s &, uint16_t const&); +template MAPNIK_DECL void fill(image_gray64s &, int16_t const&); +template MAPNIK_DECL void fill(image_gray64s &, uint8_t const&); +template MAPNIK_DECL void fill(image_gray64s &, int8_t const&); +template MAPNIK_DECL void fill(image_gray64s &, float const&); +template MAPNIK_DECL void fill(image_gray64s &, double const&); + +template +MAPNIK_DECL void fill (image_gray64f & data, T const& val) +{ + detail::visitor_fill visitor(val); + return visitor(data); +} + +template MAPNIK_DECL void fill(image_gray64f &, color const&); +template MAPNIK_DECL void fill(image_gray64f &, uint64_t const&); +template MAPNIK_DECL void fill(image_gray64f &, int64_t const&); +template MAPNIK_DECL void fill(image_gray64f &, uint32_t const&); +template MAPNIK_DECL void fill(image_gray64f &, int32_t const&); +template MAPNIK_DECL void fill(image_gray64f &, uint16_t const&); +template MAPNIK_DECL void fill(image_gray64f &, int16_t const&); +template MAPNIK_DECL void fill(image_gray64f &, uint8_t const&); +template MAPNIK_DECL void fill(image_gray64f &, int8_t const&); +template MAPNIK_DECL void fill(image_gray64f &, float const&); +template MAPNIK_DECL void fill(image_gray64f &, double const&); + +namespace detail +{ + +struct visitor_composite_pixel +{ + // Obviously c variable would only work for rgba8 currently, but didn't want to + // make this a template class until new rgba types exist. + visitor_composite_pixel(composite_mode_e comp_op, std::size_t x, std::size_t y, unsigned c, unsigned cover, double opacity) + : opacity_(clamp(opacity, 0.0, 1.0)), + comp_op_(comp_op), + x_(x), + y_(y), + c_(c), + cover_(cover) {} + + void operator() (image_rgba8 & data) const + { + using color_type = agg::rgba8; + using value_type = color_type::value_type; + using order_type = agg::order_rgba; + using blender_type = agg::comp_op_adaptor_rgba; + + if (mapnik::check_bounds(data, x_, y_)) + { + image_rgba8::pixel_type rgba = data(x_,y_); + // TODO use std::round for consistent rounding + value_type ca = safe_cast(((c_ >> 24u) & 0xff) * opacity_); + value_type cb = (c_ >> 16u) & 0xff; + value_type cg = (c_ >> 8u) & 0xff; + value_type cr = (c_ & 0xff); + blender_type::blend_pix(comp_op_, reinterpret_cast(&rgba), cr, cg, cb, ca, cover_); + data(x_,y_) = rgba; + } + } + + template + void operator() (T &) const + { + throw std::runtime_error("Composite pixel is not supported for this data type"); + } + +private: + double const opacity_; + composite_mode_e comp_op_; + std::size_t const x_; + std::size_t const y_; + unsigned const c_; + unsigned const cover_; + +}; + +} // end detail ns + +MAPNIK_DECL void composite_pixel(image_any & data, composite_mode_e comp_op, std::size_t x, std::size_t y, unsigned c, unsigned cover, double opacity ) +{ + util::apply_visitor(detail::visitor_composite_pixel(comp_op, x, y, c, cover, opacity), data); +} + +template +MAPNIK_DECL void composite_pixel(T & data, composite_mode_e comp_op, std::size_t x, std::size_t y, unsigned c, unsigned cover, double opacity ) +{ + detail::visitor_composite_pixel visitor(comp_op, x, y, c, cover, opacity); + visitor(data); +} + +template MAPNIK_DECL void composite_pixel(image_rgba8 &, composite_mode_e, std::size_t, std::size_t, unsigned, unsigned, double); +template MAPNIK_DECL void composite_pixel(image_gray8 &, composite_mode_e, std::size_t, std::size_t, unsigned, unsigned, double); +template MAPNIK_DECL void composite_pixel(image_gray8s &, composite_mode_e, std::size_t, std::size_t, unsigned, unsigned, double); +template MAPNIK_DECL void composite_pixel(image_gray16 &, composite_mode_e, std::size_t, std::size_t, unsigned, unsigned, double); +template MAPNIK_DECL void composite_pixel(image_gray16s &, composite_mode_e, std::size_t, std::size_t, unsigned, unsigned, double); +template MAPNIK_DECL void composite_pixel(image_gray32 &, composite_mode_e, std::size_t, std::size_t, unsigned, unsigned, double); +template MAPNIK_DECL void composite_pixel(image_gray32s &, composite_mode_e, std::size_t, std::size_t, unsigned, unsigned, double); +template MAPNIK_DECL void composite_pixel(image_gray32f &, composite_mode_e, std::size_t, std::size_t, unsigned, unsigned, double); +template MAPNIK_DECL void composite_pixel(image_gray64 &, composite_mode_e, std::size_t, std::size_t, unsigned, unsigned, double); +template MAPNIK_DECL void composite_pixel(image_gray64s &, composite_mode_e, std::size_t, std::size_t, unsigned, unsigned, double); +template MAPNIK_DECL void composite_pixel(image_gray64f &, composite_mode_e, std::size_t, std::size_t, unsigned, unsigned, double); + +namespace detail { + +template +struct visitor_set_pixel +{ + visitor_set_pixel(std::size_t x, std::size_t y, T1 const& val) + : val_(val), x_(x), y_(y) {} + + template + void operator() (T2 & data) const + { + using pixel_type = typename T2::pixel_type; + if (check_bounds(data, x_, y_)) + { + data(x_, y_) = safe_cast(val_); + } + } + +private: + T1 const& val_; + std::size_t const x_; + std::size_t const y_; +}; + +template<> +struct visitor_set_pixel +{ + visitor_set_pixel(std::size_t x, std::size_t y, color const& val) + : val_(val), x_(x), y_(y) {} + + template + void operator() (T2 & data) const + { + using pixel_type = typename T2::pixel_type; + pixel_type val; + if (data.get_premultiplied() && !val_.get_premultiplied()) + { + color tmp(val_); + tmp.premultiply(); + val = static_cast(tmp.rgba()); + } + else if (!data.get_premultiplied() && val_.get_premultiplied()) + { + color tmp(val_); + tmp.demultiply(); + val = static_cast(tmp.rgba()); + } + else + { + val = static_cast(val_.rgba()); + } + if (check_bounds(data, x_, y_)) + { + data(x_, y_) = val; + } + } + +private: + color const& val_; + std::size_t const x_; + std::size_t const y_; +}; + +} // end detail ns + +template +MAPNIK_DECL void set_pixel (image_any & data, std::size_t x, std::size_t y, T const& val) +{ + util::apply_visitor(detail::visitor_set_pixel(x, y, val), data); +} + +template MAPNIK_DECL void set_pixel(image_any &, std::size_t, std::size_t, color const&); +template MAPNIK_DECL void set_pixel(image_any &, std::size_t, std::size_t, uint64_t const&); +template MAPNIK_DECL void set_pixel(image_any &, std::size_t, std::size_t, int64_t const&); +template MAPNIK_DECL void set_pixel(image_any &, std::size_t, std::size_t, uint32_t const&); +template MAPNIK_DECL void set_pixel(image_any &, std::size_t, std::size_t, int32_t const&); +template MAPNIK_DECL void set_pixel(image_any &, std::size_t, std::size_t, uint16_t const&); +template MAPNIK_DECL void set_pixel(image_any &, std::size_t, std::size_t, int16_t const&); +template MAPNIK_DECL void set_pixel(image_any &, std::size_t, std::size_t, uint8_t const&); +template MAPNIK_DECL void set_pixel(image_any &, std::size_t, std::size_t, int8_t const&); +template MAPNIK_DECL void set_pixel(image_any &, std::size_t, std::size_t, float const&); +template MAPNIK_DECL void set_pixel(image_any &, std::size_t, std::size_t, double const&); + +template +MAPNIK_DECL void set_pixel (image_rgba8 & data, std::size_t x, std::size_t y, T const& val) +{ + detail::visitor_set_pixel visitor(x, y, val); + visitor(data); +} + +template MAPNIK_DECL void set_pixel(image_rgba8 &, std::size_t, std::size_t, color const&); +template MAPNIK_DECL void set_pixel(image_rgba8 &, std::size_t, std::size_t, uint64_t const&); +template MAPNIK_DECL void set_pixel(image_rgba8 &, std::size_t, std::size_t, int64_t const&); +template MAPNIK_DECL void set_pixel(image_rgba8 &, std::size_t, std::size_t, uint32_t const&); +template MAPNIK_DECL void set_pixel(image_rgba8 &, std::size_t, std::size_t, int32_t const&); +template MAPNIK_DECL void set_pixel(image_rgba8 &, std::size_t, std::size_t, uint16_t const&); +template MAPNIK_DECL void set_pixel(image_rgba8 &, std::size_t, std::size_t, int16_t const&); +template MAPNIK_DECL void set_pixel(image_rgba8 &, std::size_t, std::size_t, uint8_t const&); +template MAPNIK_DECL void set_pixel(image_rgba8 &, std::size_t, std::size_t, int8_t const&); +template MAPNIK_DECL void set_pixel(image_rgba8 &, std::size_t, std::size_t, float const&); +template MAPNIK_DECL void set_pixel(image_rgba8 &, std::size_t, std::size_t, double const&); + +template +MAPNIK_DECL void set_pixel (image_gray8 & data, std::size_t x, std::size_t y, T const& val) +{ + detail::visitor_set_pixel visitor(x, y, val); + visitor(data); +} + +template MAPNIK_DECL void set_pixel(image_gray8 &, std::size_t, std::size_t, color const&); +template MAPNIK_DECL void set_pixel(image_gray8 &, std::size_t, std::size_t, uint64_t const&); +template MAPNIK_DECL void set_pixel(image_gray8 &, std::size_t, std::size_t, int64_t const&); +template MAPNIK_DECL void set_pixel(image_gray8 &, std::size_t, std::size_t, uint32_t const&); +template MAPNIK_DECL void set_pixel(image_gray8 &, std::size_t, std::size_t, int32_t const&); +template MAPNIK_DECL void set_pixel(image_gray8 &, std::size_t, std::size_t, uint16_t const&); +template MAPNIK_DECL void set_pixel(image_gray8 &, std::size_t, std::size_t, int16_t const&); +template MAPNIK_DECL void set_pixel(image_gray8 &, std::size_t, std::size_t, uint8_t const&); +template MAPNIK_DECL void set_pixel(image_gray8 &, std::size_t, std::size_t, int8_t const&); +template MAPNIK_DECL void set_pixel(image_gray8 &, std::size_t, std::size_t, float const&); +template MAPNIK_DECL void set_pixel(image_gray8 &, std::size_t, std::size_t, double const&); + +template +MAPNIK_DECL void set_pixel (image_gray8s & data, std::size_t x, std::size_t y, T const& val) +{ + detail::visitor_set_pixel visitor(x, y, val); + visitor(data); +} + +template MAPNIK_DECL void set_pixel(image_gray8s &, std::size_t, std::size_t, color const&); +template MAPNIK_DECL void set_pixel(image_gray8s &, std::size_t, std::size_t, uint64_t const&); +template MAPNIK_DECL void set_pixel(image_gray8s &, std::size_t, std::size_t, int64_t const&); +template MAPNIK_DECL void set_pixel(image_gray8s &, std::size_t, std::size_t, uint32_t const&); +template MAPNIK_DECL void set_pixel(image_gray8s &, std::size_t, std::size_t, int32_t const&); +template MAPNIK_DECL void set_pixel(image_gray8s &, std::size_t, std::size_t, uint16_t const&); +template MAPNIK_DECL void set_pixel(image_gray8s &, std::size_t, std::size_t, int16_t const&); +template MAPNIK_DECL void set_pixel(image_gray8s &, std::size_t, std::size_t, uint8_t const&); +template MAPNIK_DECL void set_pixel(image_gray8s &, std::size_t, std::size_t, int8_t const&); +template MAPNIK_DECL void set_pixel(image_gray8s &, std::size_t, std::size_t, float const&); +template MAPNIK_DECL void set_pixel(image_gray8s &, std::size_t, std::size_t, double const&); + +template +MAPNIK_DECL void set_pixel (image_gray16 & data, std::size_t x, std::size_t y, T const& val) +{ + detail::visitor_set_pixel visitor(x, y, val); + visitor(data); +} + +template MAPNIK_DECL void set_pixel(image_gray16 &, std::size_t, std::size_t, color const&); +template MAPNIK_DECL void set_pixel(image_gray16 &, std::size_t, std::size_t, uint64_t const&); +template MAPNIK_DECL void set_pixel(image_gray16 &, std::size_t, std::size_t, int64_t const&); +template MAPNIK_DECL void set_pixel(image_gray16 &, std::size_t, std::size_t, uint32_t const&); +template MAPNIK_DECL void set_pixel(image_gray16 &, std::size_t, std::size_t, int32_t const&); +template MAPNIK_DECL void set_pixel(image_gray16 &, std::size_t, std::size_t, uint16_t const&); +template MAPNIK_DECL void set_pixel(image_gray16 &, std::size_t, std::size_t, int16_t const&); +template MAPNIK_DECL void set_pixel(image_gray16 &, std::size_t, std::size_t, uint8_t const&); +template MAPNIK_DECL void set_pixel(image_gray16 &, std::size_t, std::size_t, int8_t const&); +template MAPNIK_DECL void set_pixel(image_gray16 &, std::size_t, std::size_t, float const&); +template MAPNIK_DECL void set_pixel(image_gray16 &, std::size_t, std::size_t, double const&); + +template +MAPNIK_DECL void set_pixel (image_gray16s & data, std::size_t x, std::size_t y, T const& val) +{ + detail::visitor_set_pixel visitor(x, y, val); + visitor(data); +} + +template MAPNIK_DECL void set_pixel(image_gray16s &, std::size_t, std::size_t, color const&); +template MAPNIK_DECL void set_pixel(image_gray16s &, std::size_t, std::size_t, uint64_t const&); +template MAPNIK_DECL void set_pixel(image_gray16s &, std::size_t, std::size_t, int64_t const&); +template MAPNIK_DECL void set_pixel(image_gray16s &, std::size_t, std::size_t, uint32_t const&); +template MAPNIK_DECL void set_pixel(image_gray16s &, std::size_t, std::size_t, int32_t const&); +template MAPNIK_DECL void set_pixel(image_gray16s &, std::size_t, std::size_t, uint16_t const&); +template MAPNIK_DECL void set_pixel(image_gray16s &, std::size_t, std::size_t, int16_t const&); +template MAPNIK_DECL void set_pixel(image_gray16s &, std::size_t, std::size_t, uint8_t const&); +template MAPNIK_DECL void set_pixel(image_gray16s &, std::size_t, std::size_t, int8_t const&); +template MAPNIK_DECL void set_pixel(image_gray16s &, std::size_t, std::size_t, float const&); +template MAPNIK_DECL void set_pixel(image_gray16s &, std::size_t, std::size_t, double const&); + +template +MAPNIK_DECL void set_pixel (image_gray32 & data, std::size_t x, std::size_t y, T const& val) +{ + detail::visitor_set_pixel visitor(x, y, val); + visitor(data); +} + +template MAPNIK_DECL void set_pixel(image_gray32 &, std::size_t, std::size_t, color const&); +template MAPNIK_DECL void set_pixel(image_gray32 &, std::size_t, std::size_t, uint64_t const&); +template MAPNIK_DECL void set_pixel(image_gray32 &, std::size_t, std::size_t, int64_t const&); +template MAPNIK_DECL void set_pixel(image_gray32 &, std::size_t, std::size_t, uint32_t const&); +template MAPNIK_DECL void set_pixel(image_gray32 &, std::size_t, std::size_t, int32_t const&); +template MAPNIK_DECL void set_pixel(image_gray32 &, std::size_t, std::size_t, uint16_t const&); +template MAPNIK_DECL void set_pixel(image_gray32 &, std::size_t, std::size_t, int16_t const&); +template MAPNIK_DECL void set_pixel(image_gray32 &, std::size_t, std::size_t, uint8_t const&); +template MAPNIK_DECL void set_pixel(image_gray32 &, std::size_t, std::size_t, int8_t const&); +template MAPNIK_DECL void set_pixel(image_gray32 &, std::size_t, std::size_t, float const&); +template MAPNIK_DECL void set_pixel(image_gray32 &, std::size_t, std::size_t, double const&); + +template +MAPNIK_DECL void set_pixel (image_gray32s & data, std::size_t x, std::size_t y, T const& val) +{ + detail::visitor_set_pixel visitor(x, y, val); + visitor(data); +} + +template MAPNIK_DECL void set_pixel(image_gray32s &, std::size_t, std::size_t, color const&); +template MAPNIK_DECL void set_pixel(image_gray32s &, std::size_t, std::size_t, uint64_t const&); +template MAPNIK_DECL void set_pixel(image_gray32s &, std::size_t, std::size_t, int64_t const&); +template MAPNIK_DECL void set_pixel(image_gray32s &, std::size_t, std::size_t, uint32_t const&); +template MAPNIK_DECL void set_pixel(image_gray32s &, std::size_t, std::size_t, int32_t const&); +template MAPNIK_DECL void set_pixel(image_gray32s &, std::size_t, std::size_t, uint16_t const&); +template MAPNIK_DECL void set_pixel(image_gray32s &, std::size_t, std::size_t, int16_t const&); +template MAPNIK_DECL void set_pixel(image_gray32s &, std::size_t, std::size_t, uint8_t const&); +template MAPNIK_DECL void set_pixel(image_gray32s &, std::size_t, std::size_t, int8_t const&); +template MAPNIK_DECL void set_pixel(image_gray32s &, std::size_t, std::size_t, float const&); +template MAPNIK_DECL void set_pixel(image_gray32s &, std::size_t, std::size_t, double const&); + +template +MAPNIK_DECL void set_pixel (image_gray32f & data, std::size_t x, std::size_t y, T const& val) +{ + detail::visitor_set_pixel visitor(x, y, val); + visitor(data); +} + +template MAPNIK_DECL void set_pixel(image_gray32f &, std::size_t, std::size_t, color const&); +template MAPNIK_DECL void set_pixel(image_gray32f &, std::size_t, std::size_t, uint64_t const&); +template MAPNIK_DECL void set_pixel(image_gray32f &, std::size_t, std::size_t, int64_t const&); +template MAPNIK_DECL void set_pixel(image_gray32f &, std::size_t, std::size_t, uint32_t const&); +template MAPNIK_DECL void set_pixel(image_gray32f &, std::size_t, std::size_t, int32_t const&); +template MAPNIK_DECL void set_pixel(image_gray32f &, std::size_t, std::size_t, uint16_t const&); +template MAPNIK_DECL void set_pixel(image_gray32f &, std::size_t, std::size_t, int16_t const&); +template MAPNIK_DECL void set_pixel(image_gray32f &, std::size_t, std::size_t, uint8_t const&); +template MAPNIK_DECL void set_pixel(image_gray32f &, std::size_t, std::size_t, int8_t const&); +template MAPNIK_DECL void set_pixel(image_gray32f &, std::size_t, std::size_t, float const&); +template MAPNIK_DECL void set_pixel(image_gray32f &, std::size_t, std::size_t, double const&); + +template +MAPNIK_DECL void set_pixel (image_gray64 & data, std::size_t x, std::size_t y, T const& val) +{ + detail::visitor_set_pixel visitor(x, y, val); + visitor(data); +} + +template MAPNIK_DECL void set_pixel(image_gray64 &, std::size_t, std::size_t, color const&); +template MAPNIK_DECL void set_pixel(image_gray64 &, std::size_t, std::size_t, uint64_t const&); +template MAPNIK_DECL void set_pixel(image_gray64 &, std::size_t, std::size_t, int64_t const&); +template MAPNIK_DECL void set_pixel(image_gray64 &, std::size_t, std::size_t, uint32_t const&); +template MAPNIK_DECL void set_pixel(image_gray64 &, std::size_t, std::size_t, int32_t const&); +template MAPNIK_DECL void set_pixel(image_gray64 &, std::size_t, std::size_t, uint16_t const&); +template MAPNIK_DECL void set_pixel(image_gray64 &, std::size_t, std::size_t, int16_t const&); +template MAPNIK_DECL void set_pixel(image_gray64 &, std::size_t, std::size_t, uint8_t const&); +template MAPNIK_DECL void set_pixel(image_gray64 &, std::size_t, std::size_t, int8_t const&); +template MAPNIK_DECL void set_pixel(image_gray64 &, std::size_t, std::size_t, float const&); +template MAPNIK_DECL void set_pixel(image_gray64 &, std::size_t, std::size_t, double const&); + +template +MAPNIK_DECL void set_pixel (image_gray64s & data, std::size_t x, std::size_t y, T const& val) +{ + detail::visitor_set_pixel visitor(x, y, val); + visitor(data); +} + +template MAPNIK_DECL void set_pixel(image_gray64s &, std::size_t, std::size_t, color const&); +template MAPNIK_DECL void set_pixel(image_gray64s &, std::size_t, std::size_t, uint64_t const&); +template MAPNIK_DECL void set_pixel(image_gray64s &, std::size_t, std::size_t, int64_t const&); +template MAPNIK_DECL void set_pixel(image_gray64s &, std::size_t, std::size_t, uint32_t const&); +template MAPNIK_DECL void set_pixel(image_gray64s &, std::size_t, std::size_t, int32_t const&); +template MAPNIK_DECL void set_pixel(image_gray64s &, std::size_t, std::size_t, uint16_t const&); +template MAPNIK_DECL void set_pixel(image_gray64s &, std::size_t, std::size_t, int16_t const&); +template MAPNIK_DECL void set_pixel(image_gray64s &, std::size_t, std::size_t, uint8_t const&); +template MAPNIK_DECL void set_pixel(image_gray64s &, std::size_t, std::size_t, int8_t const&); +template MAPNIK_DECL void set_pixel(image_gray64s &, std::size_t, std::size_t, float const&); +template MAPNIK_DECL void set_pixel(image_gray64s &, std::size_t, std::size_t, double const&); + +template +MAPNIK_DECL void set_pixel (image_gray64f & data, std::size_t x, std::size_t y, T const& val) +{ + detail::visitor_set_pixel visitor(x, y, val); + visitor(data); +} + +template MAPNIK_DECL void set_pixel(image_gray64f &, std::size_t, std::size_t, color const&); +template MAPNIK_DECL void set_pixel(image_gray64f &, std::size_t, std::size_t, uint64_t const&); +template MAPNIK_DECL void set_pixel(image_gray64f &, std::size_t, std::size_t, int64_t const&); +template MAPNIK_DECL void set_pixel(image_gray64f &, std::size_t, std::size_t, uint32_t const&); +template MAPNIK_DECL void set_pixel(image_gray64f &, std::size_t, std::size_t, int32_t const&); +template MAPNIK_DECL void set_pixel(image_gray64f &, std::size_t, std::size_t, uint16_t const&); +template MAPNIK_DECL void set_pixel(image_gray64f &, std::size_t, std::size_t, int16_t const&); +template MAPNIK_DECL void set_pixel(image_gray64f &, std::size_t, std::size_t, uint8_t const&); +template MAPNIK_DECL void set_pixel(image_gray64f &, std::size_t, std::size_t, int8_t const&); +template MAPNIK_DECL void set_pixel(image_gray64f &, std::size_t, std::size_t, float const&); +template MAPNIK_DECL void set_pixel(image_gray64f &, std::size_t, std::size_t, double const&); + +namespace detail { + +template +struct visitor_get_pixel +{ + visitor_get_pixel(std::size_t x, std::size_t y) + : x_(x), y_(y) {} + + template + T1 operator() (T2 const& data) const + { + using pixel_type = T1; + if (check_bounds(data, x_, y_)) + { + return safe_cast(data(x_, y_)); + } + else + { + throw std::runtime_error("Out of range for dataset with get pixel"); + } + } + +private: + std::size_t const x_; + std::size_t const y_; +}; + +template<> +struct visitor_get_pixel +{ + visitor_get_pixel(std::size_t x, std::size_t y) + : x_(x), y_(y) {} + + template + color operator() (T2 const& data) const + { + if (check_bounds(data, x_, y_)) + { + return color(static_cast(data(x_, y_)), data.get_premultiplied()); + } + else + { + throw std::runtime_error("Out of range for dataset with get pixel"); + } + } + +private: + std::size_t const x_; + std::size_t const y_; +}; + +} // end detail ns + +template +MAPNIK_DECL T get_pixel (image_any const& data, std::size_t x, std::size_t y) +{ + return util::apply_visitor(detail::visitor_get_pixel(x, y), data); +} + +template MAPNIK_DECL color get_pixel(image_any const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_any const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_any const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_any const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_any const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_any const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_any const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_any const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_any const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_any const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_any const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_view_any const& data, std::size_t x, std::size_t y) +{ + return util::apply_visitor(detail::visitor_get_pixel(x, y), data); +} + +template MAPNIK_DECL color get_pixel(image_view_any const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_view_any const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_view_any const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_view_any const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_view_any const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_view_any const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_view_any const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_view_any const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_view_any const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_view_any const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_any const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_rgba8 const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_rgba8 const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_gray8 const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray8 const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_gray8s const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray8s const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_gray16 const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray16 const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_gray16s const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray16s const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_gray32 const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray32 const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_gray32s const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray32s const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_gray32f const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray32f const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_gray64 const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray64 const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_gray64s const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray64s const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_gray64f const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_gray64f const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_view_rgba8 const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_rgba8 const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_view_gray8 const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_view_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_view_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_view_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_view_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_view_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_view_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_view_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_view_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_view_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_view_gray8 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray8 const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_view_gray8s const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_view_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_view_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_view_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_view_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_view_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_view_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_view_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_view_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_view_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_view_gray8s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray8s const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_view_gray16 const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_view_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_view_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_view_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_view_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_view_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_view_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_view_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_view_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_view_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_view_gray16 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray16 const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_view_gray16s const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_view_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_view_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_view_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_view_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_view_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_view_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_view_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_view_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_view_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_view_gray16s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray16s const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_view_gray32 const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_view_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_view_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_view_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_view_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_view_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_view_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_view_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_view_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_view_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_view_gray32 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray32 const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_view_gray32s const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_view_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_view_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_view_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_view_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_view_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_view_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_view_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_view_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_view_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_view_gray32s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray32s const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_view_gray32f const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_view_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_view_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_view_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_view_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_view_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_view_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_view_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_view_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_view_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_view_gray32f const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray32f const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_view_gray64 const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_view_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_view_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_view_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_view_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_view_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_view_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_view_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_view_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_view_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_view_gray64 const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray64 const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_view_gray64s const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_view_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_view_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_view_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_view_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_view_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_view_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_view_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_view_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_view_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_view_gray64s const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray64s const&, std::size_t, std::size_t); + +template +MAPNIK_DECL T get_pixel (image_view_gray64f const& data, std::size_t x, std::size_t y) +{ + detail::visitor_get_pixel visitor(x, y); + return visitor(data); +} + +template MAPNIK_DECL color get_pixel(image_view_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint64_t get_pixel(image_view_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL int64_t get_pixel(image_view_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint32_t get_pixel(image_view_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL int32_t get_pixel(image_view_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint16_t get_pixel(image_view_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL int16_t get_pixel(image_view_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL uint8_t get_pixel(image_view_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL int8_t get_pixel(image_view_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL float get_pixel(image_view_gray64f const&, std::size_t, std::size_t); +template MAPNIK_DECL double get_pixel(image_view_gray64f const&, std::size_t, std::size_t); + +namespace detail +{ + +template +struct visitor_view_to_stream +{ + visitor_view_to_stream(Out & os) + : os_(os) {} + + template + void operator() (T const& view) + { + for (std::size_t i=0;i(view.get_row(i)), + safe_cast(view.row_size())); + } + } + +private: + Out & os_; +}; + +} // end detail ns + +template +void view_to_stream (image_view_any const& view, Out & os) +{ + util::apply_visitor(detail::visitor_view_to_stream(os), view); +} + +template MAPNIK_DECL void view_to_stream(image_view_any const& view, std::ostringstream & os); + +namespace detail +{ + +struct visitor_create_view +{ + visitor_create_view(std::size_t x, std::size_t y, std::size_t w, std::size_t h) + : x_(x), y_(y), w_(w), h_(h) {} + + image_view_any operator() (image_null const&) const + { + throw std::runtime_error("Can not make a view from a null image"); + } + + template + image_view_any operator() (T const& data) const + { + image_view view(x_,y_,w_,h_,data); + return image_view_any(view); + } +private: + std::size_t const x_; + std::size_t const y_; + std::size_t const w_; + std::size_t const h_; +}; + +} // end detail ns + +MAPNIK_DECL image_view_any create_view(image_any const& data, std::size_t x, std::size_t y, std::size_t w, std::size_t h) +{ + return util::apply_visitor(detail::visitor_create_view(x, y, w, h), data); +} + +template +MAPNIK_DECL std::size_t compare(T const& im1, T const& im2, double threshold, bool) +{ + using pixel_type = typename T::pixel_type; + if (im1.width() != im2.width() || im1.height() != im2.height()) + { + return im1.width() * im1.height(); + } + std::size_t difference = 0; + for (std::size_t y = 0; y < im1.height(); ++y) + { + const pixel_type * row_from = im1.get_row(y); + const pixel_type * row_from2 = im2.get_row(y); + for (std::size_t x = 0; x < im1.width(); ++x) + { + double d = std::abs(static_cast(row_from[x]) - static_cast(row_from2[x])); + if (d > threshold) + { + ++difference; + } + } + } + return difference; +} + +template MAPNIK_DECL std::size_t compare(image_gray8 const&, image_gray8 const&, double, bool); +template MAPNIK_DECL std::size_t compare(image_gray8s const&, image_gray8s const&, double, bool); +template MAPNIK_DECL std::size_t compare(image_gray16 const&, image_gray16 const&, double, bool); +template MAPNIK_DECL std::size_t compare(image_gray16s const&, image_gray16s const&, double, bool); +template MAPNIK_DECL std::size_t compare(image_gray32 const&, image_gray32 const&, double, bool); +template MAPNIK_DECL std::size_t compare(image_gray32s const&, image_gray32s const&, double, bool); +template MAPNIK_DECL std::size_t compare(image_gray32f const&, image_gray32f const&, double, bool); +template MAPNIK_DECL std::size_t compare(image_gray64 const&, image_gray64 const&, double, bool); +template MAPNIK_DECL std::size_t compare(image_gray64s const&, image_gray64s const&, double, bool); +template MAPNIK_DECL std::size_t compare(image_gray64f const&, image_gray64f const&, double, bool); + +template <> +MAPNIK_DECL std::size_t compare(image_null const&, image_null const&, double, bool) +{ + return 0; +} + +template <> +MAPNIK_DECL std::size_t compare(image_rgba8 const& im1, image_rgba8 const& im2, double threshold, bool alpha) +{ + using pixel_type = image_rgba8::pixel_type; + if (im1.width() != im2.width() || im1.height() != im2.height()) + { + return im1.width() * im1.height(); + } + unsigned difference = 0; +#ifdef SSE_MATH + __m128i true_set = _mm_set1_epi8(0xff); + __m128i one = _mm_set1_epi32(1); + __m128i sum = _mm_setzero_si128(); + uint32_t alphamask = 0xffffffff; + if (!alpha) + { + alphamask = 0xffffff; + } + __m128i mask = _mm_set1_epi32(alphamask); + if (threshold == 0.0) + { + for (unsigned int y = 0; y < im1.height(); ++y) + { + const pixel_type * row_from = im1.get_row(y); + const pixel_type * row_from2 = im2.get_row(y); + int x = 0; + for (; x < ROUND_DOWN(im1.width(),4); x +=4 ) + { + __m128i rgba = _mm_loadu_si128((__m128i*)(row_from + x)); + __m128i rgba2 = _mm_loadu_si128((__m128i*)(row_from2 + x)); + rgba = _mm_and_si128(rgba, mask); + rgba2 = _mm_and_si128(rgba2, mask); + __m128i eq = _mm_cmpeq_epi8(rgba,rgba2); + __m128i comp2 = _mm_cmpeq_epi32(eq, true_set); + sum = _mm_add_epi32(sum, _mm_andnot_si128(comp2, one)); + } + for (; x < im1.width(); ++x) + { + if ((row_from[x] & alphamask) != (row_from2[x] & alphamask)) + { + ++difference; + } + } + } + m128_int diff_sum; + diff_sum.v = sum; + difference += diff_sum.u32[0]; + difference += diff_sum.u32[1]; + difference += diff_sum.u32[2]; + difference += diff_sum.u32[3]; + } + else + { + uint8_t thres = static_cast(threshold); + __m128i m_thres = _mm_set1_epi8(thres); + for (unsigned int y = 0; y < im1.height(); ++y) + { + const pixel_type * row_from = im1.get_row(y); + const pixel_type * row_from2 = im2.get_row(y); + int x = 0; + for (; x < ROUND_DOWN(im1.width(),4); x +=4 ) + { + __m128i rgba = _mm_loadu_si128((__m128i*)(row_from + x)); + __m128i rgba2 = _mm_loadu_si128((__m128i*)(row_from2 + x)); + rgba = _mm_and_si128(rgba, mask); + rgba2 = _mm_and_si128(rgba2, mask); + __m128i abs = _mm_absdiff_epu8(rgba, rgba2); + __m128i compare = _mm_cmpgt_epu8(abs, m_thres); + __m128i comp2 = _mm_cmpeq_epi32(compare, _mm_setzero_si128()); + sum = _mm_add_epi32(sum, _mm_andnot_si128(comp2, one)); + } + for (; x < im1.width(); ++x) + { + unsigned rgba = row_from[x]; + unsigned rgba2 = row_from2[x]; + unsigned r = rgba & 0xff; + unsigned g = (rgba >> 8u) & 0xff; + unsigned b = (rgba >> 16u) & 0xff; + unsigned r2 = rgba2 & 0xff; + unsigned g2 = (rgba2 >> 8u) & 0xff; + unsigned b2 = (rgba2 >> 16u) & 0xff; + if (std::abs(static_cast(r - r2)) > static_cast(threshold) || + std::abs(static_cast(g - g2)) > static_cast(threshold) || + std::abs(static_cast(b - b2)) > static_cast(threshold)) { + ++difference; + continue; + } + if (alpha) { + unsigned a = (rgba >> 24u) & 0xff; + unsigned a2 = (rgba2 >> 24u) & 0xff; + if (std::abs(static_cast(a - a2)) > static_cast(threshold)) { + ++difference; + continue; + } + } + } + } + m128_int diff_sum; + diff_sum.v = sum; + difference += diff_sum.u32[0]; + difference += diff_sum.u32[1]; + difference += diff_sum.u32[2]; + difference += diff_sum.u32[3]; + } +#else + for (unsigned int y = 0; y < im1.height(); ++y) + { + const pixel_type * row_from = im1.get_row(y); + const pixel_type * row_from2 = im2.get_row(y); + for (unsigned int x = 0; x < im1.width(); ++x) + { + unsigned rgba = row_from[x]; + unsigned rgba2 = row_from2[x]; + unsigned r = rgba & 0xff; + unsigned g = (rgba >> 8u) & 0xff; + unsigned b = (rgba >> 16u) & 0xff; + unsigned r2 = rgba2 & 0xff; + unsigned g2 = (rgba2 >> 8u) & 0xff; + unsigned b2 = (rgba2 >> 16u) & 0xff; + if (std::abs(static_cast(r - r2)) > static_cast(threshold) || + std::abs(static_cast(g - g2)) > static_cast(threshold) || + std::abs(static_cast(b - b2)) > static_cast(threshold)) { + ++difference; + continue; + } + if (alpha) { + unsigned a = (rgba >> 24u) & 0xff; + unsigned a2 = (rgba2 >> 24u) & 0xff; + if (std::abs(static_cast(a - a2)) > static_cast(threshold)) { + ++difference; + continue; + } + } + } + } +#endif + return difference; +} + +namespace detail +{ + +struct visitor_compare +{ + visitor_compare(image_any const& im2, double threshold, bool alpha) + : im2_(im2), + threshold_(threshold), + alpha_(alpha) {} + + template + std::size_t operator() (T const & im1) const + { + if (!im2_.is()) + { + return im1.width() * im1.height(); + } + return mapnik::compare(im1, util::get(im2_), threshold_, alpha_); + } + +private: + image_any const& im2_; + double const threshold_; + bool const alpha_; +}; + +} // end detail ns + +template <> +MAPNIK_DECL std::size_t compare(image_any const& im1, image_any const& im2, double threshold, bool alpha) +{ + return util::apply_visitor(detail::visitor_compare(im2, threshold, alpha), im1); +} + +} // end ns diff --git a/src/image_util_jpeg.cpp b/src/image_util_jpeg.cpp new file mode 100644 index 000000000..22d6ed480 --- /dev/null +++ b/src/image_util_jpeg.cpp @@ -0,0 +1,128 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +// mapnik +#if defined(HAVE_JPEG) +#include +#endif + +#include +#include +#include +#include +#include +#include + +// stl +#include + +namespace mapnik +{ + +jpeg_saver::jpeg_saver(std::ostream & stream, std::string const& t): + stream_(stream), t_(t) {} + +template +void process_rgba8_jpeg(T const& image, std::string const& type, std::ostream & stream) +{ +#if defined(HAVE_JPEG) + int quality = 85; + if (type != "jpeg") + { + for (auto const& kv : parse_image_options(type)) + { + auto const& key = kv.first; + auto const& val = kv.second; + + if ( key == "jpeg" ) continue; + else if ( key == "quality") + { + if (val && ! (*val).empty()) + { + if (!mapnik::util::string2int(*val, quality) || quality < 0 || quality > 100) + { + throw image_writer_exception("invalid jpeg quality: '" + *val + "'"); + } + } + } + } + } + save_as_jpeg(stream, quality, image); +#else + throw image_writer_exception("jpeg output is not enabled in your build of Mapnik"); +#endif +} + +template<> +void jpeg_saver::operator() (image_rgba8 const& image) const +{ + process_rgba8_jpeg(image, t_, stream_); +} + +template<> +void jpeg_saver::operator() (image_view_rgba8 const& image) const +{ + process_rgba8_jpeg(image, t_, stream_); +} + +template<> +void jpeg_saver::operator() (image_null const& image) const +{ + throw image_writer_exception("Can not save a null image to jpeg"); +} + +template<> +void jpeg_saver::operator() (image_view_null const& image) const +{ + throw image_writer_exception("Can not save a null image to jpeg"); +} + +template +void jpeg_saver::operator() (T const& image) const +{ + throw image_writer_exception("Mapnik does not support jpeg grayscale images"); +} + +template void jpeg_saver::operator() (image_rgba8 const& image) const; +template void jpeg_saver::operator() (image_gray8 const& image) const; +template void jpeg_saver::operator() (image_gray8s const& image) const; +template void jpeg_saver::operator() (image_gray16 const& image) const; +template void jpeg_saver::operator() (image_gray16s const& image) const; +template void jpeg_saver::operator() (image_gray32 const& image) const; +template void jpeg_saver::operator() (image_gray32s const& image) const; +template void jpeg_saver::operator() (image_gray32f const& image) const; +template void jpeg_saver::operator() (image_gray64 const& image) const; +template void jpeg_saver::operator() (image_gray64s const& image) const; +template void jpeg_saver::operator() (image_gray64f const& image) const; +template void jpeg_saver::operator() (image_view_rgba8 const& image) const; +template void jpeg_saver::operator() (image_view_gray8 const& image) const; +template void jpeg_saver::operator() (image_view_gray8s const& image) const; +template void jpeg_saver::operator() (image_view_gray16 const& image) const; +template void jpeg_saver::operator() (image_view_gray16s const& image) const; +template void jpeg_saver::operator() (image_view_gray32 const& image) const; +template void jpeg_saver::operator() (image_view_gray32s const& image) const; +template void jpeg_saver::operator() (image_view_gray32f const& image) const; +template void jpeg_saver::operator() (image_view_gray64 const& image) const; +template void jpeg_saver::operator() (image_view_gray64s const& image) const; +template void jpeg_saver::operator() (image_view_gray64f const& image) const; + +} // end ns diff --git a/src/image_util_png.cpp b/src/image_util_png.cpp new file mode 100644 index 000000000..f2b051717 --- /dev/null +++ b/src/image_util_png.cpp @@ -0,0 +1,364 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +#if defined(HAVE_PNG) +extern "C" +{ +#include +} +#endif + +// mapnik +#if defined(HAVE_PNG) +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +// stl +#include +#include + +namespace mapnik +{ + +#if defined(HAVE_PNG) + +void handle_png_options(std::string const& type, + png_options & opts) +{ + if (type == "png" || type == "png24" || type == "png32") + { + opts.paletted = false; + return; + } + else if (type == "png8" || type == "png256") + { + opts.paletted = true; + return; + } + + bool set_colors = false; + bool set_gamma = false; + + for (auto const& kv : parse_image_options(type)) + { + auto const& key = kv.first; + auto const& val = kv.second; + if (key == "png8" || key == "png256") + { + opts.paletted = true; + } + else if (key == "png" || key == "png24" || key == "png32") + { + opts.paletted = false; + } + else if (key == "m" && val) + { + if (*val == "o") opts.use_hextree = false; + else if (*val == "h") opts.use_hextree = true; + } + else if (key == "e" && val && *val == "miniz") + { + opts.use_miniz = true; + } + else if (key == "c") + { + set_colors = true; + if (!val || !mapnik::util::string2int(*val, opts.colors) || opts.colors < 1 || opts.colors > 256) + { + throw image_writer_exception("invalid color parameter: " + to_string(val)); + } + } + else if (key == "t") + { + if (!val || !mapnik::util::string2int(*val,opts.trans_mode) || opts.trans_mode < 0 || opts.trans_mode > 2) + { + throw image_writer_exception("invalid trans_mode parameter: " + to_string(val)); + } + } + else if (key == "g") + { + set_gamma = true; + if (!val || !mapnik::util::string2double(*val, opts.gamma) || opts.gamma < 0) + { + throw image_writer_exception("invalid gamma parameter: " + to_string(val)); + } + } + else if (key == "z") + { + /* + #define Z_NO_COMPRESSION 0 + #define Z_BEST_SPEED 1 + #define Z_BEST_COMPRESSION 9 + #define Z_DEFAULT_COMPRESSION (-1) + */ + if (!val || !mapnik::util::string2int(*val, opts.compression) + || opts.compression < Z_DEFAULT_COMPRESSION + || opts.compression > 10) // use 10 here rather than Z_BEST_COMPRESSION (9) to allow for MZ_UBER_COMPRESSION + { + throw image_writer_exception("invalid compression parameter: " + to_string(val) + " (only -1 through 10 are valid)"); + } + } + else if (key == "s") + { + if (!val) throw image_writer_exception("invalid compression parameter: "); + + if (*val == "default") + { + opts.strategy = Z_DEFAULT_STRATEGY; + } + else if (*val == "filtered") + { + opts.strategy = Z_FILTERED; + } + else if (*val == "huff") + { + opts.strategy = Z_HUFFMAN_ONLY; + } + else if (*val == "rle") + { + opts.strategy = Z_RLE; + } + else if (*val == "fixed") + { + opts.strategy = Z_FIXED; + } + else + { + throw image_writer_exception("invalid compression strategy parameter: " + *val); + } + } + else + { + throw image_writer_exception("unhandled png option: " + key); + } + } + // validation + if (!opts.paletted && set_colors) + { + throw image_writer_exception("invalid color parameter: unavailable for true color (non-paletted) images"); + } + if (!opts.paletted && set_gamma) + { + throw image_writer_exception("invalid gamma parameter: unavailable for true color (non-paletted) images"); + } + if ((opts.use_miniz == false) && opts.compression > Z_BEST_COMPRESSION) + { + throw image_writer_exception("invalid compression value: (only -1 through 9 are valid)"); + } +} +#endif + +png_saver::png_saver(std::ostream & stream, std::string const& t): + stream_(stream), t_(t) {} + +png_saver_pal::png_saver_pal(std::ostream & stream, std::string const& t, rgba_palette const& pal): + stream_(stream), t_(t), pal_(pal) {} + +template<> +void png_saver::operator() (image_null const& image) const +{ + throw image_writer_exception("null images not supported for png"); +} + +template<> +void png_saver_pal::operator() (image_null const& image) const +{ + throw image_writer_exception("null images not supported for png"); +} + +template<> +void png_saver::operator() (image_view_null const& image) const +{ + throw image_writer_exception("null image views not supported for png"); +} + +template<> +void png_saver_pal::operator() (image_view_null const& image) const +{ + throw image_writer_exception("null image views not supported for png"); +} + +template +void process_rgba8_png_pal(T const& image, + std::string const& t, + std::ostream & stream, + rgba_palette const& pal) +{ +#if defined(HAVE_PNG) + png_options opts; + handle_png_options(t, opts); + if (pal.valid()) + { + save_as_png8_pal(stream, image, pal, opts); + } + else if (opts.paletted) + { + if (opts.use_hextree) + { + save_as_png8_hex(stream, image, opts); + } + else + { + save_as_png8_oct(stream, image, opts); + } + } + else + { + save_as_png(stream, image, opts); + } +#else + throw image_writer_exception("png output is not enabled in your build of Mapnik"); +#endif +} + +template +void process_rgba8_png(T const& image, + std::string const& t, + std::ostream & stream) +{ +#if defined(HAVE_PNG) + png_options opts; + handle_png_options(t, opts); + if (opts.paletted) + { + if (opts.use_hextree) + { + save_as_png8_hex(stream, image, opts); + } + else + { + save_as_png8_oct(stream, image, opts); + } + } + else + { + save_as_png(stream, image, opts); + } +#else + throw image_writer_exception("png output is not enabled in your build of Mapnik"); +#endif +} + +template<> +void png_saver_pal::operator() (image_rgba8 const& image) const +{ + process_rgba8_png_pal(image, t_, stream_, pal_); +} + +template<> +void png_saver_pal::operator() (image_view_rgba8 const& image) const +{ + process_rgba8_png_pal(image, t_, stream_, pal_); +} + +template<> +void png_saver::operator() (image_rgba8 const& image) const +{ + process_rgba8_png(image, t_, stream_); +} + +template<> +void png_saver::operator() (image_view_rgba8 const& image) const +{ + process_rgba8_png(image, t_, stream_); +} + +template +void png_saver::operator() (T const& image) const +{ +#if defined(HAVE_PNG) + throw image_writer_exception("Mapnik does not support grayscale images for png"); + //png_options opts; + //handle_png_options(t_, opts); + //save_as_png(stream_, image, opts); +#else + throw image_writer_exception("png output is not enabled in your build of Mapnik"); +#endif +} + +template +void png_saver_pal::operator() (T const& image) const +{ +#if defined(HAVE_PNG) + throw image_writer_exception("Mapnik does not support grayscale images for png"); + //png_options opts; + //handle_png_options(t_, opts); + //save_as_png(stream_, image, opts); +#else + throw image_writer_exception("png output is not enabled in your build of Mapnik"); +#endif +} + +template void png_saver::operator() (image_rgba8 const& image) const; +template void png_saver::operator() (image_gray8 const& image) const; +template void png_saver::operator() (image_gray8s const& image) const; +template void png_saver::operator() (image_gray16 const& image) const; +template void png_saver::operator() (image_gray16s const& image) const; +template void png_saver::operator() (image_gray32 const& image) const; +template void png_saver::operator() (image_gray32s const& image) const; +template void png_saver::operator() (image_gray32f const& image) const; +template void png_saver::operator() (image_gray64 const& image) const; +template void png_saver::operator() (image_gray64s const& image) const; +template void png_saver::operator() (image_gray64f const& image) const; +template void png_saver::operator() (image_view_rgba8 const& image) const; +template void png_saver::operator() (image_view_gray8 const& image) const; +template void png_saver::operator() (image_view_gray8s const& image) const; +template void png_saver::operator() (image_view_gray16 const& image) const; +template void png_saver::operator() (image_view_gray16s const& image) const; +template void png_saver::operator() (image_view_gray32 const& image) const; +template void png_saver::operator() (image_view_gray32s const& image) const; +template void png_saver::operator() (image_view_gray32f const& image) const; +template void png_saver::operator() (image_view_gray64 const& image) const; +template void png_saver::operator() (image_view_gray64s const& image) const; +template void png_saver::operator() (image_view_gray64f const& image) const; +template void png_saver_pal::operator() (image_rgba8 const& image) const; +template void png_saver_pal::operator() (image_gray8 const& image) const; +template void png_saver_pal::operator() (image_gray8s const& image) const; +template void png_saver_pal::operator() (image_gray16 const& image) const; +template void png_saver_pal::operator() (image_gray16s const& image) const; +template void png_saver_pal::operator() (image_gray32 const& image) const; +template void png_saver_pal::operator() (image_gray32s const& image) const; +template void png_saver_pal::operator() (image_gray32f const& image) const; +template void png_saver_pal::operator() (image_gray64 const& image) const; +template void png_saver_pal::operator() (image_gray64s const& image) const; +template void png_saver_pal::operator() (image_gray64f const& image) const; +template void png_saver_pal::operator() (image_view_rgba8 const& image) const; +template void png_saver_pal::operator() (image_view_gray8 const& image) const; +template void png_saver_pal::operator() (image_view_gray8s const& image) const; +template void png_saver_pal::operator() (image_view_gray16 const& image) const; +template void png_saver_pal::operator() (image_view_gray16s const& image) const; +template void png_saver_pal::operator() (image_view_gray32 const& image) const; +template void png_saver_pal::operator() (image_view_gray32s const& image) const; +template void png_saver_pal::operator() (image_view_gray32f const& image) const; +template void png_saver_pal::operator() (image_view_gray64 const& image) const; +template void png_saver_pal::operator() (image_view_gray64s const& image) const; +template void png_saver_pal::operator() (image_view_gray64f const& image) const; + +} // end ns diff --git a/src/image_util_tiff.cpp b/src/image_util_tiff.cpp new file mode 100644 index 000000000..68ef9d9f8 --- /dev/null +++ b/src/image_util_tiff.cpp @@ -0,0 +1,204 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +// mapnik +#if defined(HAVE_TIFF) +#include +#endif + +#include +#include +#include +#include +#include +#include + +// stl +#include + +namespace mapnik +{ + +#if defined(HAVE_TIFF) +void handle_tiff_options(std::string const& type, + tiff_config & config) +{ + if (type == "tiff") + { + return; + } + if (type.length() > 4) + { + + for (auto const& kv : parse_image_options(type)) + { + auto const& key = kv.first; + auto const& val = kv.second; + if (key == "tiff") continue; + else if (key == "compression") + { + if (val && !(*val).empty()) + { + if (*val == "deflate") + { + config.compression = COMPRESSION_DEFLATE; + } + else if (*val == "adobedeflate") + { + config.compression = COMPRESSION_ADOBE_DEFLATE; + } + else if (*val == "lzw") + { + config.compression = COMPRESSION_LZW; + } + else if (*val == "none") + { + config.compression = COMPRESSION_NONE; + } + else + { + throw image_writer_exception("invalid tiff compression: '" + *val + "'"); + } + } + } + else if (key == "method") + { + if (val && !(*val).empty()) + { + if (*val == "scanline") + { + config.method = TIFF_WRITE_SCANLINE; + } + else if (*val == "strip" || *val == "stripped") + { + config.method = TIFF_WRITE_STRIPPED; + } + else if (*val == "tiled") + { + config.method = TIFF_WRITE_TILED; + } + else + { + throw image_writer_exception("invalid tiff method: '" + *val + "'"); + } + } + } + else if (key == "zlevel") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.zlevel) || config.zlevel < 0 || config.zlevel > 9) + { + throw image_writer_exception("invalid tiff zlevel: '" + *val + "'"); + } + } + } + else if (key == "tile_height") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.tile_height) || config.tile_height < 0 ) + { + throw image_writer_exception("invalid tiff tile_height: '" + *val + "'"); + } + } + } + else if (key == "tile_width") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.tile_width) || config.tile_width < 0 ) + { + throw image_writer_exception("invalid tiff tile_width: '" + *val + "'"); + } + } + } + else if (key == "rows_per_strip") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.rows_per_strip) || config.rows_per_strip < 0 ) + { + throw image_writer_exception("invalid tiff rows_per_strip: '" + *val + "'"); + } + } + } + else + { + throw image_writer_exception("unhandled tiff option: " + key); + } + } + } +} +#endif + +tiff_saver::tiff_saver(std::ostream & stream, std::string const& t): + stream_(stream), t_(t) {} + +template<> +void tiff_saver::operator() (image_null const& image) const +{ + throw image_writer_exception("null images not supported"); +} + +template<> +void tiff_saver::operator() (image_view_null const& image) const +{ + throw image_writer_exception("null image views not supported"); +} + +template +void tiff_saver::operator() (T const& image) const +{ +#if defined(HAVE_TIFF) + tiff_config opts; + handle_tiff_options(t_, opts); + save_as_tiff(stream_, image, opts); +#else + throw image_writer_exception("tiff output is not enabled in your build of Mapnik"); +#endif +} + +template void tiff_saver::operator() (image_rgba8 const& image) const; +template void tiff_saver::operator() (image_gray8 const& image) const; +template void tiff_saver::operator() (image_gray8s const& image) const; +template void tiff_saver::operator() (image_gray16 const& image) const; +template void tiff_saver::operator() (image_gray16s const& image) const; +template void tiff_saver::operator() (image_gray32 const& image) const; +template void tiff_saver::operator() (image_gray32s const& image) const; +template void tiff_saver::operator() (image_gray32f const& image) const; +template void tiff_saver::operator() (image_gray64 const& image) const; +template void tiff_saver::operator() (image_gray64s const& image) const; +template void tiff_saver::operator() (image_gray64f const& image) const; +template void tiff_saver::operator() (image_view_rgba8 const& image) const; +template void tiff_saver::operator() (image_view_gray8 const& image) const; +template void tiff_saver::operator() (image_view_gray8s const& image) const; +template void tiff_saver::operator() (image_view_gray16 const& image) const; +template void tiff_saver::operator() (image_view_gray16s const& image) const; +template void tiff_saver::operator() (image_view_gray32 const& image) const; +template void tiff_saver::operator() (image_view_gray32s const& image) const; +template void tiff_saver::operator() (image_view_gray32f const& image) const; +template void tiff_saver::operator() (image_view_gray64 const& image) const; +template void tiff_saver::operator() (image_view_gray64s const& image) const; +template void tiff_saver::operator() (image_view_gray64f const& image) const; + +} // end ns diff --git a/src/image_util_webp.cpp b/src/image_util_webp.cpp new file mode 100644 index 000000000..c7b96aca5 --- /dev/null +++ b/src/image_util_webp.cpp @@ -0,0 +1,386 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +// mapnik +#if defined(HAVE_WEBP) +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +// stl +#include +#include + +namespace mapnik +{ + +#if defined(HAVE_WEBP) +void handle_webp_options(std::string const& type, + WebPConfig & config, + bool & alpha) +{ + if (type == "webp") + { + return; + } + if (type.length() > 4) + { + for (auto const& kv : parse_image_options(type)) + { + auto const& key = kv.first; + auto const& val = kv.second; + + if (key == "webp") continue; + else if (key == "quality") + { + if (val && !(*val).empty()) + { + double quality = 90; + if (!mapnik::util::string2double(*val,quality) || quality < 0.0 || quality > 100.0) + { + throw image_writer_exception("invalid webp quality: '" + *val + "'"); + } + config.quality = static_cast(quality); + } + } + else if (key == "method") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.method) || config.method < 0 || config.method > 6) + { + throw image_writer_exception("invalid webp method: '" + *val + "'"); + } + } + } + else if (key == "lossless") + { + if (val && !(*val).empty()) + { + #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 1 // >= v0.1.99 / 0x0100 + if (!mapnik::util::string2int(*val,config.lossless) || config.lossless < 0 || config.lossless > 1) + { + throw image_writer_exception("invalid webp lossless: '" + *val + "'"); + } + #else + #ifdef _MSC_VER + #pragma NOTE(compiling against webp that does not support the lossless flag) + #else + #warning "compiling against webp that does not support the lossless flag" + #endif + throw image_writer_exception("your webp version does not support the lossless option"); + #endif + } + } + else if (key == "image_hint") + { + if (val && !(*val).empty()) + { + #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 1 // >= v0.1.99 / 0x0100 + int image_hint = 0; + if (!mapnik::util::string2int(*val,image_hint) || image_hint < 0 || image_hint > 3) + { + throw image_writer_exception("invalid webp image_hint: '" + *val + "'"); + } + config.image_hint = static_cast(image_hint); + #else + #ifdef _MSC_VER + #pragma NOTE(compiling against webp that does not support the image_hint flag) + #else + #warning "compiling against webp that does not support the image_hint flag" + #endif + throw image_writer_exception("your webp version does not support the image_hint option"); + #endif + } + } + else if (key == "alpha") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2bool(*val,alpha)) + { + throw image_writer_exception("invalid webp alpha: '" + *val + "'"); + } + } + } + else if (key == "target_size") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.target_size)) + { + throw image_writer_exception("invalid webp target_size: '" + *val + "'"); + } + } + } + else if (key == "target_psnr") + { + if (val && !(*val).empty()) + { + double psnr = 0; + if (!mapnik::util::string2double(*val,psnr)) + { + throw image_writer_exception("invalid webp target_psnr: '" + *val + "'"); + } + config.target_PSNR = psnr; + } + } + else if (key == "segments") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.segments)) + { + throw image_writer_exception("invalid webp segments: '" + *val + "'"); + } + } + } + else if (key == "sns_strength") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.sns_strength)) + { + throw image_writer_exception("invalid webp sns_strength: '" + *val + "'"); + } + } + } + else if (key == "filter_strength") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.filter_strength)) + { + throw image_writer_exception("invalid webp filter_strength: '" + *val + "'"); + } + } + } + else if (key == "filter_sharpness") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.filter_sharpness)) + { + throw image_writer_exception("invalid webp filter_sharpness: '" + *val + "'"); + } + } + } + else if (key == "filter_type") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.filter_type)) + { + throw image_writer_exception("invalid webp filter_type: '" + *val + "'"); + } + } + } + else if (key == "autofilter") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.autofilter)) + { + throw image_writer_exception("invalid webp autofilter: '" + *val + "'"); + } + } + } + else if (key == "alpha_compression") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.alpha_compression)) + { + throw image_writer_exception("invalid webp alpha_compression: '" + *val + "'"); + } + } + } + else if (key == "alpha_filtering") + { + if (val && !(*val).empty()) + { + #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 1 // >= v0.1.99 / 0x0100 + if (!mapnik::util::string2int(*val,config.alpha_filtering)) + { + throw image_writer_exception("invalid webp alpha_filtering: '" + *val + "'"); + } + #else + #ifdef _MSC_VER + #pragma NOTE(compiling against webp that does not support the alpha_filtering flag) + #else + #warning "compiling against webp that does not support the alpha_filtering flag" + #endif + throw image_writer_exception("your webp version does not support the alpha_filtering option"); + #endif + } + } + else if (key == "alpha_quality") + { + if (val && !(*val).empty()) + { + #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 1 // >= v0.1.99 / 0x0100 + if (!mapnik::util::string2int(*val,config.alpha_quality)) + { + throw image_writer_exception("invalid webp alpha_quality: '" + *val + "'"); + } + #else + #ifdef _MSC_VER + #pragma NOTE(compiling against webp that does not support the alpha_quality flag) + #else + #warning "compiling against webp that does not support the alpha_quality flag" + #endif + throw image_writer_exception("your webp version does not support the alpha_quality option"); + #endif + } + } + else if (key == "pass") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.pass)) + { + throw image_writer_exception("invalid webp pass: '" + *val + "'"); + } + } + } + else if (key == "preprocessing") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.preprocessing)) + { + throw image_writer_exception("invalid webp preprocessing: '" + *val + "'"); + } + } + } + else if (key == "partitions") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.partitions)) + { + throw image_writer_exception("invalid webp partitions: '" + *val + "'"); + } + } + } + else if (key == "partition_limit") + { + if (val && !(*val).empty()) + { + if (!mapnik::util::string2int(*val,config.partition_limit)) + { + throw image_writer_exception("invalid webp partition_limit: '" + *val + "'"); + } + } + } + else + { + throw image_writer_exception("unhandled webp option: " + key); + } + } + } +} +#endif + +webp_saver::webp_saver(std::ostream & stream, std::string const& t): + stream_(stream), t_(t) {} + +template<> +void webp_saver::operator() (image_null const& image) const +{ + throw image_writer_exception("null images not supported"); +} + +template<> +void webp_saver::operator() (image_view_null const& image) const +{ + throw image_writer_exception("null image views not supported"); +} + +template +void process_rgba8_webp(T const& image, std::string const& t, std::ostream & stream) +{ +#if defined(HAVE_WEBP) + WebPConfig config; + // Default values set here will be lossless=0 and quality=75 (as least as of webp v0.3.1) + if (!WebPConfigInit(&config)) + { + throw std::runtime_error("version mismatch"); + } + // see for more details: https://github.com/mapnik/mapnik/wiki/Image-IO#webp-output-options + bool alpha = true; + handle_webp_options(t,config,alpha); + save_as_webp(stream,image,config,alpha); +#else + throw image_writer_exception("webp output is not enabled in your build of Mapnik"); +#endif +} + +template <> +void webp_saver::operator() (image_rgba8 const& image) const +{ + process_rgba8_webp(image, t_, stream_); +} + +template <> +void webp_saver::operator() (image_view_rgba8 const& image) const +{ + process_rgba8_webp(image, t_, stream_); +} + +template +void webp_saver::operator() (T const& image) const +{ + throw image_writer_exception("Mapnik does not support webp grayscale images"); +} + +template void webp_saver::operator() (image_rgba8 const& image) const; +template void webp_saver::operator() (image_gray8 const& image) const; +template void webp_saver::operator() (image_gray8s const& image) const; +template void webp_saver::operator() (image_gray16 const& image) const; +template void webp_saver::operator() (image_gray16s const& image) const; +template void webp_saver::operator() (image_gray32 const& image) const; +template void webp_saver::operator() (image_gray32s const& image) const; +template void webp_saver::operator() (image_gray32f const& image) const; +template void webp_saver::operator() (image_gray64 const& image) const; +template void webp_saver::operator() (image_gray64s const& image) const; +template void webp_saver::operator() (image_gray64f const& image) const; +template void webp_saver::operator() (image_view_rgba8 const& image) const; +template void webp_saver::operator() (image_view_gray8 const& image) const; +template void webp_saver::operator() (image_view_gray8s const& image) const; +template void webp_saver::operator() (image_view_gray16 const& image) const; +template void webp_saver::operator() (image_view_gray16s const& image) const; +template void webp_saver::operator() (image_view_gray32 const& image) const; +template void webp_saver::operator() (image_view_gray32s const& image) const; +template void webp_saver::operator() (image_view_gray32f const& image) const; +template void webp_saver::operator() (image_view_gray64 const& image) const; +template void webp_saver::operator() (image_view_gray64s const& image) const; +template void webp_saver::operator() (image_view_gray64f const& image) const; + +} // end ns diff --git a/src/image_view.cpp b/src/image_view.cpp new file mode 100644 index 000000000..44e4d7716 --- /dev/null +++ b/src/image_view.cpp @@ -0,0 +1,45 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +// mapnik +#include +#include +#include +#include + +namespace mapnik +{ + +template class MAPNIK_DECL image_view; +template class MAPNIK_DECL image_view; +template class MAPNIK_DECL image_view; +template class MAPNIK_DECL image_view; +template class MAPNIK_DECL image_view; +template class MAPNIK_DECL image_view; +template class MAPNIK_DECL image_view; +template class MAPNIK_DECL image_view; +template class MAPNIK_DECL image_view; +template class MAPNIK_DECL image_view; +template class MAPNIK_DECL image_view; +template class MAPNIK_DECL image_view; + +} // end ns mapnik diff --git a/src/image_view_any.cpp b/src/image_view_any.cpp new file mode 100644 index 000000000..6fbbd7be4 --- /dev/null +++ b/src/image_view_any.cpp @@ -0,0 +1,143 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +#include + +namespace mapnik { + +namespace detail { + +struct get_view_width_visitor +{ + template + std::size_t operator()(T const& data) const + { + return data.width(); + } +}; + +struct get_view_height_visitor +{ + template + std::size_t operator()(T const& data) const + { + return data.height(); + } +}; + +struct get_view_size_visitor +{ + template + std::size_t operator()(T const& data) const + { + return data.size(); + } +}; + +struct get_view_dtype_visitor +{ + template + image_dtype operator()(T const& data) const + { + return data.get_dtype(); + } +}; + +struct get_view_row_size_visitor +{ + template + std::size_t operator()(T const& data) const + { + return data.row_size(); + } +}; + +struct get_view_premultiplied_visitor +{ + template + bool operator()(T const& data) const + { + return data.get_premultiplied(); + } +}; + +struct get_view_offset_visitor +{ + template + double operator()(T const& data) const + { + return data.get_offset(); + } +}; + +struct get_view_scaling_visitor +{ + template + double operator()(T const& data) const + { + return data.get_scaling(); + } +}; + +} // end namespace detail + +std::size_t image_view_any::width() const +{ + return util::apply_visitor(detail::get_view_width_visitor(),*this); +} + +std::size_t image_view_any::height() const +{ + return util::apply_visitor(detail::get_view_height_visitor(),*this); +} + +std::size_t image_view_any::size() const +{ + return util::apply_visitor(detail::get_view_size_visitor(),*this); +} + +std::size_t image_view_any::row_size() const +{ + return util::apply_visitor(detail::get_view_row_size_visitor(),*this); +} + +bool image_view_any::get_premultiplied() const +{ + return util::apply_visitor(detail::get_view_premultiplied_visitor(),*this); +} + +double image_view_any::get_offset() const +{ + return util::apply_visitor(detail::get_view_offset_visitor(),*this); +} + +double image_view_any::get_scaling() const +{ + return util::apply_visitor(detail::get_view_scaling_visitor(),*this); +} + +image_dtype image_view_any::get_dtype() const +{ + return util::apply_visitor(detail::get_view_dtype_visitor(),*this); +} + +} // end mapnik ns diff --git a/src/jpeg_reader.cpp b/src/jpeg_reader.cpp index 48ac83e19..4a6284cb8 100644 --- a/src/jpeg_reader.cpp +++ b/src/jpeg_reader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -85,9 +85,8 @@ public: unsigned height() const final; boost::optional > bounding_box() const final; inline bool has_alpha() const final { return false; } - inline bool premultiplied_alpha() const final { return true; } - void read(unsigned x,unsigned y,image_data_rgba8& image) final; - image_data_any read(unsigned x, unsigned y, unsigned width, unsigned height) final; + void read(unsigned x,unsigned y,image_rgba8& image) final; + image_any read(unsigned x, unsigned y, unsigned width, unsigned height) final; private: void init(); static void on_error(j_common_ptr cinfo); @@ -207,8 +206,11 @@ void jpeg_reader::attach_stream (j_decompress_ptr cinfo, input_stream* in) } template -void jpeg_reader::on_error(j_common_ptr /*cinfo*/) +void jpeg_reader::on_error(j_common_ptr cinfo) { + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(cinfo, buffer); + throw image_reader_exception(std::string("JPEG Reader: libjpeg could not read image: ") + buffer); } template @@ -266,7 +268,7 @@ boost::optional > jpeg_reader::bounding_box() const } template -void jpeg_reader::read(unsigned x0, unsigned y0, image_data_rgba8& image) +void jpeg_reader::read(unsigned x0, unsigned y0, image_rgba8& image) { stream_.clear(); stream_.seekg(0, std::ios_base::beg); @@ -313,7 +315,7 @@ void jpeg_reader::read(unsigned x0, unsigned y0, image_data_rgba8& image) } out_row[x] = color(r, g, b, a).rgba(); } - image.setRow(row - y0, out_row.get(), w); + image.set_row(row - y0, out_row.get(), w); } ++row; } @@ -321,11 +323,11 @@ void jpeg_reader::read(unsigned x0, unsigned y0, image_data_rgba8& image) } template -image_data_any jpeg_reader::read(unsigned x, unsigned y, unsigned width, unsigned height) +image_any jpeg_reader::read(unsigned x, unsigned y, unsigned width, unsigned height) { - image_data_rgba8 data(width,height); + image_rgba8 data(width,height, true, true); read(x, y, data); - return image_data_any(std::move(data)); + return image_any(std::move(data)); } } diff --git a/src/json/build.py b/src/json/build.py index 45b4b4720..390465df5 100644 --- a/src/json/build.py +++ b/src/json/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2014 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,15 +17,14 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os from glob import glob Import('env') lib_env = env.Clone() -if 'g++' in env['CXX']: - lib_env.Append(CXXFLAGS='-fPIC') +lib_env.Append(CXXFLAGS='-fPIC') name = "mapnik-json" lib = lib_env.StaticLibrary(name, glob('./' + '*.cpp'), LIBS=[]) diff --git a/src/json/mapnik_json_feature_collection_grammar.cpp b/src/json/mapnik_json_feature_collection_grammar.cpp index 8d66c8047..5f598f54b 100644 --- a/src/json/mapnik_json_feature_collection_grammar.cpp +++ b/src/json/mapnik_json_feature_collection_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/json/mapnik_json_feature_grammar.cpp b/src/json/mapnik_json_feature_grammar.cpp index 70c65685f..1aa6c7e9e 100644 --- a/src/json/mapnik_json_feature_grammar.cpp +++ b/src/json/mapnik_json_feature_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/json/mapnik_json_generator_grammar.cpp b/src/json/mapnik_json_generator_grammar.cpp index 0f45df122..2b0171f98 100644 --- a/src/json/mapnik_json_generator_grammar.cpp +++ b/src/json/mapnik_json_generator_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,15 +21,15 @@ *****************************************************************************/ #include -#include -#include + #include #include +#include + #include using sink_type = std::back_insert_iterator; template struct mapnik::json::properties_generator_grammar; template struct mapnik::json::feature_generator_grammar; -template struct mapnik::json::geometry_generator_grammar; -template struct mapnik::json::multi_geometry_generator_grammar; +template struct mapnik::json::geometry_generator_grammar >; diff --git a/src/json/mapnik_json_geometry_grammar.cpp b/src/json/mapnik_json_geometry_grammar.cpp index bd9d81c82..f2b96f230 100644 --- a/src/json/mapnik_json_geometry_grammar.cpp +++ b/src/json/mapnik_json_geometry_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/json/mapnik_topojson_grammar.cpp b/src/json/mapnik_topojson_grammar.cpp index 6f232abf3..e70f7c590 100644 --- a/src/json/mapnik_topojson_grammar.cpp +++ b/src/json/mapnik_topojson_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/layer.cpp b/src/layer.cpp index a5180a7d8..442026b4d 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -34,8 +34,8 @@ namespace mapnik layer::layer(std::string const& name, std::string const& srs) : name_(name), srs_(srs), - min_zoom_(0), - max_zoom_(std::numeric_limits::max()), + minimum_scale_denom_(0), + maximum_scale_denom_(std::numeric_limits::max()), active_(true), queryable_(false), clear_label_cache_(false), @@ -49,8 +49,8 @@ layer::layer(std::string const& name, std::string const& srs) layer::layer(layer const& rhs) : name_(rhs.name_), srs_(rhs.srs_), - min_zoom_(rhs.min_zoom_), - max_zoom_(rhs.max_zoom_), + minimum_scale_denom_(rhs.minimum_scale_denom_), + maximum_scale_denom_(rhs.maximum_scale_denom_), active_(rhs.active_), queryable_(rhs.queryable_), clear_label_cache_(rhs.clear_label_cache_), @@ -64,8 +64,8 @@ layer::layer(layer const& rhs) layer::layer(layer && rhs) : name_(std::move(rhs.name_)), srs_(std::move(rhs.srs_)), - min_zoom_(std::move(rhs.min_zoom_)), - max_zoom_(std::move(rhs.max_zoom_)), + minimum_scale_denom_(std::move(rhs.minimum_scale_denom_)), + maximum_scale_denom_(std::move(rhs.maximum_scale_denom_)), active_(std::move(rhs.active_)), queryable_(std::move(rhs.queryable_)), clear_label_cache_(std::move(rhs.clear_label_cache_)), @@ -81,8 +81,8 @@ layer& layer::operator=(layer rhs) using std::swap; std::swap(this->name_,rhs.name_); std::swap(this->srs_, rhs.srs_); - std::swap(this->min_zoom_, rhs.min_zoom_); - std::swap(this->max_zoom_,rhs.max_zoom_); + std::swap(this->minimum_scale_denom_, rhs.minimum_scale_denom_); + std::swap(this->maximum_scale_denom_,rhs.maximum_scale_denom_); std::swap(this->active_, rhs.active_); std::swap(this->queryable_, rhs.queryable_); std::swap(this->clear_label_cache_, rhs.clear_label_cache_); @@ -99,8 +99,8 @@ bool layer::operator==(layer const& rhs) const { return (name_ == rhs.name_) && (srs_ == rhs.srs_) && - (min_zoom_ == rhs.min_zoom_) && - (max_zoom_ == rhs.max_zoom_) && + (minimum_scale_denom_ == rhs.minimum_scale_denom_) && + (maximum_scale_denom_ == rhs.maximum_scale_denom_) && (active_ == rhs.active_) && (queryable_ == rhs.queryable_) && (clear_label_cache_ == rhs.clear_label_cache_) && @@ -149,24 +149,24 @@ std::vector & layer::styles() return styles_; } -void layer::set_min_zoom(double min_zoom) +void layer::set_minimum_scale_denominator(double minimum_scale_denom) { - min_zoom_=min_zoom; + minimum_scale_denom_=minimum_scale_denom; } -void layer::set_max_zoom(double max_zoom) +void layer::set_maximum_scale_denominator(double maximum_scale_denom) { - max_zoom_=max_zoom; + maximum_scale_denom_=maximum_scale_denom; } -double layer::min_zoom() const +double layer::minimum_scale_denominator() const { - return min_zoom_; + return minimum_scale_denom_; } -double layer::max_zoom() const +double layer::maximum_scale_denominator() const { - return max_zoom_; + return maximum_scale_denom_; } void layer::set_active(bool active) @@ -179,9 +179,9 @@ bool layer::active() const return active_; } -bool layer::visible(double scale) const +bool layer::visible(double scale_denom) const { - return active() && scale >= min_zoom_ - 1e-6 && scale < max_zoom_ + 1e-6; + return active() && scale_denom >= minimum_scale_denom_ - 1e-6 && scale_denom < maximum_scale_denom_ + 1e-6; } void layer::set_queryable(bool queryable) diff --git a/src/libxml2_loader.cpp b/src/libxml2_loader.cpp index 70ca728e8..3c904074c 100644 --- a/src/libxml2_loader.cpp +++ b/src/libxml2_loader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/load_map.cpp b/src/load_map.cpp index c2d7fa4a1..44d1276db 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -65,10 +65,9 @@ #include #include #include -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#include -#pragma GCC diagnostic pop + +// stl +#include // agg #include "agg_trans_affine.h" @@ -81,7 +80,7 @@ using boost::optional; constexpr unsigned name2int(const char *str, int off = 0) { - return !str[off] ? 5381 : (name2int(str, off+1)*33) ^ str[off]; + return !str[off] ? 5381 : (name2int(str, off+1)*33) ^ static_cast(str[off]); } class map_parser : util::noncopyable @@ -130,6 +129,7 @@ private: void find_unused_nodes_recursive(xml_node const& node, std::string & error_text); std::string ensure_relative_to_xml(boost::optional const& opt_path); void ensure_exists(std::string const& file_path); + void check_styles(Map const & map) const throw (config_error); boost::optional get_opt_color_attr(boost::property_tree::ptree const& node, std::string const& name); @@ -144,22 +144,19 @@ private: std::string xml_base_path_; }; -//#include + void load_map(Map & map, std::string const& filename, bool strict, std::string base_path) { - // TODO - use xml encoding? - xml_tree tree("utf8"); + xml_tree tree; tree.set_filename(filename); read_xml(filename, tree.root()); map_parser parser(map, strict, filename); parser.parse_map(map, tree.root(), base_path); - //dump_xml(tree.root()); } void load_map_string(Map & map, std::string const& str, bool strict, std::string base_path) { - // TODO - use xml encoding? - xml_tree tree("utf8"); + xml_tree tree; if (!base_path.empty()) { read_xml_string(str, tree.root(), base_path); // accept base_path passed into function @@ -238,7 +235,7 @@ void map_parser::parse_map(Map & map, xml_node const& node, std::string const& b } map.set_srs(srs); - optional buffer_size = map_node.get_opt_attr("buffer-size"); + optional buffer_size = map_node.get_opt_attr("buffer-size"); if (buffer_size) { map.set_buffer_size(*buffer_size); @@ -329,6 +326,10 @@ void map_parser::parse_map(Map & map, xml_node const& node, std::string const& b throw config_error("Not a map file. Node 'Map' not found."); } find_unused_nodes(node); + if (strict_) + { + check_styles(map); + } } void map_parser::parse_map_include(Map & map, xml_node const& node) @@ -383,8 +384,8 @@ void map_parser::parse_map_include(Map & map, xml_node const& node) mapnik::value_bool b; mapnik::value_integer i; mapnik::value_double d; - if (mapnik::util::string2bool(val,b)) params[key] = b; - else if (mapnik::util::string2int(val,i)) params[key] = i; + if (mapnik::util::string2int(val,i)) params[key] = i; + else if (mapnik::util::string2bool(val,b)) params[key] = b; else if (mapnik::util::string2double(val,d)) params[key] = d; else params[key] = val; } @@ -588,17 +589,34 @@ void map_parser::parse_layer(Map & map, xml_node const& node) lyr.set_active(* status); } - optional min_zoom = node.get_opt_attr("minzoom"); - if (min_zoom) + optional minimum_scale_denom = node.get_opt_attr("minimum-scale-denominator"); + if (minimum_scale_denom) { - lyr.set_min_zoom(* min_zoom); + lyr.set_minimum_scale_denominator(* minimum_scale_denom); + } + else // back compatibility: remove at Mapnik 4.x + { + optional min_zoom = node.get_opt_attr("minzoom"); + if (min_zoom) + { + MAPNIK_LOG_ERROR(markers_symbolizer) << "'minzoom' is deprecated and will be removed in Mapnik 4.x, use 'minimum-scale-denominator' instead (encountered in layer " << name << ")"; + lyr.set_minimum_scale_denominator(* min_zoom); + } } - - optional max_zoom = node.get_opt_attr("maxzoom"); - if (max_zoom) + optional maximum_scale_denom = node.get_opt_attr("maximum-scale-denominator"); + if (maximum_scale_denom) { - lyr.set_max_zoom(* max_zoom); + lyr.set_maximum_scale_denominator(* maximum_scale_denom); + } + else // back compatibility: remove at Mapnik 4.x + { + optional max_zoom = node.get_opt_attr("maxzoom"); + if (max_zoom) + { + MAPNIK_LOG_ERROR(markers_symbolizer) << "'maxzoom' is deprecated and will be removed in Mapnik 4.x, use 'maximum-scale-denominator' instead (encountered in layer " << name << ")"; + lyr.set_maximum_scale_denominator(* max_zoom); + } } optional queryable = node.get_opt_attr("queryable"); @@ -628,7 +646,7 @@ void map_parser::parse_layer(Map & map, xml_node const& node) lyr.set_group_by(* group_by); } - optional buffer_size = node.get_opt_attr("buffer-size"); + optional buffer_size = node.get_opt_attr("buffer-size"); if (buffer_size) { lyr.set_buffer_size(*buffer_size); @@ -996,6 +1014,7 @@ void map_parser::parse_markers_symbolizer(rule & rule, xml_node const& node) set_symbolizer_property(sym, keys::image_transform, node); set_symbolizer_property(sym, keys::markers_placement_type, node); set_symbolizer_property(sym, keys::markers_multipolicy, node); + set_symbolizer_property(sym, keys::direction, node); parse_stroke(sym,node); rule.append(std::move(sym)); } @@ -1101,17 +1120,20 @@ void map_parser::parse_text_symbolizer(rule & rule, xml_node const& node) placements = std::make_shared(); placements->defaults.from_xml(node, fontsets_, false); } - if (strict_ && !placements->defaults.format_defaults.fontset) + if (placements) { - ensure_font_face(placements->defaults.format_defaults.face_name); + if (strict_ && !placements->defaults.format_defaults.fontset) + { + ensure_font_face(placements->defaults.format_defaults.face_name); + } + text_symbolizer sym; + parse_symbolizer_base(sym, node); + put(sym, keys::text_placements_, placements); + set_symbolizer_property(sym, keys::halo_comp_op, node); + set_symbolizer_property(sym, keys::halo_rasterizer, node); + set_symbolizer_property(sym, keys::halo_transform, node); + rule.append(std::move(sym)); } - text_symbolizer sym; - parse_symbolizer_base(sym, node); - put(sym, keys::text_placements_, placements); - set_symbolizer_property(sym, keys::halo_comp_op, node); - set_symbolizer_property(sym, keys::halo_rasterizer, node); - set_symbolizer_property(sym, keys::halo_transform, node); - rule.append(std::move(sym)); } catch (config_error const& ex) { @@ -1271,10 +1293,10 @@ void map_parser::parse_raster_symbolizer(rule & rule, xml_node const & node) if (mode) { std::string mode_string = *mode; - if (boost::algorithm::find_first(mode_string,"_")) + if (mode_string.find('_') != std::string::npos) { MAPNIK_LOG_ERROR(raster_symbolizer) << "'mode' values using \"_\" are deprecated and will be removed in Mapnik 3.x, use \"-\"instead"; - boost::algorithm::replace_all(mode_string,"_","-"); + std::replace(mode_string.begin(), mode_string.end(), '_', '-'); } put(raster_sym, keys::mode, mode_string); } @@ -1603,7 +1625,7 @@ void map_parser::ensure_exists(std::string const& file_path) if (marker_cache::instance().is_uri(file_path)) return; // validate that the filename exists if it is not a dynamic PathExpression - if (!boost::algorithm::find_first(file_path,"[") && !boost::algorithm::find_first(file_path,"]")) + if (file_path.find('[') == std::string::npos && file_path.find(']') == std::string::npos) { if (!mapnik::util::exists(file_path)) { @@ -1638,12 +1660,14 @@ void map_parser::find_unused_nodes_recursive(xml_node const& node, std::string & { if (node.is_text()) { - error_message += "\n* text '" + node.text() + "'"; + error_message += "\n* text '" + node.text(); } else { - error_message += "\n* node '" + node.name() + "' at line " + node.line_to_string(); + error_message += "\n* node '" + node.name(); } + error_message += "' at line " + node.line_to_string(); + return; //All attributes and children are automatically unprocessed, too. } xml_node::attribute_map const& attrs = node.get_attributes(); @@ -1663,4 +1687,19 @@ void map_parser::find_unused_nodes_recursive(xml_node const& node, std::string & } } +void map_parser::check_styles(Map const & map) const throw (config_error) +{ + for (auto const & layer : map.layers()) + { + for (auto const & style : layer.styles()) + { + if (!map.find_style(style)) + { + throw config_error("Unable to process some data while parsing '" + filename_ + + "': Style '" + style + "' required for layer '" + layer.name() + "'."); + } + } + } +} + } // end of namespace mapnik diff --git a/src/map.cpp b/src/map.cpp index c8e1da191..a891ebd73 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -309,7 +309,7 @@ bool Map::load_fonts() mapnik::util::file file(file_path); if (file.open()) { - auto item = font_memory_cache_.emplace(file_path, std::make_pair(std::move(file.data()),file.size())); + auto item = font_memory_cache_.emplace(file_path, std::make_pair(file.data(),file.size())); if (item.second) result = true; } } diff --git a/src/mapped_memory_cache.cpp b/src/mapped_memory_cache.cpp index f296c2253..abe08d1b9 100644 --- a/src/mapped_memory_cache.cpp +++ b/src/mapped_memory_cache.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,8 +29,12 @@ // boost #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #include +#pragma GCC diagnostic pop namespace mapnik { @@ -38,7 +42,7 @@ namespace mapnik void mapped_memory_cache::clear() { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif return cache_.clear(); } @@ -46,7 +50,7 @@ void mapped_memory_cache::clear() bool mapped_memory_cache::insert(std::string const& uri, mapped_region_ptr mem) { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif return cache_.emplace(uri,mem).second; } @@ -54,7 +58,7 @@ bool mapped_memory_cache::insert(std::string const& uri, mapped_region_ptr mem) boost::optional mapped_memory_cache::find(std::string const& uri, bool update_cache) { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif using iterator_type = std::unordered_map::const_iterator; boost::optional result; diff --git a/src/marker_cache.cpp b/src/marker_cache.cpp index c7d1b005f..3f8f9396b 100644 --- a/src/marker_cache.cpp +++ b/src/marker_cache.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -62,10 +62,7 @@ marker_cache::marker_cache() "" "" ""); - boost::optional bitmap_data = boost::optional(std::make_shared(4,4)); - (*bitmap_data)->set(0xff000000); - marker_ptr mark = std::make_shared(bitmap_data); - marker_cache_.emplace("image://square",mark); + marker_cache_.emplace("image://square",std::make_shared(mapnik::marker_rgba8())); } marker_cache::~marker_cache() {} @@ -73,10 +70,9 @@ marker_cache::~marker_cache() {} void marker_cache::clear() { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif - using iterator_type = boost::unordered_map::const_iterator; - iterator_type itr = marker_cache_.begin(); + auto itr = marker_cache_.begin(); while(itr != marker_cache_.end()) { if (!is_uri(itr->first)) @@ -103,8 +99,7 @@ bool marker_cache::is_image_uri(std::string const& path) bool marker_cache::insert_svg(std::string const& name, std::string const& svg_string) { std::string key = known_svg_prefix_ + name; - using iterator_type = boost::unordered_map::const_iterator; - iterator_type itr = svg_cache_.find(key); + auto itr = svg_cache_.find(key); if (itr == svg_cache_.end()) { return svg_cache_.emplace(key,svg_string).second; @@ -112,33 +107,54 @@ bool marker_cache::insert_svg(std::string const& name, std::string const& svg_st return false; } -bool marker_cache::insert_marker(std::string const& uri, marker_ptr path) +bool marker_cache::insert_marker(std::string const& uri, mapnik::marker && path) { #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif - return marker_cache_.emplace(uri,path).second; + return marker_cache_.emplace(uri,std::make_shared(std::move(path))).second; } -boost::optional marker_cache::find(std::string const& uri, - bool update_cache) +namespace detail { - boost::optional result; +struct visitor_create_marker +{ + marker operator() (image_rgba8 & data) + { + mapnik::premultiply_alpha(data); + return mapnik::marker(mapnik::marker_rgba8(data)); + } + + marker operator() (image_null &) + { + throw std::runtime_error("Can not make marker from null image data type"); + } + + template + marker operator() (T &) + { + throw std::runtime_error("Can not make marker from this data type"); + } +}; + +} // end detail ns + +std::shared_ptr marker_cache::find(std::string const& uri, + bool update_cache) +{ if (uri.empty()) { - return result; + return std::make_shared(mapnik::marker_null()); } #ifdef MAPNIK_THREADSAFE - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif - using iterator_type = boost::unordered_map::const_iterator; - iterator_type itr = marker_cache_.find(uri); + auto itr = marker_cache_.find(uri); if (itr != marker_cache_.end()) { - result.reset(itr->second); - return result; + return itr->second; } try @@ -146,11 +162,11 @@ boost::optional marker_cache::find(std::string const& uri, // if uri references a built-in marker if (is_svg_uri(uri)) { - boost::unordered_map::const_iterator mark_itr = svg_cache_.find(uri); + auto mark_itr = svg_cache_.find(uri); if (mark_itr == svg_cache_.end()) { MAPNIK_LOG_ERROR(marker_cache) << "Marker does not exist: " << uri; - return result; + return std::make_shared(mapnik::marker_null()); } std::string known_svg_string = mark_itr->second; using namespace mapnik::svg; @@ -165,11 +181,14 @@ boost::optional marker_cache::find(std::string const& uri, svg.bounding_rect(&lox, &loy, &hix, &hiy); marker_path->set_bounding_box(lox,loy,hix,hiy); marker_path->set_dimensions(svg.width(),svg.height()); - marker_ptr mark(std::make_shared(marker_path)); - result.reset(mark); if (update_cache) { - marker_cache_.emplace(uri,*result); + auto emplace_result = marker_cache_.emplace(uri,std::make_shared(mapnik::marker_svg(marker_path))); + return emplace_result.first->second; + } + else + { + return std::make_shared(mapnik::marker_svg(marker_path)); } } // otherwise assume file-based @@ -178,7 +197,7 @@ boost::optional marker_cache::find(std::string const& uri, if (!mapnik::util::exists(uri)) { MAPNIK_LOG_ERROR(marker_cache) << "Marker does not exist: " << uri; - return result; + return std::make_shared(mapnik::marker_null()); } if (is_svg(uri)) { @@ -194,11 +213,14 @@ boost::optional marker_cache::find(std::string const& uri, svg.bounding_rect(&lox, &loy, &hix, &hiy); marker_path->set_bounding_box(lox,loy,hix,hiy); marker_path->set_dimensions(svg.width(),svg.height()); - marker_ptr mark(std::make_shared(marker_path)); - result.reset(mark); if (update_cache) { - marker_cache_.emplace(uri,*result); + auto emplace_result = marker_cache_.emplace(uri,std::make_shared(mapnik::marker_svg(marker_path))); + return emplace_result.first->second; + } + else + { + return std::make_shared(mapnik::marker_svg(marker_path)); } } else @@ -210,24 +232,26 @@ boost::optional marker_cache::find(std::string const& uri, unsigned width = reader->width(); unsigned height = reader->height(); BOOST_ASSERT(width > 0 && height > 0); - mapnik::image_ptr image(std::make_shared(width,height)); - reader->read(0,0,*image); - if (!reader->premultiplied_alpha()) - { - agg::rendering_buffer buffer(image->getBytes(),image->width(),image->height(),image->width() * 4); - agg::pixfmt_rgba32 pixf(buffer); - pixf.premultiply(); - } - marker_ptr mark(std::make_shared(image)); - result.reset(mark); + image_any im = reader->read(0,0,width,height); if (update_cache) { - marker_cache_.emplace(uri,*result); + auto emplace_result = marker_cache_.emplace(uri, + std::make_shared( + util::apply_visitor(detail::visitor_create_marker(), im) + )); + return emplace_result.first->second; + } + else + { + return std::make_shared( + util::apply_visitor(detail::visitor_create_marker(), im) + ); } } else { MAPNIK_LOG_ERROR(marker_cache) << "could not intialize reader for: '" << uri << "'"; + return std::make_shared(mapnik::marker_null()); } } } @@ -236,7 +260,7 @@ boost::optional marker_cache::find(std::string const& uri, { MAPNIK_LOG_ERROR(marker_cache) << "Exception caught while loading: '" << uri << "' (" << ex.what() << ")"; } - return result; + return std::make_shared(mapnik::marker_null()); } } diff --git a/src/marker_helpers.cpp b/src/marker_helpers.cpp index bdc70fab0..cf37cdbe4 100644 --- a/src/marker_helpers.cpp +++ b/src/marker_helpers.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,6 +22,7 @@ // mapnik #include +#include #include "agg_ellipse.h" #include "agg_color_rgba.h" diff --git a/bindings/python/mapnik_enumeration_wrapper_converter.hpp b/src/math.cpp similarity index 66% rename from bindings/python/mapnik_enumeration_wrapper_converter.hpp rename to src/math.cpp index fe6475843..1fd2a4fff 100644 --- a/bindings/python/mapnik_enumeration_wrapper_converter.hpp +++ b/src/math.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,26 +20,30 @@ * *****************************************************************************/ -#ifndef MAPNIK_BINDINGS_PYTHON_ENUMERATION_WRAPPPER -#define MAPNIK_BINDINGS_PYTHON_ENUMERATION_WRAPPPER - // mapnik -#include +#include +#include -// boost -#include +// stl +#include +namespace mapnik { -namespace boost { namespace python { +namespace util { - struct mapnik_enumeration_wrapper_to_python + double normalize_angle(double angle) { - static PyObject* convert(mapnik::enumeration_wrapper const& v) + while (angle >= M_PI) { - return ::PyLong_FromLongLong(v.value); // FIXME: this is a temp hack!! + angle -= 2.0 * M_PI; } - }; + while (angle < -M_PI) + { + angle += 2.0 * M_PI; + } + return angle; + } -}} +} // end namespace util -#endif // MAPNIK_BINDINGS_PYTHON_ENUMERATION_WRAPPPER +} // end namespace mapnik diff --git a/src/memory.cpp b/src/memory.cpp deleted file mode 100644 index 6f4351de3..000000000 --- a/src/memory.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2014 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 - * - *****************************************************************************/ - -// mapnik -#include -#include - -#include - -namespace mapnik -{ -void* Object::operator new(size_t size) -{ - void* block=::operator new (size); - return (char*) block; -} - -void* Object::operator new(size_t size,MemoryManager* manager) -{ - assert(manager); - size_t headerSize=MemoryUtils::alignPointerSize(sizeof(MemoryManager*)); - void* const block=manager->allocate(headerSize+size); - *(MemoryManager**)block=manager; - return (char*)block+headerSize; -} - -void Object::operator delete(void* p) -{ - ::operator delete(p); -} - -void Object::operator delete(void* , MemoryManager* ) -{ - //MAPNIK_LOG_DEBUG(memory) << "operator delete with Manager " << std::hex << p << " " << manager; -} - -inline size_t MemoryUtils::alignPointerSize(size_t ptrSize) -{ - size_t alignment=(sizeof(void*) >= sizeof(double)) ? sizeof(void*) : sizeof(double); - size_t current=ptrSize % alignment; - return (current==0)?ptrSize:(ptrSize+alignment-current); -} -} diff --git a/src/memory_datasource.cpp b/src/memory_datasource.cpp index 6bcc7aea0..c30f6745f 100644 --- a/src/memory_datasource.cpp +++ b/src/memory_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,7 +27,7 @@ #include #include #include -// boost +#include // stl #include @@ -44,20 +44,18 @@ struct accumulate_extent accumulate_extent(box2d & ext) : ext_(ext),first_(true) {} - void operator() (feature_ptr feat) + void operator() (feature_ptr const& feat) { - for (std::size_t i=0;inum_geometries();++i) + auto const& geom = feat->get_geometry(); + auto bbox = geometry::envelope(geom); + if ( first_ ) { - geometry_type & geom = feat->get_geometry(i); - if ( first_ ) - { - first_ = false; - ext_ = geom.envelope(); - } - else - { - ext_.expand_to_include(geom.envelope()); - } + first_ = false; + ext_ = bbox; + } + else + { + ext_.expand_to_include(bbox); } } @@ -120,10 +118,10 @@ box2d memory_datasource::envelope() const return extent_; } -boost::optional memory_datasource::get_geometry_type() const +boost::optional memory_datasource::get_geometry_type() const { // TODO - detect this? - return datasource::Collection; + return datasource_geometry_t::Collection; } layer_descriptor memory_datasource::get_descriptor() const diff --git a/src/miniz_png.cpp b/src/miniz_png.cpp index d968d1dae..fb2658545 100644 --- a/src/miniz_png.cpp +++ b/src/miniz_png.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,16 +23,21 @@ // mapnik #include #include -#include +#include #include // miniz #define MINIZ_NO_ARCHIVE_APIS #define MINIZ_NO_ZLIB_COMPATIBLE_NAMES +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" extern "C" { #include "miniz.c" } +#pragma GCC diagnostic pop + // zlib #include @@ -253,7 +258,7 @@ void PNGWriter::writeIDAT(T const& image) } // Write scanline - status = tdefl_compress_buffer(compressor, (mz_uint8 *)image.getRow(y), stride, TDEFL_NO_FLUSH); + status = tdefl_compress_buffer(compressor, (mz_uint8 *)image.get_row(y), stride, TDEFL_NO_FLUSH); if (status != TDEFL_STATUS_OKAY) { throw std::runtime_error("failed to compress image"); @@ -290,7 +295,7 @@ void PNGWriter::writeIDATStripAlpha(T const& image) { } // Strip alpha bytes from scanline - mz_uint8 *row = (mz_uint8 *)image.getRow(y); + mz_uint8 *row = (mz_uint8 *)image.get_row(y); for (i = 0, j = 0; j < stride; i += 4, j += 3) { scanline[j] = row[i]; scanline[j+1] = row[i+1]; @@ -361,11 +366,11 @@ const mz_uint8 PNGWriter::IEND_tpl[] = { 'I', 'E', 'N', 'D' // "IEND" }; -template void PNGWriter::writeIDAT(image_data_gray8 const& image); -template void PNGWriter::writeIDAT >(image_view const& image); -template void PNGWriter::writeIDAT(image_data_rgba8 const& image); -template void PNGWriter::writeIDAT >(image_view const& image); -template void PNGWriter::writeIDATStripAlpha(image_data_rgba8 const& image); -template void PNGWriter::writeIDATStripAlpha >(image_view const& image); +template void PNGWriter::writeIDAT(image_gray8 const& image); +template void PNGWriter::writeIDAT(image_view_gray8 const& image); +template void PNGWriter::writeIDAT(image_rgba8 const& image); +template void PNGWriter::writeIDAT(image_view_rgba8 const& image); +template void PNGWriter::writeIDATStripAlpha(image_rgba8 const& image); +template void PNGWriter::writeIDATStripAlpha(image_view_rgba8 const& image); }} diff --git a/src/palette.cpp b/src/palette.cpp index 803e0efe2..54e4346b5 100644 --- a/src/palette.cpp +++ b/src/palette.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/params.cpp b/src/params.cpp index 39b36fdbd..8d3a2c859 100644 --- a/src/params.cpp +++ b/src/params.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -34,6 +34,9 @@ template boost::optional parameters::get(std::string const& key, st template boost::optional parameters::get(std::string const& key) const; template boost::optional parameters::get(std::string const& key, value_double const& default_opt_value) const; +template boost::optional parameters::get(std::string const& key) const; +template boost::optional parameters::get(std::string const& key, value_bool const& default_opt_value) const; + template boost::optional parameters::get(std::string const& key) const; template boost::optional parameters::get(std::string const& key, boolean_type const& default_opt_value) const; diff --git a/src/parse_path.cpp b/src/parse_path.cpp index 0064f3ab3..a3d67c2cb 100644 --- a/src/parse_path.cpp +++ b/src/parse_path.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/parse_transform.cpp b/src/parse_transform.cpp index c9403014c..e2daaf480 100644 --- a/src/parse_transform.cpp +++ b/src/parse_transform.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/plugin.cpp b/src/plugin.cpp index 3e66d1aaf..7b057284e 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -80,7 +80,21 @@ PluginInfo::~PluginInfo() if (module_) { #ifdef MAPNIK_SUPPORTS_DLOPEN - if (module_->dl) dlclose(module_->dl),module_->dl=0; + /* + We do not call dlclose for plugins that link libgdal. + This is a terrible hack, but necessary to prevent crashes + at exit when gdal attempts to shutdown. The problem arises + when Mapnik is used with another library that uses thread-local + storage (like libuv). In this case GDAL also tries to cleanup thread + local storage and leaves things in a state that causes libuv to crash. + This is partially fixed by http://trac.osgeo.org/gdal/ticket/5509 but only + in the case that gdal is linked as a shared library. This workaround therefore + prevents crashes with gdal 1.11.x and gdal 2.x when using a static libgdal. + */ + if (module_->dl && name_ != "gdal" && name_ != "ogr") + { + dlclose(module_->dl),module_->dl=0; + } #endif delete module_; } diff --git a/src/png_reader.cpp b/src/png_reader.cpp index 318a67b47..03968c051 100644 --- a/src/png_reader.cpp +++ b/src/png_reader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -80,9 +80,8 @@ public: unsigned height() const final; boost::optional > bounding_box() const final; inline bool has_alpha() const final { return has_alpha_; } - bool premultiplied_alpha() const final { return false; } //http://www.libpng.org/pub/png/spec/1.1/PNG-Rationale.html - void read(unsigned x,unsigned y,image_data_rgba8& image) final; - image_data_any read(unsigned x, unsigned y, unsigned width, unsigned height) final; + void read(unsigned x,unsigned y,image_rgba8& image) final; + image_any read(unsigned x, unsigned y, unsigned width, unsigned height) final; private: void init(); static void png_read_data(png_structp png_ptr, png_bytep data, png_size_t length); @@ -227,7 +226,7 @@ boost::optional > png_reader::bounding_box() const } template -void png_reader::read(unsigned x0, unsigned y0,image_data_rgba8& image) +void png_reader::read(unsigned x0, unsigned y0,image_rgba8& image) { stream_.clear(); stream_.seekg(0, std::ios_base::beg); @@ -285,7 +284,7 @@ void png_reader::read(unsigned x0, unsigned y0,image_data_rgba8& image) // alloc row pointers const std::unique_ptr rows(new png_bytep[height_]); for (unsigned i=0; i::read(unsigned x0, unsigned y0,image_data_rgba8& image) png_read_row(png_ptr,row.get(),0); if (i >= y0 && i < (y0 + h)) { - image.setRow(i-y0,reinterpret_cast(&row[x0 * 4]),w); + image.set_row(i-y0,reinterpret_cast(&row[x0 * 4]),w); } } //END @@ -311,11 +310,11 @@ void png_reader::read(unsigned x0, unsigned y0,image_data_rgba8& image) template -image_data_any png_reader::read(unsigned x, unsigned y, unsigned width, unsigned height) +image_any png_reader::read(unsigned x, unsigned y, unsigned width, unsigned height) { - image_data_rgba8 data(width,height); + image_rgba8 data(width,height); read(x, y, data); - return image_data_any(std::move(data)); + return image_any(std::move(data)); } } diff --git a/src/proj_transform.cpp b/src/proj_transform.cpp index 37ca8d703..a08b4d7dd 100644 --- a/src/proj_transform.cpp +++ b/src/proj_transform.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,7 +26,6 @@ #include #include #include -#include #ifdef MAPNIK_USE_PROJ4 // proj4 @@ -87,12 +86,53 @@ bool proj_transform::equal() const return is_source_equal_dest_; } +bool proj_transform::is_known() const +{ + return merc_to_wgs84_ || wgs84_to_merc_; +} + bool proj_transform::forward (double & x, double & y , double & z) const { return forward(&x, &y, &z, 1); } -bool proj_transform::forward (double * x, double * y , double * z, int point_count) const +bool proj_transform::forward (geometry::point & p) const +{ + double z = 0; + return forward(&(p.x), &(p.y), &z, 1); +} + +unsigned int proj_transform::forward (geometry::line_string & ls) const +{ + std::size_t size = ls.size(); + if (size == 0) return 0; + + if (is_source_equal_dest_) + return 0; + + if (wgs84_to_merc_) + { + lonlat2merc(ls); + return 0; + } + else if (merc_to_wgs84_) + { + merc2lonlat(ls); + return 0; + } + + geometry::point * ptr = ls.data(); + double * x = reinterpret_cast(ptr); + double * y = x + 1; + double * z = NULL; + if(!forward(x, y, z, size, 2)) + { + return size; + } + return 0; +} + +bool proj_transform::forward (double * x, double * y , double * z, int point_count, int offset) const { if (is_source_equal_dest_) @@ -112,30 +152,37 @@ bool proj_transform::forward (double * x, double * y , double * z, int point_cou { int i; for(i=0; i & p) const +{ + double z = 0; + return backward(&(p.x), &(p.y), &z, 1); +} + +unsigned int proj_transform::backward (geometry::line_string & ls) const +{ + std::size_t size = ls.size(); + if (size == 0) return 0; + + if (is_source_equal_dest_) + return 0; + + if (wgs84_to_merc_) + { + merc2lonlat(ls); + return 0; + } + else if (merc_to_wgs84_) + { + lonlat2merc(ls); + return 0; + } + + geometry::point * ptr = ls.data(); + double * x = reinterpret_cast(ptr); + double * y = x + 1; + double * z = NULL; + if(!backward(x, y, z, size, 2)) + { + return size; + } + return 0; +} bool proj_transform::forward (box2d & box) const { if (is_source_equal_dest_) return true; - double minx = box.minx(); - double miny = box.miny(); - double maxx = box.maxx(); - double maxy = box.maxy(); + double llx = box.minx(); + double ulx = box.minx(); + double lly = box.miny(); + double lry = box.miny(); + double lrx = box.maxx(); + double urx = box.maxx(); + double uly = box.maxy(); + double ury = box.maxy(); double z = 0.0; - if (!forward(minx,miny,z)) + if (!forward(llx,lly,z)) return false; - if (!forward(maxx,maxy,z)) + if (!forward(lrx,lry,z)) return false; - box.init(minx,miny,maxx,maxy); + if (!forward(ulx,uly,z)) + return false; + if (!forward(urx,ury,z)) + return false; + + double minx = std::min(ulx, llx); + double miny = std::min(lly, lry); + double maxx = std::max(urx, lrx); + double maxy = std::max(ury, uly); + box.init(minx, + miny, + maxx, + maxy); return true; } @@ -206,21 +311,35 @@ bool proj_transform::backward (box2d & box) const if (is_source_equal_dest_) return true; - double minx = box.minx(); - double miny = box.miny(); - double maxx = box.maxx(); - double maxy = box.maxy(); + double llx = box.minx(); + double ulx = box.minx(); + double lly = box.miny(); + double lry = box.miny(); + double lrx = box.maxx(); + double urx = box.maxx(); + double uly = box.maxy(); + double ury = box.maxy(); double z = 0.0; - if (!backward(minx,miny,z)) + if (!backward(llx,lly,z)) return false; - if (!backward(maxx,maxy,z)) + if (!backward(lrx,lry,z)) return false; - box.init(minx,miny,maxx,maxy); + if (!backward(ulx,uly,z)) + return false; + if (!backward(urx,ury,z)) + return false; + double minx = std::min(ulx, llx); + double miny = std::min(lly, lry); + double maxx = std::max(urx, lrx); + double maxy = std::max(ury, uly); + box.init(minx, + miny, + maxx, + maxy); return true; } -/* Returns points in clockwise order. This allows us to do anti-meridian checks. - */ +// Returns points in clockwise order. This allows us to do anti-meridian checks. void envelope_points(std::vector< coord > & coords, box2d& env, int points) { double width = env.width(); @@ -251,7 +370,7 @@ void envelope_points(std::vector< coord > & coords, box2d& env } } -/* determine if an ordered sequence of coordinates is in clockwise order */ +// determine if an ordered sequence of coordinates is in clockwise order bool is_clockwise(const std::vector< coord > & coords) { int n = coords.size(); @@ -278,12 +397,12 @@ box2d calculate_bbox(std::vector > & points) { } -/* More robust, but expensive, bbox transform - * in the face of proj4 out of bounds conditions. - * Can result in 20 -> 10 r/s performance hit. - * Alternative is to provide proper clipping box - * in the target srs by setting map 'maximum-extent' - */ +// More robust, but expensive, bbox transform +// in the face of proj4 out of bounds conditions. +// Can result in 20 -> 10 r/s performance hit. +// Alternative is to provide proper clipping box +// in the target srs by setting map 'maximum-extent' + bool proj_transform::backward(box2d& env, int points) const { if (is_source_equal_dest_) @@ -306,15 +425,15 @@ bool proj_transform::backward(box2d& env, int points) const } box2d result = calculate_bbox(coords); - if (is_source_longlat_ && !is_clockwise(coords)) { - /* we've gone to a geographic CS, and our clockwise envelope has - * changed into an anticlockwise one. This means we've crossed the antimeridian, and - * need to expand the X direction to +/-180 to include all the data. Once we can deal - * with multiple bboxes in queries we can improve. - */ - double miny = result.miny(); - result.expand_to_include(-180.0, miny); - result.expand_to_include(180.0, miny); + if (is_source_longlat_ && !is_clockwise(coords)) + { + // we've gone to a geographic CS, and our clockwise envelope has + // changed into an anticlockwise one. This means we've crossed the antimeridian, and + // need to expand the X direction to +/-180 to include all the data. Once we can deal + // with multiple bboxes in queries we can improve. + double miny = result.miny(); + result.expand_to_include(-180.0, miny); + result.expand_to_include(180.0, miny); } env.re_center(result.center().x, result.center().y); @@ -347,15 +466,15 @@ bool proj_transform::forward(box2d& env, int points) const box2d result = calculate_bbox(coords); - if (is_dest_longlat_ && !is_clockwise(coords)) { - /* we've gone to a geographic CS, and our clockwise envelope has - * changed into an anticlockwise one. This means we've crossed the antimeridian, and - * need to expand the X direction to +/-180 to include all the data. Once we can deal - * with multiple bboxes in queries we can improve. - */ - double miny = result.miny(); - result.expand_to_include(-180.0, miny); - result.expand_to_include(180.0, miny); + if (is_dest_longlat_ && !is_clockwise(coords)) + { + // we've gone to a geographic CS, and our clockwise envelope has + // changed into an anticlockwise one. This means we've crossed the antimeridian, and + // need to expand the X direction to +/-180 to include all the data. Once we can deal + // with multiple bboxes in queries we can improve. + double miny = result.miny(); + result.expand_to_include(-180.0, miny); + result.expand_to_include(180.0, miny); } env.re_center(result.center().x, result.center().y); diff --git a/src/projection.cpp b/src/projection.cpp index a660884ae..07f78ba11 100644 --- a/src/projection.cpp +++ b/src/projection.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,7 +22,6 @@ // mapnik #include -#include #include #include @@ -82,8 +81,8 @@ projection& projection::operator=(projection const& rhs) { projection tmp(rhs); swap(tmp); - proj_ctx_ = 0; - proj_ = 0; + proj_ctx_ = nullptr; + proj_ = nullptr; if (!defer_proj_init_) init_proj4(); return *this; } @@ -106,17 +105,21 @@ void projection::init_proj4() const #if PJ_VERSION >= 480 proj_ctx_ = pj_ctx_alloc(); proj_ = pj_init_plus_ctx(proj_ctx_, params_.c_str()); - if (!proj_) + if (!proj_ || !proj_ctx_) { if (proj_ctx_) { pj_ctx_free(proj_ctx_); - proj_ctx_ = 0; + proj_ctx_ = nullptr; + } + if (proj_) { + pj_free(proj_); + proj_ = nullptr; } throw proj_init_error(params_); } #else #if defined(MAPNIK_THREADSAFE) - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif proj_ = pj_init_plus(params_.c_str()); if (!proj_) throw proj_init_error(params_); @@ -154,7 +157,7 @@ void projection::forward(double & x, double &y ) const throw std::runtime_error("projection::forward not supported unless proj4 is initialized"); } #if defined(MAPNIK_THREADSAFE) && PJ_VERSION < 480 - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif projUV p; p.u = x * DEG_TO_RAD; @@ -181,7 +184,7 @@ void projection::inverse(double & x,double & y) const } #if defined(MAPNIK_THREADSAFE) && PJ_VERSION < 480 - mapnik::scoped_lock lock(mutex_); + std::lock_guard lock(mutex_); #endif if (is_geographic_) { @@ -202,13 +205,21 @@ void projection::inverse(double & x,double & y) const projection::~projection() { #ifdef MAPNIK_USE_PROJ4 - #if defined(MAPNIK_THREADSAFE) && PJ_VERSION < 480 - mapnik::scoped_lock lock(mutex_); - #endif - if (proj_) pj_free(proj_); - #if PJ_VERSION >= 480 - if (proj_ctx_) pj_ctx_free(proj_ctx_); - #endif + #if defined(MAPNIK_THREADSAFE) && PJ_VERSION < 480 + std::lock_guard lock(mutex_); + #endif + if (proj_) + { + pj_free(proj_); + proj_ = nullptr; + } + #if PJ_VERSION >= 480 + if (proj_ctx_) + { + pj_ctx_free(proj_ctx_); + proj_ctx_ = nullptr; + } + #endif #endif } diff --git a/src/rapidxml_loader.cpp b/src/rapidxml_loader.cpp index 841fa9fd2..c0a631f69 100644 --- a/src/rapidxml_loader.cpp +++ b/src/rapidxml_loader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,13 +26,13 @@ // mapnik #include -#include #include #include #include #include #include #include +#include // stl #include @@ -138,7 +138,11 @@ private: { if (cur_node->value_size() > 0) // Don't add empty text nodes { - node.add_child(cur_node->value(), 0, true); + // parsed text values should have leading and trailing + // whitespace trimmed. + std::string trimmed = cur_node->value(); + mapnik::util::trim(trimmed); + node.add_child(trimmed.c_str(), 0, true); } } break; diff --git a/src/raster_colorizer.cpp b/src/raster_colorizer.cpp index 9bed5500a..22d3ee88a 100644 --- a/src/raster_colorizer.cpp +++ b/src/raster_colorizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -123,15 +123,15 @@ bool raster_colorizer::add_stop(colorizer_stop const& stop) } template -void raster_colorizer::colorize(image_data_rgba8 & out, T const& in, +void raster_colorizer::colorize(image_rgba8 & out, T const& in, boost::optional const& nodata, feature_impl const& f) const { - using image_data_type = T; - using pixel_type = typename image_data_type::pixel_type; + using image_type = T; + using pixel_type = typename image_type::pixel_type; // TODO: assuming in/out have the same width/height for now - std::uint32_t * out_data = out.getData(); - pixel_type const* in_data = in.getData(); + std::uint32_t * out_data = out.data(); + pixel_type const* in_data = in.data(); int len = out.width() * out.height(); for (int i=0; iconst& nodata, feature_impl const& f) const; -template void raster_colorizer::colorize(image_data_rgba8 & out, image_data_gray16 const& in, +template void raster_colorizer::colorize(image_rgba8 & out, image_gray8s const& in, boost::optionalconst& nodata, feature_impl const& f) const; -template void raster_colorizer::colorize(image_data_rgba8 & out, image_data_gray32f const& in, +template void raster_colorizer::colorize(image_rgba8 & out, image_gray16 const& in, + boost::optionalconst& nodata, + feature_impl const& f) const; +template void raster_colorizer::colorize(image_rgba8 & out, image_gray16s const& in, + boost::optionalconst& nodata, + feature_impl const& f) const; +template void raster_colorizer::colorize(image_rgba8 & out, image_gray32 const& in, + boost::optionalconst& nodata, + feature_impl const& f) const; +template void raster_colorizer::colorize(image_rgba8 & out, image_gray32s const& in, + boost::optionalconst& nodata, + feature_impl const& f) const; +template void raster_colorizer::colorize(image_rgba8 & out, image_gray32f const& in, + boost::optionalconst& nodata, + feature_impl const& f) const; +template void raster_colorizer::colorize(image_rgba8 & out, image_gray64 const& in, + boost::optionalconst& nodata, + feature_impl const& f) const; +template void raster_colorizer::colorize(image_rgba8 & out, image_gray64s const& in, + boost::optionalconst& nodata, + feature_impl const& f) const; +template void raster_colorizer::colorize(image_rgba8 & out, image_gray64f const& in, boost::optionalconst& nodata, feature_impl const& f) const; diff --git a/src/renderer_common.cpp b/src/renderer_common.cpp index ecba13655..37223e35d 100644 --- a/src/renderer_common.cpp +++ b/src/renderer_common.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ #include #include #include +#include namespace mapnik { diff --git a/src/renderer_common/process_group_symbolizer.cpp b/src/renderer_common/process_group_symbolizer.cpp index 669de0d09..ebef9149f 100644 --- a/src/renderer_common/process_group_symbolizer.cpp +++ b/src/renderer_common/process_group_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,9 +22,7 @@ // mapnik #include -#include #include -#include #include namespace mapnik { @@ -39,7 +37,16 @@ vector_marker_render_thunk::vector_marker_render_thunk(svg_path_ptr const& src, comp_op_(comp_op), snap_to_pixels_(snap_to_pixels) {} -raster_marker_render_thunk::raster_marker_render_thunk(image_data_rgba8 & src, +vector_marker_render_thunk::vector_marker_render_thunk(vector_marker_render_thunk && rhs) + : src_(std::move(rhs.src_)), + attrs_(std::move(rhs.attrs_)), + tr_(std::move(rhs.tr_)), + opacity_(std::move(rhs.opacity_)), + comp_op_(std::move(rhs.comp_op_)), + snap_to_pixels_(std::move(rhs.snap_to_pixels_)) {} + + +raster_marker_render_thunk::raster_marker_render_thunk(image_rgba8 const& src, agg::trans_affine const& marker_trans, double opacity, composite_mode_e comp_op, @@ -48,6 +55,14 @@ raster_marker_render_thunk::raster_marker_render_thunk(image_data_rgba8 & src, snap_to_pixels_(snap_to_pixels) {} +raster_marker_render_thunk::raster_marker_render_thunk(raster_marker_render_thunk && rhs) + : src_(rhs.src_), + tr_(std::move(rhs.tr_)), + opacity_(std::move(rhs.opacity_)), + comp_op_(std::move(rhs.comp_op_)), + snap_to_pixels_(std::move(rhs.snap_to_pixels_)) {} + + text_render_thunk::text_render_thunk(helper_ptr && helper, double opacity, composite_mode_e comp_op, halo_rasterizer_enum halo_rasterizer) @@ -58,6 +73,13 @@ text_render_thunk::text_render_thunk(helper_ptr && helper, halo_rasterizer_(halo_rasterizer) {} +text_render_thunk::text_render_thunk(text_render_thunk && rhs) + : helper_(std::move(rhs.helper_)), + placements_(std::move(rhs.placements_)), + opacity_(std::move(rhs.opacity_)), + comp_op_(std::move(rhs.comp_op_)), + halo_rasterizer_(std::move(rhs.halo_rasterizer_)) {} + namespace detail { template @@ -97,7 +119,7 @@ private: template struct raster_marker_thunk_dispatch : public raster_markers_dispatch { - raster_marker_thunk_dispatch(image_data_rgba8 & src, + raster_marker_thunk_dispatch(image_rgba8 const& src, agg::trans_affine const& marker_trans, symbolizer_base const& sym, Detector & detector, @@ -125,7 +147,7 @@ private: render_thunk_list & thunks_; }; -} +} // end detail ns render_thunk_extractor::render_thunk_extractor(box2d & box, render_thunk_list & thunks, @@ -197,30 +219,15 @@ void render_thunk_extractor::update_box() const { if (box_.width() > 0 && box_.height() > 0) { - box_.expand_to_include(label.box); + box_.expand_to_include(label.get().box); } else { - box_ = label.box; + box_ = label.get().box; } } detector.clear(); } -geometry_type *origin_point(proj_transform const& prj_trans, - renderer_common const& common) -{ - // note that we choose a point in the middle of the screen to - // try to ensure that we don't get edge artefacts due to any - // symbolizers with avoid-edges set: only the avoid-edges of - // the group symbolizer itself should matter. - double x = common.width_ / 2.0, y = common.height_ / 2.0, z = 0.0; - common.t_.backward(&x, &y); - prj_trans.forward(x, y, z); - geometry_type *geom = new geometry_type(geometry_type::Point); - geom->move_to(x, y); - return geom; -} - } // namespace mapnik diff --git a/src/renderer_common/render_pattern.cpp b/src/renderer_common/render_pattern.cpp index bb404cdb0..06477d460 100644 --- a/src/renderer_common/render_pattern.cpp +++ b/src/renderer_common/render_pattern.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,42 +30,44 @@ #include "agg_rendering_buffer.h" #include "agg_pixfmt_rgba.h" +#include "agg_pixfmt_gray.h" #include "agg_color_rgba.h" +#include "agg_color_gray.h" #include "agg_scanline_u.h" namespace mapnik { -std::shared_ptr render_pattern(rasterizer & ras, - marker const& marker, - agg::trans_affine const& tr, - double opacity) +template <> +void render_pattern(rasterizer & ras, + marker_svg const& marker, + agg::trans_affine const& tr, + double opacity, + image_rgba8 & image) { using pixfmt = agg::pixfmt_rgba32_pre; using renderer_base = agg::renderer_base; using renderer_solid = agg::renderer_scanline_aa_solid; agg::scanline_u8 sl; - mapnik::box2d const& bbox = (*marker.get_vector_data())->bounding_box() * tr; + mapnik::box2d const& bbox = marker.bounding_box() * tr; mapnik::coord c = bbox.center(); agg::trans_affine mtx = agg::trans_affine_translation(-c.x,-c.y); mtx.translate(0.5 * bbox.width(), 0.5 * bbox.height()); mtx = tr * mtx; - std::shared_ptr image = std::make_shared(bbox.width(), bbox.height()); - agg::rendering_buffer buf(image->getBytes(), image->width(), image->height(), image->width() * 4); + agg::rendering_buffer buf(image.bytes(), image.width(), image.height(), image.row_size()); pixfmt pixf(buf); renderer_base renb(pixf); - mapnik::svg::vertex_stl_adapter stl_storage((*marker.get_vector_data())->source()); + mapnik::svg::vertex_stl_adapter stl_storage(marker.get_data()->source()); mapnik::svg::svg_path_adapter svg_path(stl_storage); mapnik::svg::svg_renderer_agg, renderer_solid, - agg::pixfmt_rgba32_pre > svg_renderer(svg_path, - (*marker.get_vector_data())->attributes()); + pixfmt > svg_renderer(svg_path, + marker.get_data()->attributes()); svg_renderer.render(ras, sl, renb, mtx, opacity, bbox); - return image; } } // namespace mapnik diff --git a/src/request.cpp b/src/request.cpp index 46fc220cc..f74f62c38 100644 --- a/src/request.cpp +++ b/src/request.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/rule.cpp b/src/rule.cpp index 55a1ba256..2fec472a0 100644 --- a/src/rule.cpp +++ b/src/rule.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/save_map.cpp b/src/save_map.cpp index 620f4ab13..d757f9e7f 100644 --- a/src/save_map.cpp +++ b/src/save_map.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -52,11 +52,12 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" #include +#pragma GCC diagnostic ignored "-Wsign-conversion" +#include +#include #pragma GCC diagnostic pop #include #include -#include -#include // stl #include @@ -87,12 +88,12 @@ void serialize_text_placements(ptree & node, text_placements_ptr const& p, bool { set_attr(node, "placement-type", "list"); //dfl = last properties passed as default so only attributes that change are actually written - text_symbolizer_properties *dfl = &(list->defaults); + text_symbolizer_properties *dfl2 = &(list->defaults); for (unsigned i=0; i < list->size(); ++i) { ptree & placement_node = node.push_back(ptree::value_type("Placement", ptree()))->second; - list->get(i).to_xml(placement_node, explicit_defaults, *dfl); - dfl = &(list->get(i)); + list->get(i).to_xml(placement_node, explicit_defaults, *dfl2); + dfl2 = &(list->get(i)); } } } @@ -464,13 +465,12 @@ void serialize_fontset( ptree & map_node, std::string const& name, font_set cons set_attr(fontset_node, "name", name); - for (auto const& name : fontset.get_face_names()) + for (auto const& face_name : fontset.get_face_names()) { ptree & font_node = fontset_node.push_back( ptree::value_type("Font", ptree()))->second; - set_attr(font_node, "face-name", name); + set_attr(font_node, "face-name", face_name); } - } void serialize_datasource( ptree & layer_node, datasource_ptr datasource) @@ -506,63 +506,63 @@ void serialize_parameters( ptree & map_node, mapnik::parameters const& params) } } -void serialize_layer( ptree & map_node, const layer & layer, bool explicit_defaults ) +void serialize_layer( ptree & map_node, layer const& lyr, bool explicit_defaults ) { ptree & layer_node = map_node.push_back( ptree::value_type("Layer", ptree()))->second; - if ( layer.name() != "" ) + if ( lyr.name() != "" ) { - set_attr( layer_node, "name", layer.name() ); + set_attr( layer_node, "name", lyr.name() ); } - if ( layer.srs() != "" ) + if ( lyr.srs() != "" ) { - set_attr( layer_node, "srs", layer.srs() ); + set_attr( layer_node, "srs", lyr.srs() ); } - if ( !layer.active() || explicit_defaults ) + if ( !lyr.active() || explicit_defaults ) { - set_attr/**/( layer_node, "status", layer.active() ); + set_attr/**/( layer_node, "status", lyr.active() ); } - if ( layer.clear_label_cache() || explicit_defaults ) + if ( lyr.clear_label_cache() || explicit_defaults ) { - set_attr/**/( layer_node, "clear-label-cache", layer.clear_label_cache() ); + set_attr/**/( layer_node, "clear-label-cache", lyr.clear_label_cache() ); } - if ( layer.min_zoom() ) + if ( lyr.minimum_scale_denominator() != 0 || explicit_defaults ) { - set_attr( layer_node, "minzoom", layer.min_zoom() ); + set_attr( layer_node, "minimum_scale_denominator", lyr.minimum_scale_denominator() ); } - if ( layer.max_zoom() != std::numeric_limits::max() ) + if ( lyr.maximum_scale_denominator() != std::numeric_limits::max() || explicit_defaults ) { - set_attr( layer_node, "maxzoom", layer.max_zoom() ); + set_attr( layer_node, "maximum_scale_denominator", lyr.maximum_scale_denominator() ); } - if ( layer.queryable() || explicit_defaults ) + if ( lyr.queryable() || explicit_defaults ) { - set_attr( layer_node, "queryable", layer.queryable() ); + set_attr( layer_node, "queryable", lyr.queryable() ); } - if ( layer.cache_features() || explicit_defaults ) + if ( lyr.cache_features() || explicit_defaults ) { - set_attr/**/( layer_node, "cache-features", layer.cache_features() ); + set_attr/**/( layer_node, "cache-features", lyr.cache_features() ); } - if ( layer.group_by() != "" || explicit_defaults ) + if ( lyr.group_by() != "" || explicit_defaults ) { - set_attr( layer_node, "group-by", layer.group_by() ); + set_attr( layer_node, "group-by", lyr.group_by() ); } - boost::optional const& buffer_size = layer.buffer_size(); + boost::optional const& buffer_size = lyr.buffer_size(); if ( buffer_size || explicit_defaults) { set_attr( layer_node, "buffer-size", *buffer_size ); } - optional > const& maximum_extent = layer.maximum_extent(); + optional > const& maximum_extent = lyr.maximum_extent(); if ( maximum_extent) { std::ostringstream s; @@ -572,7 +572,7 @@ void serialize_layer( ptree & map_node, const layer & layer, bool explicit_defau set_attr( layer_node, "maximum-extent", s.str() ); } - for (auto const& name : layer.styles()) + for (auto const& name : lyr.styles()) { boost::property_tree::ptree & style_node = layer_node.push_back( boost::property_tree::ptree::value_type("StyleName", @@ -580,7 +580,7 @@ void serialize_layer( ptree & map_node, const layer & layer, bool explicit_defau style_node.put_value(name); } - datasource_ptr datasource = layer.datasource(); + datasource_ptr datasource = lyr.datasource(); if ( datasource ) { serialize_datasource( layer_node, datasource ); diff --git a/src/scale_denominator.cpp b/src/scale_denominator.cpp index f7a622088..7e7b2f14d 100644 --- a/src/scale_denominator.cpp +++ b/src/scale_denominator.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/simplify.cpp b/src/simplify.cpp index e50136781..97eae9257 100644 --- a/src/simplify.cpp +++ b/src/simplify.cpp @@ -5,6 +5,8 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" #pragma GCC diagnostic ignored "-Wredeclared-class-member" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop diff --git a/src/svg/output/process_line_symbolizer.cpp b/src/svg/output/process_line_symbolizer.cpp index 4640a370d..5db205eff 100644 --- a/src/svg/output/process_line_symbolizer.cpp +++ b/src/svg/output/process_line_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/svg/output/process_polygon_symbolizer.cpp b/src/svg/output/process_polygon_symbolizer.cpp index 18bfaae1a..c5a1f8709 100644 --- a/src/svg/output/process_polygon_symbolizer.cpp +++ b/src/svg/output/process_polygon_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -35,7 +35,7 @@ namespace mapnik template void svg_renderer::process(polygon_symbolizer const& sym, mapnik::feature_impl &, - proj_transform const& prj_trans) + proj_transform const&) { path_attributes_.set_fill_color(get(sym, keys::fill, mapnik::color(128,128,128))); path_attributes_.set_fill_opacity(get(sym,keys::fill_opacity, 1.0)); diff --git a/src/svg/output/process_symbolizers.cpp b/src/svg/output/process_symbolizers.cpp index 8b57c4fa5..6ff486f7f 100644 --- a/src/svg/output/process_symbolizers.cpp +++ b/src/svg/output/process_symbolizers.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,11 +31,44 @@ #include #include #include - +#include +#include +#include +#include +#include // boost #include -namespace mapnik { +namespace mapnik { namespace geometry { + +template +struct coord_transformer +{ + using calc_type = CalculationType; + + coord_transformer(view_transform const& tr, proj_transform const& prj_trans) + : tr_(tr), prj_trans_(prj_trans) {} + + + template + inline bool apply(P1 const& p1, P2 & p2) const + { + using coordinate_type = typename boost::geometry::coordinate_type::type; + calc_type x = boost::geometry::get<0>(p1); + calc_type y = boost::geometry::get<1>(p1); + calc_type z = 0.0; + if (!prj_trans_.backward(x, y, z)) return false; + tr_.forward(&x,&y); + boost::geometry::set<0>(p2, safe_cast(x)); + boost::geometry::set<1>(p2, safe_cast(y)); + return true; + } + + view_transform const& tr_; + proj_transform const& prj_trans_; +}; + +} // ns geometry struct symbol_type_dispatch { @@ -60,7 +93,7 @@ bool is_path_based(symbolizer const& sym) } template -void generate_path(OutputIterator & output_iterator, PathType const& path, svg::path_output_attributes const& path_attributes) +void generate_path_impl(OutputIterator & output_iterator, PathType const& path, svg::path_output_attributes const& path_attributes) { using path_dash_array_grammar = svg::svg_path_dash_array_grammar; using path_attributes_grammar = svg::svg_path_attributes_grammar; @@ -79,7 +112,7 @@ bool svg_renderer::process(rule::symbolizers const& syms, proj_transform const& prj_trans) { // svg renderer supports processing of multiple symbolizers. - using path_type = transform_path_adapter; + using trans_path_type = transform_path_adapter; bool process_path = false; // process each symbolizer to collect its (path) information. @@ -97,14 +130,13 @@ bool svg_renderer::process(rule::symbolizers const& syms, if (process_path) { // generate path output for each geometry of the current feature. - for (auto & geom : feature.paths()) - { - if(geom.size() > 0) - { - path_type path(common_.t_, geom, prj_trans); - generate_path(generator_.output_iterator_, path, path_attributes_); - } - } + auto const& geom = feature.get_geometry(); + path_type path; + path.set_type(static_cast(mapnik::util::to_ds_type(geom))); + geometry::to_path(geom, path); + vertex_adapter va(path); + trans_path_type trans_path(common_.t_, va, prj_trans); + generate_path_impl(generator_.output_iterator_, trans_path, path_attributes_); // set the previously collected values back to their defaults // for the feature that will be processed next. path_attributes_.reset(); diff --git a/src/svg/output/svg_generator.cpp b/src/svg/output/svg_generator.cpp index a02c84f69..419696191 100644 --- a/src/svg/output/svg_generator.cpp +++ b/src/svg/output/svg_generator.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,12 +24,18 @@ // mapnik #include -#include #include #include // boost +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include +#pragma GCC diagnostic pop namespace mapnik { namespace svg { diff --git a/src/svg/output/svg_output_attributes.cpp b/src/svg/output/svg_output_attributes.cpp index fb0b6a783..bf05d874b 100644 --- a/src/svg/output/svg_output_attributes.cpp +++ b/src/svg/output/svg_output_attributes.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/svg/output/svg_output_grammars.cpp b/src/svg/output/svg_output_grammars.cpp index cc0d51439..398c41a7e 100644 --- a/src/svg/output/svg_output_grammars.cpp +++ b/src/svg/output/svg_output_grammars.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/svg/output/svg_renderer.cpp b/src/svg/output/svg_renderer.cpp index 4525caead..c110e5e8c 100644 --- a/src/svg/output/svg_renderer.cpp +++ b/src/svg/output/svg_renderer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/svg/svg_parser.cpp b/src/svg/svg_parser.cpp index a6fa1ee5b..1ef103c3b 100644 --- a/src/svg/svg_parser.cpp +++ b/src/svg/svg_parser.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ #include #include #include +#include #include "agg_ellipse.h" #include "agg_rounded_rect.h" @@ -34,6 +35,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #include #include @@ -1075,7 +1077,7 @@ void svg_parser::parse(std::string const& filename) void svg_parser::parse_from_string(std::string const& svg) { - xmlTextReaderPtr reader = xmlReaderForMemory(svg.c_str(),svg.size(),nullptr,nullptr, + xmlTextReaderPtr reader = xmlReaderForMemory(svg.c_str(),safe_cast(svg.size()),nullptr,nullptr, (XML_PARSE_NOBLANKS | XML_PARSE_NOCDATA | XML_PARSE_NOERROR | XML_PARSE_NOWARNING)); if (reader == nullptr) { diff --git a/src/svg/svg_path_parser.cpp b/src/svg/svg_path_parser.cpp index d69473425..ba0ce07aa 100644 --- a/src/svg/svg_path_parser.cpp +++ b/src/svg/svg_path_parser.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/svg/svg_points_parser.cpp b/src/svg/svg_points_parser.cpp index b02dafac7..99de4c905 100644 --- a/src/svg/svg_points_parser.cpp +++ b/src/svg/svg_points_parser.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/svg/svg_transform_parser.cpp b/src/svg/svg_transform_parser.cpp index ed6e7f6bb..f41b7b11e 100644 --- a/src/svg/svg_transform_parser.cpp +++ b/src/svg/svg_transform_parser.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/symbolizer.cpp b/src/symbolizer.cpp index bce44a161..6d3109f8e 100644 --- a/src/symbolizer.cpp +++ b/src/symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/symbolizer_enumerations.cpp b/src/symbolizer_enumerations.cpp index dfa91860d..94227dfd2 100644 --- a/src/symbolizer_enumerations.cpp +++ b/src/symbolizer_enumerations.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -35,7 +35,7 @@ IMPLEMENT_ENUM( line_cap_e, line_cap_strings ) static const char * line_join_strings[] = { "miter", - "miter_revert", + "miter-revert", "round", "bevel", "" @@ -85,6 +85,7 @@ IMPLEMENT_ENUM( marker_multi_policy_e, marker_multi_policy_strings ) static const char * debug_symbolizer_mode_strings[] = { "collision", "vertex", + "rings", "" }; @@ -171,12 +172,25 @@ static const char * text_upright_strings[] = { "auto-down", "left", "right", - "left_only", - "right_only", + "left-only", + "right-only", "" }; IMPLEMENT_ENUM(text_upright_e, text_upright_strings) +static const char * direction_strings[] = { + "left", + "right", + "left-only", + "right-only", + "auto", + "auto-down", + "up", + "down", + "" +}; +IMPLEMENT_ENUM(direction_e, direction_strings) + static const char * gamma_method_strings[] = { "power", //agg::gamma_power "linear", //agg::gamma_linear diff --git a/src/symbolizer_keys.cpp b/src/symbolizer_keys.cpp index b22fa2ed0..fa5c73d32 100644 --- a/src/symbolizer_keys.cpp +++ b/src/symbolizer_keys.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,12 +24,8 @@ #include #include -// boost -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wunused-local-typedef" -#include // for replace -#pragma GCC diagnostic pop +// stl +#include namespace mapnik { @@ -157,6 +153,9 @@ static const property_meta_type key_meta[const_max_key] = property_meta_type{ "upright", [](enumeration_wrapper e) {return enumeration(text_upright_enum(e.value)).as_string();}, property_types::target_upright}, + property_meta_type{ "direction", [](enumeration_wrapper e) + {return enumeration(direction_enum(e.value)).as_string();}, + property_types::target_direction}, property_meta_type{ "avoid-edges",nullptr, property_types::target_bool }, property_meta_type{ "font-feature-settings", nullptr, property_types::target_font_feature_settings }, @@ -170,7 +169,7 @@ property_meta_type const& get_meta(mapnik::keys key) mapnik::keys get_key(std::string const& name) { std::string name_copy(name); - boost::algorithm::replace_all(name_copy,"_","-"); + std::replace(name_copy.begin(), name_copy.end(), '_', '-'); for (unsigned i=0; i< const_max_key ; ++i) { property_meta_type const& item = key_meta[i]; diff --git a/src/text/face.cpp b/src/text/face.cpp index 3e14aa62b..10afa65ae 100644 --- a/src/text/face.cpp +++ b/src/text/face.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/font_feature_settings.cpp b/src/text/font_feature_settings.cpp index 67473b509..581c08501 100644 --- a/src/text/font_feature_settings.cpp +++ b/src/text/font_feature_settings.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,6 +29,7 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" #pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #include #pragma GCC diagnostic pop diff --git a/src/text/font_library.cpp b/src/text/font_library.cpp index 0e19b8c85..2bdb4ba48 100644 --- a/src/text/font_library.cpp +++ b/src/text/font_library.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,6 +22,7 @@ // mapnik #include +#include // stl #include @@ -37,19 +38,19 @@ extern "C" namespace { -void* _Alloc_Func(FT_Memory memory, long size) +void* _Alloc_Func(FT_Memory, long size) { - return std::malloc(size); + return std::malloc(mapnik::safe_cast(size)); } -void _Free_Func(FT_Memory memory, void *block) +void _Free_Func(FT_Memory, void *block) { std::free(block); } -void* _Realloc_Func(FT_Memory memory, long cur_size, long new_size, void* block) +void* _Realloc_Func(FT_Memory, long /*cur_size*/, long new_size, void* block) { - return std::realloc(block, new_size); + return std::realloc(block, mapnik::safe_cast(new_size)); } } @@ -64,7 +65,7 @@ font_library::font_library() memory_->free = _Free_Func; memory_->realloc = _Realloc_Func; FT_Error error = FT_New_Library(&*memory_, &library_); - if (error) throw std::runtime_error("can not initalize FreeType2 library"); + if (error) throw std::runtime_error("can not initialize FreeType2 library"); FT_Add_Default_Modules(library_); } diff --git a/src/text/formatting/base.cpp b/src/text/formatting/base.cpp index a1e16db38..8d8f0a1bb 100644 --- a/src/text/formatting/base.cpp +++ b/src/text/formatting/base.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/formatting/format.cpp b/src/text/formatting/format.cpp index e8c14e10b..8e0fef52d 100644 --- a/src/text/formatting/format.cpp +++ b/src/text/formatting/format.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/formatting/layout.cpp b/src/text/formatting/layout.cpp index a5b59a85a..19da033fc 100644 --- a/src/text/formatting/layout.cpp +++ b/src/text/formatting/layout.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/formatting/list.cpp b/src/text/formatting/list.cpp index c8f444fe7..89e9d2373 100644 --- a/src/text/formatting/list.cpp +++ b/src/text/formatting/list.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/formatting/registry.cpp b/src/text/formatting/registry.cpp index bf49c5653..6114f97e5 100644 --- a/src/text/formatting/registry.cpp +++ b/src/text/formatting/registry.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/formatting/text.cpp b/src/text/formatting/text.cpp index 8247bd26a..c24aab123 100644 --- a/src/text/formatting/text.cpp +++ b/src/text/formatting/text.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -46,7 +46,7 @@ void text_node::to_xml(ptree & xml) const new_node.put_value(to_expression_string(*text_)); } -node_ptr text_node::from_xml(xml_node const& xml, fontset_map const& fontsets) +node_ptr text_node::from_xml(xml_node const& xml, fontset_map const&) { return std::make_shared(xml.get_value()); } diff --git a/src/text/glyph_positions.cpp b/src/text/glyph_positions.cpp index 4717b99a7..da3b30084 100644 --- a/src/text/glyph_positions.cpp +++ b/src/text/glyph_positions.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -34,7 +34,7 @@ namespace mapnik glyph_positions::glyph_positions() : data_(), base_point_(), - marker_(), + marker_info_(), marker_pos_(), bbox_() {} @@ -68,15 +68,15 @@ void glyph_positions::set_base_point(pixel_position const& base_point) base_point_ = base_point; } -void glyph_positions::set_marker(marker_info_ptr marker, pixel_position const& marker_pos) +void glyph_positions::set_marker(marker_info_ptr mark, pixel_position const& marker_pos) { - marker_ = marker; + marker_info_ = mark; marker_pos_ = marker_pos; } -marker_info_ptr glyph_positions::marker() const +marker_info_ptr glyph_positions::get_marker() const { - return marker_; + return marker_info_; } pixel_position const& glyph_positions::marker_pos() const diff --git a/src/text/itemizer.cpp b/src/text/itemizer.cpp index 5058bfde4..9f01035f1 100644 --- a/src/text/itemizer.cpp +++ b/src/text/itemizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/placement_finder.cpp b/src/text/placement_finder.cpp index 2c3b5a806..ec2add037 100644 --- a/src/text/placement_finder.cpp +++ b/src/text/placement_finder.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,7 @@ #include #include #include +#include // agg #include "agg_conv_clip_polyline.h" @@ -58,7 +59,11 @@ placement_finder::placement_finder(feature_impl const& feature, placements_(), has_marker_(false), marker_(), - marker_box_() {} + marker_box_(), + marker_unlocked_(false), + marker_displacement_(), + move_dx_(0.0), + horizontal_alignment_(H_LEFT) {} bool placement_finder::next_position() { @@ -87,7 +92,6 @@ bool placement_finder::next_position() horizontal_alignment_ = layout->horizontal_alignment(); return true; } - MAPNIK_LOG_WARN(placement_finder) << "next_position() called while last call already returned false!\n"; return false; } @@ -95,11 +99,11 @@ text_upright_e placement_finder::simplify_upright(text_upright_e upright, double { if (upright == UPRIGHT_AUTO) { - return (std::fabs(normalize_angle(angle)) > 0.5*M_PI) ? UPRIGHT_LEFT : UPRIGHT_RIGHT; + return (std::fabs(util::normalize_angle(angle)) > 0.5*M_PI) ? UPRIGHT_LEFT : UPRIGHT_RIGHT; } if (upright == UPRIGHT_AUTO_DOWN) { - return (std::fabs(normalize_angle(angle)) < 0.5*M_PI) ? UPRIGHT_LEFT : UPRIGHT_RIGHT; + return (std::fabs(util::normalize_angle(angle)) < 0.5*M_PI) ? UPRIGHT_LEFT : UPRIGHT_RIGHT; } if (upright == UPRIGHT_LEFT_ONLY) { @@ -209,7 +213,8 @@ bool placement_finder::single_line_placement(vertex_cache &pp, text_upright_e or pixel_position align_offset = layout.alignment_offset(); pixel_position const& layout_displacement = layout.displacement(); double sign = (real_orientation == UPRIGHT_LEFT) ? -1 : 1; - double offset = layout_displacement.y + 0.5 * sign * layout.height(); + //double offset = 0 - (layout_displacement.y + 0.5 * sign * layout.height()); + double offset = layout_displacement.y - 0.5 * sign * layout.height(); double adjust_character_spacing = .0; double layout_width = layout.width(); bool adjust = layout.horizontal_alignment() == H_ADJUST; @@ -228,7 +233,7 @@ bool placement_finder::single_line_placement(vertex_cache &pp, text_upright_e or { // Only subtract half the line height here and half at the end because text is automatically // centered on the line - offset -= sign * line.height()/2; + offset += sign * line.height()/2; vertex_cache & off_pp = pp.get_offseted(offset, sign * layout_width); vertex_cache::scoped_state off_state(off_pp); // TODO: Remove this when a clean implementation in vertex_cache::get_offseted is done double line_width = adjust ? (line.glyphs_width() + line.space_count() * adjust_character_spacing) : line.width(); @@ -238,10 +243,9 @@ bool placement_finder::single_line_placement(vertex_cache &pp, text_upright_e or double last_cluster_angle = 999; int current_cluster = -1; pixel_position cluster_offset; - double angle; + double angle = 0; rotation rot; - double last_glyph_spacing = 0.; - + double last_glyph_spacing = 0.0; for (auto const& glyph : line) { if (current_cluster != static_cast(glyph.char_index)) @@ -249,21 +253,27 @@ bool placement_finder::single_line_placement(vertex_cache &pp, text_upright_e or if (adjust) { if (!off_pp.move(sign * (layout.cluster_width(current_cluster) + last_glyph_spacing))) + { return false; + } last_glyph_spacing = adjust_character_spacing; } else { if (!off_pp.move_to_distance(sign * (layout.cluster_width(current_cluster) + last_glyph_spacing))) + { return false; + } last_glyph_spacing = glyph.format->character_spacing * scale_factor_; } current_cluster = glyph.char_index; // Only calculate new angle at the start of each cluster! - angle = normalize_angle(off_pp.angle(sign * layout.cluster_width(current_cluster))); + // Y axis is inverted. + // See note about coordinate systems in placement_finder::find_point_placement(). + angle = -util::normalize_angle(off_pp.angle(sign * layout.cluster_width(current_cluster))); rot.init(angle); if ((text_props_->max_char_angle_delta > 0) && (last_cluster_angle != 999) && - std::fabs(normalize_angle(angle-last_cluster_angle)) > text_props_->max_char_angle_delta) + std::fabs(util::normalize_angle(angle - last_cluster_angle)) > text_props_->max_char_angle_delta) { return false; } @@ -271,7 +281,10 @@ bool placement_finder::single_line_placement(vertex_cache &pp, text_upright_e or last_cluster_angle = angle; } - if (std::abs(angle) > M_PI/2) ++upside_down_glyph_count; + if (std::abs(angle) > M_PI/2) + { + ++upside_down_glyph_count; + } pixel_position pos = off_pp.current_position() + cluster_offset; // Center the text on the line @@ -288,7 +301,7 @@ bool placement_finder::single_line_placement(vertex_cache &pp, text_upright_e or glyphs->emplace_back(glyph, pos, rot); } // See comment above - offset -= sign * line.height()/2; + offset += sign * line.height()/2; } } @@ -300,7 +313,7 @@ bool placement_finder::single_line_placement(vertex_cache &pp, text_upright_e or begin.restore(); return single_line_placement(pp, real_orientation == UPRIGHT_RIGHT ? UPRIGHT_LEFT : UPRIGHT_RIGHT); } - // upright==left_only or right_only and more than 50% of characters upside down => no placement + // upright==left-only or right-only and more than 50% of characters upside down => no placement else if (orientation == UPRIGHT_LEFT_ONLY || orientation == UPRIGHT_RIGHT_ONLY) { return false; @@ -328,21 +341,6 @@ void placement_finder::path_move_dx(vertex_cache & pp, double dx) if (!pp.move(dx)) pp.restore_state(state); } -double placement_finder::normalize_angle(double angle) -{ - while (angle >= M_PI) - { - angle -= 2.0 * M_PI; - } - while (angle < -M_PI) - { - angle += 2.0 * M_PI; - } - // y axis is inverted. - // See note about coordinate systems in placement_finder::find_point_placement(). - return -angle; -} - double placement_finder::get_spacing(double path_length, double layout_width) const { int num_labels = 1; diff --git a/src/text/placements/base.cpp b/src/text/placements/base.cpp index 0e70b1cf8..861c5664a 100644 --- a/src/text/placements/base.cpp +++ b/src/text/placements/base.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/placements/dummy.cpp b/src/text/placements/dummy.cpp index 569b5df48..dd51db8b8 100644 --- a/src/text/placements/dummy.cpp +++ b/src/text/placements/dummy.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,7 +33,7 @@ bool text_placement_info_dummy::next() const } text_placement_info_ptr text_placements_dummy::get_placement_info( - double scale_factor, feature_impl const& feature, attributes const& vars) const + double scale_factor, feature_impl const&, attributes const&) const { return std::make_shared(this, scale_factor); } diff --git a/src/text/placements/list.cpp b/src/text/placements/list.cpp index 1c40b68cf..65c729b84 100644 --- a/src/text/placements/list.cpp +++ b/src/text/placements/list.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -65,7 +65,7 @@ text_symbolizer_properties & text_placements_list::get(unsigned i) } -text_placement_info_ptr text_placements_list::get_placement_info(double scale_factor, feature_impl const& feature, attributes const& vars) const +text_placement_info_ptr text_placements_list::get_placement_info(double scale_factor, feature_impl const&, attributes const&) const { return std::make_shared(this, scale_factor); } @@ -83,7 +83,7 @@ void text_placements_list::add_expressions(expression_set & output) const } } -unsigned text_placements_list::size() const +std::size_t text_placements_list::size() const { return list_.size(); } diff --git a/src/text/placements/registry.cpp b/src/text/placements/registry.cpp index c7a655b6b..e24131d03 100644 --- a/src/text/placements/registry.cpp +++ b/src/text/placements/registry.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/placements/simple.cpp b/src/text/placements/simple.cpp index 693b0bacd..59e44071b 100644 --- a/src/text/placements/simple.cpp +++ b/src/text/placements/simple.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -35,6 +35,8 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" #pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -185,7 +187,7 @@ namespace detail { } template - std::string operator() (T const& val) const + std::string operator() (T const&) const { return ""; } diff --git a/src/text/properties_util.cpp b/src/text/properties_util.cpp index ca76efd02..e08d4fd55 100644 --- a/src/text/properties_util.cpp +++ b/src/text/properties_util.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/renderer.cpp b/src/text/renderer.cpp index b57c2d8ef..05a460631 100644 --- a/src/text/renderer.cpp +++ b/src/text/renderer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,11 +22,12 @@ // mapnik #include -#include #include #include #include #include +#include +#include namespace mapnik { @@ -102,7 +103,7 @@ void composite_bitmap(T & pixmap, FT_Bitmap *bitmap, unsigned rgba, int x, int y unsigned gray=bitmap->buffer[q*bitmap->width+p]; if (gray) { - pixmap.composite_pixel(comp_op, i, j, rgba, gray, opacity); + mapnik::composite_pixel(pixmap, comp_op, i, j, rgba, gray, opacity); } } } @@ -291,17 +292,17 @@ void agg_text_renderer::render_halo(FT_Bitmap *bitmap, int gray = bitmap->buffer[y*bitmap->width+x]; if (gray) { - pixmap_.composite_pixel(comp_op, x+x1-1, y+y1-1, rgba, gray*halo_radius*halo_radius, opacity); - pixmap_.composite_pixel(comp_op, x+x1, y+y1-1, rgba, gray*halo_radius, opacity); - pixmap_.composite_pixel(comp_op, x+x1+1, y+y1-1, rgba, gray*halo_radius*halo_radius, opacity); + mapnik::composite_pixel(pixmap_, comp_op, x+x1-1, y+y1-1, rgba, gray*halo_radius*halo_radius, opacity); + mapnik::composite_pixel(pixmap_, comp_op, x+x1, y+y1-1, rgba, gray*halo_radius, opacity); + mapnik::composite_pixel(pixmap_, comp_op, x+x1+1, y+y1-1, rgba, gray*halo_radius*halo_radius, opacity); - pixmap_.composite_pixel(comp_op, x+x1-1, y+y1, rgba, gray*halo_radius, opacity); - pixmap_.composite_pixel(comp_op, x+x1, y+y1, rgba, gray, opacity); - pixmap_.composite_pixel(comp_op, x+x1+1, y+y1, rgba, gray*halo_radius, opacity); + mapnik::composite_pixel(pixmap_, comp_op, x+x1-1, y+y1, rgba, gray*halo_radius, opacity); + mapnik::composite_pixel(pixmap_, comp_op, x+x1, y+y1, rgba, gray, opacity); + mapnik::composite_pixel(pixmap_, comp_op, x+x1+1, y+y1, rgba, gray*halo_radius, opacity); - pixmap_.composite_pixel(comp_op, x+x1-1, y+y1+1, rgba, gray*halo_radius*halo_radius, opacity); - pixmap_.composite_pixel(comp_op, x+x1, y+y1+1, rgba, gray*halo_radius, opacity); - pixmap_.composite_pixel(comp_op, x+x1+1, y+y1+1, rgba, gray*halo_radius*halo_radius, opacity); + mapnik::composite_pixel(pixmap_, comp_op, x+x1-1, y+y1+1, rgba, gray*halo_radius*halo_radius, opacity); + mapnik::composite_pixel(pixmap_, comp_op, x+x1, y+y1+1, rgba, gray*halo_radius, opacity); + mapnik::composite_pixel(pixmap_, comp_op, x+x1+1, y+y1+1, rgba, gray*halo_radius*halo_radius, opacity); } } } @@ -317,7 +318,7 @@ void agg_text_renderer::render_halo(FT_Bitmap *bitmap, { for (int n=-halo_radius; n <=halo_radius; ++n) for (int m=-halo_radius; m <= halo_radius; ++m) - pixmap_.composite_pixel(comp_op, x+x1+m, y+y1+n, rgba, gray, opacity); + mapnik::composite_pixel(pixmap_, comp_op, x+x1+m, y+y1+n, rgba, gray, opacity); } } } @@ -357,7 +358,7 @@ grid_text_renderer::grid_text_renderer(pixmap_type &pixmap, : text_renderer(HALO_RASTERIZER_FAST, comp_op, src_over, scale_factor), pixmap_(pixmap) {} -template class agg_text_renderer; +template class agg_text_renderer; template class grid_text_renderer; } // namespace mapnik diff --git a/src/text/symbolizer_helpers.cpp b/src/text/symbolizer_helpers.cpp index 36b6478a7..99c7c0356 100644 --- a/src/text/symbolizer_helpers.cpp +++ b/src/text/symbolizer_helpers.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,6 +28,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -40,7 +44,124 @@ //agg #include "agg_conv_clip_polyline.h" -namespace mapnik { +namespace mapnik { namespace detail { + +template +struct apply_vertex_placement +{ + apply_vertex_placement(Points & points, view_transform const& tr, proj_transform const& prj_trans) + : points_(points), + tr_(tr), + prj_trans_(prj_trans) {} + + template + void operator() (Adapter const& va) const + { + double label_x, label_y, z = 0; + va.rewind(0); + for (unsigned cmd; (cmd = va.vertex(&label_x, &label_y)) != SEG_END; ) + { + if (cmd != SEG_CLOSE) + { + prj_trans_.backward(label_x, label_y, z); + tr_.forward(&label_x, &label_y); + points_.emplace_back(label_x, label_y); + } + } + } + Points & points_; + view_transform const& tr_; + proj_transform const& prj_trans_; +}; + +template +struct split_multi_geometries +{ + using container_type = T; + split_multi_geometries(container_type & cont, view_transform const& t, + proj_transform const& prj_trans, double minimum_path_length) + : cont_(cont), + t_(t), + prj_trans_(prj_trans), + minimum_path_length_(minimum_path_length) {} + + void operator() (geometry::geometry_empty const&) const {} + void operator() (geometry::multi_point const& multi_pt) const + { + for ( auto const& pt : multi_pt ) + { + cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(pt))); + } + } + void operator() (geometry::line_string const& line) const + { + if (minimum_path_length_ > 0) + { + box2d bbox = t_.forward(geometry::envelope(line), prj_trans_); + if (bbox.width() >= minimum_path_length_) + { + cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(line))); + } + } + else + { + cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(line))); + } + } + + void operator() (geometry::multi_line_string const& multi_line) const + { + for ( auto const& line : multi_line ) + { + (*this)(line); + } + } + + void operator() (geometry::polygon const& poly) const + { + if (minimum_path_length_ > 0) + { + box2d bbox = t_.forward(geometry::envelope(poly), prj_trans_); + if (bbox.width() >= minimum_path_length_) + { + cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(poly))); + } + } + else + { + cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(poly))); + } + } + + void operator() (geometry::multi_polygon const& multi_poly) const + { + for ( auto const& poly : multi_poly ) + { + (*this)(poly); + } + } + + void operator() (geometry::geometry_collection const& collection) const + { + for ( auto const& geom : collection) + { + util::apply_visitor(*this, geom); + } + } + + template + void operator() (Geometry const& geom) const + { + cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(geom))); + } + + container_type & cont_; + view_transform const& t_; + proj_transform const& prj_trans_; + double minimum_path_length_; +}; + +} // ns detail base_symbolizer_helper::base_symbolizer_helper( symbolizer_base const& sym, @@ -68,45 +189,44 @@ base_symbolizer_helper::base_symbolizer_helper( struct largest_bbox_first { - bool operator() (geometry_type const* g0, geometry_type const* g1) const + bool operator() (geometry::geometry const* g0, geometry::geometry const* g1) const { - box2d b0 = g0->envelope(); - box2d b1 = g1->envelope(); - return b0.width()*b0.height() > b1.width()*b1.height(); + box2d b0 = geometry::envelope(*g0); + box2d b1 = geometry::envelope(*g1); + return b0.width() * b0.height() > b1.width() * b1.height(); + } + bool operator() (base_symbolizer_helper::geometry_cref const& g0, + base_symbolizer_helper::geometry_cref const& g1) const + { + // TODO - this has got to be expensive! Can we cache bbox's if there are repeated calls to same geom? + box2d b0 = geometry::envelope(g0); + box2d b1 = geometry::envelope(g1); + return b0.width() * b0.height() > b1.width() * b1.height(); } }; void base_symbolizer_helper::initialize_geometries() const { - bool largest_box_only = text_props_->largest_bbox_only; double minimum_path_length = text_props_->minimum_path_length; - for ( auto const& geom : feature_.paths()) + auto const& geom = feature_.get_geometry(); + util::apply_visitor(detail::split_multi_geometries + (geometries_to_process_, t_, prj_trans_, minimum_path_length ), geom); + if (!geometries_to_process_.empty()) { - // don't bother with empty geometries - if (geom.size() == 0) continue; - mapnik::geometry_type::types type = geom.type(); - if (type == geometry_type::types::Polygon) + auto type = geometry::geometry_type(geom); + if (type == geometry::geometry_types::Polygon || + type == geometry::geometry_types::MultiPolygon) { - if (minimum_path_length > 0) + bool largest_box_only = text_props_->largest_bbox_only; + if (largest_box_only) { - box2d gbox = t_.forward(geom.envelope(), prj_trans_); - if (gbox.width() < minimum_path_length) - { - continue; - } + geometries_to_process_.sort(largest_bbox_first()); + geo_itr_ = geometries_to_process_.begin(); + geometries_to_process_.erase(++geo_itr_, geometries_to_process_.end()); } } - // TODO - calculate length here as well - geometries_to_process_.push_back(const_cast(&geom)); - } - - if (largest_box_only) - { - geometries_to_process_.sort(largest_bbox_first()); geo_itr_ = geometries_to_process_.begin(); - geometries_to_process_.erase(++geo_itr_,geometries_to_process_.end()); } - geo_itr_ = geometries_to_process_.begin(); } void base_symbolizer_helper::initialize_points() const @@ -126,36 +246,44 @@ void base_symbolizer_helper::initialize_points() const double label_y=0.0; double z=0.0; - for (auto * geom_ptr : geometries_to_process_) + for (auto const& geom : geometries_to_process_) { - geometry_type const& geom = *geom_ptr; if (how_placed == VERTEX_PLACEMENT) { - geom.rewind(0); - for(unsigned i = 0; i < geom.size(); ++i) - { - geom.vertex(&label_x, &label_y); - prj_trans_.backward(label_x, label_y, z); - t_.forward(&label_x, &label_y); - points_.emplace_back(label_x, label_y); - } + using apply_vertex_placement = detail::apply_vertex_placement >; + apply_vertex_placement apply(points_, t_, prj_trans_); + util::apply_visitor(geometry::vertex_processor(apply), geom); } else { // https://github.com/mapnik/mapnik/issues/1423 bool success = false; // https://github.com/mapnik/mapnik/issues/1350 - if (geom.type() == geometry_type::types::LineString) + auto type = geometry::geometry_type(geom); + + // note: split_multi_geometries is called above so the only likely types are: + // Point, LineString, and Polygon. + if (type == geometry::geometry_types::LineString) { - success = label::middle_point(geom, label_x,label_y); + auto const& line = mapnik::util::get >(geom); + geometry::line_string_vertex_adapter va(line); + success = label::middle_point(va, label_x,label_y); } - else if (how_placed == POINT_PLACEMENT) + else if (how_placed == POINT_PLACEMENT || type == geometry::geometry_types::Point) { - success = label::centroid(geom, label_x, label_y); + geometry::point pt; + if (geometry::centroid(geom, pt)) + { + label_x = pt.x; + label_y = pt.y; + success = true; + } } - else if (how_placed == INTERIOR_PLACEMENT) + else if (how_placed == INTERIOR_PLACEMENT && type == geometry::geometry_types::Polygon) { - success = label::interior_position(geom, label_x, label_y); + auto const& poly = mapnik::util::get >(geom); + geometry::polygon_vertex_adapter va(poly); + success = label::interior_position(va, label_x, label_y); } else { @@ -185,7 +313,7 @@ text_symbolizer_helper::text_symbolizer_helper( : base_symbolizer_helper(sym, feature, vars, prj_trans, width, height, scale_factor, t, query_extent), finder_(feature, vars, detector, dims_, *info_ptr_, font_manager, scale_factor), adapter_(finder_,false), - converter_(query_extent_, adapter_, sym_, t, prj_trans, affine_trans, feature, vars, scale_factor) + converter_(query_extent_, sym_, t, prj_trans, affine_trans, feature, vars, scale_factor) { // setup vertex converter @@ -215,6 +343,40 @@ placements_list const& text_symbolizer_helper::get() const return finder_.placements(); } +class apply_line_placement_visitor +{ +public: + apply_line_placement_visitor(vertex_converter_type & converter, + placement_finder_adapter const & adapter) + : converter_(converter), adapter_(adapter) + { + } + + bool operator()(geometry::line_string const & geo) const + { + geometry::line_string_vertex_adapter va(geo); + converter_.apply(va, adapter_); + return adapter_.status(); + } + + bool operator()(geometry::polygon const & geo) const + { + geometry::polygon_vertex_adapter va(geo); + converter_.apply(va, adapter_); + return adapter_.status(); + } + + template + bool operator()(T const&) const + { + return false; + } + +private: + vertex_converter_type & converter_; + placement_finder_adapter const & adapter_; +}; + bool text_symbolizer_helper::next_line_placement() const { while (!geometries_to_process_.empty()) @@ -228,13 +390,13 @@ bool text_symbolizer_helper::next_line_placement() const continue; //Reexecute size check } - converter_.apply(**geo_itr_); - if (adapter_.status()) + if (mapnik::util::apply_visitor(apply_line_placement_visitor(converter_, adapter_), *geo_itr_)) { //Found a placement geo_itr_ = geometries_to_process_.erase(geo_itr_); return true; } + // No placement for this geometry. Keep it in geometries_to_process_ for next try. ++geo_itr_; } @@ -277,7 +439,7 @@ text_symbolizer_helper::text_symbolizer_helper( : base_symbolizer_helper(sym, feature, vars, prj_trans, width, height, scale_factor, t, query_extent), finder_(feature, vars, detector, dims_, *info_ptr_, font_manager, scale_factor), adapter_(finder_,true), - converter_(query_extent_, adapter_, sym_, t, prj_trans, affine_trans, feature, vars, scale_factor) + converter_(query_extent_, sym_, t, prj_trans, affine_trans, feature, vars, scale_factor) { // setup vertex converter value_bool clip = mapnik::get(sym_, feature_, vars_); @@ -301,13 +463,13 @@ void text_symbolizer_helper::init_marker() const { std::string filename = mapnik::get(sym_, feature_, vars_); if (filename.empty()) return; - boost::optional marker = marker_cache::instance().find(filename, true); - if (!marker) return; + std::shared_ptr marker = marker_cache::instance().find(filename, true); + if (marker->is()) return; agg::trans_affine trans; auto image_transform = get_optional(sym_, keys::image_transform); if (image_transform) evaluate_transform(trans, feature_, vars_, *image_transform); - double width = (*marker)->width(); - double height = (*marker)->height(); + double width = marker->width(); + double height = marker->height(); double px0 = - 0.5 * width; double py0 = - 0.5 * height; double px1 = 0.5 * width; @@ -328,7 +490,7 @@ void text_symbolizer_helper::init_marker() const value_double shield_dy = mapnik::get(sym_, feature_, vars_); pixel_position marker_displacement; marker_displacement.set(shield_dx,shield_dy); - finder_.set_marker(std::make_shared(*marker, trans), bbox, unlock_image, marker_displacement); + finder_.set_marker(std::make_shared(marker, trans), bbox, unlock_image, marker_displacement); } diff --git a/src/text/text_layout.cpp b/src/text/text_layout.cpp index fbaebe958..ff37d28e2 100644 --- a/src/text/text_layout.cpp +++ b/src/text/text_layout.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -214,17 +214,19 @@ void text_layout::break_line_icu(std::pair && line_limits) shape_text(line); double scaled_wrap_width = wrap_width_ * scale_factor_; - if (!scaled_wrap_width || line.width() < scaled_wrap_width) + if (scaled_wrap_width <= 0 || line.width() < scaled_wrap_width) { add_line(std::move(line)); return; } - if (text_ratio_) + if (text_ratio_ > 0) { double wrap_at; double string_width = line.width(); double string_height = line.line_height(); - for (double i = 1.0; ((wrap_at = string_width/i)/(string_height*i)) > text_ratio_ && (string_width/i) > scaled_wrap_width; i += 1.0) ; + for (double i = 1.0; + ((wrap_at = string_width/i)/(string_height*i)) > text_ratio_ && (string_width/i) > scaled_wrap_width; + i += 1.0) ; scaled_wrap_width = wrap_at; } @@ -243,10 +245,9 @@ void text_layout::break_line_icu(std::pair && line_limits) } breakitr->setText(text); - double current_line_length = 0; int last_break_position = static_cast(line.first_char()); - for (unsigned i=line.first_char(); i < line.last_char(); ++i) + for (unsigned i = line.first_char(); i < line.last_char(); ++i) { // TODO: character_spacing std::map::const_iterator width_itr = width_map_.find(i); @@ -256,7 +257,7 @@ void text_layout::break_line_icu(std::pair && line_limits) } if (current_line_length <= scaled_wrap_width) continue; - int break_position = wrap_before_ ? breakitr->preceding(i) : breakitr->following(i); + int break_position = wrap_before_ ? breakitr->preceding(i + 1) : breakitr->following(i); // following() returns a break position after the last word. So DONE should only be returned // when calling preceding. if (break_position <= last_break_position || break_position == static_cast(BreakIterator::DONE)) @@ -280,15 +281,18 @@ void text_layout::break_line_icu(std::pair && line_limits) { break_position = line.last_char(); } + bool adjust_for_space_character = break_position > 0 && text[break_position - 1] == 0x0020; - text_line new_line(last_break_position, break_position); - clear_cluster_widths(last_break_position, break_position); + text_line new_line(last_break_position, adjust_for_space_character ? break_position - 1 : break_position); + clear_cluster_widths(last_break_position, adjust_for_space_character ? break_position - 1 : break_position); shape_text(new_line); add_line(std::move(new_line)); + last_break_position = break_position; i = break_position - 1; current_line_length = 0; } + if (last_break_position == static_cast(line.first_char())) { // No line breaks => no reshaping required @@ -365,7 +369,7 @@ void text_layout::break_line(std::pair && line_limits) } if (current_line_length <= scaled_wrap_width) continue; - int break_position = wrap_before_ ? breaker.preceding(i) : breaker.following(i); + int break_position = wrap_before_ ? breaker.preceding(i + 1) : breaker.following(i); if (break_position <= last_break_position || break_position == static_cast(BreakIterator::DONE)) { break_position = breaker.following(i); diff --git a/src/text/text_line.cpp b/src/text/text_line.cpp index f66af1b78..f228e5b93 100644 --- a/src/text/text_line.cpp +++ b/src/text/text_line.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -59,7 +59,7 @@ void text_line::add_glyph(glyph_info && glyph, double scale_factor_) glyphs_width_ = advance; space_count_ = 0; } - else if (advance) + else if (advance > 0) { // Only add character spacing if the character is not a zero-width part of a cluster. width_ += advance + glyphs_.back().format->character_spacing * scale_factor_; diff --git a/src/text/text_properties.cpp b/src/text/text_properties.cpp index b1e9dd748..4b08c106b 100644 --- a/src/text/text_properties.cpp +++ b/src/text/text_properties.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/tiff_reader.cpp b/src/tiff_reader.cpp index 002b25cd4..dbafdf025 100644 --- a/src/tiff_reader.cpp +++ b/src/tiff_reader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -132,11 +132,11 @@ private: std::size_t height_; boost::optional > bbox_; unsigned bps_; + unsigned sample_format_; unsigned photometric_; unsigned bands_; unsigned planar_config_; unsigned compression_; - bool premultiplied_alpha_; bool has_alpha_; bool is_tiled_; @@ -153,11 +153,11 @@ public: unsigned height() const final; boost::optional > bounding_box() const final; inline bool has_alpha() const final { return has_alpha_; } - bool premultiplied_alpha() const final; - void read(unsigned x,unsigned y,image_data_rgba8& image) final; - image_data_any read(unsigned x, unsigned y, unsigned width, unsigned height) final; + void read(unsigned x,unsigned y,image_rgba8& image) final; + image_any read(unsigned x, unsigned y, unsigned width, unsigned height) final; // methods specific to tiff reader unsigned bits_per_sample() const { return bps_; } + unsigned sample_format() const { return sample_format_; } unsigned photometric() const { return photometric_; } bool is_tiled() const { return is_tiled_; } unsigned tile_width() const { return tile_width_; } @@ -169,14 +169,14 @@ private: tiff_reader(const tiff_reader&); tiff_reader& operator=(const tiff_reader&); void init(); - void read_generic(unsigned x,unsigned y,image_data_rgba8& image); - void read_stripped(unsigned x,unsigned y,image_data_rgba8& image); + void read_generic(std::size_t x,std::size_t y,image_rgba8& image); + void read_stripped(std::size_t x,std::size_t y,image_rgba8& image); template - void read_tiled(unsigned x,unsigned y, ImageData & image); + void read_tiled(std::size_t x,std::size_t y, ImageData & image); template - image_data_any read_any_gray(unsigned x, unsigned y, unsigned width, unsigned height); + image_any read_any_gray(std::size_t x, std::size_t y, std::size_t width, std::size_t height); TIFF* open(std::istream & input); }; @@ -211,11 +211,11 @@ tiff_reader::tiff_reader(std::string const& file_name) width_(0), height_(0), bps_(0), + sample_format_(SAMPLEFORMAT_UINT), photometric_(0), bands_(1), planar_config_(PLANARCONFIG_CONTIG), compression_(COMPRESSION_NONE), - premultiplied_alpha_(false), has_alpha_(false), is_tiled_(false) { @@ -235,11 +235,11 @@ tiff_reader::tiff_reader(char const* data, std::size_t size) width_(0), height_(0), bps_(0), + sample_format_(SAMPLEFORMAT_UINT), photometric_(0), bands_(1), planar_config_(PLANARCONFIG_CONTIG), compression_(COMPRESSION_NONE), - premultiplied_alpha_(false), has_alpha_(false), is_tiled_(false) { @@ -261,10 +261,12 @@ void tiff_reader::init() if (!tif) throw image_reader_exception("Can't open tiff file"); TIFFGetField(tif,TIFFTAG_BITSPERSAMPLE,&bps_); + TIFFGetField(tif,TIFFTAG_SAMPLEFORMAT,&sample_format_); TIFFGetField(tif,TIFFTAG_PHOTOMETRIC,&photometric_); TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &bands_); MAPNIK_LOG_DEBUG(tiff_reader) << "bits per sample: " << bps_; + MAPNIK_LOG_DEBUG(tiff_reader) << "sample format: " << sample_format_; MAPNIK_LOG_DEBUG(tiff_reader) << "photometric: " << photometric_; MAPNIK_LOG_DEBUG(tiff_reader) << "bands: " << bands_; @@ -303,10 +305,10 @@ void tiff_reader::init() &extrasamples, &sampleinfo)) { has_alpha_ = true; - if (extrasamples == 1 && - sampleinfo[0] == EXTRASAMPLE_ASSOCALPHA) + if (extrasamples > 0 && + sampleinfo[0] == EXTRASAMPLE_UNSPECIFIED) { - premultiplied_alpha_ = true; + throw std::runtime_error("Unspecified provided for extra samples to tiff reader."); } } // Try extracting bounding box from geoTIFF tags @@ -373,51 +375,45 @@ boost::optional > tiff_reader::bounding_box() const } template -bool tiff_reader::premultiplied_alpha() const -{ - return premultiplied_alpha_; -} - -template -void tiff_reader::read(unsigned x,unsigned y,image_data_rgba8& image) +void tiff_reader::read(unsigned x,unsigned y,image_rgba8& image) { if (read_method_==stripped) { - read_stripped(x,y,image); + read_stripped(static_cast(x),static_cast(y),image); } else if (read_method_==tiled) { - read_tiled(x,y,image); + read_tiled(static_cast(x),static_cast(y),image); } else { - read_generic(x,y,image); + read_generic(static_cast(x),static_cast(y),image); } } template template -image_data_any tiff_reader::read_any_gray(unsigned x0, unsigned y0, unsigned width, unsigned height) +image_any tiff_reader::read_any_gray(std::size_t x0, std::size_t y0, std::size_t width, std::size_t height) { - using image_data_type = ImageData; - using pixel_type = typename image_data_type::pixel_type; + using image_type = ImageData; + using pixel_type = typename image_type::pixel_type; if (read_method_ == tiled) { - image_data_type data(width,height); - read_tiled(x0, y0, data); - return image_data_any(std::move(data)); + image_type data(width,height); + read_tiled(x0, y0, data); + return image_any(std::move(data)); } else { TIFF* tif = open(stream_); if (tif) { - image_data_type data(width, height); + image_type data(width, height); std::size_t block_size = rows_per_strip_ > 0 ? rows_per_strip_ : tile_height_ ; - std::ptrdiff_t start_y = y0 - y0 % block_size; - std::ptrdiff_t end_y = std::min(y0 + height, static_cast(height_)); - std::ptrdiff_t start_x = x0; - std::ptrdiff_t end_x = std::min(x0 + width, static_cast(width_)); + std::size_t start_y = y0 - y0 % block_size; + std::size_t end_y = std::min(y0 + height, height_); + std::size_t start_x = x0; + std::size_t end_x = std::min(x0 + width, width_); std::size_t element_size = sizeof(pixel_type); std::size_t size_to_allocate = (TIFFScanlineSize(tif) + element_size - 1)/element_size; const std::unique_ptr scanline(new pixel_type[size_to_allocate]); @@ -425,14 +421,14 @@ image_data_any tiff_reader::read_any_gray(unsigned x0, unsigned y0, unsigned { if (-1 != TIFFReadScanline(tif, scanline.get(), y) && (y >= y0)) { - pixel_type * row = data.getRow(y - y0); + pixel_type * row = data.get_row(y - y0); std::transform(scanline.get() + start_x, scanline.get() + end_x, row, [](pixel_type const& p) { return p;}); } } - return image_data_any(std::move(data)); + return image_any(std::move(data)); } } - return image_data_any(); + return image_any(); } @@ -456,9 +452,9 @@ struct rgb8_to_rgba8 template struct tiff_reader_traits { - using image_data_type = T; - using pixel_type = typename image_data_type::pixel_type; - static bool read_tile(TIFF * tif, unsigned x, unsigned y, pixel_type* buf, std::size_t tile_width, std::size_t tile_height) + using image_type = T; + using pixel_type = typename image_type::pixel_type; + static bool read_tile(TIFF * tif, std::size_t x, std::size_t y, pixel_type* buf, std::size_t tile_width, std::size_t tile_height) { return (TIFFReadEncodedTile(tif, TIFFComputeTile(tif, x,y,0,0), buf, tile_width * tile_height * sizeof(pixel_type)) != -1); } @@ -466,14 +462,14 @@ struct tiff_reader_traits // default specialization that expands into RGBA template <> -struct tiff_reader_traits +struct tiff_reader_traits { using pixel_type = std::uint32_t; - static bool read_tile(TIFF * tif, unsigned x0, unsigned y0, pixel_type* buf, std::size_t tile_width, std::size_t tile_height) + static bool read_tile(TIFF * tif, std::size_t x0, std::size_t y0, pixel_type* buf, std::size_t tile_width, std::size_t tile_height) { if (TIFFReadRGBATile(tif, x0, y0, buf) != -1) { - for (unsigned y = 0; y < tile_height/2; ++y) + for (std::size_t y = 0; y < tile_height/2; ++y) { std::swap_ranges(buf + y * tile_width, buf + (y + 1) * tile_width, buf + (tile_height - y - 1) * tile_width); } @@ -486,12 +482,14 @@ struct tiff_reader_traits } template -image_data_any tiff_reader::read(unsigned x0, unsigned y0, unsigned width, unsigned height) +image_any tiff_reader::read(unsigned x, unsigned y, unsigned width, unsigned height) { if (width > 10000 || height > 10000) { throw image_reader_exception("Can't allocate tiff > 10000x10000"); } + std::size_t x0 = static_cast(x); + std::size_t y0 = static_cast(y); switch (photometric_) { case PHOTOMETRIC_MINISBLACK: @@ -501,67 +499,86 @@ image_data_any tiff_reader::read(unsigned x0, unsigned y0, unsigned width, un { case 8: { - return read_any_gray(x0, y0, width, height); - } - case 16: - { - return read_any_gray(x0, y0, width, height); - } - case 32: - { - return read_any_gray(x0, y0, width, height); - } - } - } -// read PHOTOMETRIC_RGB expand using RGBA interface -/* - case PHOTOMETRIC_RGB: - { - switch (bps_) - { - case 8: - { - TIFF* tif = open(stream_); - if (tif) + switch (sample_format_) { - image_data_rgba8 data(width, height); - std::size_t element_size = sizeof(detail::rgb8); - std::size_t size_to_allocate = (TIFFScanlineSize(tif) + element_size - 1)/element_size; - const std::unique_ptr scanline(new detail::rgb8[size_to_allocate]); - std::ptrdiff_t start_y = y0 - y0 % rows_per_strip_; - std::ptrdiff_t end_y = std::min(y0 + height, static_cast(height_)); - std::ptrdiff_t start_x = x0; - std::ptrdiff_t end_x = std::min(x0 + width, static_cast(width_)); - for (std::size_t y = start_y; y < end_y; ++y) - { - if (-1 != TIFFReadScanline(tif, scanline.get(), y)) - { - if (y >= y0) - { - image_data_rgba8::pixel_type * row = data.getRow(y - y0); - std::transform(scanline.get() + start_x, scanline.get() + end_x, row, detail::rgb8_to_rgba8()); - } - } - } - return image_data_any(std::move(data)); + case SAMPLEFORMAT_UINT: + { + return read_any_gray(x0, y0, width, height); + } + case SAMPLEFORMAT_INT: + { + return read_any_gray(x0, y0, width, height); + } + default: + { + throw std::runtime_error("tiff_reader: This sample format is not supported for this bits per sample"); + } } - return image_data_any(); } case 16: { - image_data_rgba8 data(width,height); - read(x0, y0, data); - return image_data_any(std::move(data)); + switch (sample_format_) + { + case SAMPLEFORMAT_UINT: + { + return read_any_gray(x0, y0, width, height); + } + case SAMPLEFORMAT_INT: + { + return read_any_gray(x0, y0, width, height); + } + default: + { + throw std::runtime_error("tiff_reader: This sample format is not supported for this bits per sample"); + } + } } case 32: { - image_data_rgba8 data(width,height); - read(x0, y0, data); - return image_data_any(std::move(data)); + switch (sample_format_) + { + case SAMPLEFORMAT_UINT: + { + return read_any_gray(x0, y0, width, height); + } + case SAMPLEFORMAT_INT: + { + return read_any_gray(x0, y0, width, height); + } + case SAMPLEFORMAT_IEEEFP: + { + return read_any_gray(x0, y0, width, height); + } + default: + { + throw std::runtime_error("tiff_reader: This sample format is not supported for this bits per sample"); + } + } + } + case 64: + { + switch (sample_format_) + { + case SAMPLEFORMAT_UINT: + { + return read_any_gray(x0, y0, width, height); + } + case SAMPLEFORMAT_INT: + { + return read_any_gray(x0, y0, width, height); + } + case SAMPLEFORMAT_IEEEFP: + { + return read_any_gray(x0, y0, width, height); + } + default: + { + throw std::runtime_error("tiff_reader: This sample format is not supported for this bits per sample"); + } + } } } } -*/ default: { //PHOTOMETRIC_PALETTE = 3; @@ -573,16 +590,16 @@ image_data_any tiff_reader::read(unsigned x0, unsigned y0, unsigned width, un //PHOTOMETRIC_ITULAB = 10; //PHOTOMETRIC_LOGL = 32844; //PHOTOMETRIC_LOGLUV = 32845; - image_data_rgba8 data(width,height); + image_rgba8 data(width,height, true, true); read(x0, y0, data); - return image_data_any(std::move(data)); + return image_any(std::move(data)); } } - return image_data_any(); + return image_any(); } template -void tiff_reader::read_generic(unsigned, unsigned, image_data_rgba8& image) +void tiff_reader::read_generic(std::size_t, std::size_t, image_rgba8& image) { TIFF* tif = open(stream_); if (tif) @@ -593,7 +610,7 @@ void tiff_reader::read_generic(unsigned, unsigned, image_data_rgba8& image) template template -void tiff_reader::read_tiled(unsigned x0,unsigned y0, ImageData & image) +void tiff_reader::read_tiled(std::size_t x0,std::size_t y0, ImageData & image) { using pixel_type = typename detail::tiff_reader_traits::pixel_type; @@ -601,33 +618,33 @@ void tiff_reader::read_tiled(unsigned x0,unsigned y0, ImageData & image) if (tif) { std::unique_ptr buf(new pixel_type[tile_width_*tile_height_]); - int width = image.width(); - int height = image.height(); - int start_y = (y0 / tile_height_) * tile_height_; - int end_y = ((y0 + height) / tile_height_ + 1) * tile_height_; - int start_x = (x0 / tile_width_) * tile_width_; - int end_x = ((x0 + width) / tile_width_ + 1) * tile_width_; - end_y = std::min(end_y, int(height_)); - end_x = std::min(end_x, int(width_)); + std::size_t width = image.width(); + std::size_t height = image.height(); + std::size_t start_y = (y0 / tile_height_) * tile_height_; + std::size_t end_y = ((y0 + height) / tile_height_ + 1) * tile_height_; + std::size_t start_x = (x0 / tile_width_) * tile_width_; + std::size_t end_x = ((x0 + width) / tile_width_ + 1) * tile_width_; + end_y = std::min(end_y, height_); + end_x = std::min(end_x, width_); - for (int y = start_y; y < end_y; y += tile_height_) + for (std::size_t y = start_y; y < end_y; y += tile_height_) { - int ty0 = std::max(y0, static_cast(y)) - y; - int ty1 = std::min(height + y0, static_cast(y + tile_height_)) - y; + std::size_t ty0 = std::max(y0, y) - y; + std::size_t ty1 = std::min(height + y0, y + tile_height_) - y; - for (int x = start_x; x < end_x; x += tile_width_) + for (std::size_t x = start_x; x < end_x; x += tile_width_) { if (!detail::tiff_reader_traits::read_tile(tif, x, y, buf.get(), tile_width_, tile_height_)) { - std::clog << "read_tile(...) failed at " << x << "/" << y << " for " << width_ << "/" << height_ << "\n"; + MAPNIK_LOG_DEBUG(tiff_reader) << "read_tile(...) failed at " << x << "/" << y << " for " << width_ << "/" << height_ << "\n"; break; } - int tx0 = std::max(x0, static_cast(x)); - int tx1 = std::min(width + x0, static_cast(x + tile_width_)); - int row = y + ty0 - y0; - for (int ty = ty0; ty < ty1; ++ty, ++row) + std::size_t tx0 = std::max(x0, x); + std::size_t tx1 = std::min(width + x0, x + tile_width_); + std::size_t row = y + ty0 - y0; + for (std::size_t ty = ty0; ty < ty1; ++ty, ++row) { - image.setRow(row, tx0 - x0, tx1 - x0, &buf[ty * tile_width_ + tx0 - x]); + image.set_row(row, tx0 - x0, tx1 - x0, &buf[ty * tile_width_ + tx0 - x]); } } } @@ -636,40 +653,36 @@ void tiff_reader::read_tiled(unsigned x0,unsigned y0, ImageData & image) template -void tiff_reader::read_stripped(unsigned x0,unsigned y0,image_data_rgba8& image) +void tiff_reader::read_stripped(std::size_t x0,std::size_t y0,image_rgba8& image) { TIFF* tif = open(stream_); if (tif) { - image_data_rgba8 strip(width_,rows_per_strip_,false); - int width=image.width(); - int height=image.height(); + image_rgba8 strip(width_,rows_per_strip_,false); + std::size_t width=image.width(); + std::size_t height=image.height(); - unsigned start_y=(y0/rows_per_strip_)*rows_per_strip_; - unsigned end_y=((y0+height)/rows_per_strip_+1)*rows_per_strip_; - bool laststrip=(static_cast(end_y) > height_)?true:false; - int row,tx0,tx1,ty0,ty1; + std::size_t start_y=(y0/rows_per_strip_)*rows_per_strip_; + std::size_t end_y=std::min(y0+height, height_); + std::size_t tx0,tx1,ty0,ty1; tx0=x0; - tx1=std::min(width+x0,static_cast(width_)); - - for (unsigned y=start_y; y < end_y; y+=rows_per_strip_) + tx1=std::min(width+x0,width_); + std::size_t row = 0; + for (std::size_t y=start_y; y < end_y; y+=rows_per_strip_) { ty0 = std::max(y0,y)-y; - ty1 = std::min(height+y0,y+rows_per_strip_)-y; + ty1 = std::min(end_y,y+rows_per_strip_)-y; - if (!TIFFReadRGBAStrip(tif,y,strip.getData())) + if (!TIFFReadRGBAStrip(tif,y,strip.data())) { - std::clog << "TIFFReadRGBAStrip failed at " << y << " for " << width_ << "/" << height_ << "\n"; + MAPNIK_LOG_DEBUG(tiff_reader) << "TIFFReadRGBAStrip failed at " << y << " for " << width_ << "/" << height_ << "\n"; break; } - row=y+ty0-y0; - - int n0=laststrip ? 0:(rows_per_strip_-ty1); - int n1=laststrip ? (ty1-ty0-1):(rows_per_strip_-ty0-1); - for (int n=n1;n>=n0;--n) + // This is in reverse because the TIFFReadRGBAStrip reads inverted + for (std::size_t ty = ty1; ty > ty0; --ty) { - image.setRow(row,tx0-x0,tx1-x0,&strip.getData()[n*width_+tx0]); + image.set_row(row,tx0-x0,tx1-x0,&strip.data()[(ty-1)*width_+tx0]); ++row; } } diff --git a/src/transform_expression.cpp b/src/transform_expression.cpp index e065ddc7e..34c704866 100644 --- a/src/transform_expression.cpp +++ b/src/transform_expression.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/transform_expression_grammar.cpp b/src/transform_expression_grammar.cpp index 767730de4..170b0a823 100644 --- a/src/transform_expression_grammar.cpp +++ b/src/transform_expression_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/unicode.cpp b/src/unicode.cpp index f6c059f60..cf36f555f 100644 --- a/src/unicode.cpp +++ b/src/unicode.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/utils.cpp b/src/util/utf_conv_win.cpp similarity index 96% rename from src/utils.cpp rename to src/util/utf_conv_win.cpp index f694faa18..7bfcbc29f 100644 --- a/src/utils.cpp +++ b/src/util/utf_conv_win.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,7 +22,7 @@ #ifdef _WINDOWS // windows specific methods for UTF8 from/to UTF16 -#include +#include #include #include #define NOMINMAX diff --git a/src/vertex_cache.cpp b/src/vertex_cache.cpp index d5a18a316..071b8d08b 100644 --- a/src/vertex_cache.cpp +++ b/src/vertex_cache.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/warp.cpp b/src/warp.cpp index 16a81492d..572974834 100644 --- a/src/warp.cpp +++ b/src/warp.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,7 +23,7 @@ // mapnik #include #include -#include +#include #include #include #include @@ -53,12 +53,12 @@ MAPNIK_DECL void warp_image (T & target, T const& source, proj_transform const& box2d const& target_ext, box2d const& source_ext, double offset_x, double offset_y, unsigned mesh_size, scaling_method_e scaling_method, double filter_factor) { - using image_data_type = T; - using pixel_type = typename image_data_type::pixel_type; - using pixfmt_pre = typename detail::agg_scaling_traits::pixfmt_pre; - using color_type = typename detail::agg_scaling_traits::color_type; + using image_type = T; + using pixel_type = typename image_type::pixel_type; + using pixfmt_pre = typename detail::agg_scaling_traits::pixfmt_pre; + using color_type = typename detail::agg_scaling_traits::color_type; using renderer_base = agg::renderer_base; - using interpolator_type = typename detail::agg_scaling_traits::interpolator_type; + using interpolator_type = typename detail::agg_scaling_traits::interpolator_type; constexpr std::size_t pixel_size = sizeof(pixel_type); @@ -70,8 +70,8 @@ MAPNIK_DECL void warp_image (T & target, T const& source, proj_transform const& std::size_t mesh_nx = std::ceil(source.width()/double(mesh_size) + 1); std::size_t mesh_ny = std::ceil(source.height()/double(mesh_size) + 1); - image_data xs(mesh_nx, mesh_ny); - image_data ys(mesh_nx, mesh_ny); + image_gray64f xs(mesh_nx, mesh_ny, false); + image_gray64f ys(mesh_nx, mesh_ny, false); // Precalculate reprojected mesh for(std::size_t j = 0; j < mesh_ny; ++j) @@ -83,11 +83,11 @@ MAPNIK_DECL void warp_image (T & target, T const& source, proj_transform const& ts.backward(&xs(i,j), &ys(i,j)); } } - prj_trans.backward(xs.getData(), ys.getData(), nullptr, mesh_nx*mesh_ny); + prj_trans.backward(xs.data(), ys.data(), nullptr, mesh_nx*mesh_ny); agg::rasterizer_scanline_aa<> rasterizer; agg::scanline_bin scanline; - agg::rendering_buffer buf(target.getBytes(), + agg::rendering_buffer buf(target.bytes(), target.width(), target.height(), target.width() * pixel_size); @@ -95,7 +95,7 @@ MAPNIK_DECL void warp_image (T & target, T const& source, proj_transform const& renderer_base rb(pixf); rasterizer.clip_box(0, 0, target.width(), target.height()); agg::rendering_buffer buf_tile( - const_cast(source.getBytes()), + const_cast(source.bytes()), source.width(), source.height(), source.width() * pixel_size); @@ -138,13 +138,13 @@ MAPNIK_DECL void warp_image (T & target, T const& source, proj_transform const& interpolator_type interpolator(tr); if (scaling_method == SCALING_NEAR) { - using span_gen_type = typename detail::agg_scaling_traits::span_image_filter; + using span_gen_type = typename detail::agg_scaling_traits::span_image_filter; span_gen_type sg(ia, interpolator); agg::render_scanlines_bin(rasterizer, scanline, rb, sa, sg); } else { - using span_gen_type = typename detail::agg_scaling_traits::span_image_resample_affine; + using span_gen_type = typename detail::agg_scaling_traits::span_image_resample_affine; agg::image_filter_lut filter; detail::set_scaling_method(filter, scaling_method, filter_factor); span_gen_type sg(ia, interpolator, filter); @@ -172,16 +172,16 @@ struct warp_image_visitor scaling_method_(scaling_method), filter_factor_(filter_factor) {} - void operator() (image_data_null const&) {} + void operator() (image_null const&) {} template void operator() (T const& source) { - using image_data_type = T; + using image_type = T; //source and target image data types must match - if (target_raster_.data_.template is()) + if (target_raster_.data_.template is()) { - image_data_type & target = util::get(target_raster_.data_); + image_type & target = util::get(target_raster_.data_); warp_image (target, source, prj_trans_, target_raster_.ext_, source_ext_, offset_x_, offset_y_, mesh_size_, scaling_method_, filter_factor_); } @@ -210,16 +210,16 @@ void reproject_and_scale_raster(raster & target, raster const& source, util::apply_visitor(warper, source.data_); } -template MAPNIK_DECL void warp_image (image_data_rgba8&, image_data_rgba8 const&, proj_transform const&, +template MAPNIK_DECL void warp_image (image_rgba8&, image_rgba8 const&, proj_transform const&, box2d const&, box2d const&, double, double, unsigned, scaling_method_e, double); -template MAPNIK_DECL void warp_image (image_data_gray8&, image_data_gray8 const&, proj_transform const&, +template MAPNIK_DECL void warp_image (image_gray8&, image_gray8 const&, proj_transform const&, box2d const&, box2d const&, double, double, unsigned, scaling_method_e, double); -template MAPNIK_DECL void warp_image (image_data_gray16&, image_data_gray16 const&, proj_transform const&, +template MAPNIK_DECL void warp_image (image_gray16&, image_gray16 const&, proj_transform const&, box2d const&, box2d const&, double, double, unsigned, scaling_method_e, double); -template MAPNIK_DECL void warp_image (image_data_gray32f&, image_data_gray32f const&, proj_transform const&, +template MAPNIK_DECL void warp_image (image_gray32f&, image_gray32f const&, proj_transform const&, box2d const&, box2d const&, double, double, unsigned, scaling_method_e, double); diff --git a/src/webp_reader.cpp b/src/webp_reader.cpp index 6add17485..fbd046064 100644 --- a/src/webp_reader.cpp +++ b/src/webp_reader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -124,9 +124,8 @@ public: unsigned height() const final; boost::optional > bounding_box() const final; inline bool has_alpha() const final { return has_alpha_; } - bool premultiplied_alpha() const final { return false; } - void read(unsigned x,unsigned y,image_data_rgba8& image) final; - image_data_any read(unsigned x, unsigned y, unsigned width, unsigned height) final; + void read(unsigned x,unsigned y,image_rgba8& image) final; + image_any read(unsigned x, unsigned y, unsigned width, unsigned height) final; private: void init(); }; @@ -237,7 +236,7 @@ boost::optional > webp_reader::bounding_box() const } template -void webp_reader::read(unsigned x0, unsigned y0,image_data_rgba8& image) +void webp_reader::read(unsigned x0, unsigned y0,image_rgba8& image) { WebPDecoderConfig config; config_guard guard(config); @@ -258,7 +257,7 @@ void webp_reader::read(unsigned x0, unsigned y0,image_data_rgba8& image) } config.output.colorspace = MODE_RGBA; - config.output.u.RGBA.rgba = reinterpret_cast(image.getBytes()); + config.output.u.RGBA.rgba = reinterpret_cast(image.bytes()); config.output.u.RGBA.stride = 4 * image.width(); config.output.u.RGBA.size = image.width() * image.height() * 4; config.output.is_external_memory = 1; @@ -269,11 +268,11 @@ void webp_reader::read(unsigned x0, unsigned y0,image_data_rgba8& image) } template -image_data_any webp_reader::read(unsigned x, unsigned y, unsigned width, unsigned height) +image_any webp_reader::read(unsigned x, unsigned y, unsigned width, unsigned height) { - image_data_rgba8 data(width,height); + image_rgba8 data(width,height); read(x, y, data); - return image_data_any(std::move(data)); + return image_any(std::move(data)); } } diff --git a/src/well_known_srs.cpp b/src/well_known_srs.cpp index 8aaf7ab18..d3296effa 100644 --- a/src/well_known_srs.cpp +++ b/src/well_known_srs.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/wkb.cpp b/src/wkb.cpp index 8e7bf62d7..19b31ca5c 100644 --- a/src/wkb.cpp +++ b/src/wkb.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,24 +25,16 @@ #include #include #include -#include -#include #include #include +#include namespace mapnik { -using CoordinateArray = coord_array; - struct wkb_reader : util::noncopyable { private: - enum wkbByteOrder { - wkbXDR=0, - wkbNDR=1 - }; - const char* wkb_; std::size_t size_; std::size_t pos_; @@ -84,7 +76,7 @@ public: wkbMultiLineStringZM=3005, wkbMultiPolygonZM=3006, wkbGeometryCollectionZM=3007 - }; + }; wkb_reader(const char* wkb, std::size_t size, wkbFormat format) : wkb_(wkb), @@ -125,83 +117,84 @@ public: needSwap_ = byteOrder_ ? wkbXDR : wkbNDR; } - void read(geometry_container & paths) + mapnik::geometry::geometry read() { + mapnik::geometry::geometry geom = mapnik::geometry::geometry_empty(); int type = read_integer(); - switch (type) { case wkbPoint: - read_point(paths); + geom = read_point(); break; case wkbLineString: - read_linestring(paths); + geom = read_linestring(); break; case wkbPolygon: - read_polygon(paths); + geom = read_polygon(); break; case wkbMultiPoint: - read_multipoint(paths); + geom = read_multipoint(); break; case wkbMultiLineString: - read_multilinestring(paths); + geom = read_multilinestring(); break; case wkbMultiPolygon: - read_multipolygon(paths); + geom = read_multipolygon(); break; case wkbGeometryCollection: - read_collection(paths); + geom = read_collection(); break; case wkbPointZ: case wkbPointM: - read_point_xyz(paths); + geom = read_point(); break; case wkbPointZM: - read_point_xyzm(paths); + geom = read_point(); break; case wkbLineStringZ: case wkbLineStringM: - read_linestring_xyz(paths); + geom = read_linestring(); break; case wkbLineStringZM: - read_linestring_xyzm(paths); + geom = read_linestring(); break; case wkbPolygonZ: case wkbPolygonM: - read_polygon_xyz(paths); + geom = read_polygon(); break; case wkbPolygonZM: - read_polygon_xyzm(paths); + geom = read_polygon(); break; case wkbMultiPointZ: case wkbMultiPointM: - read_multipoint_xyz(paths); + geom = read_multipoint(); break; case wkbMultiPointZM: - read_multipoint_xyzm(paths); + geom = read_multipoint(); break; case wkbMultiLineStringZ: case wkbMultiLineStringM: - read_multilinestring_xyz(paths); + geom = read_multilinestring(); break; case wkbMultiLineStringZM: - read_multilinestring_xyzm(paths); + geom = read_multilinestring(); break; case wkbMultiPolygonZ: case wkbMultiPolygonM: - read_multipolygon_xyz(paths); + geom = read_multipolygon(); break; case wkbMultiPolygonZM: - read_multipolygon_xyzm(paths); + geom = read_multipolygon(); break; case wkbGeometryCollectionZ: case wkbGeometryCollectionM: case wkbGeometryCollectionZM: - read_collection(paths); + geom = read_collection(); break; default: break; } + return geom; } private: @@ -238,329 +231,136 @@ private: return d; } - void read_coords(CoordinateArray& ar) + template + void read_coords(Ring & ring, std::size_t num_points) { - if (! needSwap_) + double x,y; + if (!needSwap_) { - for (auto & coord : ar) + for (std::size_t i = 0; i < num_points; ++i) { - read_double_ndr(wkb_ + pos_, coord.x); - read_double_ndr(wkb_ + pos_ + 8, coord.y); + read_double_ndr(wkb_ + pos_, x); + read_double_ndr(wkb_ + pos_ + 8, y); + ring.emplace_back(x,y); pos_ += 16; // skip XY + if (Z) pos_ += 8; + if (M) pos_ += 8; } } else { - for (auto & coord : ar) + for (std::size_t i = 0; i < num_points; ++i) { - read_double_xdr(wkb_ + pos_, coord.x); - read_double_xdr(wkb_ + pos_ + 8, coord.y); + read_double_xdr(wkb_ + pos_, x); + read_double_xdr(wkb_ + pos_ + 8, y); + ring.emplace_back(x,y); pos_ += 16; // skip XY + if (Z) pos_ += 8; + if (M) pos_ += 8; } } } - void read_coords_xyz(CoordinateArray& ar) - { - if (! needSwap_) - { - for (auto & coord : ar) - { - read_double_ndr(wkb_ + pos_, coord.x); - read_double_ndr(wkb_ + pos_ + 8, coord.y); - pos_ += 24; // skip XYZ - } - } - else - { - for (auto & coord : ar) - { - read_double_xdr(wkb_ + pos_, coord.x); - read_double_xdr(wkb_ + pos_ + 8, coord.y); - pos_ += 24; // skip XYZ - } - } - } - - void read_coords_xyzm(CoordinateArray& ar) - { - if (! needSwap_) - { - for (auto & coord : ar) - { - read_double_ndr(wkb_ + pos_, coord.x); - read_double_ndr(wkb_ + pos_ + 8, coord.y); - pos_ += 32; // skip XYZM - } - } - else - { - for (auto & coord : ar) - { - read_double_xdr(wkb_ + pos_, coord.x); - read_double_xdr(wkb_ + pos_ + 8, coord.y); - pos_ += 32; // skip XYZM - } - } - } - - void read_point(geometry_container & paths) + template + mapnik::geometry::point read_point() { double x = read_double(); double y = read_double(); - auto pt = std::make_unique(geometry_type::types::Point); - pt->move_to(x, y); - paths.push_back(pt.release()); + if (Z) pos_ += 8; + if (M) pos_ += 8; + return mapnik::geometry::point(x, y); } - void read_multipoint(geometry_container & paths) + template + mapnik::geometry::multi_point read_multipoint() { + mapnik::geometry::multi_point multi_point; int num_points = read_integer(); + multi_point.reserve(num_points); for (int i = 0; i < num_points; ++i) { pos_ += 5; - read_point(paths); + multi_point.emplace_back(read_point()); } + return multi_point; } - void read_point_xyz(geometry_container & paths) - { - double x = read_double(); - double y = read_double(); - auto pt = std::make_unique(geometry_type::types::Point); - pos_ += 8; // double z = read_double(); - pt->move_to(x, y); - paths.push_back(pt.release()); - } - - void read_point_xyzm(geometry_container & paths) - { - double x = read_double(); - double y = read_double(); - auto pt = std::make_unique(geometry_type::types::Point); - pos_ += 16; - pt->move_to(x, y); - paths.push_back(pt.release()); - } - - void read_multipoint_xyz(geometry_container & paths) - { - int num_points = read_integer(); - for (int i = 0; i < num_points; ++i) - { - pos_ += 5; - read_point_xyz(paths); - } - } - - void read_multipoint_xyzm(geometry_container & paths) - { - int num_points = read_integer(); - for (int i = 0; i < num_points; ++i) - { - pos_ += 5; - read_point_xyzm(paths); - } - } - - void read_linestring(geometry_container & paths) + template + mapnik::geometry::line_string read_linestring() { + mapnik::geometry::line_string line; int num_points = read_integer(); if (num_points > 0) { - CoordinateArray ar(num_points); - read_coords(ar); - auto line = std::make_unique(geometry_type::types::LineString); - line->move_to(ar[0].x, ar[0].y); - for (int i = 1; i < num_points; ++i) - { - line->line_to(ar[i].x, ar[i].y); - } - paths.push_back(line.release()); + line.reserve(num_points); + read_coords, M, Z>(line, num_points); } + return line; } - void read_multilinestring(geometry_container & paths) + template + mapnik::geometry::multi_line_string read_multilinestring() { int num_lines = read_integer(); + mapnik::geometry::multi_line_string multi_line; + multi_line.reserve(num_lines); for (int i = 0; i < num_lines; ++i) { pos_ += 5; - read_linestring(paths); + multi_line.push_back(read_linestring()); } + return multi_line; } - void read_linestring_xyz(geometry_container & paths) - { - int num_points = read_integer(); - if (num_points > 0) - { - CoordinateArray ar(num_points); - read_coords_xyz(ar); - auto line = std::make_unique(geometry_type::types::LineString); - line->move_to(ar[0].x, ar[0].y); - for (int i = 1; i < num_points; ++i) - { - line->line_to(ar[i].x, ar[i].y); - } - paths.push_back(line.release()); - } - } - - void read_linestring_xyzm(geometry_container & paths) - { - int num_points = read_integer(); - if (num_points > 0) - { - CoordinateArray ar(num_points); - read_coords_xyzm(ar); - auto line = std::make_unique(geometry_type::types::LineString); - line->move_to(ar[0].x, ar[0].y); - for (int i = 1; i < num_points; ++i) - { - line->line_to(ar[i].x, ar[i].y); - } - paths.push_back(line.release()); - } - } - - void read_multilinestring_xyz(geometry_container & paths) - { - int num_lines = read_integer(); - for (int i = 0; i < num_lines; ++i) - { - pos_ += 5; - read_linestring_xyz(paths); - } - } - - void read_multilinestring_xyzm(geometry_container & paths) - { - int num_lines = read_integer(); - for (int i = 0; i < num_lines; ++i) - { - pos_ += 5; - read_linestring_xyzm(paths); - } - } - - void read_polygon(geometry_container & paths) + template + mapnik::geometry::polygon read_polygon() { int num_rings = read_integer(); - if (num_rings > 0) + mapnik::geometry::polygon poly; + if (num_rings > 1) { - auto poly = std::make_unique(geometry_type::types::Polygon); - for (int i = 0; i < num_rings; ++i) - { - int num_points = read_integer(); - if (num_points > 0) - { - CoordinateArray ar(num_points); - read_coords(ar); - poly->move_to(ar[0].x, ar[0].y); - for (int j = 1; j < num_points ; ++j) - { - poly->line_to(ar[j].x, ar[j].y); - } - poly->close_path(); - } - } - if (poly->size() > 3) // ignore if polygon has less than (3 + close_path) vertices - paths.push_back(poly.release()); + poly.interior_rings.reserve(num_rings - 1); } + + for (int i = 0; i < num_rings; ++i) + { + mapnik::geometry::linear_ring ring; + int num_points = read_integer(); + if (num_points > 0) + { + ring.reserve(num_points); + read_coords, M, Z>(ring, num_points); + } + if ( i == 0) poly.set_exterior_ring(std::move(ring)); + else poly.add_hole(std::move(ring)); + } + return poly; } - void read_multipolygon(geometry_container & paths) + template + mapnik::geometry::multi_polygon read_multipolygon() { int num_polys = read_integer(); + mapnik::geometry::multi_polygon multi_poly; for (int i = 0; i < num_polys; ++i) { pos_ += 5; - read_polygon(paths); + multi_poly.push_back(read_polygon()); } + return multi_poly; } - void read_polygon_xyz(geometry_container & paths) - { - int num_rings = read_integer(); - if (num_rings > 0) - { - auto poly = std::make_unique(geometry_type::types::Polygon); - for (int i = 0; i < num_rings; ++i) - { - int num_points = read_integer(); - if (num_points > 0) - { - CoordinateArray ar(num_points); - read_coords_xyz(ar); - poly->move_to(ar[0].x, ar[0].y); - for (int j = 1; j < num_points; ++j) - { - poly->line_to(ar[j].x, ar[j].y); - } - poly->close_path(); - } - } - if (poly->size() > 2) // ignore if polygon has less than 3 vertices - paths.push_back(poly.release()); - } - } - - void read_polygon_xyzm(geometry_container & paths) - { - int num_rings = read_integer(); - if (num_rings > 0) - { - auto poly = std::make_unique(geometry_type::types::Polygon); - for (int i = 0; i < num_rings; ++i) - { - int num_points = read_integer(); - if (num_points > 0) - { - CoordinateArray ar(num_points); - read_coords_xyzm(ar); - poly->move_to(ar[0].x, ar[0].y); - for (int j = 1; j < num_points; ++j) - { - poly->line_to(ar[j].x, ar[j].y); - } - poly->close_path(); - } - } - if (poly->size() > 2) // ignore if polygon has less than 3 vertices - paths.push_back(poly.release()); - } - } - - void read_multipolygon_xyz(geometry_container & paths) - { - int num_polys = read_integer(); - for (int i = 0; i < num_polys; ++i) - { - pos_ += 5; - read_polygon_xyz(paths); - } - } - - void read_multipolygon_xyzm(geometry_container & paths) - { - int num_polys = read_integer(); - for (int i = 0; i < num_polys; ++i) - { - pos_ += 5; - read_polygon_xyzm(paths); - } - } - - void read_collection(geometry_container & paths) + mapnik::geometry::geometry_collection read_collection() { int num_geometries = read_integer(); + mapnik::geometry::geometry_collection collection; for (int i = 0; i < num_geometries; ++i) { pos_ += 1; // skip byte order - read(paths); - } - } + collection.push_back(read()); + } + return collection; + } std::string wkb_geometry_type_string(int type) { @@ -595,7 +395,7 @@ private: case wkbGeometryCollection: s << "GeometryCollection"; break; case wkbGeometryCollectionZ: s << "GeometryCollectionZ"; break; case wkbGeometryCollectionM: s << "GeometryCollectionM"; break; - case wkbGeometryCollectionZM: s << "GeometryCollectionZM"; break; + case wkbGeometryCollectionZM:s << "GeometryCollectionZM"; break; default: s << "wkbUnknown(" << type << ")"; break; } @@ -604,17 +404,15 @@ private: }; -bool geometry_utils::from_wkb(geometry_container& paths, - const char* wkb, - unsigned size, - wkbFormat format) +mapnik::geometry::geometry geometry_utils::from_wkb(const char* wkb, + std::size_t size, + wkbFormat format) { - std::size_t geom_count = paths.size(); wkb_reader reader(wkb, size, format); - reader.read(paths); - if (paths.size() > geom_count) - return true; - return false; + mapnik::geometry::geometry geom(reader.read()); + // note: this will only be applied to polygons + mapnik::geometry::correct(geom); + return geom; } -} +} // namespace mapnik diff --git a/src/wkt/build.py b/src/wkt/build.py index c1c4f70af..e925cf497 100644 --- a/src/wkt/build.py +++ b/src/wkt/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2014 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,15 +17,14 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os from glob import glob Import('env') lib_env = env.Clone() -if 'g++' in env['CXX']: - lib_env.Append(CXXFLAGS='-fPIC') +lib_env.Append(CXXFLAGS='-fPIC') name = "mapnik-wkt" lib = lib_env.StaticLibrary(name, glob('./' + '*.cpp'), LIBS=[]) diff --git a/src/wkt/mapnik_wkt_generator_grammar.cpp b/src/wkt/mapnik_wkt_generator_grammar.cpp index 52636b8ea..07813fcc8 100644 --- a/src/wkt/mapnik_wkt_generator_grammar.cpp +++ b/src/wkt/mapnik_wkt_generator_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,14 +21,13 @@ *****************************************************************************/ #include -#include #include #include namespace mapnik { namespace wkt { using sink_type = std::back_insert_iterator; -template struct wkt_generator; -template struct wkt_multi_generator; +template struct wkt_generator_grammar>; +template struct wkt_generator_grammar>; }} diff --git a/src/wkt/mapnik_wkt_grammar.cpp b/src/wkt/mapnik_wkt_grammar.cpp index b5d299674..aea52a917 100644 --- a/src/wkt/mapnik_wkt_grammar.cpp +++ b/src/wkt/mapnik_wkt_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,6 +24,8 @@ #include namespace mapnik { namespace wkt { + using iterator_type = std::string::const_iterator; -template struct wkt_collection_grammar; +template struct wkt_grammar; + }} diff --git a/src/xml_tree.cpp b/src/xml_tree.cpp index e46f6a4f2..e342e6861 100644 --- a/src/xml_tree.cpp +++ b/src/xml_tree.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -68,6 +68,7 @@ struct name_trait DEFINE_NAME_TRAIT( double, "double") DEFINE_NAME_TRAIT( float, "float") DEFINE_NAME_TRAIT( unsigned, "unsigned") +DEFINE_NAME_TRAIT( int, "int") DEFINE_NAME_TRAIT( boolean_type, "boolean_type") #ifdef BIGINT DEFINE_NAME_TRAIT( mapnik::value_integer, "long long" ) @@ -98,7 +99,7 @@ struct name_trait< mapnik::enumeration > } }; -xml_tree::xml_tree(std::string const& encoding) +xml_tree::xml_tree() : node_(*this, ""), file_() { @@ -413,6 +414,7 @@ std::string xml_node::line_to_string() const compile_get_opt_attr(boolean_type); compile_get_opt_attr(std::string); +compile_get_opt_attr(int); compile_get_opt_attr(unsigned); compile_get_opt_attr(mapnik::value_integer); compile_get_opt_attr(float); @@ -427,6 +429,7 @@ compile_get_opt_attr(vertical_alignment_e); compile_get_opt_attr(horizontal_alignment_e); compile_get_opt_attr(justify_alignment_e); compile_get_opt_attr(text_upright_e); +compile_get_opt_attr(direction_e); compile_get_opt_attr(halo_rasterizer_e); compile_get_opt_attr(expression_ptr); compile_get_opt_attr(font_feature_settings); diff --git a/test/build.py b/test/build.py new file mode 100644 index 000000000..c600d01bc --- /dev/null +++ b/test/build.py @@ -0,0 +1,62 @@ +import os +import glob +from copy import copy + +Import ('env') + +test_env = env.Clone() + +if not env['CPP_TESTS']: + for cpp_test_bin in glob.glob('./*/*-bin'): + os.unlink(cpp_test_bin) +else: + test_env['LIBS'] = [env['MAPNIK_NAME']] + test_env.AppendUnique(LIBS='mapnik-wkt') + test_env.AppendUnique(LIBS='mapnik-json') + test_env.AppendUnique(LIBS=copy(env['LIBMAPNIK_LIBS'])) + if env['RUNTIME_LINK'] == 'static' and env['PLATFORM'] == 'Linux': + test_env.AppendUnique(LIBS='dl') + test_env.AppendUnique(CXXFLAGS='-g') + test_env['CXXFLAGS'] = copy(test_env['LIBMAPNIK_CXXFLAGS']) + test_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES']) + if test_env['HAS_CAIRO']: + test_env.PrependUnique(CPPPATH=test_env['CAIRO_CPPPATHS']) + test_env.Append(CPPDEFINES = '-DHAVE_CAIRO') + test_env.PrependUnique(CPPPATH=['./']) + if test_env['PLATFORM'] == 'Linux': + test_env['LINKFLAGS'].append('-pthread') + test_env.AppendUnique(LIBS='boost_program_options%s' % env['BOOST_APPEND']) + test_env_local = test_env.Clone() + + + # unit tests + sources = glob.glob('./unit/*/*.cpp') + sources.extend(glob.glob('./unit/*.cpp')) + test_program = test_env_local.Program("./unit/run", source=sources) + Depends(test_program, env.subst('../src/%s' % env['MAPNIK_LIB_NAME'])) + Depends(test_program, env.subst('../src/json/libmapnik-json${LIBSUFFIX}')) + Depends(test_program, env.subst('../src/wkt/libmapnik-wkt${LIBSUFFIX}')) + if 'install' in COMMAND_LINE_TARGETS: + env.Alias('install',test_program) + + # standalone tests + for standalone in glob.glob('./standalone/*cpp'): + test_program2 = test_env_local.Program(standalone.replace('.cpp','-bin'), source=standalone) + Depends(test_program, env.subst('../src/%s' % env['MAPNIK_LIB_NAME'])) + if 'install' in COMMAND_LINE_TARGETS: + env.Alias('install',test_program2) + + # visual tests + source = Split( + """ + visual/report.cpp + visual/runner.cpp + visual/run.cpp + """ + ) + test_program3 = test_env_local.Program('visual/run', source=source) + Depends(test_program, env.subst('../src/%s' % env['MAPNIK_LIB_NAME'])) + + # build locally if installing + if 'install' in COMMAND_LINE_TARGETS: + env.Alias('install',test_program3) diff --git a/tests/cxx/catch.hpp b/test/catch.hpp similarity index 92% rename from tests/cxx/catch.hpp rename to test/catch.hpp index 6b8dfb5eb..5b616a2b6 100644 --- a/tests/cxx/catch.hpp +++ b/test/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v1.0 build 53 (master branch) - * Generated: 2014-08-20 08:08:19.533804 + * CATCH v1.1 build 1 (master branch) + * Generated: 2015-03-27 18:00:16.346230 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -18,26 +18,31 @@ #define TWOBLUECUBES_CATCH_SUPPRESS_WARNINGS_H_INCLUDED #ifdef __clang__ -#pragma clang diagnostic ignored "-Wglobal-constructors" -#pragma clang diagnostic ignored "-Wvariadic-macros" -#pragma clang diagnostic ignored "-Wc99-extensions" -#pragma clang diagnostic ignored "-Wunused-variable" -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wpadded" -#pragma clang diagnostic ignored "-Wc++98-compat" -#pragma clang diagnostic ignored "-Wc++98-compat-pedantic" +# ifdef __ICC // icpc defines the __clang__ macro +# pragma warning(push) +# pragma warning(disable: 161 1682) +# else // __ICC +# pragma clang diagnostic ignored "-Wglobal-constructors" +# pragma clang diagnostic ignored "-Wvariadic-macros" +# pragma clang diagnostic ignored "-Wc99-extensions" +# pragma clang diagnostic ignored "-Wunused-variable" +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wpadded" +# pragma clang diagnostic ignored "-Wc++98-compat" +# pragma clang diagnostic ignored "-Wc++98-compat-pedantic" +# endif #elif defined __GNUC__ -#pragma GCC diagnostic ignored "-Wvariadic-macros" -#pragma GCC diagnostic ignored "-Wunused-variable" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpadded" +# pragma GCC diagnostic ignored "-Wvariadic-macros" +# pragma GCC diagnostic ignored "-Wunused-variable" +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpadded" #endif -#ifdef CATCH_CONFIG_MAIN -# define CATCH_CONFIG_RUNNER +#if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER) +# define CATCH_IMPL #endif -#ifdef CATCH_CONFIG_RUNNER +#ifdef CATCH_IMPL # ifndef CLARA_CONFIG_MAIN # define CLARA_CONFIG_MAIN_NOT_DEFINED # define CLARA_CONFIG_MAIN @@ -135,6 +140,10 @@ // Visual C++ #ifdef _MSC_VER +#if (_MSC_VER >= 1600) +#define CATCH_CONFIG_CPP11_NULLPTR +#endif + #if (_MSC_VER >= 1310 ) // (VC++ 7.0+) //#define CATCH_CONFIG_SFINAE // Not confirmed #endif @@ -176,8 +185,16 @@ namespace Catch { class NonCopyable { - NonCopyable( NonCopyable const& ); - void operator = ( NonCopyable const& ); +#ifdef CATCH_CPP11_OR_GREATER + NonCopyable( NonCopyable const& ) = delete; + NonCopyable( NonCopyable && ) = delete; + NonCopyable& operator = ( NonCopyable const& ) = delete; + NonCopyable& operator = ( NonCopyable && ) = delete; +#else + NonCopyable( NonCopyable const& info ); + NonCopyable& operator = ( NonCopyable const& ); +#endif + protected: NonCopyable() {} virtual ~NonCopyable(); @@ -215,6 +232,7 @@ namespace Catch { void toLowerInPlace( std::string& s ); std::string toLower( std::string const& s ); std::string trim( std::string const& str ); + bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ); struct pluralise { pluralise( std::size_t count, std::string const& label ); @@ -237,6 +255,7 @@ namespace Catch { # endif bool empty() const; bool operator == ( SourceLineInfo const& other ) const; + bool operator < ( SourceLineInfo const& other ) const; std::string file; std::size_t line; @@ -467,7 +486,7 @@ namespace Catch { struct ITestCaseRegistry { virtual ~ITestCaseRegistry(); virtual std::vector const& getAllTests() const = 0; - virtual void getFilteredTests( TestSpec const& testSpec, IConfig const& config, std::vector& matchingTestCases ) const = 0; + virtual void getFilteredTests( TestSpec const& testSpec, IConfig const& config, std::vector& matchingTestCases, bool negated = false ) const = 0; }; } @@ -603,7 +622,9 @@ namespace Catch { Exception = 0x100 | FailureBit, ThrewException = Exception | 1, - DidntThrowException = Exception | 2 + DidntThrowException = Exception | 2, + + FatalErrorCondition = 0x200 | FailureBit }; }; @@ -1034,9 +1055,49 @@ inline id performOptionalSelector( id obj, SEL sel ) { #endif +#ifdef CATCH_CPP11_OR_GREATER +#include +#include +#endif + namespace Catch { + +// Why we're here. +template +std::string toString( T const& value ); + +// Built in overloads + +std::string toString( std::string const& value ); +std::string toString( std::wstring const& value ); +std::string toString( const char* const value ); +std::string toString( char* const value ); +std::string toString( const wchar_t* const value ); +std::string toString( wchar_t* const value ); +std::string toString( int value ); +std::string toString( unsigned long value ); +std::string toString( unsigned int value ); +std::string toString( const double value ); +std::string toString( const float value ); +std::string toString( bool value ); +std::string toString( char value ); +std::string toString( signed char value ); +std::string toString( unsigned char value ); + +#ifdef CATCH_CONFIG_CPP11_NULLPTR +std::string toString( std::nullptr_t ); +#endif + +#ifdef __OBJC__ + std::string toString( NSString const * const& nsstring ); + std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ); + std::string toString( NSObject* const& nsObject ); +#endif + namespace Detail { + extern std::string unprintableString; + // SFINAE is currently disabled by default for all compilers. // If the non SFINAE version of IsStreamInsertable is ambiguous for you // and your compiler supports SFINAE, try #defining CATCH_CONFIG_SFINAE @@ -1077,10 +1138,38 @@ namespace Detail { #endif +#if defined(CATCH_CPP11_OR_GREATER) + template::value + > + struct EnumStringMaker + { + static std::string convert( T const& ) { return unprintableString; } + }; + + template + struct EnumStringMaker + { + static std::string convert( T const& v ) + { + return ::Catch::toString( + static_cast::type>(v) + ); + } + }; +#endif template struct StringMakerBase { +#if defined(CATCH_CPP11_OR_GREATER) template - static std::string convert( T const& ) { return "{?}"; } + static std::string convert( T const& v ) + { + return EnumStringMaker::convert( v ); + } +#else + template + static std::string convert( T const& ) { return unprintableString; } +#endif }; template<> @@ -1102,9 +1191,6 @@ namespace Detail { } // end namespace Detail -template -std::string toString( T const& value ); - template struct StringMaker : Detail::StringMakerBase::value> {}; @@ -1135,12 +1221,59 @@ namespace Detail { std::string rangeToString( InputIterator first, InputIterator last ); } +//template +//struct StringMaker > { +// static std::string convert( std::vector const& v ) { +// return Detail::rangeToString( v.begin(), v.end() ); +// } +//}; + template -struct StringMaker > { - static std::string convert( std::vector const& v ) { - return Detail::rangeToString( v.begin(), v.end() ); +std::string toString( std::vector const& v ) { + return Detail::rangeToString( v.begin(), v.end() ); +} + +#ifdef CATCH_CPP11_OR_GREATER + +// toString for tuples +namespace TupleDetail { + template< + typename Tuple, + std::size_t N = 0, + bool = (N < std::tuple_size::value) + > + struct ElementPrinter { + static void print( const Tuple& tuple, std::ostream& os ) + { + os << ( N ? ", " : " " ) + << Catch::toString(std::get(tuple)); + ElementPrinter::print(tuple,os); + } + }; + + template< + typename Tuple, + std::size_t N + > + struct ElementPrinter { + static void print( const Tuple&, std::ostream& ) {} + }; + +} + +template +struct StringMaker> { + + static std::string convert( const std::tuple& tuple ) + { + std::ostringstream os; + os << '{'; + TupleDetail::ElementPrinter>::print( tuple, os ); + os << " }"; + return os.str(); } }; +#endif namespace Detail { template @@ -1161,44 +1294,15 @@ std::string toString( T const& value ) { return StringMaker::convert( value ); } -// Built in overloads - -std::string toString( std::string const& value ); -std::string toString( std::wstring const& value ); -std::string toString( const char* const value ); -std::string toString( char* const value ); -std::string toString( const wchar_t* const value ); -std::string toString( wchar_t* const value ); -std::string toString( int value ); -std::string toString( unsigned long value ); -std::string toString( unsigned int value ); -std::string toString( const double value ); -std::string toString( const float value ); -std::string toString( bool value ); -std::string toString( char value ); -std::string toString( signed char value ); -std::string toString( unsigned char value ); - -#ifdef CATCH_CONFIG_CPP11_NULLPTR -std::string toString( std::nullptr_t ); -#endif - -#ifdef __OBJC__ - std::string toString( NSString const * const& nsstring ); - std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ); - std::string toString( NSObject* const& nsObject ); -#endif - namespace Detail { template std::string rangeToString( InputIterator first, InputIterator last ) { std::ostringstream oss; oss << "{ "; if( first != last ) { - oss << toString( *first ); - for( ++first ; first != last ; ++first ) { - oss << ", " << toString( *first ); - } + oss << Catch::toString( *first ); + for( ++first ; first != last ; ++first ) + oss << ", " << Catch::toString( *first ); } oss << " }"; return oss.str(); @@ -1395,6 +1499,8 @@ namespace Catch { virtual std::string getCurrentTestName() const = 0; virtual const AssertionResult* getLastResult() const = 0; + + virtual void handleFatalErrorCondition( std::string const& message ) = 0; }; IResultCapture& getResultCapture(); @@ -1575,7 +1681,7 @@ namespace Catch { std::string matcherAsString = ::Catch::Matchers::matcher.toString(); \ __catchResult \ .setLhs( Catch::toString( arg ) ) \ - .setRhs( matcherAsString == "{?}" ? #matcher : matcherAsString ) \ + .setRhs( matcherAsString == Catch::Detail::unprintableString ? #matcher : matcherAsString ) \ .setOp( "matches" ) \ .setResultType( ::Catch::Matchers::matcher.match( arg ) ); \ __catchResult.captureExpression(); \ @@ -1636,6 +1742,9 @@ namespace Catch { bool allPassed() const { return failed == 0 && failedButOk == 0; } + bool allOk() const { + return failed == 0; + } std::size_t passed; std::size_t failed; @@ -1688,7 +1797,7 @@ namespace Catch { public: Timer() : m_ticks( 0 ) {} void start(); - unsigned int getElapsedNanoseconds() const; + unsigned int getElapsedMicroseconds() const; unsigned int getElapsedMilliseconds() const; double getElapsedSeconds() const; @@ -1702,7 +1811,7 @@ namespace Catch { namespace Catch { - class Section { + class Section : NonCopyable { public: Section( SectionInfo const& info ); ~Section(); @@ -1711,15 +1820,6 @@ namespace Catch { operator bool() const; private: -#ifdef CATCH_CPP11_OR_GREATER - Section( Section const& ) = delete; - Section( Section && ) = delete; - Section& operator = ( Section const& ) = delete; - Section& operator = ( Section && ) = delete; -#else - Section( Section const& info ); - Section& operator = ( Section const& ); -#endif SectionInfo m_info; std::string m_name; @@ -2694,7 +2794,7 @@ return @ desc; \ #endif -#ifdef CATCH_CONFIG_RUNNER +#ifdef CATCH_IMPL // #included from: internal/catch_impl.hpp #define TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED @@ -2706,7 +2806,7 @@ return @ desc; \ #pragma clang diagnostic ignored "-Wweak-vtables" #endif -// #included from: catch_runner.hpp +// #included from: ../catch_runner.hpp #define TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED // #included from: internal/catch_commandline.hpp @@ -2962,6 +3062,11 @@ namespace Catch { Always, Never }; }; + struct RunTests { enum InWhatOrder { + InDeclarationOrder, + InLexicographicalOrder, + InRandomOrder + }; }; class TestSpec; @@ -2979,6 +3084,9 @@ namespace Catch { virtual bool showInvisibles() const = 0; virtual ShowDurations::OrNot showDurations() const = 0; virtual TestSpec const& testSpec() const = 0; + virtual RunTests::InWhatOrder runOrder() const = 0; + virtual unsigned int rngSeed() const = 0; + virtual bool forceColour() const = 0; }; } @@ -3004,12 +3112,16 @@ namespace Catch { private: bool isOwned; }; + + std::ostream& cout(); + std::ostream& cerr(); } #include #include #include #include +#include #ifndef CATCH_CONFIG_CONSOLE_WIDTH #define CATCH_CONFIG_CONSOLE_WIDTH 80 @@ -3029,10 +3141,13 @@ namespace Catch { noThrow( false ), showHelp( false ), showInvisibles( false ), + forceColour( false ), abortAfter( -1 ), + rngSeed( 0 ), verbosity( Verbosity::Normal ), warnings( WarnAbout::Nothing ), - showDurations( ShowDurations::DefaultForReporter ) + showDurations( ShowDurations::DefaultForReporter ), + runOrder( RunTests::InDeclarationOrder ) {} bool listTests; @@ -3045,12 +3160,15 @@ namespace Catch { bool noThrow; bool showHelp; bool showInvisibles; + bool forceColour; int abortAfter; + unsigned int rngSeed; Verbosity::Level verbosity; WarnAbout::What warnings; ShowDurations::OrNot showDurations; + RunTests::InWhatOrder runOrder; std::string reporterName; std::string outputFilename; @@ -3068,12 +3186,12 @@ namespace Catch { public: Config() - : m_os( std::cout.rdbuf() ) + : m_os( Catch::cout().rdbuf() ) {} Config( ConfigData const& data ) : m_data( data ), - m_os( std::cout.rdbuf() ) + m_os( Catch::cout().rdbuf() ) { if( !data.testsOrTags.empty() ) { TestSpecParser parser( ITagAliasRegistry::get() ); @@ -3084,7 +3202,7 @@ namespace Catch { } virtual ~Config() { - m_os.rdbuf( std::cout.rdbuf() ); + m_os.rdbuf( Catch::cout().rdbuf() ); m_stream.release(); } @@ -3106,7 +3224,7 @@ namespace Catch { bool shouldDebugBreak() const { return m_data.shouldDebugBreak; } void setStreamBuf( std::streambuf* buf ) { - m_os.rdbuf( buf ? buf : std::cout.rdbuf() ); + m_os.rdbuf( buf ? buf : Catch::cout().rdbuf() ); } void useStream( std::string const& streamName ) { @@ -3132,6 +3250,9 @@ namespace Catch { virtual bool includeSuccessfulResults() const { return m_data.showSuccessfulTests; } virtual bool warnAboutMissingAssertions() const { return m_data.warnings & WarnAbout::NoAssertions; } virtual ShowDurations::OrNot showDurations() const { return m_data.showDurations; } + virtual RunTests::InWhatOrder runOrder() const { return m_data.runOrder; } + virtual unsigned int rngSeed() const { return m_data.rngSeed; } + virtual bool forceColour() const { return m_data.forceColour; } private: ConfigData m_data; @@ -3760,7 +3881,7 @@ namespace Clara { m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens ) { if( other.m_floatingArg.get() ) - m_floatingArg = ArgAutoPtr( new Arg( *other.m_floatingArg ) ); + m_floatingArg.reset( new Arg( *other.m_floatingArg ) ); } CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) { @@ -3788,7 +3909,7 @@ namespace Clara { ArgBuilder operator[]( UnpositionalTag ) { if( m_floatingArg.get() ) throw std::logic_error( "Only one unpositional argument can be added" ); - m_floatingArg = ArgAutoPtr( new Arg() ); + m_floatingArg.reset( new Arg() ); ArgBuilder builder( m_floatingArg.get() ); return builder; } @@ -3930,7 +4051,7 @@ namespace Clara { if( it == itEnd ) { if( token.type == Parser::Token::Positional || !m_throwOnUnrecognisedTokens ) unusedTokens.push_back( token ); - else if( m_throwOnUnrecognisedTokens ) + else if( errors.empty() && m_throwOnUnrecognisedTokens ) errors.push_back( "unrecognised option: " + token.data ); } } @@ -4028,7 +4149,28 @@ namespace Catch { config.warnings = static_cast( config.warnings | WarnAbout::NoAssertions ); else throw std::runtime_error( "Unrecognised warning: '" + _warning + "'" ); - + } + inline void setOrder( ConfigData& config, std::string const& order ) { + if( startsWith( "declared", order ) ) + config.runOrder = RunTests::InDeclarationOrder; + else if( startsWith( "lexical", order ) ) + config.runOrder = RunTests::InLexicographicalOrder; + else if( startsWith( "random", order ) ) + config.runOrder = RunTests::InRandomOrder; + else + throw std::runtime_error( "Unrecognised ordering: '" + order + "'" ); + } + inline void setRngSeed( ConfigData& config, std::string const& seed ) { + if( seed == "time" ) { + config.rngSeed = static_cast( std::time(0) ); + } + else { + std::stringstream ss; + ss << seed; + ss >> config.rngSeed; + if( ss.fail() ) + throw std::runtime_error( "Argment to --rng-seed should be the word 'time' or a number" ); + } } inline void setVerbosity( ConfigData& config, int level ) { // !TBD: accept strings? @@ -4140,6 +4282,18 @@ namespace Catch { .describe( "list all reporters" ) .bind( &ConfigData::listReporters ); + cli["--order"] + .describe( "test case order (defaults to decl)" ) + .bind( &setOrder, "decl|lex|rand" ); + + cli["--rng-seed"] + .describe( "set a specific seed for random numbers" ) + .bind( &setRngSeed, "'time'|number" ); + + cli["--force-colour"] + .describe( "force colourised output" ) + .bind( &ConfigData::forceColour ); + return cli; } @@ -4313,10 +4467,6 @@ namespace Catch { namespace Catch { - namespace Detail { - struct IColourImpl; - } - struct Colour { enum Code { None = 0, @@ -4362,7 +4512,6 @@ namespace Catch { static void use( Code _colourCode ); private: - static Detail::IColourImpl* impl(); bool m_moved; }; @@ -4592,11 +4741,14 @@ namespace Catch virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; + // The return value indicates if the messages buffer should be cleared: virtual bool assertionEnded( AssertionStats const& assertionStats ) = 0; virtual void sectionEnded( SectionStats const& sectionStats ) = 0; virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0; virtual void testRunEnded( TestRunStats const& testRunStats ) = 0; + + virtual void skipTest( TestCaseInfo const& testInfo ) = 0; }; struct IReporterFactory { @@ -4624,9 +4776,9 @@ namespace Catch { TestSpec testSpec = config.testSpec(); if( config.testSpec().hasFilters() ) - std::cout << "Matching test cases:\n"; + Catch::cout() << "Matching test cases:\n"; else { - std::cout << "All available test cases:\n"; + Catch::cout() << "All available test cases:\n"; testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec(); } @@ -4647,15 +4799,15 @@ namespace Catch { : Colour::None; Colour colourGuard( colour ); - std::cout << Text( testCaseInfo.name, nameAttr ) << std::endl; + Catch::cout() << Text( testCaseInfo.name, nameAttr ) << std::endl; if( !testCaseInfo.tags.empty() ) - std::cout << Text( testCaseInfo.tagsAsString, tagsAttr ) << std::endl; + Catch::cout() << Text( testCaseInfo.tagsAsString, tagsAttr ) << std::endl; } if( !config.testSpec().hasFilters() ) - std::cout << pluralise( matchedTests, "test case" ) << "\n" << std::endl; + Catch::cout() << pluralise( matchedTests, "test case" ) << "\n" << std::endl; else - std::cout << pluralise( matchedTests, "matching test case" ) << "\n" << std::endl; + Catch::cout() << pluralise( matchedTests, "matching test case" ) << "\n" << std::endl; return matchedTests; } @@ -4671,7 +4823,7 @@ namespace Catch { ++it ) { matchedTests++; TestCaseInfo const& testCaseInfo = it->getTestCaseInfo(); - std::cout << testCaseInfo.name << std::endl; + Catch::cout() << testCaseInfo.name << std::endl; } return matchedTests; } @@ -4697,9 +4849,9 @@ namespace Catch { inline std::size_t listTags( Config const& config ) { TestSpec testSpec = config.testSpec(); if( config.testSpec().hasFilters() ) - std::cout << "Tags for matching test cases:\n"; + Catch::cout() << "Tags for matching test cases:\n"; else { - std::cout << "All available tags:\n"; + Catch::cout() << "All available tags:\n"; testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec(); } @@ -4733,14 +4885,14 @@ namespace Catch { .setInitialIndent( 0 ) .setIndent( oss.str().size() ) .setWidth( CATCH_CONFIG_CONSOLE_WIDTH-10 ) ); - std::cout << oss.str() << wrapper << "\n"; + Catch::cout() << oss.str() << wrapper << "\n"; } - std::cout << pluralise( tagCounts.size(), "tag" ) << "\n" << std::endl; + Catch::cout() << pluralise( tagCounts.size(), "tag" ) << "\n" << std::endl; return tagCounts.size(); } inline std::size_t listReporters( Config const& /*config*/ ) { - std::cout << "Available reports:\n"; + Catch::cout() << "Available reporters:\n"; IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); IReporterRegistry::FactoryMap::const_iterator itBegin = factories.begin(), itEnd = factories.end(), it; std::size_t maxNameLen = 0; @@ -4752,13 +4904,13 @@ namespace Catch { .setInitialIndent( 0 ) .setIndent( 7+maxNameLen ) .setWidth( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen-8 ) ); - std::cout << " " + Catch::cout() << " " << it->first << ":" << std::string( maxNameLen - it->first.size() + 2, ' ' ) << wrapper << "\n"; } - std::cout << std::endl; + Catch::cout() << std::endl; return factories.size(); } @@ -4915,6 +5067,81 @@ using SectionTracking::TestCaseTracker; } // namespace Catch +// #included from: catch_fatal_condition.hpp +#define TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED + +namespace Catch { + + // Report the error condition then exit the process + inline void fatal( std::string const& message, int exitCode ) { + IContext& context = Catch::getCurrentContext(); + IResultCapture* resultCapture = context.getResultCapture(); + resultCapture->handleFatalErrorCondition( message ); + + if( Catch::alwaysTrue() ) // avoids "no return" warnings + exit( exitCode ); + } + +} // namespace Catch + +#if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// + +namespace Catch { + + struct FatalConditionHandler { + void reset() {} + }; + +} // namespace Catch + +#else // Not Windows - assumed to be POSIX compatible ////////////////////////// + +#include + +namespace Catch { + + struct SignalDefs { int id; const char* name; }; + extern SignalDefs signalDefs[]; + SignalDefs signalDefs[] = { + { SIGINT, "SIGINT - Terminal interrupt signal" }, + { SIGILL, "SIGILL - Illegal instruction signal" }, + { SIGFPE, "SIGFPE - Floating point error signal" }, + { SIGSEGV, "SIGSEGV - Segmentation violation signal" }, + { SIGTERM, "SIGTERM - Termination request signal" }, + { SIGABRT, "SIGABRT - Abort (abnormal termination) signal" } + }; + + struct FatalConditionHandler { + + static void handleSignal( int sig ) { + for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) + if( sig == signalDefs[i].id ) + fatal( signalDefs[i].name, -sig ); + fatal( "", -sig ); + } + + FatalConditionHandler() : m_isSet( true ) { + for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) + signal( signalDefs[i].id, handleSignal ); + } + ~FatalConditionHandler() { + reset(); + } + void reset() { + if( m_isSet ) { + for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) + signal( signalDefs[i].id, SIG_DFL ); + m_isSet = false; + } + } + + bool m_isSet; + }; + +} // namespace Catch + +#endif // not Windows + #include #include @@ -5102,6 +5329,37 @@ namespace Catch { return &m_lastResult; } + virtual void handleFatalErrorCondition( std::string const& message ) { + ResultBuilder resultBuilder = makeUnexpectedResultBuilder(); + resultBuilder.setResultType( ResultWas::FatalErrorCondition ); + resultBuilder << message; + resultBuilder.captureExpression(); + + handleUnfinishedSections(); + + // Recreate section for test case (as we will lose the one that was in scope) + TestCaseInfo const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); + SectionInfo testCaseSection( testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description ); + + Counts assertions; + assertions.failed = 1; + SectionStats testCaseSectionStats( testCaseSection, assertions, 0, false ); + m_reporter->sectionEnded( testCaseSectionStats ); + + TestCaseInfo testInfo = m_activeTestCase->getTestCaseInfo(); + + Totals deltaTotals; + deltaTotals.testCases.failed = 1; + m_reporter->testCaseEnded( TestCaseStats( testInfo, + deltaTotals, + "", + "", + false ) ); + m_totals.testCases.failed++; + testGroupEnded( "", m_totals, 1, 1 ); + m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, false ) ); + } + public: // !TBD We need to do this another way! bool aborting() const { @@ -5123,12 +5381,12 @@ namespace Catch { Timer timer; timer.start(); if( m_reporter->getPreferences().shouldRedirectStdOut ) { - StreamRedirect coutRedir( std::cout, redirectedCout ); - StreamRedirect cerrRedir( std::cerr, redirectedCerr ); - m_activeTestCase->invoke(); + StreamRedirect coutRedir( Catch::cout(), redirectedCout ); + StreamRedirect cerrRedir( Catch::cerr(), redirectedCerr ); + invokeActiveTestCase(); } else { - m_activeTestCase->invoke(); + invokeActiveTestCase(); } duration = timer.getElapsedSeconds(); } @@ -5136,20 +5394,9 @@ namespace Catch { // This just means the test was aborted due to failure } catch(...) { - ResultBuilder exResult( m_lastAssertionInfo.macroName.c_str(), - m_lastAssertionInfo.lineInfo, - m_lastAssertionInfo.capturedExpression.c_str(), - m_lastAssertionInfo.resultDisposition ); - exResult.useActiveException(); + makeUnexpectedResultBuilder().useActiveException(); } - // If sections ended prematurely due to an exception we stored their - // infos here so we can tear them down outside the unwind process. - for( std::vector::const_reverse_iterator it = m_unfinishedSections.rbegin(), - itEnd = m_unfinishedSections.rend(); - it != itEnd; - ++it ) - sectionEnded( it->info, it->prevAssertions, it->durationInSeconds ); - m_unfinishedSections.clear(); + handleUnfinishedSections(); m_messages.clear(); Counts assertions = m_totals.assertions - prevAssertions; @@ -5165,7 +5412,32 @@ namespace Catch { m_reporter->sectionEnded( testCaseSectionStats ); } + void invokeActiveTestCase() { + FatalConditionHandler fatalConditionHandler; // Handle signals + m_activeTestCase->invoke(); + fatalConditionHandler.reset(); + } + private: + + ResultBuilder makeUnexpectedResultBuilder() const { + return ResultBuilder( m_lastAssertionInfo.macroName.c_str(), + m_lastAssertionInfo.lineInfo, + m_lastAssertionInfo.capturedExpression.c_str(), + m_lastAssertionInfo.resultDisposition ); + } + + void handleUnfinishedSections() { + // If sections ended prematurely due to an exception we stored their + // infos here so we can tear them down outside the unwind process. + for( std::vector::const_reverse_iterator it = m_unfinishedSections.rbegin(), + itEnd = m_unfinishedSections.rend(); + it != itEnd; + ++it ) + sectionEnded( it->info, it->prevAssertions, it->durationInSeconds ); + m_unfinishedSections.clear(); + } + struct UnfinishedSections { UnfinishedSections( SectionInfo const& _info, Counts const& _prevAssertions, double _durationInSeconds ) : info( _info ), prevAssertions( _prevAssertions ), durationInSeconds( _durationInSeconds ) @@ -5253,7 +5525,7 @@ namespace Catch { Totals totals; - context.testGroupStarting( "", 1, 1 ); // deprecated? + context.testGroupStarting( "all tests", 1, 1 ); // deprecated? TestSpec testSpec = m_config->testSpec(); if( !testSpec.hasFilters() ) @@ -5276,7 +5548,15 @@ namespace Catch { m_testsAlreadyRun.insert( *it ); } } - context.testGroupEnded( "", totals, 1, 1 ); + std::vector skippedTestCases; + getRegistryHub().getTestCaseRegistry().getFilteredTests( testSpec, *m_config, skippedTestCases, true ); + + for( std::vector::const_iterator it = skippedTestCases.begin(), itEnd = skippedTestCases.end(); + it != itEnd; + ++it ) + m_reporter->skipTest( *it ); + + context.testGroupEnded( "all tests", totals, 1, 1 ); return totals; } @@ -5313,7 +5593,7 @@ namespace Catch { std::set m_testsAlreadyRun; }; - class Session { + class Session : NonCopyable { static bool alreadyInstantiated; public: @@ -5324,7 +5604,7 @@ namespace Catch { : m_cli( makeCommandLineParser() ) { if( alreadyInstantiated ) { std::string msg = "Only one instance of Catch::Session can ever be used"; - std::cerr << msg << std::endl; + Catch::cerr() << msg << std::endl; throw std::logic_error( msg ); } alreadyInstantiated = true; @@ -5334,15 +5614,15 @@ namespace Catch { } void showHelp( std::string const& processName ) { - std::cout << "\nCatch v" << libraryVersion.majorVersion << "." + Catch::cout() << "\nCatch v" << libraryVersion.majorVersion << "." << libraryVersion.minorVersion << " build " << libraryVersion.buildNumber; if( libraryVersion.branchName != std::string( "master" ) ) - std::cout << " (" << libraryVersion.branchName << " branch)"; - std::cout << "\n"; + Catch::cout() << " (" << libraryVersion.branchName << " branch)"; + Catch::cout() << "\n"; - m_cli.usage( std::cout, processName ); - std::cout << "For more detail usage please see the project docs\n" << std::endl; + m_cli.usage( Catch::cout(), processName ); + Catch::cout() << "For more detail usage please see the project docs\n" << std::endl; } int applyCommandLine( int argc, char* const argv[], OnUnusedOptions::DoWhat unusedOptionBehaviour = OnUnusedOptions::Fail ) { @@ -5356,11 +5636,11 @@ namespace Catch { catch( std::exception& ex ) { { Colour colourGuard( Colour::Red ); - std::cerr << "\nError(s) in input:\n" + Catch::cerr() << "\nError(s) in input:\n" << Text( ex.what(), TextAttributes().setIndent(2) ) << "\n\n"; } - m_cli.usage( std::cout, m_configData.processName ); + m_cli.usage( Catch::cout(), m_configData.processName ); return (std::numeric_limits::max)(); } return 0; @@ -5386,6 +5666,9 @@ namespace Catch { try { config(); // Force config to be constructed + + std::srand( m_configData.rngSeed ); + Runner runner( m_config ); // Handle list request @@ -5395,7 +5678,7 @@ namespace Catch { return static_cast( runner.runTests().assertions.failed ); } catch( std::exception& ex ) { - std::cerr << ex.what() << std::endl; + Catch::cerr() << ex.what() << std::endl; return (std::numeric_limits::max)(); } } @@ -5436,10 +5719,18 @@ namespace Catch { #include #include #include +#include namespace Catch { class TestRegistry : public ITestCaseRegistry { + struct LexSort { + bool operator() (TestCase i,TestCase j) const { return (i& matchingTestCases ) const { + virtual void getFilteredTests( TestSpec const& testSpec, IConfig const& config, std::vector& matchingTestCases, bool negated = false ) const { + for( std::vector::const_iterator it = m_functionsInOrder.begin(), itEnd = m_functionsInOrder.end(); it != itEnd; ++it ) { - if( testSpec.matches( *it ) && ( config.allowThrows() || !it->throws() ) ) + bool includeTest = testSpec.matches( *it ) && ( config.allowThrows() || !it->throws() ); + if( includeTest != negated ) matchingTestCases.push_back( *it ); } + sortTests( config, matchingTestCases ); } private: + static void sortTests( IConfig const& config, std::vector& matchingTestCases ) { + + switch( config.runOrder() ) { + case RunTests::InLexicographicalOrder: + std::sort( matchingTestCases.begin(), matchingTestCases.end(), LexSort() ); + break; + case RunTests::InRandomOrder: + { + RandomNumberGenerator rng; + std::random_shuffle( matchingTestCases.begin(), matchingTestCases.end(), rng ); + } + break; + case RunTests::InDeclarationOrder: + // already in declaration order + break; + } + } std::set m_functions; std::vector m_functionsInOrder; std::vector m_nonHiddenFunctions; @@ -5613,7 +5924,7 @@ namespace Catch { throw; } @catch (NSException *exception) { - return toString( [exception description] ); + return Catch::toString( [exception description] ); } #else throw; @@ -5760,6 +6071,7 @@ namespace Catch { #include #include +#include namespace Catch { @@ -5823,6 +6135,15 @@ namespace Catch { isOwned = false; } } + +#ifndef CATCH_CONFIG_NOSTDOUT // If you #define this you must implement this functions + std::ostream& cout() { + return std::cout; + } + std::ostream& cerr() { + return std::cerr; + } +#endif } namespace Catch { @@ -5872,7 +6193,7 @@ namespace Catch { std::string testName = getResultCapture()->getCurrentTestName(); std::map::const_iterator it = - m_generatorsByTestName.find( testName ); + m_generatorsByTestName.find( testName ); return it != m_generatorsByTestName.end() ? it->second : NULL; @@ -5908,8 +6229,8 @@ namespace Catch { } Stream createStream( std::string const& streamName ) { - if( streamName == "stdout" ) return Stream( std::cout.rdbuf(), false ); - if( streamName == "stderr" ) return Stream( std::cerr.rdbuf(), false ); + if( streamName == "stdout" ) return Stream( Catch::cout().rdbuf(), false ); + if( streamName == "stderr" ) return Stream( Catch::cerr().rdbuf(), false ); if( streamName == "debug" ) return Stream( new StreamBufImpl, true ); throw std::domain_error( "Unknown stream: " + streamName ); @@ -5924,14 +6245,35 @@ namespace Catch { // #included from: catch_console_colour_impl.hpp #define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED -namespace Catch { namespace Detail { - struct IColourImpl { - virtual ~IColourImpl() {} - virtual void use( Colour::Code _colourCode ) = 0; - }; -}} +namespace Catch { + namespace { -#if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// + struct IColourImpl { + virtual ~IColourImpl() {} + virtual void use( Colour::Code _colourCode ) = 0; + }; + + struct NoColourImpl : IColourImpl { + void use( Colour::Code ) {} + + static IColourImpl* instance() { + static NoColourImpl s_instance; + return &s_instance; + } + }; + + } // anon namespace +} // namespace Catch + +#if !defined( CATCH_CONFIG_COLOUR_NONE ) && !defined( CATCH_CONFIG_COLOUR_WINDOWS ) && !defined( CATCH_CONFIG_COLOUR_ANSI ) +# ifdef CATCH_PLATFORM_WINDOWS +# define CATCH_CONFIG_COLOUR_WINDOWS +# else +# define CATCH_CONFIG_COLOUR_ANSI +# endif +#endif + +#if defined ( CATCH_CONFIG_COLOUR_WINDOWS ) ///////////////////////////////////////// #ifndef NOMINMAX #define NOMINMAX @@ -5946,7 +6288,7 @@ namespace Catch { namespace Detail { namespace Catch { namespace { - class Win32ColourImpl : public Detail::IColourImpl { + class Win32ColourImpl : public IColourImpl { public: Win32ColourImpl() : stdoutHandle( GetStdHandle(STD_OUTPUT_HANDLE) ) { @@ -5983,11 +6325,7 @@ namespace { WORD originalAttributes; }; - inline bool shouldUseColourForPlatform() { - return true; - } - - static Detail::IColourImpl* platformColourInstance() { + IColourImpl* platformColourInstance() { static Win32ColourImpl s_instance; return &s_instance; } @@ -5995,7 +6333,7 @@ namespace { } // end anon namespace } // end namespace Catch -#else // Not Windows - assumed to be POSIX compatible ////////////////////////// +#elif defined( CATCH_CONFIG_COLOUR_ANSI ) ////////////////////////////////////// #include @@ -6006,7 +6344,7 @@ namespace { // Thanks to Adam Strzelecki for original contribution // (http://github.com/nanoant) // https://github.com/philsquared/Catch/pull/131 - class PosixColourImpl : public Detail::IColourImpl { + class PosixColourImpl : public IColourImpl { public: virtual void use( Colour::Code _colourCode ) { switch( _colourCode ) { @@ -6027,53 +6365,48 @@ namespace { case Colour::Bright: throw std::logic_error( "not a colour" ); } } + static IColourImpl* instance() { + static PosixColourImpl s_instance; + return &s_instance; + } + private: void setColour( const char* _escapeCode ) { - std::cout << '\033' << _escapeCode; + Catch::cout() << '\033' << _escapeCode; } }; - inline bool shouldUseColourForPlatform() { - return isatty(STDOUT_FILENO); - } - - static Detail::IColourImpl* platformColourInstance() { - static PosixColourImpl s_instance; - return &s_instance; + IColourImpl* platformColourInstance() { + Ptr config = getCurrentContext().getConfig(); + return (config && config->forceColour()) || isatty(STDOUT_FILENO) + ? PosixColourImpl::instance() + : NoColourImpl::instance(); } } // end anon namespace } // end namespace Catch -#endif // not Windows +#else // not Windows or ANSI /////////////////////////////////////////////// namespace Catch { - namespace { - struct NoColourImpl : Detail::IColourImpl { - void use( Colour::Code ) {} + static IColourImpl* platformColourInstance() { return NoColourImpl::instance(); } - static IColourImpl* instance() { - static NoColourImpl s_instance; - return &s_instance; - } - }; - static bool shouldUseColour() { - return shouldUseColourForPlatform() && !isDebuggerActive(); - } - } +} // end namespace Catch + +#endif // Windows/ ANSI/ None + +namespace Catch { Colour::Colour( Code _colourCode ) : m_moved( false ) { use( _colourCode ); } Colour::Colour( Colour const& _other ) : m_moved( false ) { const_cast( _other ).m_moved = true; } Colour::~Colour(){ if( !m_moved ) use( None ); } - void Colour::use( Code _colourCode ) { - impl()->use( _colourCode ); - } - Detail::IColourImpl* Colour::impl() { - return shouldUseColour() - ? platformColourInstance() - : NoColourImpl::instance(); + void Colour::use( Code _colourCode ) { + static IColourImpl* impl = isDebuggerActive() + ? NoColourImpl::instance() + : platformColourInstance(); + impl->use( _colourCode ); } } // end namespace Catch @@ -6238,7 +6571,7 @@ namespace Catch { namespace Catch { inline TestCaseInfo::SpecialProperties parseSpecialTag( std::string const& tag ) { - if( tag == "." || + if( startsWith( tag, "." ) || tag == "hide" || tag == "!hide" ) return TestCaseInfo::IsHidden; @@ -6258,13 +6591,13 @@ namespace Catch { if( isReservedTag( tag ) ) { { Colour colourGuard( Colour::Red ); - std::cerr + Catch::cerr() << "Tag name [" << tag << "] not allowed.\n" << "Tag names starting with non alpha-numeric characters are reserved\n"; } { Colour colourGuard( Colour::FileName ); - std::cerr << _lineInfo << std::endl; + Catch::cerr() << _lineInfo << std::endl; } exit(1); } @@ -6292,14 +6625,15 @@ namespace Catch { } else { if( c == ']' ) { - enforceNotReservedTag( tag, _lineInfo ); - - inTag = false; - if( tag == "hide" || tag == "." ) + TestCaseInfo::SpecialProperties prop = parseSpecialTag( tag ); + if( prop == TestCaseInfo::IsHidden ) isHidden = true; - else - tags.insert( tag ); + else if( prop == TestCaseInfo::None ) + enforceNotReservedTag( tag, _lineInfo ); + + tags.insert( tag ); tag.clear(); + inTag = false; } else tag += c; @@ -6417,7 +6751,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 1, 0, 53, "master" ); + Version libraryVersion( 1, 1, 1, "master" ); } // #included from: catch_message.hpp @@ -6501,6 +6835,7 @@ namespace Catch virtual void testCaseEnded( TestCaseStats const& testCaseStats ); virtual void testGroupEnded( TestGroupStats const& testGroupStats ); virtual void testRunEnded( TestRunStats const& testRunStats ); + virtual void skipTest( TestCaseInfo const& ); private: Ptr m_legacyReporter; @@ -6574,6 +6909,8 @@ namespace Catch void LegacyReporterAdapter::testRunEnded( TestRunStats const& testRunStats ) { m_legacyReporter->EndTesting( testRunStats.totals ); } + void LegacyReporterAdapter::skipTest( TestCaseInfo const& ) { + } } // #included from: catch_timer.hpp @@ -6596,11 +6933,11 @@ namespace Catch { uint64_t getCurrentTicks() { static uint64_t hz=0, hzo=0; if (!hz) { - QueryPerformanceFrequency((LARGE_INTEGER*)&hz); - QueryPerformanceCounter((LARGE_INTEGER*)&hzo); + QueryPerformanceFrequency( reinterpret_cast( &hz ) ); + QueryPerformanceCounter( reinterpret_cast( &hzo ) ); } uint64_t t; - QueryPerformanceCounter((LARGE_INTEGER*)&t); + QueryPerformanceCounter( reinterpret_cast( &t ) ); return ((t-hzo)*1000000)/hz; } #else @@ -6615,14 +6952,14 @@ namespace Catch { void Timer::start() { m_ticks = getCurrentTicks(); } - unsigned int Timer::getElapsedNanoseconds() const { + unsigned int Timer::getElapsedMicroseconds() const { return static_cast(getCurrentTicks() - m_ticks); } unsigned int Timer::getElapsedMilliseconds() const { - return static_cast((getCurrentTicks() - m_ticks)/1000); + return static_cast(getElapsedMicroseconds()/1000); } double Timer::getElapsedSeconds() const { - return (getCurrentTicks() - m_ticks)/1000000.0; + return getElapsedMicroseconds()/1000000.0; } } // namespace Catch @@ -6660,6 +6997,20 @@ namespace Catch { return start != std::string::npos ? str.substr( start, 1+end-start ) : ""; } + bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) { + bool replaced = false; + std::size_t i = str.find( replaceThis ); + while( i != std::string::npos ) { + replaced = true; + str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() ); + if( i < str.size()-withThis.size() ) + i = str.find( replaceThis, i+withThis.size() ); + else + i = std::string::npos; + } + return replaced; + } + pluralise::pluralise( std::size_t count, std::string const& label ) : m_count( count ), m_label( label ) @@ -6687,6 +7038,9 @@ namespace Catch { bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const { return line == other.line && file == other.file; } + bool SourceLineInfo::operator < ( SourceLineInfo const& other ) const { + return line < other.line || ( line == other.line && file < other.file ); + } std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) { #ifndef __GNUG__ @@ -6781,7 +7135,7 @@ namespace Catch { size = sizeof(info); if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0) != 0 ) { - std::cerr << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl; + Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl; return false; } @@ -6822,7 +7176,7 @@ namespace Catch { namespace Catch { void writeToDebugConsole( std::string const& text ) { // !TBD: Need a version for Mac/ XCode and other IDEs - std::cout << text; + Catch::cout() << text; } } #endif // Platform @@ -6834,6 +7188,8 @@ namespace Catch { namespace Detail { + std::string unprintableString = "{?}"; + namespace { struct Endianness { enum Arch { Big, Little }; @@ -6892,7 +7248,7 @@ std::string toString( std::wstring const& value ) { s.reserve( value.size() ); for(size_t i = 0; i < value.size(); ++i ) s += value[i] <= 0xff ? static_cast( value[i] ) : '?'; - return toString( s ); + return Catch::toString( s ); } std::string toString( const char* const value ) { @@ -6915,7 +7271,10 @@ std::string toString( wchar_t* const value ) std::string toString( int value ) { std::ostringstream oss; - oss << value; + if( value > 8192 ) + oss << "0x" << std::hex << value; + else + oss << value; return oss.str(); } @@ -6929,7 +7288,7 @@ std::string toString( unsigned long value ) { } std::string toString( unsigned int value ) { - return toString( static_cast( value ) ); + return Catch::toString( static_cast( value ) ); } template @@ -7195,7 +7554,7 @@ namespace Catch { } catch( std::exception& ex ) { Colour colourGuard( Colour::Red ); - std::cerr << ex.what() << std::endl; + Catch::cerr() << ex.what() << std::endl; exit(1); } } @@ -7208,6 +7567,8 @@ namespace Catch { // #included from: catch_reporter_bases.hpp #define TWOBLUECUBES_CATCH_REPORTER_BASES_HPP_INCLUDED +#include + namespace Catch { struct StreamingReporterBase : SharedImpl { @@ -7240,7 +7601,6 @@ namespace Catch { } virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) { currentTestCaseInfo.reset(); - assert( m_sectionStack.empty() ); } virtual void testGroupEnded( TestGroupStats const& /* _testGroupStats */ ) { currentGroupInfo.reset(); @@ -7251,6 +7611,11 @@ namespace Catch { currentTestRunInfo.reset(); } + virtual void skipTest( TestCaseInfo const& ) { + // Don't do anything with this by default. + // It can optionally be overridden in the derived class. + } + Ptr m_config; std::ostream& stream; @@ -7380,6 +7745,8 @@ namespace Catch { } virtual void testRunEndedCumulative() = 0; + virtual void skipTest( TestCaseInfo const& ) {} + Ptr m_config; std::ostream& stream; std::vector m_assertions; @@ -7395,6 +7762,16 @@ namespace Catch { }; + template + char const* getLineOfChars() { + static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0}; + if( !*line ) { + memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 ); + line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0; + } + return line; + } + } // end namespace Catch // #included from: ../internal/catch_reporter_registrars.hpp @@ -7464,7 +7841,6 @@ namespace Catch { #define TWOBLUECUBES_CATCH_XMLWRITER_HPP_INCLUDED #include -#include #include #include @@ -7507,7 +7883,7 @@ namespace Catch { XmlWriter() : m_tagIsOpen( false ), m_needsNewline( false ), - m_os( &std::cout ) + m_os( &Catch::cout() ) {} XmlWriter( std::ostream& os ) @@ -7677,81 +8053,90 @@ namespace Catch { } namespace Catch { - class XmlReporter : public SharedImpl { + class XmlReporter : public StreamingReporterBase { public: - XmlReporter( ReporterConfig const& config ) : m_config( config ), m_sectionDepth( 0 ) {} + XmlReporter( ReporterConfig const& _config ) + : StreamingReporterBase( _config ), + m_sectionDepth( 0 ) + {} + + virtual ~XmlReporter(); static std::string getDescription() { return "Reports test results as an XML document"; } - virtual ~XmlReporter(); - private: // IReporter - - virtual bool shouldRedirectStdout() const { - return true; + public: // StreamingReporterBase + virtual ReporterPreferences getPreferences() const { + ReporterPreferences prefs; + prefs.shouldRedirectStdOut = true; + return prefs; } - virtual void StartTesting() { - m_xml.setStream( m_config.stream() ); + virtual void noMatchingTestCases( std::string const& s ) { + StreamingReporterBase::noMatchingTestCases( s ); + } + + virtual void testRunStarting( TestRunInfo const& testInfo ) { + StreamingReporterBase::testRunStarting( testInfo ); + m_xml.setStream( stream ); m_xml.startElement( "Catch" ); - if( !m_config.fullConfig()->name().empty() ) - m_xml.writeAttribute( "name", m_config.fullConfig()->name() ); + if( !m_config->name().empty() ) + m_xml.writeAttribute( "name", m_config->name() ); } - virtual void EndTesting( const Totals& totals ) { - m_xml.scopedElement( "OverallResults" ) - .writeAttribute( "successes", totals.assertions.passed ) - .writeAttribute( "failures", totals.assertions.failed ) - .writeAttribute( "expectedFailures", totals.assertions.failedButOk ); - m_xml.endElement(); - } - - virtual void StartGroup( const std::string& groupName ) { + virtual void testGroupStarting( GroupInfo const& groupInfo ) { + StreamingReporterBase::testGroupStarting( groupInfo ); m_xml.startElement( "Group" ) - .writeAttribute( "name", groupName ); + .writeAttribute( "name", groupInfo.name ); } - virtual void EndGroup( const std::string&, const Totals& totals ) { - m_xml.scopedElement( "OverallResults" ) - .writeAttribute( "successes", totals.assertions.passed ) - .writeAttribute( "failures", totals.assertions.failed ) - .writeAttribute( "expectedFailures", totals.assertions.failedButOk ); - m_xml.endElement(); + virtual void testCaseStarting( TestCaseInfo const& testInfo ) { + StreamingReporterBase::testCaseStarting(testInfo); + m_xml.startElement( "TestCase" ).writeAttribute( "name", trim( testInfo.name ) ); + + if ( m_config->showDurations() == ShowDurations::Always ) + m_testCaseTimer.start(); } - virtual void StartSection( const std::string& sectionName, const std::string& description ) { + virtual void sectionStarting( SectionInfo const& sectionInfo ) { + StreamingReporterBase::sectionStarting( sectionInfo ); if( m_sectionDepth++ > 0 ) { m_xml.startElement( "Section" ) - .writeAttribute( "name", trim( sectionName ) ) - .writeAttribute( "description", description ); - } - } - virtual void NoAssertionsInSection( const std::string& ) {} - virtual void NoAssertionsInTestCase( const std::string& ) {} - - virtual void EndSection( const std::string& /*sectionName*/, const Counts& assertions ) { - if( --m_sectionDepth > 0 ) { - m_xml.scopedElement( "OverallResults" ) - .writeAttribute( "successes", assertions.passed ) - .writeAttribute( "failures", assertions.failed ) - .writeAttribute( "expectedFailures", assertions.failedButOk ); - m_xml.endElement(); + .writeAttribute( "name", trim( sectionInfo.name ) ) + .writeAttribute( "description", sectionInfo.description ); } } - virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) { - m_xml.startElement( "TestCase" ).writeAttribute( "name", trim( testInfo.name ) ); - m_currentTestSuccess = true; - } + virtual void assertionStarting( AssertionInfo const& ) { } - virtual void Result( const Catch::AssertionResult& assertionResult ) { - if( !m_config.fullConfig()->includeSuccessfulResults() && assertionResult.getResultType() == ResultWas::Ok ) - return; + virtual bool assertionEnded( AssertionStats const& assertionStats ) { + const AssertionResult& assertionResult = assertionStats.assertionResult; + // Print any info messages in tags. + if( assertionStats.assertionResult.getResultType() != ResultWas::Ok ) { + for( std::vector::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end(); + it != itEnd; + ++it ) { + if( it->type == ResultWas::Info ) { + m_xml.scopedElement( "Info" ) + .writeText( it->message ); + } else if ( it->type == ResultWas::Warning ) { + m_xml.scopedElement( "Warning" ) + .writeText( it->message ); + } + } + } + + // Drop out if result was successful but we're not printing them. + if( !m_config->includeSuccessfulResults() && isOk(assertionResult.getResultType()) ) + return true; + + // Print the expression if there is one. if( assertionResult.hasExpression() ) { m_xml.startElement( "Expression" ) .writeAttribute( "success", assertionResult.succeeded() ) + .writeAttribute( "type", assertionResult.getTestMacroName() ) .writeAttribute( "filename", assertionResult.getSourceInfo().file ) .writeAttribute( "line", assertionResult.getSourceInfo().line ); @@ -7759,58 +8144,96 @@ namespace Catch { .writeText( assertionResult.getExpression() ); m_xml.scopedElement( "Expanded" ) .writeText( assertionResult.getExpandedExpression() ); - m_currentTestSuccess &= assertionResult.succeeded(); } + // And... Print a result applicable to each result type. switch( assertionResult.getResultType() ) { case ResultWas::ThrewException: m_xml.scopedElement( "Exception" ) .writeAttribute( "filename", assertionResult.getSourceInfo().file ) .writeAttribute( "line", assertionResult.getSourceInfo().line ) .writeText( assertionResult.getMessage() ); - m_currentTestSuccess = false; + break; + case ResultWas::FatalErrorCondition: + m_xml.scopedElement( "Fatal Error Condition" ) + .writeAttribute( "filename", assertionResult.getSourceInfo().file ) + .writeAttribute( "line", assertionResult.getSourceInfo().line ) + .writeText( assertionResult.getMessage() ); break; case ResultWas::Info: m_xml.scopedElement( "Info" ) .writeText( assertionResult.getMessage() ); break; case ResultWas::Warning: - m_xml.scopedElement( "Warning" ) - .writeText( assertionResult.getMessage() ); + // Warning will already have been written break; case ResultWas::ExplicitFailure: m_xml.scopedElement( "Failure" ) .writeText( assertionResult.getMessage() ); - m_currentTestSuccess = false; break; - case ResultWas::Unknown: - case ResultWas::Ok: - case ResultWas::FailureBit: - case ResultWas::ExpressionFailed: - case ResultWas::Exception: - case ResultWas::DidntThrowException: + default: break; } + if( assertionResult.hasExpression() ) m_xml.endElement(); + + return true; } - virtual void Aborted() { - // !TBD + virtual void sectionEnded( SectionStats const& sectionStats ) { + StreamingReporterBase::sectionEnded( sectionStats ); + if( --m_sectionDepth > 0 ) { + XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResults" ); + e.writeAttribute( "successes", sectionStats.assertions.passed ); + e.writeAttribute( "failures", sectionStats.assertions.failed ); + e.writeAttribute( "expectedFailures", sectionStats.assertions.failedButOk ); + + if ( m_config->showDurations() == ShowDurations::Always ) + e.writeAttribute( "durationInSeconds", sectionStats.durationInSeconds ); + + m_xml.endElement(); + } } - virtual void EndTestCase( const Catch::TestCaseInfo&, const Totals&, const std::string&, const std::string& ) { - m_xml.scopedElement( "OverallResult" ).writeAttribute( "success", m_currentTestSuccess ); + virtual void testCaseEnded( TestCaseStats const& testCaseStats ) { + StreamingReporterBase::testCaseEnded( testCaseStats ); + XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResult" ); + e.writeAttribute( "success", testCaseStats.totals.assertions.allOk() ); + + if ( m_config->showDurations() == ShowDurations::Always ) + e.writeAttribute( "durationInSeconds", m_testCaseTimer.getElapsedSeconds() ); + + m_xml.endElement(); + } + + virtual void testGroupEnded( TestGroupStats const& testGroupStats ) { + StreamingReporterBase::testGroupEnded( testGroupStats ); + // TODO: Check testGroupStats.aborting and act accordingly. + m_xml.scopedElement( "OverallResults" ) + .writeAttribute( "successes", testGroupStats.totals.assertions.passed ) + .writeAttribute( "failures", testGroupStats.totals.assertions.failed ) + .writeAttribute( "expectedFailures", testGroupStats.totals.assertions.failedButOk ); + m_xml.endElement(); + } + + virtual void testRunEnded( TestRunStats const& testRunStats ) { + StreamingReporterBase::testRunEnded( testRunStats ); + m_xml.scopedElement( "OverallResults" ) + .writeAttribute( "successes", testRunStats.totals.assertions.passed ) + .writeAttribute( "failures", testRunStats.totals.assertions.failed ) + .writeAttribute( "expectedFailures", testRunStats.totals.assertions.failedButOk ); m_xml.endElement(); } private: - ReporterConfig m_config; - bool m_currentTestSuccess; + Timer m_testCaseTimer; XmlWriter m_xml; int m_sectionDepth; }; + INTERNAL_CATCH_REGISTER_REPORTER( "xml", XmlReporter ) + } // end namespace Catch // #included from: ../reporters/catch_reporter_junit.hpp @@ -7937,7 +8360,7 @@ namespace Catch { xml.writeAttribute( "classname", className ); xml.writeAttribute( "name", name ); } - xml.writeAttribute( "time", toString( sectionNode.stats.durationInSeconds ) ); + xml.writeAttribute( "time", Catch::toString( sectionNode.stats.durationInSeconds ) ); writeAssertions( sectionNode ); @@ -7970,6 +8393,7 @@ namespace Catch { std::string elementName; switch( result.getResultType() ) { case ResultWas::ThrewException: + case ResultWas::FatalErrorCondition: elementName = "error"; break; case ResultWas::ExplicitFailure: @@ -8028,8 +8452,6 @@ namespace Catch { // #included from: ../reporters/catch_reporter_console.hpp #define TWOBLUECUBES_CATCH_REPORTER_CONSOLE_HPP_INCLUDED -#include - namespace Catch { struct ConsoleReporter : StreamingReporterBase { @@ -8164,6 +8586,11 @@ namespace Catch { passOrFail = "FAILED"; messageLabel = "due to unexpected exception with message"; break; + case ResultWas::FatalErrorCondition: + colour = Colour::Error; + passOrFail = "FAILED"; + messageLabel = "due to a fatal error condition"; + break; case ResultWas::DidntThrowException: colour = Colour::Error; passOrFail = "FAILED"; @@ -8281,6 +8708,9 @@ namespace Catch { stream << " host application.\n" << "Run with -? for options\n\n"; + if( m_config->rngSeed() != 0 ) + stream << "Randomness seeded to: " << m_config->rngSeed() << "\n\n"; + currentTestRunInfo.used = true; } void lazyPrintGroupInfo() { @@ -8452,15 +8882,6 @@ namespace Catch { void printSummaryDivider() { stream << getLineOfChars<'-'>() << "\n"; } - template - static char const* getLineOfChars() { - static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0}; - if( !*line ) { - memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 ); - line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0; - } - return line; - } private: bool m_headerPrinted; @@ -8569,6 +8990,13 @@ namespace Catch { printExpressionWas(); printRemainingMessages(); break; + case ResultWas::FatalErrorCondition: + printResultType( Colour::Error, failedString() ); + printIssue( "fatal error condition with message:" ); + printMessage(); + printExpressionWas(); + printRemainingMessages(); + break; case ResultWas::DidntThrowException: printResultType( Colour::Error, failedString() ); printIssue( "expected exception, got none" ); @@ -8798,8 +9226,6 @@ namespace Catch { Matchers::Impl::StdString::EndsWith::~EndsWith() {} void Config::dummy() {} - - INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( "xml", XmlReporter ) } #ifdef __clang__ @@ -8988,9 +9414,13 @@ using Catch::Detail::Approx; #define TWOBLUECUBES_CATCH_REENABLE_WARNINGS_H_INCLUDED #ifdef __clang__ -#pragma clang diagnostic pop +# ifdef __ICC // icpc defines the __clang__ macro +# pragma warning(pop) +# else +# pragma clang diagnostic pop +# endif #elif defined __GNUC__ -#pragma GCC diagnostic pop +# pragma GCC diagnostic pop #endif #endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED diff --git a/test/cleanup.hpp b/test/cleanup.hpp new file mode 100644 index 000000000..264a6b559 --- /dev/null +++ b/test/cleanup.hpp @@ -0,0 +1,53 @@ +#ifndef TEST_MEMORY_CLEANUP +#define TEST_MEMORY_CLEANUP + +#include +#include +#include + +#if defined(HAVE_CAIRO) +#include +#endif + +#include +#ifdef MAPNIK_USE_PROJ4 +#include +#endif + +namespace testing { + +inline void run_cleanup() +{ + // only call this once, on exit + // to make sure valgrind output is clean + // http://xmlsoft.org/xmlmem.html + xmlCleanupCharEncodingHandlers(); + xmlCleanupEncodingAliases(); + xmlCleanupGlobals(); + xmlCleanupParser(); + xmlCleanupThreads(); + xmlCleanupInputCallbacks(); + xmlCleanupOutputCallbacks(); + xmlCleanupMemory(); + +#if defined(HAVE_CAIRO) + // http://cairographics.org/manual/cairo-Error-handling.html#cairo-debug-reset-static-data + cairo_debug_reset_static_data(); +#endif + + // http://icu-project.org/apiref/icu4c/uclean_8h.html#a93f27d0ddc7c196a1da864763f2d8920 + u_cleanup(); + +#ifdef MAPNIK_USE_PROJ4 + // http://trac.osgeo.org/proj/ticket/149 + #if PJ_VERSION >= 480 + pj_clear_initcache(); + #endif + // https://trac.osgeo.org/proj/wiki/ProjAPI#EnvironmentFunctions + pj_deallocate_grids(); +#endif +} + +} + +#endif \ No newline at end of file diff --git a/test/data b/test/data new file mode 160000 index 000000000..2823c6a0b --- /dev/null +++ b/test/data @@ -0,0 +1 @@ +Subproject commit 2823c6a0ba9e642869537d8e5c1a1ca5fd3de18a diff --git a/test/data-visual b/test/data-visual new file mode 160000 index 000000000..d694deeca --- /dev/null +++ b/test/data-visual @@ -0,0 +1 @@ +Subproject commit d694deeca509481d540568b85f079ee35a3fda39 diff --git a/test/run b/test/run new file mode 100755 index 000000000..cd45c681f --- /dev/null +++ b/test/run @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +failures=0 + +cd "$( dirname "${BASH_SOURCE[0]}" )" +cd ../ +source ./localize.sh + +function run_step { >&2 echo -e "\033[1m\033[34m* $1\033[0m"; } +function run_substep { >&2 echo -e "\033[1m\033[36m* $1\033[0m"; } +function run_success { >&2 echo -e "\033[1m\033[32m* $1\033[0m"; } + +run_step "Starting Mapnik tests" + +if [ -d "test/data" ]; then + + run_substep "Running C++ Unit tests..." + ./test/unit/run + failures=$((failures+$?)) + + run_substep "Running standalone C++ tests..." + if [ -n "$(find test/standalone/ -maxdepth 1 -name '*-bin' -print -quit)" ]; then + for FILE in test/standalone/*-bin; do + ${FILE}; + failures=$((failures+$?)) + done + fi + + if [ -d "test/data-visual/styles" ]; then + run_substep "Running visual tests..." + if [ -z "$JOBS" ]; then + JOBS=1 + fi + ./test/visual/run -j $JOBS + failures=$((failures+$?)) + else + echo "Notice: Skipping visual tests, the visual tests data are not present under the standard directory \"test/data-visual\"." + fi + +else + echo "Notice: Skipping all tests, the test data are not present under the standard directory \"test/data\"." +fi + +exit $failures diff --git a/test/standalone/agg_rasterizer_integer_overflow_test.cpp b/test/standalone/agg_rasterizer_integer_overflow_test.cpp new file mode 100644 index 000000000..101596b83 --- /dev/null +++ b/test/standalone/agg_rasterizer_integer_overflow_test.cpp @@ -0,0 +1,64 @@ +#define CATCH_CONFIG_MAIN +#include "catch.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +// geojson box of the world +const std::string geojson("{ \"type\": \"Feature\", \"properties\": { }, \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [ [ [ -17963313.143242701888084, -6300857.11560364998877 ], [ -17963313.143242701888084, 13071343.332991421222687 ], [ 7396658.353099936619401, 13071343.332991421222687 ], [ 7396658.353099936619401, -6300857.11560364998877 ], [ -17963313.143242701888084, -6300857.11560364998877 ] ] ] } }"); + +TEST_CASE("agg_rasterizer_integer_overflow") { + +SECTION("coordinates_do_not_overflow_and_polygon_is_rendered") { + auto expected_color = mapnik::color("white"); + + mapnik::Map m(256,256); + m.set_background(mapnik::color("black")); + + mapnik::feature_type_style s; + { + mapnik::rule r; + mapnik::polygon_symbolizer sym; + mapnik::put(sym, mapnik::keys::fill, expected_color); + mapnik::put(sym, mapnik::keys::clip, false); + r.append(std::move(sym)); + s.add_rule(std::move(r)); + } + m.insert_style("style",std::move(s)); + + mapnik::layer lyr("Layer"); + lyr.styles().emplace_back("style"); + { + auto ds = std::make_shared(mapnik::parameters()); + auto context = std::make_shared(); + auto f = std::make_shared(context, 0); + REQUIRE(mapnik::json::from_geojson(geojson, *f)); + ds->push(f); + lyr.set_datasource(ds); + } + m.add_layer(std::move(lyr)); + + // 17/20864/45265.png + m.zoom_to_box(mapnik::box2d(-13658379.710221574,6197514.253362091,-13657768.213995293,6198125.749588372)); + + // works 15/5216/11316.png + //m.zoom_to_box(mapnik::box2d(-13658379.710221574,6195679.764683247,-13655933.72531645,6198125.749588372)); + + mapnik::image_rgba8 im(256, 256); + { + mapnik::agg_renderer ren(m, im); + ren.apply(); + } + + REQUIRE(im(128,128) == expected_color.rgba()); +} // SECTION +} // TEST_CASE diff --git a/test/standalone/csv_test.cpp b/test/standalone/csv_test.cpp new file mode 100644 index 000000000..2023f67f4 --- /dev/null +++ b/test/standalone/csv_test.cpp @@ -0,0 +1,682 @@ +#define CATCH_CONFIG_MAIN +#include "catch.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace bfs = boost::filesystem; + +namespace { +void add_csv_files(bfs::path dir, std::vector &csv_files) { + for (auto const &entry : boost::make_iterator_range( + bfs::directory_iterator(dir), bfs::directory_iterator())) { + auto path = entry.path(); + if (path.extension().native() == ".csv") { + csv_files.emplace_back(path); + } + } +} + +mapnik::datasource_ptr get_csv_ds(std::string const &file_name, bool strict = true) { + mapnik::parameters params; + params["type"] = std::string("csv"); + params["file"] = file_name; + params["strict"] = mapnik::value_bool(strict); + auto ds = mapnik::datasource_cache::instance().create(params); + // require a non-null pointer returned + REQUIRE(bool(ds)); + return ds; +} + +void require_field_names(std::vector const &fields, + std::initializer_list const &names) { + REQUIRE(fields.size() == names.size()); + auto itr_a = fields.begin(); + auto const end_a = fields.end(); + auto itr_b = names.begin(); + for (; itr_a != end_a; ++itr_a, ++itr_b) { + CHECK(itr_a->get_name() == *itr_b); + } +} + +void require_field_types(std::vector const &fields, + std::initializer_list const &types) { + REQUIRE(fields.size() == types.size()); + auto itr_a = fields.begin(); + auto const end_a = fields.end(); + auto itr_b = types.begin(); + for (; itr_a != end_a; ++itr_a, ++itr_b) { + CHECK(itr_a->get_type() == *itr_b); + } +} + +mapnik::featureset_ptr all_features(mapnik::datasource_ptr ds) { + auto fields = ds->get_descriptor().get_descriptors(); + mapnik::query query(ds->envelope()); + for (auto const &field : fields) { + query.add_property_name(field.get_name()); + } + return ds->features(query); +} + +std::size_t count_features(mapnik::featureset_ptr features) { + std::size_t count = 0; + while (features->next()) { + ++count; + } + return count; +} + +using attr = std::tuple; +void require_attributes(mapnik::feature_ptr feature, + std::initializer_list const &attrs) { + REQUIRE(bool(feature)); + for (auto const &kv : attrs) { + REQUIRE(feature->has_key(std::get<0>(kv))); + CHECK(feature->get(std::get<0>(kv)) == std::get<1>(kv)); + } +} + +namespace detail { +struct feature_count { + template + std::size_t operator()(T const &geom) const { + return mapnik::util::apply_visitor(*this, geom); + } + + std::size_t operator()(mapnik::geometry::geometry_empty const &) const { + return 0; + } + + template + std::size_t operator()(mapnik::geometry::point const &) const { + return 1; + } + + template + std::size_t operator()(mapnik::geometry::line_string const &) const { + return 1; + } + + template + std::size_t operator()(mapnik::geometry::polygon const &) const { + return 1; + } + + template + std::size_t operator()(mapnik::geometry::multi_point const &mp) const { + return mp.size(); + } + + template + std::size_t operator()(mapnik::geometry::multi_line_string const &mls) const { + return mls.size(); + } + + template + std::size_t operator()(mapnik::geometry::multi_polygon const &mp) const { + return mp.size(); + } + + template + std::size_t operator()(mapnik::geometry::geometry_collection const &col) const { + std::size_t sum = 0; + for (auto const &geom : col) { + sum += operator()(geom); + } + return sum; + } +}; +} // namespace detail + +template +std::size_t feature_count(mapnik::geometry::geometry const &g) { + return detail::feature_count()(g); +} + +void require_geometry(mapnik::feature_ptr feature, + std::size_t num_parts, + mapnik::geometry::geometry_types type) { + REQUIRE(bool(feature)); + CHECK(mapnik::geometry::geometry_type(feature->get_geometry()) == type); + CHECK(feature_count(feature->get_geometry()) == num_parts); +} +} // anonymous namespace + +static const std::string csv_plugin("./plugins/input/csv.input"); + +const bool registered = mapnik::datasource_cache::instance().register_datasources(csv_plugin); + +TEST_CASE("csv") { + + if (mapnik::util::exists(csv_plugin)) + { + + REQUIRE(registered); + + // make the tests silent since we intentially test error conditions that are noisy + auto const severity = mapnik::logger::instance().get_severity(); + mapnik::logger::instance().set_severity(mapnik::logger::none); + + // check the CSV datasource is loaded + const std::vector plugin_names = + mapnik::datasource_cache::instance().plugin_names(); + const bool have_csv_plugin = + std::find(plugin_names.begin(), plugin_names.end(), "csv") != plugin_names.end(); + + SECTION("broken files") { + if (have_csv_plugin) { + std::vector broken; + add_csv_files("test/data/csv/fails", broken); + add_csv_files("test/data/csv/warns", broken); + broken.emplace_back("test/data/csv/fails/does_not_exist.csv"); + + for (auto const &path : broken) { + REQUIRE_THROWS(get_csv_ds(path.native())); + } + } + } // END SECTION + + SECTION("good files") { + if (have_csv_plugin) { + std::vector good; + add_csv_files("test/data/csv", good); + add_csv_files("test/data/csv/warns", good); + + for (auto const &path : good) { + auto ds = get_csv_ds(path.native(), false); + // require a non-null pointer returned + REQUIRE(bool(ds)); + } + } + } // END SECTION + + SECTION("lon/lat detection") { + for (auto const &lon_name : {std::string("lon"), std::string("lng")}) { + auto ds = get_csv_ds((boost::format("test/data/csv/%1%_lat.csv") % lon_name).str()); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {lon_name, "lat"}); + require_field_types(fields, {mapnik::Integer, mapnik::Integer}); + + CHECK(ds->get_geometry_type() == mapnik::datasource_geometry_t::Point); + + mapnik::query query(ds->envelope()); + for (auto const &field : fields) { + query.add_property_name(field.get_name()); + } + auto features = ds->features(query); + auto feature = features->next(); + + require_attributes(feature, { + attr { lon_name, mapnik::value_integer(0) }, + attr { "lat", mapnik::value_integer(0) } + }); + } + } // END SECTION + + SECTION("type detection") { + auto ds = get_csv_ds("test/data/csv/nypd.csv"); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"Precinct", "Phone", "Address", "City", "geo_longitude", "geo_latitude", "geo_accuracy"}); + require_field_types(fields, {mapnik::String, mapnik::String, mapnik::String, mapnik::String, mapnik::Double, mapnik::Double, mapnik::String}); + + CHECK(ds->get_geometry_type() == mapnik::datasource_geometry_t::Point); + CHECK(count_features(all_features(ds)) == 2); + + auto feature = all_features(ds)->next(); + require_attributes(feature, { + attr { "City", mapnik::value_unicode_string("New York, NY") } + , attr { "geo_accuracy", mapnik::value_unicode_string("house") } + , attr { "Phone", mapnik::value_unicode_string("(212) 334-0711") } + , attr { "Address", mapnik::value_unicode_string("19 Elizabeth Street") } + , attr { "Precinct", mapnik::value_unicode_string("5th Precinct") } + , attr { "geo_longitude", mapnik::value_integer(-70) } + , attr { "geo_latitude", mapnik::value_integer(40) } + }); + } // END SECTION + + SECTION("skipping blank rows") { + auto ds = get_csv_ds("test/data/csv/blank_rows.csv"); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "name"}); + require_field_types(fields, {mapnik::Integer, mapnik::Integer, mapnik::String}); + + CHECK(ds->get_geometry_type() == mapnik::datasource_geometry_t::Point); + CHECK(count_features(all_features(ds)) == 2); + } // END SECTION + + SECTION("empty rows") { + auto ds = get_csv_ds("test/data/csv/empty_rows.csv"); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "text", "date", "integer", "boolean", "float", "time", "datetime", "empty_column"}); + require_field_types(fields, {mapnik::Integer, mapnik::Integer, mapnik::String, mapnik::String, mapnik::Integer, mapnik::Boolean, mapnik::Double, mapnik::String, mapnik::String, mapnik::String}); + + CHECK(ds->get_geometry_type() == mapnik::datasource_geometry_t::Point); + CHECK(count_features(all_features(ds)) == 4); + + auto featureset = all_features(ds); + auto feature = featureset->next(); + require_attributes(feature, { + attr { "x", mapnik::value_integer(0) } + , attr { "empty_column", mapnik::value_unicode_string("") } + , attr { "text", mapnik::value_unicode_string("a b") } + , attr { "float", mapnik::value_double(1.0) } + , attr { "datetime", mapnik::value_unicode_string("1971-01-01T04:14:00") } + , attr { "y", mapnik::value_integer(0) } + , attr { "boolean", mapnik::value_bool(true) } + , attr { "time", mapnik::value_unicode_string("04:14:00") } + , attr { "date", mapnik::value_unicode_string("1971-01-01") } + , attr { "integer", mapnik::value_integer(40) } + }); + + while (bool(feature = featureset->next())) { + CHECK(feature->size() == 10); + CHECK(feature->get("empty_column") == mapnik::value_unicode_string("")); + } + } // END SECTION + + SECTION("slashes") { + auto ds = get_csv_ds("test/data/csv/has_attributes_with_slashes.csv"); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "name"}); + // NOTE: y column is integer, even though a double value is used below in the test? + require_field_types(fields, {mapnik::Integer, mapnik::Integer, mapnik::String}); + + auto featureset = all_features(ds); + require_attributes(featureset->next(), { + attr{"x", 0} + , attr{"y", 0} + , attr{"name", mapnik::value_unicode_string("a/a") } }); + require_attributes(featureset->next(), { + attr{"x", 1} + , attr{"y", 4} + , attr{"name", mapnik::value_unicode_string("b/b") } }); + require_attributes(featureset->next(), { + attr{"x", 10} + , attr{"y", 2.5} + , attr{"name", mapnik::value_unicode_string("c/c") } }); + } // END SECTION + + SECTION("wkt field") { + using mapnik::geometry::geometry_types; + + auto ds = get_csv_ds("test/data/csv/wkt.csv"); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"type"}); + require_field_types(fields, {mapnik::String}); + + auto featureset = all_features(ds); + require_geometry(featureset->next(), 1, geometry_types::Point); + require_geometry(featureset->next(), 1, geometry_types::LineString); + require_geometry(featureset->next(), 1, geometry_types::Polygon); + require_geometry(featureset->next(), 1, geometry_types::Polygon); + require_geometry(featureset->next(), 4, geometry_types::MultiPoint); + require_geometry(featureset->next(), 2, geometry_types::MultiLineString); + require_geometry(featureset->next(), 2, geometry_types::MultiPolygon); + require_geometry(featureset->next(), 2, geometry_types::MultiPolygon); + } // END SECTION + + SECTION("handling of missing header") { + // TODO: does this mean 'missing_header.csv' should be in the warnings + // subdirectory, since it doesn't work in strict mode? + auto ds = get_csv_ds("test/data/csv/missing_header.csv", false); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"one", "two", "x", "y", "_4", "aftermissing"}); + auto feature = all_features(ds)->next(); + REQUIRE(feature); + REQUIRE(feature->has_key("_4")); + CHECK(feature->get("_4") == mapnik::value_unicode_string("missing")); + } // END SECTION + + SECTION("handling of headers that are numbers") { + auto ds = get_csv_ds("test/data/csv/numbers_for_headers.csv"); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "1990", "1991", "1992"}); + auto feature = all_features(ds)->next(); + require_attributes(feature, { + attr{"x", 0} + , attr{"y", 0} + , attr{"1990", 1} + , attr{"1991", 2} + , attr{"1992", 3} + }); + auto expression = mapnik::parse_expression("[1991]=2"); + REQUIRE(bool(expression)); + auto value = mapnik::util::apply_visitor( + mapnik::evaluate( + *feature, mapnik::attributes()), *expression); + CHECK(value == true); + } // END SECTION + + SECTION("quoted numbers") { + using ustring = mapnik::value_unicode_string; + + auto ds = get_csv_ds("test/data/csv/quoted_numbers.csv"); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "label"}); + auto featureset = all_features(ds); + + require_attributes(featureset->next(), { + attr{"x", 0}, attr{"y", 0}, attr{"label", ustring("0,0") } }); + require_attributes(featureset->next(), { + attr{"x", 5}, attr{"y", 5}, attr{"label", ustring("5,5") } }); + require_attributes(featureset->next(), { + attr{"x", 0}, attr{"y", 5}, attr{"label", ustring("0,5") } }); + require_attributes(featureset->next(), { + attr{"x", 5}, attr{"y", 0}, attr{"label", ustring("5,0") } }); + require_attributes(featureset->next(), { + attr{"x", 2.5}, attr{"y", 2.5}, attr{"label", ustring("2.5,2.5") } }); + + } // END SECTION + + SECTION("reading newlines") { + for (auto const &platform : {std::string("windows"), std::string("mac")}) { + std::string file_name = (boost::format("test/data/csv/%1%_newlines.csv") % platform).str(); + auto ds = get_csv_ds(file_name); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "z"}); + require_attributes(all_features(ds)->next(), { + attr{"x", 1}, attr{"y", 10}, attr{"z", 9999.9999} }); + } + } // END SECTION + + SECTION("mixed newlines") { + using ustring = mapnik::value_unicode_string; + + for (auto const &file : { + std::string("test/data/csv/mac_newlines_with_unix_inline.csv") + , std::string("test/data/csv/mac_newlines_with_unix_inline_escaped.csv") + , std::string("test/data/csv/windows_newlines_with_unix_inline.csv") + , std::string("test/data/csv/windows_newlines_with_unix_inline_escaped.csv") + }) { + auto ds = get_csv_ds(file); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "line"}); + require_attributes(all_features(ds)->next(), { + attr{"x", 0}, attr{"y", 0} + , attr{"line", ustring("many\n lines\n of text\n with unix newlines")} }); + } + } // END SECTION + + SECTION("tabs") { + auto ds = get_csv_ds("test/data/csv/tabs_in_csv.csv"); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "z"}); + require_attributes(all_features(ds)->next(), { + attr{"x", -122}, attr{"y", 48}, attr{"z", 0} }); + } // END SECTION + + SECTION("separators") { + using ustring = mapnik::value_unicode_string; + + for (auto const &file : { + std::string("test/data/csv/pipe_delimiters.csv") + , std::string("test/data/csv/semicolon_delimiters.csv") + }) { + auto ds = get_csv_ds(file); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "z"}); + require_attributes(all_features(ds)->next(), { + attr{"x", 0}, attr{"y", 0}, attr{"z", ustring("hello")} }); + } + } // END SECTION + + SECTION("null and bool keywords are empty strings") { + using ustring = mapnik::value_unicode_string; + + auto ds = get_csv_ds("test/data/csv/nulls_and_booleans_as_strings.csv"); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "null", "boolean"}); + require_field_types(fields, {mapnik::Integer, mapnik::Integer, mapnik::String, mapnik::Boolean}); + + auto featureset = all_features(ds); + require_attributes(featureset->next(), { + attr{"x", 0}, attr{"y", 0}, attr{"null", ustring("null")}, attr{"boolean", true}}); + require_attributes(featureset->next(), { + attr{"x", 0}, attr{"y", 0}, attr{"null", ustring("")}, attr{"boolean", false}}); + } // END SECTION + + SECTION("nonexistent query fields throw") { + auto ds = get_csv_ds("test/data/csv/lon_lat.csv"); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"lon", "lat"}); + require_field_types(fields, {mapnik::Integer, mapnik::Integer}); + + mapnik::query query(ds->envelope()); + for (auto const &field : fields) { + query.add_property_name(field.get_name()); + } + // also add an invalid one, triggering throw + query.add_property_name("bogus"); + + REQUIRE_THROWS(ds->features(query)); + } // END SECTION + + SECTION("leading zeros mean strings") { + using ustring = mapnik::value_unicode_string; + + auto ds = get_csv_ds("test/data/csv/leading_zeros.csv"); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "fips"}); + require_field_types(fields, {mapnik::Integer, mapnik::Integer, mapnik::String}); + + auto featureset = all_features(ds); + require_attributes(featureset->next(), { + attr{"x", 0}, attr{"y", 0}, attr{"fips", ustring("001")}}); + require_attributes(featureset->next(), { + attr{"x", 0}, attr{"y", 0}, attr{"fips", ustring("003")}}); + require_attributes(featureset->next(), { + attr{"x", 0}, attr{"y", 0}, attr{"fips", ustring("005")}}); + } // END SECTION + + SECTION("advanced geometry detection") { + using row = std::pair; + + for (row r : { + row{"point", mapnik::datasource_geometry_t::Point} + , row{"poly", mapnik::datasource_geometry_t::Polygon} + , row{"multi_poly", mapnik::datasource_geometry_t::Polygon} + , row{"line", mapnik::datasource_geometry_t::LineString} + }) { + std::string file_name = (boost::format("test/data/csv/%1%_wkt.csv") % r.first).str(); + auto ds = get_csv_ds(file_name); + CHECK(ds->get_geometry_type() == r.second); + } + } // END SECTION + + SECTION("creation of CSV from in-memory strings") { + using ustring = mapnik::value_unicode_string; + + for (auto const &name : {std::string("Winthrop, WA"), std::string(u8"Qu\u00e9bec")}) { + std::string csv_string = + (boost::format( + "wkt,Name\n" + "\"POINT (120.15 48.47)\",\"%1%\"\n" + ) % name).str(); + + mapnik::parameters params; + params["type"] = std::string("csv"); + params["inline"] = csv_string; + auto ds = mapnik::datasource_cache::instance().create(params); + REQUIRE(bool(ds)); + + auto feature = all_features(ds)->next(); + REQUIRE(bool(feature)); + REQUIRE(feature->has_key("Name")); + CHECK(feature->get("Name") == ustring(name.c_str())); + } + } // END SECTION + + SECTION("geojson quoting") { + using mapnik::geometry::geometry_types; + + for (auto const &file : { + std::string("test/data/csv/geojson_double_quote_escape.csv") + , std::string("test/data/csv/geojson_single_quote.csv") + , std::string("test/data/csv/geojson_2x_double_quote_filebakery_style.csv") + }) { + auto ds = get_csv_ds(file); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"type"}); + require_field_types(fields, {mapnik::String}); + + auto featureset = all_features(ds); + require_geometry(featureset->next(), 1, geometry_types::Point); + require_geometry(featureset->next(), 1, geometry_types::LineString); + require_geometry(featureset->next(), 1, geometry_types::Polygon); + require_geometry(featureset->next(), 1, geometry_types::Polygon); + require_geometry(featureset->next(), 4, geometry_types::MultiPoint); + require_geometry(featureset->next(), 2, geometry_types::MultiLineString); + require_geometry(featureset->next(), 2, geometry_types::MultiPolygon); + require_geometry(featureset->next(), 2, geometry_types::MultiPolygon); + } + } // END SECTION + + SECTION("blank undelimited rows are still parsed") { + using ustring = mapnik::value_unicode_string; + + // TODO: does this mean this CSV file should be in the warnings + // subdirectory, since it doesn't work in strict mode? + auto ds = get_csv_ds("test/data/csv/more_headers_than_column_values.csv", false); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "one", "two", "three"}); + require_field_types(fields, {mapnik::Integer, mapnik::Integer, mapnik::String, mapnik::String, mapnik::String}); + + require_attributes(all_features(ds)->next(), { + attr{"x", 0}, attr{"y", 0}, attr{"one", ustring("")}, attr{"two", ustring("")}, attr{"three", ustring("")} }); + } // END SECTION + + SECTION("fewer headers than rows throws") { + REQUIRE_THROWS(get_csv_ds("test/data/csv/more_column_values_than_headers.csv")); + } // END SECTION + + SECTION("feature ID only incremented for valid rows") { + auto ds = get_csv_ds("test/data/csv/warns/feature_id_counting.csv", false); + auto fs = all_features(ds); + + // first + auto feature = fs->next(); + REQUIRE(bool(feature)); + CHECK(feature->id() == 1); + + // second, should have skipped bogus one + feature = fs->next(); + REQUIRE(bool(feature)); + CHECK(feature->id() == 2); + + feature = fs->next(); + CHECK(!feature); + } // END SECTION + + SECTION("dynamically defining headers") { + using ustring = mapnik::value_unicode_string; + using row = std::pair; + + for (auto const &r : { + row{"test/data/csv/fails/needs_headers_two_lines.csv", 2} + , row{"test/data/csv/fails/needs_headers_one_line.csv", 1} + , row{"test/data/csv/fails/needs_headers_one_line_no_newline.csv", 1} + }) { + mapnik::parameters params; + params["type"] = std::string("csv"); + params["file"] = r.first; + params["headers"] = "x,y,name"; + auto ds = mapnik::datasource_cache::instance().create(params); + REQUIRE(bool(ds)); + + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "name"}); + require_field_types(fields, {mapnik::Integer, mapnik::Integer, mapnik::String}); + require_attributes(all_features(ds)->next(), { + attr{"x", 0}, attr{"y", 0}, attr{"name", ustring("data_name")} }); + REQUIRE(count_features(all_features(ds)) == r.second); + } + } // END SECTION + + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wlong-long" + SECTION("64bit int fields work") { + auto ds = get_csv_ds("test/data/csv/64bit_int.csv"); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "bigint"}); + require_field_types(fields, {mapnik::Integer, mapnik::Integer, mapnik::Integer}); + + auto fs = all_features(ds); + auto feature = fs->next(); + require_attributes(feature, { + attr{"x", 0}, attr{"y", 0}, attr{"bigint", 2147483648} }); + + feature = fs->next(); + require_attributes(feature, { + attr{"x", 0}, attr{"y", 0}, attr{"bigint", 9223372036854775807ll} }); + require_attributes(feature, { + attr{"x", 0}, attr{"y", 0}, attr{"bigint", 0x7FFFFFFFFFFFFFFFll} }); + } // END SECTION + #pragma GCC diagnostic pop + + SECTION("various number types") { + auto ds = get_csv_ds("test/data/csv/number_types.csv"); + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {"x", "y", "floats"}); + require_field_types(fields, {mapnik::Integer, mapnik::Integer, mapnik::Double}); + + auto fs = all_features(ds); + for (double d : { .0, +.0, 1e-06, -1e-06, 0.000001, 1.234e+16, 1.234e+16 }) { + auto feature = fs->next(); + REQUIRE(bool(feature)); + CHECK(feature->get("floats").get() == Approx(d)); + } + } // END SECTION + + SECTION("manually supplied extent") { + std::string csv_string("wkt,Name\n"); + mapnik::parameters params; + params["type"] = std::string("csv"); + params["inline"] = csv_string; + params["extent"] = "-180,-90,180,90"; + auto ds = mapnik::datasource_cache::instance().create(params); + REQUIRE(bool(ds)); + + auto box = ds->envelope(); + CHECK(box.minx() == -180); + CHECK(box.miny() == -90); + CHECK(box.maxx() == 180); + CHECK(box.maxy() == 90); + } // END SECTION + + SECTION("inline geojson") { + std::string csv_string = "geojson\n'{\"coordinates\":[-92.22568,38.59553],\"type\":\"Point\"}'"; + mapnik::parameters params; + params["type"] = std::string("csv"); + params["inline"] = csv_string; + auto ds = mapnik::datasource_cache::instance().create(params); + REQUIRE(bool(ds)); + + auto fields = ds->get_descriptor().get_descriptors(); + require_field_names(fields, {}); + + // TODO: this originally had the following comment: + // - re-enable after https://github.com/mapnik/mapnik/issues/2319 is fixed + // but that seems to have been merged and tested separately? + auto fs = all_features(ds); + auto feat = fs->next(); + CHECK(feature_count(feat->get_geometry()) == 1); + } // END SECTION + + mapnik::logger::instance().set_severity(severity); + } +} // END TEST CASE diff --git a/test/standalone/font_registration_test.cpp b/test/standalone/font_registration_test.cpp new file mode 100644 index 000000000..fda605f0c --- /dev/null +++ b/test/standalone/font_registration_test.cpp @@ -0,0 +1,191 @@ +#define CATCH_CONFIG_MAIN +#include "catch.hpp" + +#include +#include +#include +#include +#include + +#include +#include +#include + +TEST_CASE("font") { + +SECTION("registration") { + try + { + mapnik::logger logger; + mapnik::logger::severity_type original_severity = logger.get_severity(); + + // grab references to global statics of registered/cached fonts + auto const& global_mapping = mapnik::freetype_engine::get_mapping(); + auto const& global_cache = mapnik::freetype_engine::get_cache(); + + // mapnik.Map object has parallel structure for localized fonts + mapnik::Map m(1,1); + auto const& local_mapping = m.get_font_file_mapping(); + auto const& local_cache = m.get_font_memory_cache(); + + // should be empty to start + REQUIRE( global_mapping.empty() ); + REQUIRE( global_cache.empty() ); + REQUIRE( local_mapping.empty() ); + REQUIRE( local_cache.empty() ); + + std::string fontdir("fonts/"); + + REQUIRE( mapnik::util::exists( fontdir ) ); + REQUIRE( mapnik::util::is_directory( fontdir ) ); + + // test map cached fonts + REQUIRE( m.register_fonts(fontdir , false ) ); + REQUIRE( m.get_font_memory_cache().size() == 0 ); + REQUIRE( m.get_font_file_mapping().size() == 1 ); + REQUIRE( m.load_fonts() ); + REQUIRE( m.get_font_memory_cache().size() == 1 ); + REQUIRE( m.register_fonts(fontdir , true ) ); + REQUIRE( m.get_font_file_mapping().size() == 22 ); + REQUIRE( m.load_fonts() ); + REQUIRE( m.get_font_memory_cache().size() == 22 ); + + // copy discards memory cache but not file mapping + mapnik::Map m2(m); + REQUIRE( m2.get_font_memory_cache().size() == 0 ); + REQUIRE( m2.get_font_file_mapping().size() == 22 ); + REQUIRE( m2.load_fonts() ); + REQUIRE( m2.get_font_memory_cache().size() == 22 ); + + // test font-directory from XML + mapnik::Map m3(1,1); + mapnik::load_map_string(m3,""); + REQUIRE( m3.get_font_memory_cache().size() == 0 ); + REQUIRE( m3.load_fonts() ); + REQUIRE( m3.get_font_memory_cache().size() == 1 ); + + std::vector face_names; + std::string foo("foo"); + // fake directories + REQUIRE( !mapnik::freetype_engine::register_fonts(foo , true ) ); + face_names = mapnik::freetype_engine::face_names(); + REQUIRE( face_names.size() == 0 ); + REQUIRE( !mapnik::freetype_engine::register_fonts(foo) ); + face_names = mapnik::freetype_engine::face_names(); + REQUIRE( face_names.size() == 0 ); + + // directories without fonts + // silence warnings here by altering the logging severity + logger.set_severity(mapnik::logger::none); + std::string src("src"); + // an empty directory will not return true + // we need to register at least one font and not fail on any + // to return true + REQUIRE( mapnik::freetype_engine::register_font(src) == false ); + REQUIRE( mapnik::freetype_engine::register_fonts(src, true) == false ); + REQUIRE( mapnik::freetype_engine::face_names().size() == 0 ); + + // bogus, emtpy file that looks like font + REQUIRE( mapnik::freetype_engine::register_font("test/data/fonts/fake.ttf") == false ); + REQUIRE( mapnik::freetype_engine::register_fonts("test/data/fonts/fake.ttf") == false ); + REQUIRE( mapnik::freetype_engine::face_names().size() == 0 ); + + REQUIRE( mapnik::freetype_engine::register_font("test/data/fonts/intentionally-broken.ttf") == false ); + REQUIRE( mapnik::freetype_engine::register_fonts("test/data/fonts/intentionally-broken.ttf") == false ); + REQUIRE( mapnik::freetype_engine::face_names().size() == 0 ); + + // now restore the original severity + logger.set_severity(original_severity); + + // register unifont, since we know it sits in the root fonts/ dir + REQUIRE( mapnik::freetype_engine::register_fonts(fontdir) ); + face_names = mapnik::freetype_engine::face_names(); + REQUIRE( face_names.size() > 0 ); + REQUIRE( face_names.size() == 1 ); + + // re-register unifont, should not have any affect + REQUIRE( mapnik::freetype_engine::register_fonts(fontdir, false) ); + face_names = mapnik::freetype_engine::face_names(); + REQUIRE( face_names.size() == 1 ); + + // single dejavu font in separate location + std::string dejavu_bold_oblique("test/data/fonts/DejaVuSansMono-BoldOblique.ttf"); + REQUIRE( mapnik::freetype_engine::register_font(dejavu_bold_oblique) ); + face_names = mapnik::freetype_engine::face_names(); + REQUIRE( face_names.size() == 2 ); + + // now, inspect font mapping and confirm the correct 'DejaVu Sans Mono Bold Oblique' is registered + using font_file_mapping = std::map >; + font_file_mapping const& name2file = mapnik::freetype_engine::get_mapping(); + bool found_dejavu = false; + for (auto const& item : name2file) + { + if (item.first == "DejaVu Sans Mono Bold Oblique") + { + found_dejavu = true; + REQUIRE( item.second.first == 0 ); + REQUIRE( item.second.second == dejavu_bold_oblique ); + } + } + REQUIRE( found_dejavu ); + + // recurse to find all dejavu fonts + REQUIRE( mapnik::freetype_engine::register_fonts(fontdir, true) ); + face_names = mapnik::freetype_engine::face_names(); + REQUIRE( face_names.size() == 22 ); + + // we should have re-registered 'DejaVu Sans Mono Bold Oblique' again, + // but now at a new path + bool found_dejavu2 = false; + for (auto const& item : name2file) + { + if (item.first == "DejaVu Sans Mono Bold Oblique") + { + found_dejavu2 = true; + REQUIRE( item.second.first == 0 ); + // path should be different + REQUIRE( item.second.second != dejavu_bold_oblique ); + } + } + REQUIRE( found_dejavu2 ); + + // now that global registry is populated + // now test that a map only loads new fonts + mapnik::Map m4(1,1); + REQUIRE( m4.register_fonts(fontdir , true ) ); + REQUIRE( m4.get_font_memory_cache().size() == 0 ); + REQUIRE( m4.get_font_file_mapping().size() == 22 ); + REQUIRE( !m4.load_fonts() ); + REQUIRE( m4.get_font_memory_cache().size() == 0 ); + REQUIRE( m4.register_fonts(dejavu_bold_oblique, false) ); + REQUIRE( m4.load_fonts() ); + REQUIRE( m4.get_font_memory_cache().size() == 1 ); + + // check that we can correctly read a .ttc containing + // multiple valid faces + // https://github.com/mapnik/mapnik/issues/2274 + REQUIRE( mapnik::freetype_engine::register_font("test/data/fonts/NotoSans-Regular.ttc") ); + face_names = mapnik::freetype_engine::face_names(); + REQUIRE( face_names.size() == 24 ); + + // now blindly register as many system fonts as possible + // the goal here to make sure we don't crash + // linux + mapnik::freetype_engine::register_fonts("/usr/share/fonts/", true); + mapnik::freetype_engine::register_fonts("/usr/local/share/fonts/", true); + // osx + mapnik::freetype_engine::register_fonts("/Library/Fonts/", true); + mapnik::freetype_engine::register_fonts("/System/Library/Fonts/", true); + // windows + mapnik::freetype_engine::register_fonts("C:\\Windows\\Fonts", true); + face_names = mapnik::freetype_engine::face_names(); + REQUIRE( face_names.size() > 22 ); + } + catch (std::exception const & ex) + { + std::clog << ex.what() << "\n"; + REQUIRE(false); + } + +} +} \ No newline at end of file diff --git a/test/unit/README.md b/test/unit/README.md new file mode 100644 index 000000000..d446edec0 --- /dev/null +++ b/test/unit/README.md @@ -0,0 +1,11 @@ + +## C++ unit tests + +### Building + + python scons/scons.py test/unit/run + + +### Running + + ./test/unit/run \ No newline at end of file diff --git a/test/unit/color/css_color.cpp b/test/unit/color/css_color.cpp new file mode 100644 index 000000000..38e151890 --- /dev/null +++ b/test/unit/color/css_color.cpp @@ -0,0 +1,38 @@ +#include "catch.hpp" +#include +#include + +TEST_CASE("css color") { + + SECTION("conversions") + { + mapnik::percent_conv_impl conv; + CHECK( conv(1.0) == 3 ); + CHECK( conv(60.0) == 153 ); + // should not overflow on invalid input + CHECK( conv(100000.0) == 255 ); + CHECK( conv(-100000.0) == 0 ); + + mapnik::alpha_conv_impl conv2; + CHECK( conv2(0.5) == 128 ); + CHECK( conv2(1.0) == 255 ); + // should not overflow on invalid input + CHECK( conv2(60.0) == 255 ); + CHECK( conv2(100000.0) == 255 ); + CHECK( conv2(-100000.0) == 0 ); + + mapnik::hsl_conv_impl conv3; + mapnik::color c; + conv3(c, 1.0, 1.0, 1.0); + CHECK( c.alpha() == 255 ); + CHECK( c.red() == 3 ); + CHECK( c.green() == 3 ); + CHECK( c.blue() == 3 ); + // invalid + conv3(c, -1, -1, -1); + CHECK( c.alpha() == 255 ); // should not be touched by hsl converter + CHECK( c.red() == 0 ); + CHECK( c.green() == 0 ); + CHECK( c.blue() == 0 ); + } +} \ No newline at end of file diff --git a/test/unit/core/box2d_test.cpp b/test/unit/core/box2d_test.cpp new file mode 100644 index 000000000..0ed32f851 --- /dev/null +++ b/test/unit/core/box2d_test.cpp @@ -0,0 +1,163 @@ +#include "catch.hpp" + +#include +#include +#include + +TEST_CASE("box2d") { +SECTION("coord init") { + auto c = mapnik::coord2d(100, 100); + + REQUIRE(c.x == 100); + REQUIRE(c.y == 100); +} + +SECTION("coord multiplication") { + auto c = mapnik::coord2d(100, 100); + c *= 2; + + REQUIRE(c.x == 200); + REQUIRE(c.y == 200); +} + +SECTION("envelope init") { + auto e = mapnik::box2d(100, 100, 200, 200); + + REQUIRE(e.contains(100, 100)); + REQUIRE(e.contains(100, 200)); + REQUIRE(e.contains(200, 200)); + REQUIRE(e.contains(200, 100)); + + REQUIRE(e.contains(e.center())); + + REQUIRE(!e.contains(99.9, 99.9)); + REQUIRE(!e.contains(99.9, 200.1)); + REQUIRE(!e.contains(200.1, 200.1)); + REQUIRE(!e.contains(200.1, 99.9)); + + REQUIRE(e.width() == 100); + REQUIRE(e.height() == 100); + + REQUIRE(e.minx() == 100); + REQUIRE(e.miny() == 100); + + REQUIRE(e.maxx() == 200); + REQUIRE(e.maxy() == 200); + + REQUIRE(e[0] == 100); + REQUIRE(e[1] == 100); + REQUIRE(e[2] == 200); + REQUIRE(e[3] == 200); + REQUIRE(e[0] == e[-4]); + REQUIRE(e[1] == e[-3]); + REQUIRE(e[2] == e[-2]); + REQUIRE(e[3] == e[-1]); + + auto c = e.center(); + + REQUIRE(c.x == 150); + REQUIRE(c.y == 150); +} + +SECTION("envelope static init") { + auto e = mapnik::box2d(100, 100, 200, 200); + + mapnik::box2d e1, e2, e3; + REQUIRE(e1.from_string("100 100 200 200")); + REQUIRE(e2.from_string("100,100,200,200")); + REQUIRE(e3.from_string("100 , 100 , 200 , 200")); + + REQUIRE(e == e1); + REQUIRE(e == e2); + REQUIRE(e == e3); +} + +SECTION("envelope multiplication") { + // no width then no impact of multiplication + { + auto a = mapnik::box2d(100, 100, 100, 100); + a *= 5; + + REQUIRE(a.minx() == 100); + REQUIRE(a.miny() == 100); + REQUIRE(a.maxx() == 100); + REQUIRE(a.maxy() == 100); + } + + { + auto a = mapnik::box2d(100.0, 100.0, 100.0, 100.0); + a *= 5; + + REQUIRE(a.minx() == 100); + REQUIRE(a.miny() == 100); + REQUIRE(a.maxx() == 100); + REQUIRE(a.maxy() == 100); + } + + { + auto a = mapnik::box2d(100.0, 100.0, 100.001, 100.001); + a *= 5; + + REQUIRE(a.minx() == Approx( 99.9980)); + REQUIRE(a.miny() == Approx( 99.9980)); + REQUIRE(a.maxx() == Approx(100.0030)); + REQUIRE(a.maxy() == Approx(100.0030)); + } + + { + auto e = mapnik::box2d(100, 100, 200, 200); + e *= 2; + + REQUIRE(e.minx() == 50); + REQUIRE(e.miny() == 50); + REQUIRE(e.maxx() == 250); + REQUIRE(e.maxy() == 250); + + REQUIRE(e.contains(50, 50)); + REQUIRE(e.contains(50, 250)); + REQUIRE(e.contains(250, 250)); + REQUIRE(e.contains(250, 50)); + + REQUIRE(!e.contains(49.9, 49.9)); + REQUIRE(!e.contains(49.9, 250.1)); + REQUIRE(!e.contains(250.1, 250.1)); + REQUIRE(!e.contains(250.1, 49.9)); + + REQUIRE(e.contains(e.center())); + + REQUIRE(e.width() == 200); + REQUIRE(e.height() == 200); + + REQUIRE(e.minx() == 50); + REQUIRE(e.miny() == 50); + + REQUIRE(e.maxx() == 250); + REQUIRE(e.maxy() == 250); + + auto c = e.center(); + + REQUIRE(c.x == 150); + REQUIRE(c.y == 150); + } +} + +SECTION("envelope clipping") { + auto e1 = mapnik::box2d(-180,-90,180,90); + auto e2 = mapnik::box2d(-120,40,-110,48); + e1.clip(e2); + REQUIRE(e1 == e2); + + // madagascar in merc + e1 = mapnik::box2d(4772116.5490, -2744395.0631, 5765186.4203, -1609458.0673); + e2 = mapnik::box2d(5124338.3753, -2240522.1727, 5207501.8621, -2130452.8520); + e1.clip(e2); + REQUIRE(e1 == e2); + + // nz in lon/lat + e1 = mapnik::box2d(163.8062, -47.1897, 179.3628, -33.9069); + e2 = mapnik::box2d(173.7378, -39.6395, 174.4849, -38.9252); + e1.clip(e2); + REQUIRE(e1 == e2); +} + +} // TEST_CASE diff --git a/tests/cpp_tests/conversions_test.cpp b/test/unit/core/conversions_test.cpp similarity index 60% rename from tests/cpp_tests/conversions_test.cpp rename to test/unit/core/conversions_test.cpp index bb86f7138..0b42d8512 100644 --- a/tests/cpp_tests/conversions_test.cpp +++ b/test/unit/core/conversions_test.cpp @@ -1,27 +1,27 @@ +#include "catch.hpp" + #include #include +#include #include -#include + #include #include #include -#include +#include +#include #if defined(_MSC_VER) && _MSC_VER < 1900 #include #endif -int main(int argc, char** argv) -{ +TEST_CASE("conversions") { + +SECTION("to string") { + #if defined(_MSC_VER) && _MSC_VER < 1900 unsigned int old = _set_output_format(_TWO_DIGIT_EXPONENT); #endif - std::vector args; - for (int i=1;i; + using values_container = std::unordered_map; values_container vc; mapnik::value val2(1); vc[val2] = 1; - BOOST_TEST_EQ( (int)vc[1], (int)1 ); + REQUIRE( vc[1] == static_cast(1) ); + + // mapnik::value << to ostream + std::stringstream s; + mapnik::transcoder tr("utf-8"); + mapnik::value_unicode_string ustr = tr.transcode("hello world!"); + mapnik::value streamable(ustr); + s << streamable; + CHECK( s.str() == std::string("hello world!") ); } catch (std::exception const & ex) { std::clog << ex.what() << "\n"; - BOOST_TEST(false); - } - - if (!::boost::detail::test_errors()) { - if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; - else std::clog << "C++ type conversions: \x1b[1;32m✓ \x1b[0m\n"; - ::boost::detail::report_errors_remind().called_report_errors_function = true; - } else { - return ::boost::report_errors(); + REQUIRE(false); } } + +} diff --git a/test/unit/core/copy_move_test.cpp b/test/unit/core/copy_move_test.cpp new file mode 100644 index 000000000..690537920 --- /dev/null +++ b/test/unit/core/copy_move_test.cpp @@ -0,0 +1,83 @@ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "catch.hpp" + + +TEST_CASE("copy") { + +SECTION("layers") { + + try + { + mapnik::Map m0(100,100); + mapnik::Map m2(200,100); + std::string shape_plugin("./plugins/input/shape.input"); + if (mapnik::util::exists(shape_plugin)) + { + mapnik::datasource_cache::instance().register_datasources("plugins/input/shape.input"); + mapnik::parameters p; + p["type"]="shape"; + p["file"]="demo/data/boundaries"; + p["encoding"]="latin1"; + auto ds0 = mapnik::datasource_cache::instance().create(p); + + auto ds1 = ds0; // shared ptr copy + REQUIRE( (ds1 == ds0) ); + REQUIRE( !(*ds1 != *ds0) ); + REQUIRE( (ds1.get() == ds0.get()) ); + ds1 = mapnik::datasource_cache::instance().create(p); // new with the same parameters + REQUIRE( (ds1 != ds0) ); + REQUIRE( (*ds1 == *ds0) ); + auto ds2 = std::move(ds1); + REQUIRE( (ds2 != ds0) ); + REQUIRE( (*ds2 == *ds0) ); + + // mapnik::layer + mapnik::layer l0("test-layer"); + l0.set_datasource(ds0); + + mapnik::layer l1 = l0; // copy assignment + REQUIRE( (l1 == l0) ); + mapnik::layer l2(l0); // copy ctor + REQUIRE( (l2 == l0) ); + mapnik::layer l3(mapnik::layer("test-layer")); // move ctor + l3.set_datasource(ds2); + + REQUIRE( (l3 == l0) ); + mapnik::layer l4 = std::move(l3); + REQUIRE( (l4 == l0) ); // move assignment + + m0.add_layer(l4); + m0.set_background(mapnik::color("skyblue")); + m2.set_background(mapnik::color("skyblue")); + + auto m1 = m0; //copy + + REQUIRE( (m0 == m1) ); + REQUIRE( (m0 != m2) ); + + m2 = m1; // copy + REQUIRE( (m2 == m1) ); + m2 = std::move(m1); + REQUIRE( (m2 == m0) ); + REQUIRE( (m1 != m0) ); + + REQUIRE( (m0 == m2) ); + } + } + catch (std::exception const & ex) + { + std::clog << ex.what() << "\n"; + REQUIRE(false); + } +} +} \ No newline at end of file diff --git a/tests/cpp_tests/exceptions_test.cpp b/test/unit/core/exceptions_test.cpp similarity index 66% rename from tests/cpp_tests/exceptions_test.cpp rename to test/unit/core/exceptions_test.cpp index 1bfc826e0..332460082 100644 --- a/tests/cpp_tests/exceptions_test.cpp +++ b/test/unit/core/exceptions_test.cpp @@ -1,10 +1,10 @@ -#include +#include "catch.hpp" + #include #include #include #include #include -#include #include #include #include @@ -20,51 +20,41 @@ #include #include -#include "utils.hpp" +TEST_CASE("exceptions") { -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;i ren(m,im); + mapnik::image_rgba8 im(m.width(),m.height()); + mapnik::agg_renderer ren(m,im); //std::clog << mapnik::save_map_to_string(m) << "\n"; - BOOST_TEST(true); + REQUIRE(true); // should throw here with "CSV Plugin: no attribute 'foo'. Valid attributes are: x,y." ren.apply(); - BOOST_TEST(false); + REQUIRE(false); } catch (...) { - BOOST_TEST(true); + REQUIRE(true); } } @@ -103,17 +93,11 @@ int main(int argc, char** argv) p2["type"]="shape"; p2["file"]="foo"; mapnik::datasource_cache::instance().create(p2); - BOOST_TEST(false); + REQUIRE(false); } catch (...) { - BOOST_TEST(true); + REQUIRE(true); } } - if (!::boost::detail::test_errors()) { - if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; - else std::clog << "C++ exceptions: \x1b[1;32m✓ \x1b[0m\n"; - ::boost::detail::report_errors_remind().called_report_errors_function = true; - } else { - return ::boost::report_errors(); - } +} } diff --git a/test/unit/core/params_test.cpp b/test/unit/core/params_test.cpp new file mode 100644 index 000000000..879b86177 --- /dev/null +++ b/test/unit/core/params_test.cpp @@ -0,0 +1,115 @@ +#include "catch.hpp" + +#include +#include +#include +#include +#include +#include + +#include + +namespace detail { + +class string_holder { + public: + string_holder() : + member_("member") {} + std::string const& get_string() const + { + return member_; + } + private: + std::string member_; +}; + +} + +TEST_CASE("parameters") { + +SECTION("get/set") { + + try + { + mapnik::parameters params; + + // true + params["bool"] = mapnik::value_integer(true); + REQUIRE( (params.get("bool") && *params.get("bool") == true)); + + params["bool"] = "true"; + REQUIRE( (params.get("bool") && *params.get("bool") == true)); + + params["bool"] = mapnik::value_integer(1); + REQUIRE( (params.get("bool") && *params.get("bool") == true)); + + params["bool"] = "1"; + REQUIRE( (params.get("bool") && *params.get("bool") == true)); + + params["bool"] = "True"; + REQUIRE( (params.get("bool") && *params.get("bool") == true)); + + params["bool"] = "on"; + REQUIRE( (params.get("bool") && *params.get("bool") == true)); + + params["bool"] = "yes"; + REQUIRE( (params.get("bool") && *params.get("bool") == true)); + + // false + params["bool"] = mapnik::value_integer(false); + REQUIRE( (params.get("bool") && *params.get("bool") == false) ); + + params["bool"] = "false"; + REQUIRE( (params.get("bool") && *params.get("bool") == false) ); + + params["bool"] = mapnik::value_integer(0); + REQUIRE( (params.get("bool") && *params.get("bool") == false)); + + params["bool"] = "0"; + REQUIRE( (params.get("bool") && *params.get("bool") == false)); + + params["bool"] = "False"; + REQUIRE( (params.get("bool") && *params.get("bool") == false)); + + params["bool"] = "off"; + REQUIRE( (params.get("bool") && *params.get("bool") == false)); + + params["bool"] = "no"; + REQUIRE( (params.get("bool") && *params.get("bool") == false)); + + // strings + params["string"] = "hello"; + REQUIRE( (params.get("string") && *params.get("string") == "hello") ); + + // int + params["int"] = mapnik::value_integer(1); + REQUIRE( (params.get("int") && *params.get("int") == 1) ); + + // double + params["double"] = 1.5; + REQUIRE( (params.get("double") && *params.get("double") == 1.5) ); + // value_null + params["null"] = mapnik::value_null(); + // https://github.com/mapnik/mapnik/issues/2471 + //REQUIRE( (params.get("null") && *params.get("null") == mapnik::value_null()) ); + + std::string value("value"); + params["value"] = value; + REQUIRE( (params.get("value") == std::string("value")) ) ; + REQUIRE(value == std::string("value")); + + // ensure that const member is not moved incorrectly when added to params + detail::string_holder holder; + std::string const& holder_member = holder.get_string(); + params["member"] = holder_member; + REQUIRE( (params.get("member") == std::string("member")) ); + REQUIRE( (holder_member == std::string("member")) ); + } + catch (std::exception const& ex) + { + std::cerr << ex.what() << "\n"; + REQUIRE(false); + } + +} +} diff --git a/tests/cpp_tests/data/cases.txt b/test/unit/data/cases.txt similarity index 100% rename from tests/cpp_tests/data/cases.txt rename to test/unit/data/cases.txt diff --git a/tests/cpp_tests/fontset_runtime_test.cpp b/test/unit/font/fontset_runtime_test.cpp similarity index 70% rename from tests/cpp_tests/fontset_runtime_test.cpp rename to test/unit/font/fontset_runtime_test.cpp index 1b7cc59f9..4e703fa99 100644 --- a/tests/cpp_tests/fontset_runtime_test.cpp +++ b/test/unit/font/fontset_runtime_test.cpp @@ -1,11 +1,11 @@ -#include +#include "catch.hpp" + #include #include #include #include #include #include -#include #include #include #include @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -25,22 +24,11 @@ #include #include -// icu - for memory cleanup (to make valgrind happy) -#include "unicode/uclean.h" +TEST_CASE("fontset") { -#include "utils.hpp" - -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;iput("name",ustr); - auto pt = std::make_unique(mapnik::geometry_type::types::Point); - pt->move_to(128,128); - feature->add_geometry(pt.release()); + //auto pt = std::make_unique(mapnik::geometry::geometry_types::Point); + //pt->move_to(128,128); + mapnik::geometry::point pt(128,128); + feature->set_geometry(std::move(pt)); mapnik::parameters params; params["type"]="memory"; @@ -82,18 +71,11 @@ int main(int argc, char** argv) m.insert_style("style", std::move(the_style) ); m.zoom_to_box(mapnik::box2d(-256,-256, 256,256)); - mapnik::image_32 buf(m.width(),m.height()); - mapnik::agg_renderer ren(m,buf); + mapnik::image_rgba8 buf(m.width(),m.height()); + mapnik::agg_renderer ren(m,buf); ren.apply(); } catch (std::exception const& ex) { - BOOST_TEST_EQ(std::string(ex.what()),std::string("Unable to find specified font face 'DejaVu Sans Book' in font set: 'fontset'")); - } - u_cleanup(); - if (!::boost::detail::test_errors()) { - if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; - else std::clog << "C++ fontset runtime: \x1b[1;32m✓ \x1b[0m\n"; - ::boost::detail::report_errors_remind().called_report_errors_function = true; - } else { - return ::boost::report_errors(); + REQUIRE(std::string(ex.what()) == std::string("Unable to find specified font face 'DejaVu Sans Book' in font set: 'fontset'")); } } +} \ No newline at end of file diff --git a/test/unit/geometry/geometry.cpp b/test/unit/geometry/geometry.cpp new file mode 100644 index 000000000..4e0598a98 --- /dev/null +++ b/test/unit/geometry/geometry.cpp @@ -0,0 +1,39 @@ +#include "catch.hpp" + +#include +#include +#include +#include +#include + +TEST_CASE("geometry") { + +SECTION("json point") { + mapnik::util::file input("./test/data/json/point1.json"); + REQUIRE( input.open() ); + mapnik::geometry::geometry geom; + REQUIRE( input.data() ); + std::string json_string(input.data().get(), input.size()); + REQUIRE( mapnik::json::from_geojson(json_string, geom) ); + REQUIRE( geom.is >() ); + auto const& point = mapnik::util::get >(geom); + REQUIRE( point.x == 30 ); + REQUIRE( point.y == 10 ); + std::string new_json; + REQUIRE( mapnik::util::to_geojson(new_json, geom) ); +} + +SECTION("json point reversed") { + mapnik::util::file input("./test/data/json/point2.json"); + REQUIRE( input.open() ); + mapnik::geometry::geometry geom; + REQUIRE( input.data() ); + std::string json_string(input.data().get(), input.size()); + REQUIRE( mapnik::json::from_geojson(json_string,geom) ); + REQUIRE( geom.is >() ); + auto const& point = mapnik::util::get >(geom); + REQUIRE( point.x == 30 ); + REQUIRE( point.y == 10 ); +} + +} diff --git a/tests/cpp_tests/geometry_converters_test.cpp b/test/unit/geometry/geometry_converters_test.cpp similarity index 76% rename from tests/cpp_tests/geometry_converters_test.cpp rename to test/unit/geometry/geometry_converters_test.cpp index 1bc115617..3689051b5 100644 --- a/tests/cpp_tests/geometry_converters_test.cpp +++ b/test/unit/geometry/geometry_converters_test.cpp @@ -1,8 +1,8 @@ -#include +#include "catch.hpp" + #include #include #include -#include "utils.hpp" #include #include @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -20,7 +19,7 @@ // stl #include - +#if 0 // FIXME struct output_geometry_backend { output_geometry_backend(mapnik::geometry_container & paths, mapnik::geometry_type::types type) @@ -56,7 +55,7 @@ boost::optional linestring_bbox_clipping(mapnik::box2d bbox line_symbolizer sym; view_transform t(bbox.width(),bbox.height(), bbox); mapnik::geometry_container output_paths; - output_geometry_backend backend(output_paths, mapnik::geometry_type::types::LineString); + output_geometry_backend backend(output_paths, mapnik::geometry::geometry_types::LineString); mapnik::context_ptr ctx = std::make_shared(); mapnik::feature_impl f(ctx,0); @@ -71,13 +70,14 @@ boost::optional linestring_bbox_clipping(mapnik::box2d bbox throw std::runtime_error("Failed to parse WKT"); } - for (geometry_type & geom : p) + for (geometry_type const& geom : p) { - converter.apply(geom); + vertex_adapter va(geom); + converter.apply(va); } using sink_type = std::back_insert_iterator; - std::string wkt; // Use Python String directly ? + std::string wkt; sink_type sink(wkt); static const mapnik::wkt::wkt_multi_generator generator; if (boost::spirit::karma::generate(sink, generator, output_paths)) @@ -98,7 +98,7 @@ boost::optional polygon_bbox_clipping(mapnik::box2d bbox, polygon_symbolizer sym; view_transform t(bbox.width(),bbox.height(), bbox); mapnik::geometry_container output_paths; - output_geometry_backend backend(output_paths, mapnik::geometry_type::types::Polygon); + output_geometry_backend backend(output_paths, mapnik::geometry::geometry_types::Polygon); mapnik::context_ptr ctx = std::make_shared(); mapnik::feature_impl f(ctx,0); @@ -113,9 +113,10 @@ boost::optional polygon_bbox_clipping(mapnik::box2d bbox, throw std::runtime_error("Failed to parse WKT"); } - for (geometry_type & geom : p) + for (geometry_type const& geom : p) { - converter.apply(geom); + vertex_adapter va(geom); + converter.apply(va); } using sink_type = std::back_insert_iterator; @@ -130,72 +131,62 @@ boost::optional polygon_bbox_clipping(mapnik::box2d bbox, return boost::optional(); } -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;i result = linestring_bbox_clipping(mapnik::box2d(50,50,150,150),wkt_in); - BOOST_TEST(result); - BOOST_TEST_EQ(*result,std::string("LineString(50 50,150 150)")); + REQUIRE(result); + REQUIRE(*result == std::string("LineString(50 50,150 150)")); } // Polygon/bbox clipping - #if 0 - // these tests will fail { std::string wkt_in("Polygon((50 50,150 50,150 150,50 150,50 50))"); boost::optional result = polygon_bbox_clipping(mapnik::box2d(50,50,150,150),wkt_in); - BOOST_TEST(result); - BOOST_TEST_EQ(*result,std::string("Polygon((50 50,150 50,150 150,50 150,50 50))")); + REQUIRE(result); + // TODO - the extra 50 50 is not ideal, but we enforce this result for now to prevent + // regressions and because we don't have actionable solution to drop extra 50 50 + REQUIRE(*result == std::string("Polygon((50 50,150 50,150 150,50 150,50 50,50 50))")); + // below is ideal, but not current result + //REQUIRE(*result == std::string("Polygon((50 50,150 50,150 150,50 150,50 50))")); } { std::string wkt_in("Polygon((60 60,140 60,140 160,60 140,60 60))"); boost::optional result = polygon_bbox_clipping(mapnik::box2d(50,50,150,150),wkt_in); - BOOST_TEST(result); - BOOST_TEST_EQ(*result,std::string("Polygon((60 60,140 60,140 160,60 140,60 60))")); + REQUIRE(result); + REQUIRE(*result == std::string("Polygon((60 60,140 60,140 150,100 150,60 140,60 60,60 60))")); + //REQUIRE(*result == std::string("Polygon((60 60,140 60,140 160,60 140,60 60))")); } { std::string wkt_in("Polygon((0 0,10 0,10 10,0 10,0 0))"); boost::optional result = polygon_bbox_clipping(mapnik::box2d(50,50,150,150),wkt_in); - BOOST_TEST(result); - BOOST_TEST_EQ(*result, std::string("GeometryCollection EMPTY")); + REQUIRE(result); + // TODO - this is completely wrong: should not have )) and ideally should be EMPTY + REQUIRE(*result == std::string("Polygon())")); } { std::string wkt_in("Polygon((0 0,100 200,200 0,0 0 ))"); boost::optional result = polygon_bbox_clipping(mapnik::box2d(50,50,150,150),wkt_in); - BOOST_TEST(result); - BOOST_TEST_EQ(*result,std::string("Polygon((50 50,50 100,75 150,125 150,150 100,150 50,50 50))")); + REQUIRE(result); + REQUIRE(*result == std::string("Polygon((50 50,50 100,75 150,125 150,150 100,150 50))")); + //REQUIRE(*result == std::string("Polygon((50 50,50 100,75 150,125 150,150 100,150 50,50 50))")); } - #endif +#endif } catch (std::exception const & ex) { std::clog << ex.what() << "\n"; - BOOST_TEST(false); - } - - - if (!::boost::detail::test_errors()) - { - if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; - else std::clog << "C++ geometry conversions: \x1b[1;32m✓ \x1b[0m\n"; - ::boost::detail::report_errors_remind().called_report_errors_function = true; - } - else - { - return ::boost::report_errors(); + REQUIRE(false); } } +} diff --git a/test/unit/geometry/geometry_envelope_test.cpp b/test/unit/geometry/geometry_envelope_test.cpp new file mode 100644 index 000000000..0b7087cd6 --- /dev/null +++ b/test/unit/geometry/geometry_envelope_test.cpp @@ -0,0 +1,153 @@ +#include "catch.hpp" + +#include +#include +#include +#include +#include + +TEST_CASE("geometry ops - envelope") { + +SECTION("envelope_test - double") { + using namespace mapnik::geometry; + { + geometry geom(point(1,2)); + mapnik::box2d bbox = mapnik::geometry::envelope(geom); + REQUIRE( bbox.minx() == 1 ); + REQUIRE( bbox.miny() == 2 ); + REQUIRE( bbox.maxx() == 1 ); + REQUIRE( bbox.maxy() == 2 ); + } + { + // Test empty geom + geometry geom = mapnik::geometry::geometry_empty(); + mapnik::box2d bbox = mapnik::geometry::envelope(geom); + REQUIRE_FALSE( bbox.valid() ); + } + { + line_string line; + line.add_coord(0,0); + line.add_coord(1,1); + line.add_coord(2,2); + geometry geom(line); + mapnik::box2d bbox = mapnik::geometry::envelope(geom); + REQUIRE( bbox.minx() == 0 ); + REQUIRE( bbox.miny() == 0 ); + REQUIRE( bbox.maxx() == 2 ); + REQUIRE( bbox.maxy() == 2 ); + } + { + line_string line; + line.add_coord(0,0); + line.add_coord(1,1); + line.add_coord(2,2); + line_string line2; + line2.add_coord(0,0); + line2.add_coord(-1,-1); + line2.add_coord(-2,-2); + multi_line_string multi_line; + multi_line.emplace_back(std::move(line)); + multi_line.emplace_back(std::move(line2)); + geometry geom(multi_line); + mapnik::box2d bbox = mapnik::geometry::envelope(geom); + REQUIRE( bbox.minx() == -2 ); + REQUIRE( bbox.miny() == -2 ); + REQUIRE( bbox.maxx() == 2 ); + REQUIRE( bbox.maxy() == 2 ); + } + { + polygon poly; + linear_ring ring; + ring.add_coord(0,0); + ring.add_coord(-10,0); + ring.add_coord(-10,10); + ring.add_coord(0,10); + ring.add_coord(0,0); + poly.set_exterior_ring(std::move(ring)); + geometry geom(poly); + mapnik::box2d bbox = mapnik::geometry::envelope(geom); + REQUIRE( bbox.minx() == -10 ); + REQUIRE( bbox.miny() == 0 ); + REQUIRE( bbox.maxx() == 0 ); + REQUIRE( bbox.maxy() == 10 ); + + multi_polygon mp; + mp.push_back(poly); + geometry geom_mp(mp); + bbox = mapnik::geometry::envelope(geom_mp); + REQUIRE( bbox.minx() == -10 ); + REQUIRE( bbox.miny() == 0 ); + REQUIRE( bbox.maxx() == 0 ); + REQUIRE( bbox.maxy() == 10 ); + + correct(geom); + bbox = mapnik::geometry::envelope(geom); + REQUIRE( bbox.minx() == -10 ); + REQUIRE( bbox.miny() == 0 ); + REQUIRE( bbox.maxx() == 0 ); + REQUIRE( bbox.maxy() == 10 ); + correct(geom_mp); + bbox = mapnik::geometry::envelope(geom_mp); + REQUIRE( bbox.minx() == -10 ); + REQUIRE( bbox.miny() == 0 ); + REQUIRE( bbox.maxx() == 0 ); + REQUIRE( bbox.maxy() == 10 ); + + geometry_collection gc; + bbox = mapnik::geometry::envelope(gc); + REQUIRE_FALSE( bbox.valid() ); + gc.push_back(geom_mp); + bbox = mapnik::geometry::envelope(gc); + REQUIRE( bbox.minx() == -10 ); + REQUIRE( bbox.miny() == 0 ); + REQUIRE( bbox.maxx() == 0 ); + REQUIRE( bbox.maxy() == 10 ); + gc.emplace_back(point(-50,-50)); + bbox = mapnik::geometry::envelope(gc); + REQUIRE( bbox.minx() == -50 ); + REQUIRE( bbox.miny() == -50 ); + REQUIRE( bbox.maxx() == 0 ); + REQUIRE( bbox.maxy() == 10 ); + } + + { + // polygon with hole + polygon poly; + linear_ring ring; + ring.add_coord(0,0); + ring.add_coord(-10,0); + ring.add_coord(-10,10); + ring.add_coord(0,10); + ring.add_coord(0,0); + poly.set_exterior_ring(std::move(ring)); + linear_ring hole; + hole.add_coord(-7,7); + hole.add_coord(-7,3); + hole.add_coord(-3,3); + hole.add_coord(-3,7); + hole.add_coord(-7,7); + poly.add_hole(std::move(hole)); + geometry geom(poly); + mapnik::box2d bbox = mapnik::geometry::envelope(poly); + REQUIRE( bbox.minx() == -10 ); + REQUIRE( bbox.miny() == 0 ); + REQUIRE( bbox.maxx() == 0 ); + REQUIRE( bbox.maxy() == 10 ); + // add another hole inside the first hole + // which should be considered a hit + linear_ring fill; + fill.add_coord(-6,4); + fill.add_coord(-6,6); + fill.add_coord(-4,6); + fill.add_coord(-4,4); + fill.add_coord(-6,4); + poly.add_hole(std::move(fill)); + bbox = mapnik::geometry::envelope(poly); + REQUIRE( bbox.minx() == -10 ); + REQUIRE( bbox.miny() == 0 ); + REQUIRE( bbox.maxx() == 0 ); + REQUIRE( bbox.maxy() == 10 ); + } +} + +} diff --git a/test/unit/geometry/geometry_equal.hpp b/test/unit/geometry/geometry_equal.hpp new file mode 100644 index 000000000..6b5dc6861 --- /dev/null +++ b/test/unit/geometry/geometry_equal.hpp @@ -0,0 +1,217 @@ +#include "catch.hpp" + +// boost +#include +#include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" +#include +#include +#include +#pragma GCC diagnostic pop + +// helper namespace to ensure correct functionality +namespace aux{ +namespace adl{ +using std::begin; +using std::end; + +template +auto do_begin(T& v) -> decltype(begin(v)); +template +auto do_end(T& v) -> decltype(end(v)); +} // adl:: + +template +using zipper_it = boost::zip_iterator>; + +template +T const& as_const(T const& v){ return v; } +} // aux:: + +template +auto zip_begin(Conts&... conts) + -> aux::zipper_it +{ + using std::begin; + return {boost::make_tuple(begin(conts)...)}; +} + +template +auto zip_end(Conts&... conts) + -> aux::zipper_it +{ + using std::end; + return {boost::make_tuple(end(conts)...)}; +} + +template +auto zip_range(Conts&... conts) + -> boost::iterator_range +{ + return {zip_begin(conts...), zip_end(conts...)}; +} + +// for const access +template +auto zip_cbegin(Conts&... conts) + -> decltype(zip_begin(aux::as_const(conts)...)) +{ + using std::begin; + return zip_begin(aux::as_const(conts)...); +} + +template +auto zip_cend(Conts&... conts) + -> decltype(zip_end(aux::as_const(conts)...)) +{ + using std::end; + return zip_end(aux::as_const(conts)...); +} + +template +auto zip_crange(Conts&... conts) + -> decltype(zip_range(aux::as_const(conts)...)) +{ + return zip_range(aux::as_const(conts)...); +} + +// mapnik +#include +#include + +using namespace mapnik::geometry; + +template +void assert_g_equal(geometry const& g1, geometry const& g2); + +struct geometry_equal_visitor +{ + template + void operator() (T1 const&, T2 const&) + { + // comparing two different types! + REQUIRE(false); + } + + void operator() (geometry_empty const&, geometry_empty const&) + { + REQUIRE(true); + } + + template + void operator() (point const& p1, point const& p2) + { + REQUIRE(p1.x == Approx(p2.x)); + REQUIRE(p1.y == Approx(p2.y)); + } + + template + void operator() (line_string const& ls1, line_string const& ls2) + { + if (ls1.size() != ls2.size()) + { + REQUIRE(false); + } + + for(auto const& p : zip_crange(ls1, ls2)) + { + REQUIRE(p.template get<0>().x == Approx(p.template get<1>().x)); + REQUIRE(p.template get<0>().y == Approx(p.template get<1>().y)); + } + } + + template + void operator() (polygon const& p1, polygon const& p2) + { + (*this)(static_cast const&>(p1.exterior_ring), static_cast const&>(p2.exterior_ring)); + + if (p1.interior_rings.size() != p2.interior_rings.size()) + { + REQUIRE(false); + } + + for (auto const& p : zip_crange(p1.interior_rings, p2.interior_rings)) + { + (*this)(static_cast const&>(p.template get<0>()),static_cast const&>(p.template get<1>())); + } + } + + template + void operator() (multi_point const& mp1, multi_point const& mp2) + { + (*this)(static_cast const&>(mp1), static_cast const&>(mp2)); + } + + template + void operator() (multi_line_string const& mls1, multi_line_string const& mls2) + { + if (mls1.size() != mls2.size()) + { + REQUIRE(false); + } + + for (auto const& ls : zip_crange(mls1, mls2)) + { + (*this)(ls.template get<0>(),ls.template get<1>()); + } + } + + template + void operator() (multi_polygon const& mpoly1, multi_polygon const& mpoly2) + { + if (mpoly1.size() != mpoly2.size()) + { + REQUIRE(false); + } + + for (auto const& poly : zip_crange(mpoly1, mpoly2)) + { + (*this)(poly.template get<0>(),poly.template get<1>()); + } + } + + template + void operator() (mapnik::util::recursive_wrapper > const& c1_, mapnik::util::recursive_wrapper > const& c2_) + { + geometry_collection const& c1 = static_cast const&>(c1_); + geometry_collection const& c2 = static_cast const&>(c2_); + if (c1.size() != c2.size()) + { + REQUIRE(false); + } + + for (auto const& g : zip_crange(c1, c2)) + { + assert_g_equal(g.template get<0>(),g.template get<1>()); + } + } + + template + void operator() (geometry_collection const& c1, geometry_collection const& c2) + { + if (c1.size() != c2.size()) + { + REQUIRE(false); + } + + for (auto const& g : zip_crange(c1, c2)) + { + assert_g_equal(g.template get<0>(),g.template get<1>()); + } + } +}; + +template +void assert_g_equal(geometry const& g1, geometry const& g2) +{ + return mapnik::util::apply_visitor(geometry_equal_visitor(), g1, g2); +} + +template +void assert_g_equal(T const& g1, T const& g2) +{ + return geometry_equal_visitor()(g1,g2); +} diff --git a/test/unit/geometry/geometry_hit_test.cpp b/test/unit/geometry/geometry_hit_test.cpp new file mode 100644 index 000000000..7552d0143 --- /dev/null +++ b/test/unit/geometry/geometry_hit_test.cpp @@ -0,0 +1,108 @@ +#include "catch.hpp" + +#include +#include +#include + +TEST_CASE("geometry ops") { + +SECTION("hit_test_filter - double") { + using namespace mapnik::geometry; + { + geometry geom(point(0,0)); + REQUIRE( mapnik::hit_test(geom,0,0,0) ); + } + { + geometry geom(point(0,0)); + REQUIRE( mapnik::hit_test(geom,1,0,1) ); + } + { + geometry geom(point(0,0)); + REQUIRE( mapnik::hit_test(geom,0,1,1) ); + } + { + geometry geom(point(0,0)); + REQUIRE( mapnik::hit_test(geom,1,1,1.5) ); + } + { + line_string line; + line.add_coord(0,0); + line.add_coord(1,1); + line.add_coord(2,2); + geometry geom(line); + REQUIRE( mapnik::hit_test(geom,0,0,1.5) ); + } + { + line_string line; + line.add_coord(0,0); + line.add_coord(1,1); + line.add_coord(2,2); + multi_line_string multi_line; + multi_line.emplace_back(std::move(line)); + geometry geom(multi_line); + REQUIRE( mapnik::hit_test(geom,0,0,1.5) ); + } + { + polygon poly; + linear_ring ring; + ring.add_coord(0,0); + ring.add_coord(-10,0); + ring.add_coord(-10,10); + ring.add_coord(0,10); + ring.add_coord(0,0); + poly.set_exterior_ring(std::move(ring)); + geometry geom(poly); + REQUIRE( mapnik::hit_test(geom,-5,5,0) ); + + multi_polygon mp; + mp.push_back(poly); + geometry geom_mp(mp); + REQUIRE( mapnik::hit_test(geom_mp,-5,5,0) ); + + correct(geom); + REQUIRE( mapnik::hit_test(geom,-5,5,0) ); + correct(geom_mp); + REQUIRE( mapnik::hit_test(geom_mp,-5,5,0) ); + + geometry_collection gc; + REQUIRE( !mapnik::hit_test(geometry(gc),-5,5,0) ); + gc.push_back(geom_mp); + REQUIRE( mapnik::hit_test(geometry(gc),-5,5,0) ); + REQUIRE( !mapnik::hit_test(geometry(gc),-50,-50,0) ); + gc.emplace_back(point(-50,-50)); + REQUIRE( mapnik::hit_test(geometry(gc),-50,-50,0) ); + } + + { + // polygon with hole + polygon poly; + linear_ring ring; + ring.add_coord(0,0); + ring.add_coord(-10,0); + ring.add_coord(-10,10); + ring.add_coord(0,10); + ring.add_coord(0,0); + poly.set_exterior_ring(std::move(ring)); + linear_ring hole; + hole.add_coord(-7,7); + hole.add_coord(-7,3); + hole.add_coord(-3,3); + hole.add_coord(-3,7); + hole.add_coord(-7,7); + poly.add_hole(std::move(hole)); + geometry geom(poly); + REQUIRE( !mapnik::hit_test(geom,-5,5,0) ); + // add another hole inside the first hole + // which should be considered a hit + linear_ring fill; + fill.add_coord(-6,4); + fill.add_coord(-6,6); + fill.add_coord(-4,6); + fill.add_coord(-4,4); + fill.add_coord(-6,4); + poly.add_hole(std::move(fill)); + REQUIRE( mapnik::hit_test(geometry(poly),-5,5,0) ); + } +} + +} diff --git a/test/unit/geometry/geometry_is_valid.cpp b/test/unit/geometry/geometry_is_valid.cpp new file mode 100644 index 000000000..5f4f862e3 --- /dev/null +++ b/test/unit/geometry/geometry_is_valid.cpp @@ -0,0 +1,31 @@ +#include "catch.hpp" + +#include +#include +#include + +TEST_CASE("geometry is_valid") { + +// only Boost >= 1.56 has the is_valid function +#if BOOST_VERSION >= 105600 + +SECTION("point") { + mapnik::geometry::point pt(0,0); + REQUIRE( mapnik::geometry::is_valid(pt) ); + + // uninitialized: should likely not be considered valid + mapnik::geometry::point pt2; + REQUIRE( mapnik::geometry::is_valid(pt2) ); +} + +SECTION("line_string") { + mapnik::geometry::line_string line; + line.add_coord(0,0); + line.add_coord(1,1); + REQUIRE( mapnik::geometry::is_valid(line) ); + +} + +#endif // BOOST_VERSION >= 1.56 + +} diff --git a/test/unit/geometry/geometry_reprojection.cpp b/test/unit/geometry/geometry_reprojection.cpp new file mode 100644 index 000000000..1a5212956 --- /dev/null +++ b/test/unit/geometry/geometry_reprojection.cpp @@ -0,0 +1,1274 @@ +#include "catch.hpp" +#include "geometry_equal.hpp" + +// mapnik +#include +#include +#include +#include +#include + +// std +#include + +TEST_CASE("geometry reprojection") { + +SECTION("test_projection_4326_3857 - Empty Geometry Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans(source, dest); + { + geometry_empty geom; + unsigned int err = 0; + // Test Standard Transform + geometry_empty new_geom = reproject_copy(geom, proj_trans, err); + REQUIRE(err == 0); + // Transform providing projections not transfrom + new_geom = reproject_copy(geom, source, dest, err); + REQUIRE(err == 0); + // Transform providing projections in reverse + new_geom = reproject_copy(geom, dest, source, err); + REQUIRE(err == 0); + // Transform in place + REQUIRE(reproject(new_geom, proj_trans)); + // Transform in place providing projections + REQUIRE(reproject(new_geom, source, dest)); + // Transform in place provoding projections reversed + REQUIRE(reproject(new_geom, dest, source)); + } +} // End Section + +SECTION("test_projection_4326_3857 - Empty Geometry in Geometry Variant") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans(source, dest); + { + geometry geom = geometry_empty(); + unsigned int err = 0; + // Test Standard Transform + geometry new_geom = reproject_copy(geom, proj_trans, err); + REQUIRE(err == 0); + REQUIRE(new_geom.is()); + // Transform providing projections not transfrom + new_geom = reproject_copy(geom, source, dest, err); + REQUIRE(err == 0); + REQUIRE(new_geom.is()); + // Transform providing projections in reverse + new_geom = reproject_copy(geom, dest, source, err); + REQUIRE(err == 0); + REQUIRE(new_geom.is()); + // Transform in place + REQUIRE(reproject(new_geom, proj_trans)); + // Transform in place providing projections + REQUIRE(reproject(new_geom, source, dest)); + // Transform in place provoding projections reversed + REQUIRE(reproject(new_geom, dest, source)); + } +} // End Section + +SECTION("test_projection_4326_3857 - Point Geometry Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + point geom1(-97.552175, 35.522895); + point geom2(-10859458.446776, 4235169.496066); + unsigned int err = 0; + { + // Test Standard Transform + point new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform in reverse + point new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + point new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + point new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + point geom3(-97.552175, 35.522895); + REQUIRE(reproject(geom3, proj_trans1)); + assert_g_equal(geom3, geom2); + // Transform in place reverse - back + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + point geom3(-97.552175, 35.522895); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // End Section + +SECTION("test_projection_4326_3857 - Point Geometry Variant Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + double x1 = -97.552175; + double y1 = 35.522895; + double x2 = -10859458.446776; + double y2 = 4235169.496066; + geometry geom1(point(x1, y1)); + geometry geom2(point(x2, y2)); + unsigned int err = 0; + { + // Test Standard Transform + geometry new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform in reverse + geometry new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + geometry new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + geometry new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + geometry geom3(point(-97.552175, 35.522895)); + // Transform in place + REQUIRE(reproject(geom3, proj_trans1)); + assert_g_equal(geom3, geom2); + // Transform in place reverse - back + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + geometry geom3(point(-97.552175, 35.522895)); + // Transform in place providing projections + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // End Section */ + +SECTION("test_projection_4326_3857 - Line_String Geometry Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + line_string geom1; + geom1.emplace_back(point(-97.48872756958008, 35.360286150765084)); + geom1.emplace_back(point(-97.48065948486328, 35.34894577151337)); + geom1.emplace_back(point(-97.47267723083496, 35.36224605490395)); + geom1.emplace_back(point(-97.46323585510252, 35.34523530173256)); + geom1.emplace_back(point(-97.45963096618651, 35.36329598397908)); + geom1.emplace_back(point(-97.47550964355469, 35.369245324153866)); + line_string geom2; + geom2.emplace_back(point(-10852395.511130, 4212951.024108)); + geom2.emplace_back(point(-10851497.376047, 4211403.174286)); + geom2.emplace_back(point(-10850608.795594, 4213218.553707)); + geom2.emplace_back(point(-10849557.786455, 4210896.778973)); + geom2.emplace_back(point(-10849156.492056, 4213361.873135)); + geom2.emplace_back(point(-10850924.098335, 4214174.016561)); + unsigned int err = 0; + { + // Test Standard Transform + line_string new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform in reverse + line_string new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + line_string new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + line_string new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + line_string geom3(geom1); + REQUIRE(reproject(geom3, proj_trans1)); + assert_g_equal(geom3, geom2); + // Transform in place reverse + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + line_string geom3(geom1); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // End Section + +SECTION("test_projection_4326_3857 - Line_String Geometry Variant Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + line_string geom1_; + geom1_.emplace_back(point(-97.48872756958008, 35.360286150765084)); + geom1_.emplace_back(point(-97.48065948486328, 35.34894577151337)); + geom1_.emplace_back(point(-97.47267723083496, 35.36224605490395)); + geom1_.emplace_back(point(-97.46323585510252, 35.34523530173256)); + geom1_.emplace_back(point(-97.45963096618651, 35.36329598397908)); + geom1_.emplace_back(point(-97.47550964355469, 35.369245324153866)); + line_string geom2_; + geom2_.emplace_back(point(-10852395.511130, 4212951.024108)); + geom2_.emplace_back(point(-10851497.376047, 4211403.174286)); + geom2_.emplace_back(point(-10850608.795594, 4213218.553707)); + geom2_.emplace_back(point(-10849557.786455, 4210896.778973)); + geom2_.emplace_back(point(-10849156.492056, 4213361.873135)); + geom2_.emplace_back(point(-10850924.098335, 4214174.016561)); + line_string geom0_; + geometry geom0(geom0_); + geometry geom1(geom1_); + geometry geom2(geom2_); + unsigned int err = 0; + { + // Reprojecting empty line string will return a geometry_empty + geometry new_geom = reproject_copy(geom0, proj_trans1, err); + REQUIRE(err == 0); + REQUIRE(new_geom.is()); + } + { + // Test Standard Transform + geometry new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform in reverse + geometry new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + geometry new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + geometry new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + geometry geom3(geom1); + REQUIRE(reproject(geom3, proj_trans1)); + assert_g_equal(geom3, geom2); + // Transform in place reverse + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + geometry geom3(geom1); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // End Section + +SECTION("test_projection_4326_3857 - Polygon Geometry Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + polygon geom1; + geom1.exterior_ring.emplace_back(point(-97.62588500976562, 35.62939577711732)); + geom1.exterior_ring.emplace_back(point(-97.79067993164062, 35.43941441533686)); + geom1.exterior_ring.emplace_back(point(-97.60391235351562, 35.34425514918409)); + geom1.exterior_ring.emplace_back(point(-97.42813110351562, 35.48191987272801)); + geom1.exterior_ring.emplace_back(point(-97.62588500976562, 35.62939577711732)); + geom1.interior_rings.emplace_back(); + geom1.interior_rings.back().emplace_back(point(-97.66571044921875, 35.46849952318069)); + geom1.interior_rings.back().emplace_back(point(-97.61489868164062, 35.54116627999813)); + geom1.interior_rings.back().emplace_back(point(-97.53799438476562, 35.459551379037606)); + geom1.interior_rings.back().emplace_back(point(-97.62451171875, 35.42598697382711)); + geom1.interior_rings.back().emplace_back(point(-97.66571044921875, 35.46849952318069)); + polygon geom2; + geom2.exterior_ring.emplace_back(point(-10867663.807530, 4249745.898599)); + geom2.exterior_ring.emplace_back(point(-10886008.694318, 4223757.308982)); + geom2.exterior_ring.emplace_back(point(-10865217.822625, 4210763.014174)); + geom2.exterior_ring.emplace_back(point(-10845649.943384, 4229566.523132)); + geom2.exterior_ring.emplace_back(point(-10867663.807530, 4249745.898599)); + geom2.interior_rings.emplace_back(); + geom2.interior_rings.back().emplace_back(point(-10872097.155170, 4227732.034453)); + geom2.interior_rings.back().emplace_back(point(-10866440.815077, 4237668.848130)); + geom2.interior_rings.back().emplace_back(point(-10857879.867909, 4226509.042001)); + geom2.interior_rings.back().emplace_back(point(-10867510.933473, 4221922.820303)); + geom2.interior_rings.back().emplace_back(point(-10872097.155170, 4227732.034453)); + unsigned int err = 0; + { + // Test Standard Transform + // Add extra vector to outer ring. + geom1.interior_rings.emplace_back(); + REQUIRE(geom1.interior_rings.size() == 2); + polygon new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + // Should remove the empty ring added to back of geom1 + REQUIRE(new_geom.interior_rings.size() == 1); + assert_g_equal(new_geom, geom2); + // Remove extra ring for future validity tests. + geom1.interior_rings.pop_back(); + REQUIRE(geom1.interior_rings.size() == 1); + } + { + // Transform in reverse + polygon new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + polygon new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + polygon new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + polygon geom3(geom1); + geom3.interior_rings.emplace_back(); + REQUIRE(reproject(geom3, proj_trans1)); + // Should NOT remove the empty ring added to back of geom1 + REQUIRE(geom3.interior_rings.size() == 2); + // Remove so asserts that geometries are the same + geom3.interior_rings.pop_back(); + REQUIRE(geom3.interior_rings.size() == 1); + assert_g_equal(geom3, geom2); + // Transform in place reverse + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + polygon geom3(geom1); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // End Section + +SECTION("test_projection_4326_3857 - Polygon Geometry Variant Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + polygon geom1_; + geom1_.exterior_ring.emplace_back(point(-97.62588500976562, 35.62939577711732)); + geom1_.exterior_ring.emplace_back(point(-97.79067993164062, 35.43941441533686)); + geom1_.exterior_ring.emplace_back(point(-97.60391235351562, 35.34425514918409)); + geom1_.exterior_ring.emplace_back(point(-97.42813110351562, 35.48191987272801)); + geom1_.exterior_ring.emplace_back(point(-97.62588500976562, 35.62939577711732)); + geom1_.interior_rings.emplace_back(); + geom1_.interior_rings.back().emplace_back(point(-97.66571044921875, 35.46849952318069)); + geom1_.interior_rings.back().emplace_back(point(-97.61489868164062, 35.54116627999813)); + geom1_.interior_rings.back().emplace_back(point(-97.53799438476562, 35.459551379037606)); + geom1_.interior_rings.back().emplace_back(point(-97.62451171875, 35.42598697382711)); + geom1_.interior_rings.back().emplace_back(point(-97.66571044921875, 35.46849952318069)); + polygon geom2_; + geom2_.exterior_ring.emplace_back(point(-10867663.807530, 4249745.898599)); + geom2_.exterior_ring.emplace_back(point(-10886008.694318, 4223757.308982)); + geom2_.exterior_ring.emplace_back(point(-10865217.822625, 4210763.014174)); + geom2_.exterior_ring.emplace_back(point(-10845649.943384, 4229566.523132)); + geom2_.exterior_ring.emplace_back(point(-10867663.807530, 4249745.898599)); + geom2_.interior_rings.emplace_back(); + geom2_.interior_rings.back().emplace_back(point(-10872097.155170, 4227732.034453)); + geom2_.interior_rings.back().emplace_back(point(-10866440.815077, 4237668.848130)); + geom2_.interior_rings.back().emplace_back(point(-10857879.867909, 4226509.042001)); + geom2_.interior_rings.back().emplace_back(point(-10867510.933473, 4221922.820303)); + geom2_.interior_rings.back().emplace_back(point(-10872097.155170, 4227732.034453)); + polygon geom0_; + geometry geom0(geom0_); + geometry geom1(geom1_); + geometry geom2(geom2_); + unsigned int err = 0; + { + // Reprojecting empty poly will return a geometry_empty + geometry new_geom = reproject_copy(geom0, proj_trans1, err); + REQUIRE(err == 0); + REQUIRE(new_geom.is()); + } + { + // Test Standard Transform + geometry new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform in reverse + geometry new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + geometry new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + geometry new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + geometry geom3(geom1); + REQUIRE(reproject(geom3, proj_trans1)); + assert_g_equal(geom3, geom2); + // Transform in place reverse + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + geometry geom3(geom1); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // END SECTION + +SECTION("test_projection_4326_3857 - Multi_Point Geometry Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + multi_point geom1; + geom1.emplace_back(point(-97.48872756958008, 35.360286150765084)); + geom1.emplace_back(point(-97.48065948486328, 35.34894577151337)); + geom1.emplace_back(point(-97.47267723083496, 35.36224605490395)); + geom1.emplace_back(point(-97.46323585510252, 35.34523530173256)); + geom1.emplace_back(point(-97.45963096618651, 35.36329598397908)); + geom1.emplace_back(point(-97.47550964355469, 35.369245324153866)); + multi_point geom2; + geom2.emplace_back(point(-10852395.511130, 4212951.024108)); + geom2.emplace_back(point(-10851497.376047, 4211403.174286)); + geom2.emplace_back(point(-10850608.795594, 4213218.553707)); + geom2.emplace_back(point(-10849557.786455, 4210896.778973)); + geom2.emplace_back(point(-10849156.492056, 4213361.873135)); + geom2.emplace_back(point(-10850924.098335, 4214174.016561)); + unsigned int err = 0; + { + // Test Standard Transform + multi_point new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform in reverse + multi_point new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + multi_point new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + multi_point new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + multi_point geom3(geom1); + REQUIRE(reproject(geom3, proj_trans1)); + assert_g_equal(geom3, geom2); + // Transform in place reverse + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + multi_point geom3(geom1); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // End Section + +SECTION("test_projection_4326_3857 - Multi_Point Geometry Variant Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + multi_point geom1_; + geom1_.emplace_back(point(-97.48872756958008, 35.360286150765084)); + geom1_.emplace_back(point(-97.48065948486328, 35.34894577151337)); + geom1_.emplace_back(point(-97.47267723083496, 35.36224605490395)); + geom1_.emplace_back(point(-97.46323585510252, 35.34523530173256)); + geom1_.emplace_back(point(-97.45963096618651, 35.36329598397908)); + geom1_.emplace_back(point(-97.47550964355469, 35.369245324153866)); + multi_point geom2_; + geom2_.emplace_back(point(-10852395.511130, 4212951.024108)); + geom2_.emplace_back(point(-10851497.376047, 4211403.174286)); + geom2_.emplace_back(point(-10850608.795594, 4213218.553707)); + geom2_.emplace_back(point(-10849557.786455, 4210896.778973)); + geom2_.emplace_back(point(-10849156.492056, 4213361.873135)); + geom2_.emplace_back(point(-10850924.098335, 4214174.016561)); + multi_point geom0_; + geometry geom0(geom0_); + geometry geom1(geom1_); + geometry geom2(geom2_); + unsigned int err = 0; + { + // Reprojecting empty multi point will return a geometry_empty + geometry new_geom = reproject_copy(geom0, proj_trans1, err); + REQUIRE(err == 0); + REQUIRE(new_geom.is()); + } + { + // Test Standard Transform + geometry new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform in reverse + geometry new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + geometry new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + geometry new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + geometry geom3(geom1); + REQUIRE(reproject(geom3, proj_trans1)); + assert_g_equal(geom3, geom2); + // Transform in place reverse + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + geometry geom3(geom1); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // End Section + +SECTION("test_projection_4326_3857 - Multi_Line_String Geometry Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + line_string geom1a; + geom1a.emplace_back(point(-97.48872756958008, 35.360286150765084)); + geom1a.emplace_back(point(-97.48065948486328, 35.34894577151337)); + geom1a.emplace_back(point(-97.47267723083496, 35.36224605490395)); + geom1a.emplace_back(point(-97.46323585510252, 35.34523530173256)); + geom1a.emplace_back(point(-97.45963096618651, 35.36329598397908)); + geom1a.emplace_back(point(-97.47550964355469, 35.369245324153866)); + multi_line_string geom1; + geom1.emplace_back(geom1a); + line_string geom2a; + geom2a.emplace_back(point(-10852395.511130, 4212951.024108)); + geom2a.emplace_back(point(-10851497.376047, 4211403.174286)); + geom2a.emplace_back(point(-10850608.795594, 4213218.553707)); + geom2a.emplace_back(point(-10849557.786455, 4210896.778973)); + geom2a.emplace_back(point(-10849156.492056, 4213361.873135)); + geom2a.emplace_back(point(-10850924.098335, 4214174.016561)); + multi_line_string geom2; + geom2.emplace_back(geom2a); + unsigned int err = 0; + { + // Prior to test add an empty line_string to the the multi_line_string + // this should be removed. + geom1.emplace_back(); + REQUIRE(geom1.size() == 2); + // Test Standard Transform + multi_line_string new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + REQUIRE(new_geom.size() == 1); + // Restore geom1 removing empty for later tests. + geom1.pop_back(); + REQUIRE(geom1.size() == 1); + assert_g_equal(new_geom, geom2); + } + { + // Transform in reverse + multi_line_string new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + multi_line_string new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + multi_line_string new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + multi_line_string geom3(geom1); + REQUIRE(reproject(geom3, proj_trans1)); + assert_g_equal(geom3, geom2); + // Transform in place reverse + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + multi_line_string geom3(geom1); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // End Section + +SECTION("test_projection_4326_3857 - Multi_Line_String Geometry Variant Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + line_string geom1a_; + geom1a_.emplace_back(point(-97.48872756958008, 35.360286150765084)); + geom1a_.emplace_back(point(-97.48065948486328, 35.34894577151337)); + geom1a_.emplace_back(point(-97.47267723083496, 35.36224605490395)); + geom1a_.emplace_back(point(-97.46323585510252, 35.34523530173256)); + geom1a_.emplace_back(point(-97.45963096618651, 35.36329598397908)); + geom1a_.emplace_back(point(-97.47550964355469, 35.369245324153866)); + multi_line_string geom1_; + geom1_.emplace_back(geom1a_); + line_string geom2a_; + geom2a_.emplace_back(point(-10852395.511130, 4212951.024108)); + geom2a_.emplace_back(point(-10851497.376047, 4211403.174286)); + geom2a_.emplace_back(point(-10850608.795594, 4213218.553707)); + geom2a_.emplace_back(point(-10849557.786455, 4210896.778973)); + geom2a_.emplace_back(point(-10849156.492056, 4213361.873135)); + geom2a_.emplace_back(point(-10850924.098335, 4214174.016561)); + multi_line_string geom2_; + geom2_.emplace_back(geom2a_); + multi_line_string geom0_; + geometry geom0(geom0_); + geometry geom1(geom1_); + geometry geom2(geom2_); + unsigned int err = 0; + { + // Reprojecting empty line string will return a geometry_empty + geometry new_geom = reproject_copy(geom0, proj_trans1, err); + REQUIRE(err == 0); + REQUIRE(new_geom.is()); + } + { + // Test Standard Transform + geometry new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform in reverse + geometry new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + geometry new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + geometry new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + geometry geom3(geom1); + REQUIRE(reproject(geom3, proj_trans1)); + assert_g_equal(geom3, geom2); + // Transform in place reverse + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + geometry geom3(geom1); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // End Section + +SECTION("test_projection_4326_3857 - Multi_Polygon Geometry Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + polygon geom1a; + geom1a.exterior_ring.emplace_back(point(-97.62588500976562, 35.62939577711732)); + geom1a.exterior_ring.emplace_back(point(-97.79067993164062, 35.43941441533686)); + geom1a.exterior_ring.emplace_back(point(-97.60391235351562, 35.34425514918409)); + geom1a.exterior_ring.emplace_back(point(-97.42813110351562, 35.48191987272801)); + geom1a.exterior_ring.emplace_back(point(-97.62588500976562, 35.62939577711732)); + geom1a.interior_rings.emplace_back(); + geom1a.interior_rings.back().emplace_back(point(-97.66571044921875, 35.46849952318069)); + geom1a.interior_rings.back().emplace_back(point(-97.61489868164062, 35.54116627999813)); + geom1a.interior_rings.back().emplace_back(point(-97.53799438476562, 35.459551379037606)); + geom1a.interior_rings.back().emplace_back(point(-97.62451171875, 35.42598697382711)); + geom1a.interior_rings.back().emplace_back(point(-97.66571044921875, 35.46849952318069)); + multi_polygon geom1; + geom1.emplace_back(geom1a); + polygon geom2a; + geom2a.exterior_ring.emplace_back(point(-10867663.807530, 4249745.898599)); + geom2a.exterior_ring.emplace_back(point(-10886008.694318, 4223757.308982)); + geom2a.exterior_ring.emplace_back(point(-10865217.822625, 4210763.014174)); + geom2a.exterior_ring.emplace_back(point(-10845649.943384, 4229566.523132)); + geom2a.exterior_ring.emplace_back(point(-10867663.807530, 4249745.898599)); + geom2a.interior_rings.emplace_back(); + geom2a.interior_rings.back().emplace_back(point(-10872097.155170, 4227732.034453)); + geom2a.interior_rings.back().emplace_back(point(-10866440.815077, 4237668.848130)); + geom2a.interior_rings.back().emplace_back(point(-10857879.867909, 4226509.042001)); + geom2a.interior_rings.back().emplace_back(point(-10867510.933473, 4221922.820303)); + geom2a.interior_rings.back().emplace_back(point(-10872097.155170, 4227732.034453)); + multi_polygon geom2; + geom2.emplace_back(geom2a); + unsigned int err = 0; + { + // Test Standard Transform + // Add extra polygon to outer ring. + geom1.emplace_back(); + REQUIRE(geom1.size() == 2); + multi_polygon new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + // Should remove the empty polygon added to back of geom1 + REQUIRE(new_geom.size() == 1); + assert_g_equal(new_geom, geom2); + // Remove extra ring for future validity tests. + geom1.pop_back(); + REQUIRE(geom1.size() == 1); + } + { + // Transform in reverse + multi_polygon new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + multi_polygon new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + multi_polygon new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + multi_polygon geom3(geom1); + geom3.emplace_back(); + REQUIRE(reproject(geom3, proj_trans1)); + // Should NOT remove the empty ring added to back of geom1 + REQUIRE(geom3.size() == 2); + // Remove so asserts that geometries are the same + geom3.pop_back(); + REQUIRE(geom3.size() == 1); + assert_g_equal(geom3, geom2); + // Transform in place reverse + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + multi_polygon geom3(geom1); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // End Section + +SECTION("test_projection_4326_3857 - Multi_Polygon Geometry Variant Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + polygon geom1a_; + geom1a_.exterior_ring.emplace_back(point(-97.62588500976562, 35.62939577711732)); + geom1a_.exterior_ring.emplace_back(point(-97.79067993164062, 35.43941441533686)); + geom1a_.exterior_ring.emplace_back(point(-97.60391235351562, 35.34425514918409)); + geom1a_.exterior_ring.emplace_back(point(-97.42813110351562, 35.48191987272801)); + geom1a_.exterior_ring.emplace_back(point(-97.62588500976562, 35.62939577711732)); + geom1a_.interior_rings.emplace_back(); + geom1a_.interior_rings.back().emplace_back(point(-97.66571044921875, 35.46849952318069)); + geom1a_.interior_rings.back().emplace_back(point(-97.61489868164062, 35.54116627999813)); + geom1a_.interior_rings.back().emplace_back(point(-97.53799438476562, 35.459551379037606)); + geom1a_.interior_rings.back().emplace_back(point(-97.62451171875, 35.42598697382711)); + geom1a_.interior_rings.back().emplace_back(point(-97.66571044921875, 35.46849952318069)); + multi_polygon geom1_; + geom1_.emplace_back(geom1a_); + polygon geom2a_; + geom2a_.exterior_ring.emplace_back(point(-10867663.807530, 4249745.898599)); + geom2a_.exterior_ring.emplace_back(point(-10886008.694318, 4223757.308982)); + geom2a_.exterior_ring.emplace_back(point(-10865217.822625, 4210763.014174)); + geom2a_.exterior_ring.emplace_back(point(-10845649.943384, 4229566.523132)); + geom2a_.exterior_ring.emplace_back(point(-10867663.807530, 4249745.898599)); + geom2a_.interior_rings.emplace_back(); + geom2a_.interior_rings.back().emplace_back(point(-10872097.155170, 4227732.034453)); + geom2a_.interior_rings.back().emplace_back(point(-10866440.815077, 4237668.848130)); + geom2a_.interior_rings.back().emplace_back(point(-10857879.867909, 4226509.042001)); + geom2a_.interior_rings.back().emplace_back(point(-10867510.933473, 4221922.820303)); + geom2a_.interior_rings.back().emplace_back(point(-10872097.155170, 4227732.034453)); + multi_polygon geom2_; + geom2_.emplace_back(geom2a_); + multi_polygon geom0_; + geometry geom0(geom0_); + geometry geom1(geom1_); + geometry geom2(geom2_); + unsigned int err = 0; + { + // Reprojecting empty poly will return a geometry_empty + geometry new_geom = reproject_copy(geom0, proj_trans1, err); + REQUIRE(err == 0); + REQUIRE(new_geom.is()); + } + { + // Test Standard Transform + geometry new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform in reverse + geometry new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + geometry new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + geometry new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + geometry geom3(geom1); + REQUIRE(reproject(geom3, proj_trans1)); + assert_g_equal(geom3, geom2); + // Transform in place reverse + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + geometry geom3(geom1); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // END SECTION + +SECTION("test_projection_4326_3857 - Geometry Collection Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + polygon geom1a; + geom1a.exterior_ring.emplace_back(point(-97.62588500976562, 35.62939577711732)); + geom1a.exterior_ring.emplace_back(point(-97.79067993164062, 35.43941441533686)); + geom1a.exterior_ring.emplace_back(point(-97.60391235351562, 35.34425514918409)); + geom1a.exterior_ring.emplace_back(point(-97.42813110351562, 35.48191987272801)); + geom1a.exterior_ring.emplace_back(point(-97.62588500976562, 35.62939577711732)); + geom1a.interior_rings.emplace_back(); + geom1a.interior_rings.back().emplace_back(point(-97.66571044921875, 35.46849952318069)); + geom1a.interior_rings.back().emplace_back(point(-97.61489868164062, 35.54116627999813)); + geom1a.interior_rings.back().emplace_back(point(-97.53799438476562, 35.459551379037606)); + geom1a.interior_rings.back().emplace_back(point(-97.62451171875, 35.42598697382711)); + geom1a.interior_rings.back().emplace_back(point(-97.66571044921875, 35.46849952318069)); + geometry_collection geom1; + geom1.emplace_back(geometry(geom1a)); + polygon geom2a; + geom2a.exterior_ring.emplace_back(point(-10867663.807530, 4249745.898599)); + geom2a.exterior_ring.emplace_back(point(-10886008.694318, 4223757.308982)); + geom2a.exterior_ring.emplace_back(point(-10865217.822625, 4210763.014174)); + geom2a.exterior_ring.emplace_back(point(-10845649.943384, 4229566.523132)); + geom2a.exterior_ring.emplace_back(point(-10867663.807530, 4249745.898599)); + geom2a.interior_rings.emplace_back(); + geom2a.interior_rings.back().emplace_back(point(-10872097.155170, 4227732.034453)); + geom2a.interior_rings.back().emplace_back(point(-10866440.815077, 4237668.848130)); + geom2a.interior_rings.back().emplace_back(point(-10857879.867909, 4226509.042001)); + geom2a.interior_rings.back().emplace_back(point(-10867510.933473, 4221922.820303)); + geom2a.interior_rings.back().emplace_back(point(-10872097.155170, 4227732.034453)); + geometry_collection geom2; + geom2.emplace_back(geometry(geom2a)); + unsigned int err = 0; + { + // Test Standard Transform + // Add extra geometry to outer ring. + geom1.emplace_back(); + REQUIRE(geom1.size() == 2); + geometry_collection new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + // Should remove the empty geometry added to back of geom1 + REQUIRE(new_geom.size() == 1); + assert_g_equal(new_geom, geom2); + // Remove extra ring for future validity tests. + geom1.pop_back(); + REQUIRE(geom1.size() == 1); + } + { + // Transform in reverse + geometry_collection new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + geometry_collection new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + geometry_collection new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + geometry_collection geom3(geom1); + geom3.emplace_back(); + REQUIRE(reproject(geom3, proj_trans1)); + // Should NOT remove the empty ring added to back of geom1 + REQUIRE(geom3.size() == 2); + // Remove so asserts that geometries are the same + geom3.pop_back(); + REQUIRE(geom3.size() == 1); + assert_g_equal(geom3, geom2); + // Transform in place reverse + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + geometry_collection geom3(geom1); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // End Section + +SECTION("test_projection_4326_3857 - Geometry Collection Variant Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + polygon geom1a_; + geom1a_.exterior_ring.emplace_back(point(-97.62588500976562, 35.62939577711732)); + geom1a_.exterior_ring.emplace_back(point(-97.79067993164062, 35.43941441533686)); + geom1a_.exterior_ring.emplace_back(point(-97.60391235351562, 35.34425514918409)); + geom1a_.exterior_ring.emplace_back(point(-97.42813110351562, 35.48191987272801)); + geom1a_.exterior_ring.emplace_back(point(-97.62588500976562, 35.62939577711732)); + geom1a_.interior_rings.emplace_back(); + geom1a_.interior_rings.back().emplace_back(point(-97.66571044921875, 35.46849952318069)); + geom1a_.interior_rings.back().emplace_back(point(-97.61489868164062, 35.54116627999813)); + geom1a_.interior_rings.back().emplace_back(point(-97.53799438476562, 35.459551379037606)); + geom1a_.interior_rings.back().emplace_back(point(-97.62451171875, 35.42598697382711)); + geom1a_.interior_rings.back().emplace_back(point(-97.66571044921875, 35.46849952318069)); + geometry_collection geom1_; + geom1_.emplace_back(geometry(geom1a_)); + polygon geom2a_; + geom2a_.exterior_ring.emplace_back(point(-10867663.807530, 4249745.898599)); + geom2a_.exterior_ring.emplace_back(point(-10886008.694318, 4223757.308982)); + geom2a_.exterior_ring.emplace_back(point(-10865217.822625, 4210763.014174)); + geom2a_.exterior_ring.emplace_back(point(-10845649.943384, 4229566.523132)); + geom2a_.exterior_ring.emplace_back(point(-10867663.807530, 4249745.898599)); + geom2a_.interior_rings.emplace_back(); + geom2a_.interior_rings.back().emplace_back(point(-10872097.155170, 4227732.034453)); + geom2a_.interior_rings.back().emplace_back(point(-10866440.815077, 4237668.848130)); + geom2a_.interior_rings.back().emplace_back(point(-10857879.867909, 4226509.042001)); + geom2a_.interior_rings.back().emplace_back(point(-10867510.933473, 4221922.820303)); + geom2a_.interior_rings.back().emplace_back(point(-10872097.155170, 4227732.034453)); + geometry_collection geom2_; + geom2_.emplace_back(geometry(geom2a_)); + multi_polygon geom0_; + geometry geom0(geom0_); + geometry geom1(geom1_); + geometry geom2(geom2_); + unsigned int err = 0; + { + // Reprojecting empty poly will return a geometry_empty + geometry new_geom = reproject_copy(geom0, proj_trans1, err); + REQUIRE(err == 0); + REQUIRE(new_geom.is()); + } + { + // Test Standard Transform + geometry new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform in reverse + geometry new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + geometry new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + geometry new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + geometry geom3(geom1); + REQUIRE(reproject(geom3, proj_trans1)); + assert_g_equal(geom3, geom2); + // Transform in place reverse + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + geometry geom3(geom1); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // END SECTION + +SECTION("test_projection_4269_3857 - Line_String Geometry Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4269"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + line_string geom1; + geom1.emplace_back(point(-97.48872756958008, 35.360286150765084)); + geom1.emplace_back(point(-97.48065948486328, 35.34894577151337)); + geom1.emplace_back(point(-97.47267723083496, 35.36224605490395)); + geom1.emplace_back(point(-97.46323585510252, 35.34523530173256)); + geom1.emplace_back(point(-97.45963096618651, 35.36329598397908)); + geom1.emplace_back(point(-97.47550964355469, 35.369245324153866)); + line_string geom2; + geom2.emplace_back(point(-10852395.511130, 4212951.024108)); + geom2.emplace_back(point(-10851497.376047, 4211403.174286)); + geom2.emplace_back(point(-10850608.795594, 4213218.553707)); + geom2.emplace_back(point(-10849557.786455, 4210896.778973)); + geom2.emplace_back(point(-10849156.492056, 4213361.873135)); + geom2.emplace_back(point(-10850924.098335, 4214174.016561)); + unsigned int err = 0; + { + // Test Standard Transform + line_string new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform in reverse + line_string new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + line_string new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + line_string new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + line_string geom3(geom1); + REQUIRE(reproject(geom3, proj_trans1)); + assert_g_equal(geom3, geom2); + // Transform in place reverse + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + line_string geom3(geom1); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // End Section + +SECTION("test_projection_4269_3857 - Point Geometry Object") { + using namespace mapnik::geometry; + mapnik::projection source("+init=epsg:4269"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans1(source, dest); + mapnik::proj_transform proj_trans2(dest, source); + point geom1(-97.552175, 35.522895); + point geom2(-10859458.446776, 4235169.496066); + unsigned int err = 0; + { + // Test Standard Transform + point new_geom = reproject_copy(geom1, proj_trans1, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform in reverse + point new_geom = reproject_copy(geom2, proj_trans2, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform providing projections not transfrom + point new_geom = reproject_copy(geom1, source, dest, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom2); + } + { + // Transform providing projections in reverse + point new_geom = reproject_copy(geom2, dest, source, err); + REQUIRE(err == 0); + assert_g_equal(new_geom, geom1); + } + { + // Transform in place + point geom3(-97.552175, 35.522895); + REQUIRE(reproject(geom3, proj_trans1)); + assert_g_equal(geom3, geom2); + // Transform in place reverse - back + REQUIRE(reproject(geom3, proj_trans2)); + assert_g_equal(geom3, geom1); + } + { + // Transform in place providing projections + point geom3(-97.552175, 35.522895); + REQUIRE(reproject(geom3, source, dest)); + assert_g_equal(geom3, geom2); + // Transform in place provoding projections reversed + REQUIRE(reproject(geom3, dest, source)); + assert_g_equal(geom3, geom1); + } +} // End Section + + +} // End Testcase diff --git a/test/unit/geometry/geometry_strategy_test.cpp b/test/unit/geometry/geometry_strategy_test.cpp new file mode 100644 index 000000000..50acb721d --- /dev/null +++ b/test/unit/geometry/geometry_strategy_test.cpp @@ -0,0 +1,187 @@ +#include "catch.hpp" +#include "geometry_equal.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include + +TEST_CASE("geometry strategy tests") { + +SECTION("proj and view strategy") { + using namespace mapnik::geometry; + mapnik::box2d e(-20037508.342789,-20037508.342789,20037508.342789,20037508.342789); + mapnik::view_transform vt(256, 256, e); + mapnik::view_strategy vs(vt); + mapnik::unview_strategy uvs(vt); + mapnik::projection source("+init=epsg:4326"); + mapnik::projection dest("+init=epsg:3857"); + mapnik::proj_transform proj_trans(source, dest); + mapnik::proj_transform proj_trans_rev(dest, source); + mapnik::proj_strategy ps(proj_trans); + mapnik::proj_strategy ps_rev(proj_trans_rev); + { + // Test first that proj strategy works properly + point p1(-97.553098,35.523105); + point r1(-1.08596e+07, 4.2352e+06); + point p3 = transform(p1, ps); + assert_g_equal(r1, p3); + } + { + // Test next that view_strategy works + point p1(-1.08596e+07, 4.2352e+06); + point r1(58.6287 , 100.945); + point p3 = transform(p1, vs); + assert_g_equal(r1, p3); + + } + { + // Test next that view_strategy works as single process in strategy group + point p1(-1.08596e+07, 4.2352e+06); + point r1(58.6287 , 100.945); + using sg_type = strategy_group; + sg_type sg(vs); + point p3 = transform(p1, sg); + assert_g_equal(r1, p3); + + } + { + // Test that both work grouped together in strategy group + using sg_type = strategy_group; + sg_type sg(ps, vs); + point p1(-97.553098,35.523105); + point r1(58.6287 , 100.945); + point p3 = transform(p1, sg); + assert_g_equal(r1, p3); + } + { + // Test that both work grouped together passing in geometry + using sg_type = strategy_group; + sg_type sg(ps, vs); + geometry p1(point(-97.553098,35.523105)); + point r1(58.6287 , 100.945); + geometry p2 = transform(p1, sg); + REQUIRE(p2.is >()); + point p3 = mapnik::util::get >(p2); + assert_g_equal(r1, p3); + } + { + // Test that it works pulling back int + using sg_type = strategy_group; + sg_type sg(ps, vs); + geometry p1(point(-97.553098,35.523105)); + point r1(58 , 100); + geometry p2 = transform(p1, sg); + REQUIRE(p2.is >()); + point p3 = mapnik::util::get >(p2); + assert_g_equal(r1, p3); + } + { + // Test with scaling as well. This would be like projection from 4326 to a vector tile. + mapnik::geometry::scale_rounding_strategy ss(16); + using sg_type = strategy_group; + sg_type sg(ps, vs, ss); + geometry p1(point(-97.553098,35.523105)); + point r1(938 , 1615); + geometry p2 = transform(p1, sg); + REQUIRE(p2.is >()); + point p3 = mapnik::util::get >(p2); + assert_g_equal(r1, p3); + } + { + // Test the entire process in reverse! This would be like converting a vector tile coordinate to 4326. + mapnik::geometry::scale_strategy ss(1.0/16.0); + using sg_type = strategy_group_first; + sg_type sg(ss, uvs, ps_rev); + geometry p1(point(938 , 1615)); + point r1(-97.5586 , 35.5322); + geometry p2 = transform(p1, sg); + REQUIRE(p2.is >()); + point p3 = mapnik::util::get >(p2); + assert_g_equal(r1, p3); + } + { + // Test with scaling + offset as well. This would be like projection from 4326 to a vector tile. + mapnik::geometry::scale_rounding_strategy ss(16, 20); + using sg_type = strategy_group; + sg_type sg(ps, vs, ss); + geometry p1(point(-97.553098,35.523105)); + point r1(958 , 1635); + geometry p2 = transform(p1, sg); + REQUIRE(p2.is >()); + point p3 = mapnik::util::get >(p2); + assert_g_equal(r1, p3); + } + { + // Test the entire scaling plus offset in reverse process in reverse! This would be like converting a vector tile coordinate to 4326. + mapnik::geometry::scale_strategy ss(1.0/16.0, -20.0/16.0); + using sg_type = strategy_group_first; + sg_type sg(ss, uvs, ps_rev); + geometry p1(point(958 , 1635)); + point r1(-97.5586 , 35.5322); + geometry p2 = transform(p1, sg); + REQUIRE(p2.is >()); + point p3 = mapnik::util::get >(p2); + assert_g_equal(r1, p3); + } + +} // END SECTION + +SECTION("scaling strategies - double to double") { + using namespace mapnik::geometry; + + { + scale_strategy ss(10.0); + point p(-90.3, 35.5); + point r(-903.0, 355.0); + point o = transform(p, ss); + assert_g_equal(r, o); + } + { + scale_strategy ss(0.5, -2.0); + point p(-90.3, 35.5); + point r(-47.15, 15.75); + point o = transform(p, ss); + assert_g_equal(r, o); + } + { + scale_rounding_strategy ss(0.5, -2.0); + point p(-90.3, 35.5); + point r(-47.0, 16.0); + point o = transform(p, ss); + assert_g_equal(r, o); + } + +} // END SECTION + +SECTION("scaling strategies - double to int64") { + using namespace mapnik::geometry; + + { + scale_strategy ss(10.0); + point p(-90.31, 35.58); + point r(-903, 355); + point o = transform(p, ss); + assert_g_equal(r, o); + } + { + scale_strategy ss(0.5, -2.0); + point p(-90.3, 35.5); + point r(-47, 15); + point o = transform(p, ss); + assert_g_equal(r, o); + } + { + scale_rounding_strategy ss(0.5, -2.0); + point p(-90.3, 35.5); + point r(-47, 16); + point o = transform(p, ss); + assert_g_equal(r, o); + } +} // END SECTION + +} // END TEST CASE diff --git a/test/unit/geometry/label_algo_test.cpp b/test/unit/geometry/label_algo_test.cpp new file mode 100644 index 000000000..851db3352 --- /dev/null +++ b/test/unit/geometry/label_algo_test.cpp @@ -0,0 +1,65 @@ +#include "catch.hpp" + +#include +#include +#include +#include +#include +#include + +TEST_CASE("labeling") { + +SECTION("algorithms") { + + try + { + // reused these for simplicity + mapnik::geometry::point centroid; + { + // single point + mapnik::geometry::point pt(10,10); + REQUIRE( mapnik::geometry::centroid(pt, centroid)); + REQUIRE( pt.x == centroid.x); + REQUIRE( pt.y == centroid.y); + } + + // linestring with three consecutive verticies + { + mapnik::geometry::line_string line; + line.add_coord(0, 0); + line.add_coord(25, 25); + line.add_coord(50, 50); + REQUIRE(mapnik::geometry::centroid(line, centroid)); + REQUIRE( centroid.x == 25 ); + REQUIRE( centroid.y == 25 ); + } + // TODO - centroid and interior should be equal but they appear not to be (check largest) + // MULTIPOLYGON(((-52 40,-60 32,-68 40,-60 48,-52 40)),((-60 50,-80 30,-100 49.9999999999999,-80.0000000000001 70,-60 50)),((-52 60,-60 52,-68 60,-60 68,-52 60))) +#if 0 + // hit tests + { + mapnik::geometry_type pt_hit(mapnik::geometry::geometry_types::Point); + pt_hit.move_to(10,10); + mapnik::vertex_adapter va(pt_hit); + REQUIRE( mapnik::label::hit_test(va, 10, 10, 0.1) ); + REQUIRE( !mapnik::label::hit_test(va, 9, 9, 0) ); + REQUIRE( mapnik::label::hit_test(va, 9, 9, 1.5) ); + } + { + mapnik::geometry_type line_hit(mapnik::geometry::geometry_types::LineString); + line_hit.move_to(0,0); + line_hit.line_to(50,50); + mapnik::vertex_adapter va(line_hit); + REQUIRE( mapnik::label::hit_test(va, 0, 0, 0.001) ); + REQUIRE( !mapnik::label::hit_test(va, 1, 1, 0) ); + REQUIRE( mapnik::label::hit_test(va, 1, 1, 1.001) ); + } +#endif + } + catch (std::exception const & ex) + { + std::clog << ex.what() << "\n"; + REQUIRE(false); + } +} +} diff --git a/test/unit/imaging/image.cpp b/test/unit/imaging/image.cpp new file mode 100644 index 000000000..ee70a6705 --- /dev/null +++ b/test/unit/imaging/image.cpp @@ -0,0 +1,293 @@ +#include "catch.hpp" + +// mapnik +#include +#include +#include +#include +#include + +TEST_CASE("image class") { + +SECTION("test gray16") { + + const mapnik::image_gray16 im(4,4); + mapnik::image_gray16 im2(im); + mapnik::image_gray16 im3(5,5); + + CHECK(im == im); + CHECK_FALSE(im == im2); + CHECK_FALSE(im2 == im3); + CHECK(im < im3); + CHECK_FALSE(im < im2); + + // Check that width is correct + CHECK(im.width() == 4); + CHECK(im2.width() == 4); + + // Check that height is correct + CHECK(im.height() == 4); + CHECK(im2.height() == 4); + + CHECK(im(0,0) == 0); + CHECK(im2(0,0) == 0); + im2(0,0) = 1; + CHECK(im2(0,0) == 1); + im2.set(514); + CHECK(im2(0,0) == 514); + CHECK(im2(1,1) == 514); + + // Check that size is correct + CHECK(im.size() == 32); + CHECK(im2.size() == 32); + + // Check that row_size is correct + CHECK(im.row_size() == 8); + CHECK(im2.row_size() == 8); + + // Check that get_premultiplied is correct + CHECK_FALSE(im.get_premultiplied()); + CHECK_FALSE(im2.get_premultiplied()); + + // Check that set premultiplied works + im2.set_premultiplied(true); + CHECK(im2.get_premultiplied()); + + // Check that painted is correct + CHECK_FALSE(im.painted()); + CHECK_FALSE(im2.painted()); + + // Check that set premultiplied works + im2.painted(true); + CHECK(im2.painted()); + + // Check that offset is correct + CHECK(im.get_offset() == 0.0); + CHECK(im2.get_offset() == 0.0); + + // Check that set offset works + im2.set_offset(2.3); + CHECK(im2.get_offset() == 2.3); + + // Check that scaling is correct + CHECK(im.get_scaling() == 1.0); + CHECK(im2.get_scaling() == 1.0); + + // Check that set scaling works + im2.set_scaling(1.1); + CHECK(im2.get_scaling() == 1.1); + + // CHECK that image dtype is correct + CHECK(im.get_dtype() == mapnik::image_dtype_gray16); + CHECK(im2.get_dtype() == mapnik::image_dtype_gray16); + + using pixel_type = mapnik::image_view_gray16::pixel_type; + pixel_type expected_val; + // Check that all data in the view is correct + // IM + expected_val = 0; + pixel_type const* data_im = im.data(); + CHECK(*data_im == expected_val); + unsigned char const* data_b = im.bytes(); + CHECK(*data_b == 0); + for (std::size_t y = 0; y < im.height(); ++y) + { + std::size_t width = im.width(); + pixel_type const* data_1 = im.get_row(y); + pixel_type const* data_2 = im.get_row(y, 1); + for (std::size_t x = 0; x < width; ++x) + { + CHECK(*data_1 == expected_val); + ++data_1; + } + for (std::size_t x = 1; x < width; ++x) + { + CHECK(*data_2 == expected_val); + ++data_2; + } + } + // IM2 + expected_val = 514; + pixel_type * data_im2 = im2.data(); + CHECK(*data_im2 == expected_val); + unsigned char * data_b2 = im2.bytes(); + CHECK(*data_b2 == 2); + ++data_b; + CHECK(*data_b2 == 2); + for (std::size_t y = 0; y < im2.height(); ++y) + { + std::size_t width = im2.width(); + pixel_type const* data_1 = im2.get_row(y); + pixel_type const* data_2 = im2.get_row(y, 1); + for (std::size_t x = 0; x < width; ++x) + { + CHECK(*data_1 == expected_val); + ++data_1; + } + for (std::size_t x = 1; x < width; ++x) + { + CHECK(*data_2 == expected_val); + ++data_2; + } + } + + // Test set row + std::vector v1(im2.width(), 30); + std::vector v2(im2.width()-1, 50); + im2.set_row(0, v1.data(), v1.size()); + im2.set_row(1, 1, v2.size(), v2.data()); + + CHECK(im2(0,0) == 30); + CHECK(im2(0,1) == 514); + CHECK(im2(1,1) == 50); + +} // END SECTION + +SECTION("image_null") +{ + mapnik::image_null im_null; + const mapnik::image_null im_null2(2,2); // Actually doesn't really set any size + mapnik::image_null im_null3(im_null2); + mapnik::image_null im_null4(std::move(im_null3)); + + // All nulls are equal + CHECK(im_null == im_null4); + CHECK(im_null == im_null2); + + // No null is greater + CHECK_FALSE(im_null < im_null4); + CHECK_FALSE(im_null < im_null2); + + // Check defaults + CHECK(im_null.width() == 0); + CHECK(im_null.height() == 0); + CHECK(im_null.size() == 0); + CHECK(im_null.row_size() == 0); + // Setting offset does nothing + im_null.set_offset(10000000.0); + CHECK(im_null.get_offset() == 0.0); + // Setting scaling does nothing + im_null.set_scaling(123123123.0); + CHECK(im_null.get_scaling() == 1.0); + CHECK(im_null.get_dtype() == mapnik::image_dtype_null); + // Setting premultiplied does nothing + im_null.set_premultiplied(true); + CHECK_FALSE(im_null.get_premultiplied()); + // Setting painted does nothing + im_null.painted(true); + CHECK_FALSE(im_null.painted()); + + // Should throw if we try to access or setdata. + REQUIRE_THROWS(im_null(0,0)); + REQUIRE_THROWS(im_null2(0,0)); + REQUIRE_THROWS(im_null(0,0) = 1); + + unsigned char const* e1 = im_null.bytes(); + unsigned char * e2 = im_null.bytes(); + CHECK(e1 == nullptr); + CHECK(e2 == nullptr); + +} // END SECTION + +SECTION("image any") +{ + mapnik::image_null null_im; + const mapnik::image_any im_any_null(null_im); + CHECK(im_any_null.get_dtype() == mapnik::image_dtype_null); + CHECK(im_any_null.bytes() == nullptr); + + mapnik::image_gray16 im(4,4); + mapnik::fill(im, 514); + mapnik::image_any im_any(im); + + CHECK(im_any.get_dtype() == mapnik::image_dtype_gray16); + unsigned char * foo = im_any.bytes(); + CHECK(*foo == 2); + ++foo; + CHECK(*foo == 2); + CHECK(im_any.width() == 4); + CHECK(im_any.height() == 4); + CHECK(im_any.size() == 32); + CHECK(im_any.row_size() == 8); + CHECK_FALSE(im_any.get_premultiplied()); + im_any.set_offset(10.0); + CHECK(im_any.get_offset() == 10.0); + im_any.set_scaling(2.1); + CHECK(im_any.get_scaling() == 2.1); + CHECK_FALSE(im_any.painted()); + +} // END SECTION + + +SECTION("test image_any initialization") +{ + { + mapnik::image_any im(4,4); + CHECK(im.get_dtype() == mapnik::image_dtype_rgba8); + } + { + mapnik::image_any im(4, 4, mapnik::image_dtype_null); + CHECK(im.get_dtype() == mapnik::image_dtype_null); + } + { + mapnik::image_any im(4, 4, mapnik::image_dtype_gray8); + CHECK(im.get_dtype() == mapnik::image_dtype_gray8); + } + { + mapnik::image_any im(4, 4, mapnik::image_dtype_gray8s); + CHECK(im.get_dtype() == mapnik::image_dtype_gray8s); + } + { + mapnik::image_any im(4, 4, mapnik::image_dtype_gray16); + CHECK(im.get_dtype() == mapnik::image_dtype_gray16); + } + { + mapnik::image_any im(4, 4, mapnik::image_dtype_gray16s); + CHECK(im.get_dtype() == mapnik::image_dtype_gray16s); + } + { + mapnik::image_any im(4, 4, mapnik::image_dtype_gray32); + CHECK(im.get_dtype() == mapnik::image_dtype_gray32); + } + { + mapnik::image_any im(4, 4, mapnik::image_dtype_gray32s); + CHECK(im.get_dtype() == mapnik::image_dtype_gray32s); + } + { + mapnik::image_any im(4, 4, mapnik::image_dtype_gray32f); + CHECK(im.get_dtype() == mapnik::image_dtype_gray32f); + } + { + mapnik::image_any im(4, 4, mapnik::image_dtype_gray64); + CHECK(im.get_dtype() == mapnik::image_dtype_gray64); + } + { + mapnik::image_any im(4, 4, mapnik::image_dtype_gray64s); + CHECK(im.get_dtype() == mapnik::image_dtype_gray64s); + } + { + mapnik::image_any im(4, 4, mapnik::image_dtype_gray64f); + CHECK(im.get_dtype() == mapnik::image_dtype_gray64f); + } + +} // END SECTION + +SECTION("Image Buffer") +{ + mapnik::detail::buffer buf_zero(0); + CHECK(buf_zero.size() == 0); + CHECK(!buf_zero); + mapnik::detail::buffer buf(10); + CHECK(buf.size() == 10); + CHECK_FALSE(!buf); + unsigned char * d = buf.data(); + *d = 9; + const mapnik::detail::buffer buf2 = buf; + CHECK(buf2.size() == 10); + unsigned char const* d2 = buf2.data(); + CHECK(*d2 == 9); + +} // END SECTION + +} // END TEST CASE + diff --git a/test/unit/imaging/image_apply_opacity.cpp b/test/unit/imaging/image_apply_opacity.cpp new file mode 100644 index 000000000..09f8dd1c3 --- /dev/null +++ b/test/unit/imaging/image_apply_opacity.cpp @@ -0,0 +1,104 @@ +#include "catch.hpp" + +// mapnik +#include +#include +#include + +TEST_CASE("image apply_opacity") { + +SECTION("test rgba8") { + + mapnik::image_rgba8 im(4,4); + mapnik::image_rgba8 im2(4,4,true,true); // Initialize as already premultiplied + mapnik::image_any im_any(mapnik::image_rgba8(4,4)); + mapnik::image_any im2_any(mapnik::image_rgba8(4,4,true,true)); + + // Fill the images with meaningfull values + mapnik::color c1(57,70,128,128); // This color is not premultiplied + mapnik::color c2(57,70,128,128, true); // This color is premultiplied + mapnik::fill(im, c1); // Because c1 is not premultiplied it will make the image not premultiplied + mapnik::fill(im_any, c1); // Because c1 is not premultiplied it will make the image not premultiplied + mapnik::fill(im2, c2); // Because c1 is premultiplied it will make the image premultiplied + mapnik::fill(im2_any, c2); // Because c1 is premultiplied it will make the image premultiplied + + mapnik::apply_opacity(im, 0.75); + mapnik::apply_opacity(im_any, 0.75); + mapnik::apply_opacity(im2, 0.75); + mapnik::apply_opacity(im2_any, 0.75); + + mapnik::color out; + // This should have only changed the alpha, as it was not premultipleid + out = mapnik::get_pixel(im, 0, 0); + CHECK(static_cast(out.red()) == 57); + CHECK(static_cast(out.green()) == 70); + CHECK(static_cast(out.blue()) == 128); + CHECK(static_cast(out.alpha()) == 96); + out = mapnik::get_pixel(im_any, 0, 0); + CHECK(static_cast(out.red()) == 57); + CHECK(static_cast(out.green()) == 70); + CHECK(static_cast(out.blue()) == 128); + CHECK(static_cast(out.alpha()) == 96); + // This will be different because it is demultiplied then premultiplied again after setting alpha + out = mapnik::get_pixel(im2, 0, 0); + CHECK(static_cast(out.red()) == 43); + CHECK(static_cast(out.green()) == 53); + CHECK(static_cast(out.blue()) == 96); + CHECK(static_cast(out.alpha()) == 96); + out = mapnik::get_pixel(im2_any, 0, 0); + CHECK(static_cast(out.red()) == 43); + CHECK(static_cast(out.green()) == 53); + CHECK(static_cast(out.blue()) == 96); + CHECK(static_cast(out.alpha()) == 96); + +} // END SECTION + +SECTION("test rgba8 overflow") { + + mapnik::image_rgba8 im(4,4); + mapnik::color c(128,128,128,128); // This color is premultiplied + mapnik::fill(im, c); // Because c1 is not premultiplied it will make the image not premultiplied + mapnik::color out; + out = mapnik::get_pixel(im, 0, 0); + CHECK(static_cast(out.red()) == 128); + CHECK(static_cast(out.green()) == 128); + CHECK(static_cast(out.blue()) == 128); + CHECK(static_cast(out.alpha()) == 128); + + mapnik::apply_opacity(im, 2.5); + + out = mapnik::get_pixel(im, 0, 0); + CHECK(static_cast(out.red()) == 128); + CHECK(static_cast(out.green()) == 128); + CHECK(static_cast(out.blue()) == 128); + CHECK(static_cast(out.alpha()) == 128); + +} // END SECTION + +SECTION("test rgba8 underflow") { + + mapnik::image_rgba8 im(4,4); + mapnik::color c(128,128,128,128); // This color is premultiplied + mapnik::fill(im, c); // Because c1 is not premultiplied it will make the image not premultiplied + + mapnik::apply_opacity(im, -2.5); + + mapnik::color out; + out = mapnik::get_pixel(im, 0, 0); + CHECK(static_cast(out.red()) == 128); + CHECK(static_cast(out.green()) == 128); + CHECK(static_cast(out.blue()) == 128); + CHECK(static_cast(out.alpha()) == 0); + +} // END SECTION + +SECTION("test gray8") { + + mapnik::image_gray8 im(4,4); + mapnik::image_any im_any(mapnik::image_gray8(4,4)); + + CHECK_THROWS(mapnik::apply_opacity(im, 0.25)); + CHECK_THROWS(mapnik::apply_opacity(im_any, 0.25)); + +} // END SECTION +} // END TEST_CASE diff --git a/test/unit/imaging/image_io_test.cpp b/test/unit/imaging/image_io_test.cpp new file mode 100644 index 000000000..d0a984d7d --- /dev/null +++ b/test/unit/imaging/image_io_test.cpp @@ -0,0 +1,99 @@ +#include "catch.hpp" + +#include +#include +#include +#include +#include +#include +#include +#if defined(HAVE_CAIRO) +#include +#include +#endif + +TEST_CASE("image io") { + +SECTION("readers") { + + std::string should_throw; + boost::optional type; + try + { +#if defined(HAVE_JPEG) + should_throw = "./test/data/images/blank.jpg"; + REQUIRE( mapnik::util::exists( should_throw ) ); + type = mapnik::type_from_filename(should_throw); + REQUIRE( type ); + REQUIRE_THROWS(std::unique_ptr reader(mapnik::get_image_reader(should_throw,*type))); + + // actually a png so jpeg reader should throw + should_throw = "./test/data/images/landusepattern.jpg"; + REQUIRE( mapnik::util::exists( should_throw ) ); + type = mapnik::type_from_filename(should_throw); + REQUIRE( type ); + try + { + std::unique_ptr reader(mapnik::get_image_reader(should_throw,*type)); + REQUIRE(false); + } + catch (std::exception const& ex) + { + REQUIRE( std::string(ex.what()) == std::string("JPEG Reader: libjpeg could not read image: Not a JPEG file: starts with 0x89 0x50") ); + } +#endif + + REQUIRE_THROWS(mapnik::image_rgba8 im(-10,-10)); // should throw rather than overflow + +#if defined(HAVE_CAIRO) + mapnik::cairo_surface_ptr image_surface( + cairo_image_surface_create(CAIRO_FORMAT_ARGB32,256,257), + mapnik::cairo_surface_closer()); + mapnik::image_rgba8 im_data(cairo_image_surface_get_width(&*image_surface), cairo_image_surface_get_height(&*image_surface)); + im_data.set(1); + REQUIRE( (unsigned)im_data(0,0) == unsigned(1) ); + // Should set back to fully transparent + mapnik::cairo_image_to_rgba8(im_data, image_surface); + REQUIRE( (unsigned)im_data(0,0) == unsigned(0) ); +#endif + +#if defined(HAVE_PNG) + should_throw = "./test/data/images/blank.png"; + REQUIRE( mapnik::util::exists( should_throw ) ); + type = mapnik::type_from_filename(should_throw); + REQUIRE( type ); + REQUIRE_THROWS(std::unique_ptr reader(mapnik::get_image_reader(should_throw,*type))); + + should_throw = "./test/data/images/xcode-CgBI.png"; + REQUIRE( mapnik::util::exists( should_throw ) ); + type = mapnik::type_from_filename(should_throw); + REQUIRE( type ); + REQUIRE_THROWS(std::unique_ptr reader(mapnik::get_image_reader(should_throw,*type))); +#endif + +#if defined(HAVE_TIFF) + should_throw = "./test/data/images/blank.tiff"; + REQUIRE( mapnik::util::exists( should_throw ) ); + type = mapnik::type_from_filename(should_throw); + REQUIRE( type ); + REQUIRE_THROWS(std::unique_ptr reader(mapnik::get_image_reader(should_throw,*type))); +#endif + +#if defined(HAVE_WEBP) + should_throw = "./test/data/images/blank.webp"; + REQUIRE( mapnik::util::exists( should_throw ) ); + type = mapnik::type_from_filename(should_throw); + REQUIRE( type ); + REQUIRE_THROWS(std::unique_ptr reader(mapnik::get_image_reader(should_throw,*type))); +#endif + } + catch (std::exception const & ex) + { + std::clog << ex.what() << "\n"; + REQUIRE(false); + } + +} // END SECTION + + +} // END TEST_CASE diff --git a/test/unit/imaging/image_is_solid.cpp b/test/unit/imaging/image_is_solid.cpp new file mode 100644 index 000000000..5bc8217ba --- /dev/null +++ b/test/unit/imaging/image_is_solid.cpp @@ -0,0 +1,94 @@ +#include "catch.hpp" + +// mapnik +#include +#include +#include +#include + + +TEST_CASE("image is_solid") { + +SECTION("test rgba8") { + + mapnik::image_rgba8 im(4,4); + mapnik::image_any im_any(mapnik::image_rgba8(4,4)); + + CHECK(mapnik::is_solid(im)); + CHECK(mapnik::is_solid(im_any)); + + mapnik::image_view_rgba8 im_view(0,0,4,4,im); + mapnik::image_view_any im_view_any(mapnik::image_view_rgba8(0,0,4,4,im)); + + CHECK(mapnik::is_solid(im_view)); + CHECK(mapnik::is_solid(im_view_any)); + + mapnik::color c1("green"); + mapnik::color c2("blue"); + mapnik::fill(im, c1); + mapnik::fill(im_any, c1); + + CHECK(mapnik::is_solid(im)); + CHECK(mapnik::is_solid(im_any)); + CHECK(mapnik::is_solid(im_view)); + CHECK(mapnik::is_solid(im_view_any)); + + mapnik::set_pixel(im, 0, 0, c2); + mapnik::set_pixel(im_any, 0, 0, c2); + + CHECK_FALSE(mapnik::is_solid(im)); + CHECK_FALSE(mapnik::is_solid(im_any)); + CHECK_FALSE(mapnik::is_solid(im_view)); + CHECK_FALSE(mapnik::is_solid(im_view_any)); + +} // END SECTION + +SECTION("test gray8") { + + mapnik::image_gray8 im(4,4); + mapnik::image_any im_any(mapnik::image_gray8(4,4)); + + CHECK(mapnik::is_solid(im)); + CHECK(mapnik::is_solid(im_any)); + + mapnik::image_view_gray8 im_view(0,0,4,4,im); + mapnik::image_view_any im_view_any(mapnik::image_view_gray8(0,0,4,4,im)); + + CHECK(mapnik::is_solid(im_view)); + CHECK(mapnik::is_solid(im_view_any)); + + mapnik::fill(im, 1); + mapnik::fill(im_any, 1); + + CHECK(mapnik::is_solid(im)); + CHECK(mapnik::is_solid(im_any)); + CHECK(mapnik::is_solid(im_view)); + CHECK(mapnik::is_solid(im_view_any)); + + mapnik::set_pixel(im, 0, 0, 2); + mapnik::set_pixel(im_any, 0, 0, 2); + + CHECK_FALSE(mapnik::is_solid(im)); + CHECK_FALSE(mapnik::is_solid(im_any)); + CHECK_FALSE(mapnik::is_solid(im_view)); + CHECK_FALSE(mapnik::is_solid(im_view_any)); + +} // END SECTION + +SECTION("test image null") { + + mapnik::image_null im; + mapnik::image_any im_any; + + CHECK(mapnik::is_solid(im)); + CHECK(mapnik::is_solid(im_any)); + + mapnik::image_view_null im_view; + mapnik::image_view_any im_view_any; + + CHECK(mapnik::is_solid(im_view)); + CHECK(mapnik::is_solid(im_view_any)); + +} // END SECTION + +} // END TEST CASE diff --git a/test/unit/imaging/image_painted_test.cpp b/test/unit/imaging/image_painted_test.cpp new file mode 100644 index 000000000..a1fbbc979 --- /dev/null +++ b/test/unit/imaging/image_painted_test.cpp @@ -0,0 +1,74 @@ +#include "catch.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +TEST_CASE("image") { + +SECTION("painting") { + + using namespace mapnik; + + try + { + std::string csv_plugin("./plugins/input/csv.input"); + if (mapnik::util::exists(csv_plugin)) + { + datasource_cache::instance().register_datasources(csv_plugin); + + Map m(256, 256); + + feature_type_style lines_style; + { + rule r; + line_symbolizer line_sym; + r.append(std::move(line_sym)); + lines_style.add_rule(std::move(r)); + } + m.insert_style("lines", std::move(lines_style)); + + feature_type_style markers_style; + { + rule r; + r.set_filter(parse_expression("False")); + markers_symbolizer mark_sym; + r.append(std::move(mark_sym)); + markers_style.add_rule(std::move(r)); + } + m.insert_style("markers", std::move(markers_style)); + + parameters p; + p["type"] = "csv"; + p["separator"] = "|"; + p["inline"] = "wkt\nLINESTRING(-10 0, 0 20, 10 0, 15 5)"; + + layer lyr("layer"); + lyr.set_datasource(datasource_cache::instance().create(p)); + lyr.add_style("lines"); + lyr.add_style("markers"); + m.add_layer(lyr); + + m.zoom_all(); + + image_rgba8 image(m.width(), m.height()); + agg_renderer ren(m, image); + ren.apply(); + + REQUIRE(image.painted() == true); + } + } + catch (std::exception const & ex) + { + std::clog << ex.what() << std::endl; + REQUIRE(false); + } + +} +} \ No newline at end of file diff --git a/test/unit/imaging/image_premultiply.cpp b/test/unit/imaging/image_premultiply.cpp new file mode 100644 index 000000000..3a5e2a1c0 --- /dev/null +++ b/test/unit/imaging/image_premultiply.cpp @@ -0,0 +1,146 @@ +#include "catch.hpp" + +// mapnik +#include +#include +#include + +TEST_CASE("image premultiply") { + +SECTION("test rgba8") { + + mapnik::image_rgba8 im(4,4); + mapnik::image_rgba8 im2(4,4,true,true); // Initialize as already premultiplied + mapnik::image_any im_any(mapnik::image_rgba8(4,4)); + mapnik::image_any im2_any(mapnik::image_rgba8(4,4,true,true)); + + // First test that the default state is correct for each + CHECK_FALSE(im.get_premultiplied()); + CHECK_FALSE(im_any.get_premultiplied()); + CHECK(im2.get_premultiplied()); + CHECK(im2_any.get_premultiplied()); + + // Set the image to premultiplied + im.set_premultiplied(true); + CHECK(im.get_premultiplied()); + // Set back to not premultiplied + im.set_premultiplied(false); + CHECK_FALSE(im.get_premultiplied()); + + mapnik::set_premultiplied_alpha(im, true); + CHECK(im.get_premultiplied()); + mapnik::set_premultiplied_alpha(im, false); + CHECK_FALSE(im.get_premultiplied()); + + // Fill the images with meaningfull values + mapnik::color c1(57,70,128,128); // This color is not premultiplied + mapnik::color c2(57,70,128,128, true); // This color is premultiplied + mapnik::fill(im, c2); // Because c2 is premultiplied it will make the image premultiplied + mapnik::fill(im_any, c2); // Because c2 is premultiplied it will make the image premultiplied + mapnik::fill(im2, c1); // Because c1 is not premultiplied it will make the image not premultiplied + mapnik::fill(im2_any, c1); // Because c1 is not premultiplied it will make the image not premultiplied + + // Demultipled via image_util + CHECK(mapnik::demultiply_alpha(im)); // Should return true as was premultiplied + CHECK(mapnik::demultiply_alpha(im_any)); // Should return true as was premultiplied + CHECK_FALSE(mapnik::demultiply_alpha(im2)); // Should return false as was demultiplied + CHECK_FALSE(mapnik::demultiply_alpha(im2_any)); // Should return false as was demultiplied + + mapnik::color out; + // This will be higher because it became demultiplied! + out = mapnik::get_pixel(im, 0, 0); + CHECK(static_cast(out.red()) == 113); + CHECK(static_cast(out.green()) == 139); + CHECK(static_cast(out.blue()) == 255); + CHECK(static_cast(out.alpha()) == 128); + out = mapnik::get_pixel(im_any, 0, 0); + CHECK(static_cast(out.red()) == 113); + CHECK(static_cast(out.green()) == 139); + CHECK(static_cast(out.blue()) == 255); + CHECK(static_cast(out.alpha()) == 128); + // This will be the same because it was already demultiplied + out = mapnik::get_pixel(im2, 0, 0); + CHECK(static_cast(out.red()) == 57); + CHECK(static_cast(out.green()) == 70); + CHECK(static_cast(out.blue()) == 128); + CHECK(static_cast(out.alpha()) == 128); + out = mapnik::get_pixel(im2_any, 0, 0); + CHECK(static_cast(out.red()) == 57); + CHECK(static_cast(out.green()) == 70); + CHECK(static_cast(out.blue()) == 128); + CHECK(static_cast(out.alpha()) == 128); + + // Set back to im2s to "premultiplied" with out changing underlying values + mapnik::set_premultiplied_alpha(im2, true); + mapnik::set_premultiplied_alpha(im2_any, true); + + // Demultipled via image_util + CHECK(mapnik::premultiply_alpha(im)); // Should return true as was demultiplied + CHECK(mapnik::premultiply_alpha(im_any)); // Should return true as was demultiplied + CHECK_FALSE(mapnik::premultiply_alpha(im2)); // Should return false as was premultiplied + CHECK_FALSE(mapnik::premultiply_alpha(im2_any)); // Should return false as was premultiplied + + // This will be the same because it was already demultiplied + out = mapnik::get_pixel(im, 0, 0); + CHECK(static_cast(out.red()) == 57); + CHECK(static_cast(out.green()) == 70); + CHECK(static_cast(out.blue()) == 128); + CHECK(static_cast(out.alpha()) == 128); + out = mapnik::get_pixel(im_any, 0, 0); + CHECK(static_cast(out.red()) == 57); + CHECK(static_cast(out.green()) == 70); + CHECK(static_cast(out.blue()) == 128); + CHECK(static_cast(out.alpha()) == 128); + // This will be the same because it was already demultiplied + out = mapnik::get_pixel(im2, 0, 0); + CHECK(static_cast(out.red()) == 57); + CHECK(static_cast(out.green()) == 70); + CHECK(static_cast(out.blue()) == 128); + CHECK(static_cast(out.alpha()) == 128); + out = mapnik::get_pixel(im2_any, 0, 0); + CHECK(static_cast(out.red()) == 57); + CHECK(static_cast(out.green()) == 70); + CHECK(static_cast(out.blue()) == 128); + CHECK(static_cast(out.alpha()) == 128); + +} // END SECTION + +SECTION("test gray8") { + + mapnik::image_gray8 im(4,4); + mapnik::image_gray8 im2(4,4,true,true); // Initialize as already premultiplied + mapnik::image_any im_any(mapnik::image_gray8(4,4)); + mapnik::image_any im2_any(mapnik::image_gray8(4,4,true,true)); + + // First test that the default state is correct for each + CHECK_FALSE(im.get_premultiplied()); + CHECK_FALSE(im_any.get_premultiplied()); + CHECK(im2.get_premultiplied()); + CHECK(im2_any.get_premultiplied()); + + // Set the image to premultiplied + im.set_premultiplied(true); + CHECK(im.get_premultiplied()); + // Set back to not premultiplied + im.set_premultiplied(false); + CHECK_FALSE(im.get_premultiplied()); + + mapnik::set_premultiplied_alpha(im, true); + CHECK(im.get_premultiplied()); + mapnik::set_premultiplied_alpha(im, false); + CHECK_FALSE(im.get_premultiplied()); + + // Always fails on demultiply since its gray8 + CHECK_FALSE(mapnik::demultiply_alpha(im)); + CHECK_FALSE(mapnik::demultiply_alpha(im_any)); + CHECK_FALSE(mapnik::demultiply_alpha(im2)); + CHECK_FALSE(mapnik::demultiply_alpha(im2_any)); + + // Always fails on premultiply since its gray8 + CHECK_FALSE(mapnik::premultiply_alpha(im)); + CHECK_FALSE(mapnik::premultiply_alpha(im_any)); + CHECK_FALSE(mapnik::premultiply_alpha(im2)); + CHECK_FALSE(mapnik::premultiply_alpha(im2_any)); + +} // END SECTION +} // END TEST_CASE diff --git a/test/unit/imaging/image_set_pixel.cpp b/test/unit/imaging/image_set_pixel.cpp new file mode 100644 index 000000000..ed7ceaffc --- /dev/null +++ b/test/unit/imaging/image_set_pixel.cpp @@ -0,0 +1,28 @@ +#include "catch.hpp" + +// mapnik +#include +#include +#include +#include + + +TEST_CASE("image set_pixel") { + +SECTION("test gray32") { + mapnik::image_gray32 im(256,256); + mapnik::set_pixel(im, 0, 0, -1); + auto pixel = mapnik::get_pixel(im, 0, 0); + INFO( pixel ); + CHECK( pixel == 0 ); +} + +SECTION("test gray8s") { + mapnik::image_gray8s im(256,256); + mapnik::set_pixel(im, 0, 0, std::numeric_limits::max()+1); + auto pixel = mapnik::get_pixel(im, 0, 0); + INFO( pixel ); + CHECK( (int)pixel == (int)std::numeric_limits::max() ); +} + +} \ No newline at end of file diff --git a/test/unit/imaging/image_view.cpp b/test/unit/imaging/image_view.cpp new file mode 100644 index 000000000..dac76449b --- /dev/null +++ b/test/unit/imaging/image_view.cpp @@ -0,0 +1,281 @@ +#include "catch.hpp" + +// mapnik +#include +#include +#include +#include + +TEST_CASE("image view") { + +SECTION("test rgba8") { + + mapnik::image_rgba8 im(4,4); + mapnik::color c_red("red"); + mapnik::color c_blue("blue"); + mapnik::color c_green("green"); + mapnik::color c_yellow("yellow"); + mapnik::fill(im, c_red); + // Upper Left 2x2 is blue + mapnik::set_pixel(im, 0, 0, c_blue); + mapnik::set_pixel(im, 0, 1, c_blue); + mapnik::set_pixel(im, 1, 0, c_blue); + mapnik::set_pixel(im, 1, 1, c_blue); + // Upper Right 2x2 is green + mapnik::set_pixel(im, 2, 0, c_green); + mapnik::set_pixel(im, 2, 1, c_green); + mapnik::set_pixel(im, 3, 0, c_green); + mapnik::set_pixel(im, 3, 1, c_green); + // Lower Left 2x2 is yellow + mapnik::set_pixel(im, 0, 2, c_yellow); + mapnik::set_pixel(im, 0, 3, c_yellow); + mapnik::set_pixel(im, 1, 2, c_yellow); + mapnik::set_pixel(im, 1, 3, c_yellow); + + mapnik::image_rgba8 im2(5,5); + mapnik::fill(im2, c_red); + + // Now that we have test data run tests + mapnik::image_view_rgba8 view_all(0,0,4,4,im); + mapnik::image_view_rgba8 view_blue(0,0,2,2,im); + mapnik::image_view_rgba8 view_green(2,0,2,2,im); + mapnik::image_view_rgba8 view_yellow(0,2,2,2,im); + mapnik::image_view_rgba8 view_red(2,2,2,2,im); + mapnik::image_view_rgba8 view_bad(99,99,99,99,im); + const mapnik::image_view_rgba8 view_all_2(0,0,4,4,im2); + + // Check that image_views all have the same underlying data + CHECK(view_all == view_blue); + CHECK(view_all == view_green); + CHECK(view_all == view_yellow); + CHECK(view_all == view_red); + + CHECK(view_all.data() == im); + + // Check that view_all and view_all_2 are not the same underlying data + CHECK_FALSE(view_all == view_all_2); + CHECK(view_all < view_all_2); + + // Check that copy constructor works + mapnik::image_view_rgba8 view_all_3(view_all_2); + CHECK(view_all_2 == view_all_3); + + // Check other constructor + mapnik::image_view_rgba8 view_all_4(std::move(view_all_3)); + CHECK(view_all_2 == view_all_4); + + // Check that x offset is correct + CHECK(view_all.x() == 0); + CHECK(view_blue.x() == 0); + CHECK(view_green.x() == 2); + CHECK(view_yellow.x() == 0); + CHECK(view_red.x() == 2); + CHECK(view_bad.x() == 3); + + // Check that y offset is correct + CHECK(view_all.y() == 0); + CHECK(view_blue.y() == 0); + CHECK(view_green.y() == 0); + CHECK(view_yellow.y() == 2); + CHECK(view_red.y() == 2); + CHECK(view_bad.y() == 3); + + // Check that width is correct + CHECK(view_all.width() == 4); + CHECK(view_blue.width() == 2); + CHECK(view_green.width() == 2); + CHECK(view_yellow.width() == 2); + CHECK(view_red.width() == 2); + CHECK(view_bad.width() == 1); + + // Check that height is correct + CHECK(view_all.height() == 4); + CHECK(view_blue.height() == 2); + CHECK(view_green.height() == 2); + CHECK(view_yellow.height() == 2); + CHECK(view_red.height() == 2); + CHECK(view_bad.height() == 1); + + // Check that size is correct + CHECK(view_all.size() == 64); + CHECK(view_blue.size() == 16); + CHECK(view_green.size() == 16); + CHECK(view_yellow.size() == 16); + CHECK(view_red.size() == 16); + + // Check that row_size is correct + CHECK(view_all.row_size() == 16); + CHECK(view_blue.row_size() == 8); + CHECK(view_green.row_size() == 8); + CHECK(view_yellow.row_size() == 8); + CHECK(view_red.row_size() == 8); + + // Check that get_premultiplied is correct + CHECK_FALSE(view_all.get_premultiplied()); + CHECK_FALSE(view_blue.get_premultiplied()); + CHECK_FALSE(view_green.get_premultiplied()); + CHECK_FALSE(view_yellow.get_premultiplied()); + CHECK_FALSE(view_red.get_premultiplied()); + + // Check that operator to retrieve value works properly + CHECK(view_all(0,0) == c_blue.rgba()); + CHECK(view_blue(0,0) == c_blue.rgba()); + CHECK(view_green(0,0) == c_green.rgba()); + CHECK(view_yellow(0,0) == c_yellow.rgba()); + CHECK(view_red.row_size() == 8); + + // Check that offset is correct + CHECK(view_all.get_offset() == 0.0); + CHECK(view_blue.get_offset() == 0.0); + CHECK(view_green.get_offset() == 0.0); + CHECK(view_yellow.get_offset() == 0.0); + CHECK(view_red.get_offset() == 0.0); + + // Check that scaling is correct + CHECK(view_all.get_scaling() == 1.0); + CHECK(view_blue.get_scaling() == 1.0); + CHECK(view_green.get_scaling() == 1.0); + CHECK(view_yellow.get_scaling() == 1.0); + CHECK(view_red.get_scaling() == 1.0); + + // CHECK that image dtype is correct + CHECK(view_all.get_dtype() == mapnik::image_dtype_rgba8); + CHECK(view_blue.get_dtype() == mapnik::image_dtype_rgba8); + CHECK(view_green.get_dtype() == mapnik::image_dtype_rgba8); + CHECK(view_yellow.get_dtype() == mapnik::image_dtype_rgba8); + CHECK(view_red.get_dtype() == mapnik::image_dtype_rgba8); + + unsigned expected_val; + using pixel_type = mapnik::image_view_rgba8::pixel_type; + // Check that all data in the view is correct + // Blue + expected_val = c_blue.rgba(); + for (std::size_t y = 0; y < view_blue.height(); ++y) + { + std::size_t width = view_blue.width(); + pixel_type const* data_1 = view_blue.get_row(y); + pixel_type const* data_2 = view_blue.get_row(y, 1); + for (std::size_t x = 0; x < width; ++x) + { + CHECK(*data_1 == expected_val); + ++data_1; + } + for (std::size_t x = 1; x < width; ++x) + { + CHECK(*data_2 == expected_val); + ++data_2; + } + } + // Green + expected_val = c_green.rgba(); + for (std::size_t y = 0; y < view_green.height(); ++y) + { + std::size_t width = view_green.width(); + pixel_type const* data_1 = view_green.get_row(y); + pixel_type const* data_2 = view_green.get_row(y, 1); + for (std::size_t x = 0; x < width; ++x) + { + CHECK(*data_1 == expected_val); + ++data_1; + } + for (std::size_t x = 1; x < width; ++x) + { + CHECK(*data_2 == expected_val); + ++data_2; + } + } + // Yellow + expected_val = c_yellow.rgba(); + for (std::size_t y = 0; y < view_yellow.height(); ++y) + { + std::size_t width = view_yellow.width(); + pixel_type const* data_1 = view_yellow.get_row(y); + pixel_type const* data_2 = view_yellow.get_row(y, 1); + for (std::size_t x = 0; x < width; ++x) + { + CHECK(*data_1 == expected_val); + ++data_1; + } + for (std::size_t x = 1; x < width; ++x) + { + CHECK(*data_2 == expected_val); + ++data_2; + } + } + // Red + expected_val = c_red.rgba(); + for (std::size_t y = 0; y < view_red.height(); ++y) + { + std::size_t width = view_red.width(); + pixel_type const* data_1 = view_red.get_row(y); + pixel_type const* data_2 = view_red.get_row(y, 1); + for (std::size_t x = 0; x < width; ++x) + { + CHECK(*data_1 == expected_val); + ++data_1; + } + for (std::size_t x = 1; x < width; ++x) + { + CHECK(*data_2 == expected_val); + ++data_2; + } + } + +} // END SECTION + +SECTION("image_view_null") +{ + mapnik::image_view_null view_null; + const mapnik::image_view_null view_null2; + mapnik::image_view_null view_null3(view_null2); + mapnik::image_view_null & view_null4 = view_null3; + + // All nulls are equal + CHECK(view_null == view_null4); + CHECK(view_null == view_null2); + + // No null is greater + CHECK_FALSE(view_null < view_null4); + CHECK_FALSE(view_null < view_null2); + + // Check defaults + CHECK(view_null.x() == 0); + CHECK(view_null.y() == 0); + CHECK(view_null.width() == 0); + CHECK(view_null.height() == 0); + CHECK(view_null.size() == 0); + CHECK(view_null.row_size() == 0); + CHECK(view_null.get_offset() == 0.0); + CHECK(view_null.get_scaling() == 1.0); + CHECK(view_null.get_dtype() == mapnik::image_dtype_null); + CHECK_FALSE(view_null.get_premultiplied()); + + // Should throw if we try to access data. + REQUIRE_THROWS(view_null(0,0)); + + CHECK(view_null.get_row(0) == nullptr); + CHECK(view_null.get_row(0,0) == nullptr); + +} // END SECTION + +SECTION("image view any") +{ + mapnik::image_view_any im_any_null; + CHECK(im_any_null.get_dtype() == mapnik::image_dtype_null); + + mapnik::image_gray8 im(4,4); + mapnik::image_view_gray8 im_view(0,0,4,4,im); + mapnik::image_view_any im_view_any(im_view); + + CHECK(im_view_any.get_dtype() == mapnik::image_dtype_gray8); + CHECK(im_view_any.width() == 4); + CHECK(im_view_any.height() == 4); + CHECK(im_view_any.size() == 16); + CHECK(im_view_any.row_size() == 4); + CHECK_FALSE(im_view_any.get_premultiplied()); + CHECK(im_view_any.get_offset() == 0.0); + CHECK(im_view_any.get_scaling() == 1.0); + +} // END SECTION + +} // END TEST CASE diff --git a/tests/cxx/tiff_io.cpp b/test/unit/imaging/tiff_io.cpp similarity index 70% rename from tests/cxx/tiff_io.cpp rename to test/unit/imaging/tiff_io.cpp index 37cfdddd4..2e31d566d 100644 --- a/tests/cxx/tiff_io.cpp +++ b/test/unit/imaging/tiff_io.cpp @@ -1,5 +1,8 @@ -#if defined(HAVE_TIFF) +// disabled on windows due to https://github.com/mapnik/mapnik/issues/2838 +// TODO - get to the bottom of why including `tiff_reader.cpp` breaks windows +// or re-write image_readers to allow `#include tiff_reader.hpp` +#if !defined(_MSC_VER) && defined(HAVE_TIFF) #include "catch.hpp" @@ -8,7 +11,7 @@ #include #include -#include "../../src/tiff_reader.cpp" +#include "../../../src/tiff_reader.cpp" #define TIFF_ASSERT(filename) \ mapnik::tiff_reader tiff_reader(filename); \ @@ -26,39 +29,40 @@ REQUIRE( reader2->width() == 256 ); \ REQUIRE( reader2->height() == 256 ); \ -#define TIFF_ASSERT_ALPHA \ +#define TIFF_ASSERT_ALPHA( data ) \ REQUIRE( tiff_reader.has_alpha() == true ); \ - REQUIRE( tiff_reader.premultiplied_alpha() == false ); \ REQUIRE( reader->has_alpha() == true ); \ - REQUIRE( reader->premultiplied_alpha() == false ); \ REQUIRE( tiff_reader2.has_alpha() == true ); \ - REQUIRE( tiff_reader2.premultiplied_alpha() == false ); \ REQUIRE( reader2->has_alpha() == true ); \ - REQUIRE( reader2->premultiplied_alpha() == false ); \ + REQUIRE( data.get_premultiplied() == true ); \ -#define TIFF_ASSERT_NO_ALPHA \ +#define TIFF_ASSERT_NO_ALPHA_RGB( data ) \ REQUIRE( tiff_reader.has_alpha() == false ); \ - REQUIRE( tiff_reader.premultiplied_alpha() == false ); \ REQUIRE( reader->has_alpha() == false ); \ - REQUIRE( reader->premultiplied_alpha() == false ); \ REQUIRE( tiff_reader2.has_alpha() == false ); \ - REQUIRE( tiff_reader2.premultiplied_alpha() == false ); \ REQUIRE( reader2->has_alpha() == false ); \ - REQUIRE( reader2->premultiplied_alpha() == false ); \ + REQUIRE( data.get_premultiplied() == true ); \ + +#define TIFF_ASSERT_NO_ALPHA_GRAY( data ) \ + REQUIRE( tiff_reader.has_alpha() == false ); \ + REQUIRE( reader->has_alpha() == false ); \ + REQUIRE( tiff_reader2.has_alpha() == false ); \ + REQUIRE( reader2->has_alpha() == false ); \ + REQUIRE( data.get_premultiplied() == false ); \ #define TIFF_ASSERT_SIZE( data,reader ) \ REQUIRE( data.width() == reader->width() ); \ REQUIRE( data.height() == reader->height() ); \ #define TIFF_READ_ONE_PIXEL \ - mapnik::image_data_any subimage = reader->read(1, 1, 1, 1); \ + mapnik::image_any subimage = reader->read(1, 1, 1, 1); \ REQUIRE( subimage.width() == 1 ); \ REQUIRE( subimage.height() == 1 ); \ TEST_CASE("tiff io") { SECTION("scan rgb8 striped") { - std::string filename("./tests/data/tiff/scan_512x512_rgb8_striped.tif"); + std::string filename("./test/data/tiff/scan_512x512_rgb8_striped.tif"); mapnik::tiff_reader tiff_reader(filename); REQUIRE( tiff_reader.width() == 512 ); REQUIRE( tiff_reader.height() == 512 ); @@ -80,15 +84,15 @@ SECTION("scan rgb8 striped") { std::unique_ptr reader2(mapnik::get_image_reader(file.data().get(),file.size())); REQUIRE( reader2->width() == 512 ); REQUIRE( reader2->height() == 512 ); - mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); - REQUIRE( data.is() == true ); + mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_SIZE( data,reader ); - TIFF_ASSERT_NO_ALPHA + TIFF_ASSERT_NO_ALPHA_RGB( data ); TIFF_READ_ONE_PIXEL } SECTION("scan rgb8 tiled") { - std::string filename("./tests/data/tiff/scan_512x512_rgb8_tiled.tif"); + std::string filename("./test/data/tiff/scan_512x512_rgb8_tiled.tif"); mapnik::tiff_reader tiff_reader(filename); REQUIRE( tiff_reader.width() == 512 ); REQUIRE( tiff_reader.height() == 512 ); @@ -110,15 +114,15 @@ SECTION("scan rgb8 tiled") { std::unique_ptr reader2(mapnik::get_image_reader(file.data().get(),file.size())); REQUIRE( reader2->width() == 512 ); REQUIRE( reader2->height() == 512 ); - mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); - REQUIRE( data.is() == true ); + mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_SIZE( data,reader ); - TIFF_ASSERT_NO_ALPHA + TIFF_ASSERT_NO_ALPHA_RGB( data ); TIFF_READ_ONE_PIXEL } SECTION("rgba8 striped") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_rgba8_striped.tif") + TIFF_ASSERT("./test/data/tiff/ndvi_256x256_rgba8_striped.tif") REQUIRE( tiff_reader.rows_per_strip() == 1 ); REQUIRE( tiff_reader.bits_per_sample() == 8 ); REQUIRE( tiff_reader.is_tiled() == false ); @@ -126,15 +130,15 @@ SECTION("rgba8 striped") { REQUIRE( tiff_reader.tile_height() == 0 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_RGB ); REQUIRE( tiff_reader.compression() == COMPRESSION_ADOBE_DEFLATE ); - mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); - REQUIRE( data.is() == true ); + mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_SIZE( data,reader ); - TIFF_ASSERT_ALPHA + TIFF_ASSERT_ALPHA( data ); TIFF_READ_ONE_PIXEL } SECTION("rgba8 tiled") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_rgba8_tiled.tif") + TIFF_ASSERT("./test/data/tiff/ndvi_256x256_rgba8_tiled.tif") REQUIRE( tiff_reader.rows_per_strip() == 0 ); REQUIRE( tiff_reader.bits_per_sample() == 8 ); REQUIRE( tiff_reader.is_tiled() == true ); @@ -142,15 +146,15 @@ SECTION("rgba8 tiled") { REQUIRE( tiff_reader.tile_height() == 256 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_RGB ); REQUIRE( tiff_reader.compression() == COMPRESSION_LZW ); - mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); - REQUIRE( data.is() == true ); + mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_SIZE( data,reader ); - TIFF_ASSERT_ALPHA + TIFF_ASSERT_ALPHA( data ); TIFF_READ_ONE_PIXEL } SECTION("rgb8 striped") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_rgb8_striped.tif") + TIFF_ASSERT("./test/data/tiff/ndvi_256x256_rgb8_striped.tif") REQUIRE( tiff_reader.rows_per_strip() == 10 ); REQUIRE( tiff_reader.bits_per_sample() == 8 ); REQUIRE( tiff_reader.is_tiled() == false ); @@ -158,15 +162,15 @@ SECTION("rgb8 striped") { REQUIRE( tiff_reader.tile_height() == 0 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_RGB ); REQUIRE( tiff_reader.compression() == COMPRESSION_NONE ); - mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); - REQUIRE( data.is() == true ); + mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_SIZE( data,reader ); - TIFF_ASSERT_NO_ALPHA + TIFF_ASSERT_NO_ALPHA_RGB( data ); TIFF_READ_ONE_PIXEL } SECTION("rgb8 tiled") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_rgb8_tiled.tif") + TIFF_ASSERT("./test/data/tiff/ndvi_256x256_rgb8_tiled.tif") REQUIRE( tiff_reader.rows_per_strip() == 0 ); REQUIRE( tiff_reader.bits_per_sample() == 8 ); REQUIRE( tiff_reader.is_tiled() == true ); @@ -174,15 +178,15 @@ SECTION("rgb8 tiled") { REQUIRE( tiff_reader.tile_height() == 256 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_RGB ); REQUIRE( tiff_reader.compression() == COMPRESSION_LZW ); - mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); - REQUIRE( data.is() == true ); + mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_SIZE( data,reader ); - TIFF_ASSERT_NO_ALPHA + TIFF_ASSERT_NO_ALPHA_RGB( data ); TIFF_READ_ONE_PIXEL } SECTION("gray8 striped") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_gray8_striped.tif") + TIFF_ASSERT("./test/data/tiff/ndvi_256x256_gray8_striped.tif") REQUIRE( tiff_reader.rows_per_strip() == 32 ); REQUIRE( tiff_reader.bits_per_sample() == 8 ); REQUIRE( tiff_reader.is_tiled() == false ); @@ -190,15 +194,15 @@ SECTION("gray8 striped") { REQUIRE( tiff_reader.tile_height() == 0 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); REQUIRE( tiff_reader.compression() == COMPRESSION_NONE ); - mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); - REQUIRE( data.is() == true ); + mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_SIZE( data,reader ); - TIFF_ASSERT_NO_ALPHA + TIFF_ASSERT_NO_ALPHA_GRAY( data ); TIFF_READ_ONE_PIXEL } SECTION("gray8 tiled") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_gray8_tiled.tif") + TIFF_ASSERT("./test/data/tiff/ndvi_256x256_gray8_tiled.tif") REQUIRE( tiff_reader.rows_per_strip() == 0 ); REQUIRE( tiff_reader.bits_per_sample() == 8 ); REQUIRE( tiff_reader.is_tiled() == true ); @@ -206,15 +210,15 @@ SECTION("gray8 tiled") { REQUIRE( tiff_reader.tile_height() == 256 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); REQUIRE( tiff_reader.compression() == COMPRESSION_LZW ); - mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); - REQUIRE( data.is() == true ); + mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_SIZE( data,reader ); - TIFF_ASSERT_NO_ALPHA + TIFF_ASSERT_NO_ALPHA_GRAY( data ); TIFF_READ_ONE_PIXEL } SECTION("gray16 striped") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_gray16_striped.tif") + TIFF_ASSERT("./test/data/tiff/ndvi_256x256_gray16_striped.tif") REQUIRE( tiff_reader.rows_per_strip() == 16 ); REQUIRE( tiff_reader.bits_per_sample() == 16 ); REQUIRE( tiff_reader.is_tiled() == false ); @@ -222,15 +226,15 @@ SECTION("gray16 striped") { REQUIRE( tiff_reader.tile_height() == 0 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); REQUIRE( tiff_reader.compression() == COMPRESSION_NONE ); - mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); - REQUIRE( data.is() == true ); + mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_SIZE( data,reader ); - TIFF_ASSERT_NO_ALPHA + TIFF_ASSERT_NO_ALPHA_GRAY( data ); TIFF_READ_ONE_PIXEL } SECTION("gray16 tiled") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_gray16_tiled.tif") + TIFF_ASSERT("./test/data/tiff/ndvi_256x256_gray16_tiled.tif") REQUIRE( tiff_reader.rows_per_strip() == 0 ); REQUIRE( tiff_reader.bits_per_sample() == 16 ); REQUIRE( tiff_reader.is_tiled() == true ); @@ -238,15 +242,15 @@ SECTION("gray16 tiled") { REQUIRE( tiff_reader.tile_height() == 256 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); REQUIRE( tiff_reader.compression() == COMPRESSION_LZW ); - mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); - REQUIRE( data.is() == true ); + mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_SIZE( data,reader ); - TIFF_ASSERT_NO_ALPHA + TIFF_ASSERT_NO_ALPHA_GRAY( data ); TIFF_READ_ONE_PIXEL } SECTION("gray32f striped") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_gray32f_striped.tif") + TIFF_ASSERT("./test/data/tiff/ndvi_256x256_gray32f_striped.tif") REQUIRE( tiff_reader.rows_per_strip() == 8 ); REQUIRE( tiff_reader.bits_per_sample() == 32 ); REQUIRE( tiff_reader.is_tiled() == false ); @@ -254,15 +258,15 @@ SECTION("gray32f striped") { REQUIRE( tiff_reader.tile_height() == 0 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); REQUIRE( tiff_reader.compression() == COMPRESSION_NONE ); - mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); - REQUIRE( data.is() == true ); + mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_SIZE( data,reader ); - TIFF_ASSERT_NO_ALPHA + TIFF_ASSERT_NO_ALPHA_GRAY( data ); TIFF_READ_ONE_PIXEL } SECTION("gray32f tiled") { - TIFF_ASSERT("./tests/data/tiff/ndvi_256x256_gray32f_tiled.tif") + TIFF_ASSERT("./test/data/tiff/ndvi_256x256_gray32f_tiled.tif") REQUIRE( tiff_reader.rows_per_strip() == 0 ); REQUIRE( tiff_reader.bits_per_sample() == 32 ); REQUIRE( tiff_reader.is_tiled() == true ); @@ -270,10 +274,10 @@ SECTION("gray32f tiled") { REQUIRE( tiff_reader.tile_height() == 256 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); REQUIRE( tiff_reader.compression() == COMPRESSION_LZW ); - mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); - REQUIRE( data.is() == true ); + mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_SIZE( data,reader ); - TIFF_ASSERT_NO_ALPHA + TIFF_ASSERT_NO_ALPHA_GRAY( data ); TIFF_READ_ONE_PIXEL } diff --git a/test/unit/imaging/webp_io.cpp b/test/unit/imaging/webp_io.cpp new file mode 100644 index 000000000..6f580a42f --- /dev/null +++ b/test/unit/imaging/webp_io.cpp @@ -0,0 +1,26 @@ + +#if defined(HAVE_WEBP) + +#include "catch.hpp" + +#include +#include +#include + +TEST_CASE("webp io") { + +SECTION("does not crash accessing view") { + std::stringstream s; + mapnik::image_rgba8 im(1024,1024); + mapnik::image_view_rgba8 view(512,512,1024,1024,im); + WebPConfig config; + if (!WebPConfigInit(&config)) + { + throw std::runtime_error("version mismatch"); + } + save_as_webp(s,view,config,true); +} + +} + +#endif diff --git a/test/unit/numerics/safe_cast.cpp b/test/unit/numerics/safe_cast.cpp new file mode 100644 index 000000000..b6cba62c1 --- /dev/null +++ b/test/unit/numerics/safe_cast.cpp @@ -0,0 +1,59 @@ +#include "catch.hpp" +#include + +#define CAST_ASSERT(numeric_type) \ + using limit = std::numeric_limits; \ + auto min_value = static_cast(limit::min())-1; \ + auto max_value = static_cast(limit::max())+1; \ + CHECK( limit::min() == mapnik::safe_cast(min_value) ); \ + CHECK( limit::max() == mapnik::safe_cast(max_value) ); \ + +#define CAST_ASSERT2(numeric_type) \ + using limit = std::numeric_limits; \ + auto min_value = static_cast(limit::min()); \ + auto max_value = static_cast(limit::max()); \ + CHECK( limit::min() == mapnik::safe_cast(min_value) ); \ + CHECK( limit::max() == mapnik::safe_cast(max_value) ); \ + +#define CAST_ASSERT3(numeric_type) \ + using limit = std::numeric_limits; \ + auto min_value = static_cast(limit::min())-1; \ + auto max_value = static_cast(limit::max()); \ + CHECK( limit::min() == mapnik::safe_cast(min_value) ); \ + CHECK( limit::max() == mapnik::safe_cast(max_value) ); \ + +#define CAST_ASSERT4(numeric_type) \ + using limit = std::numeric_limits; \ + auto min_value = static_cast(-limit::max())-1; \ + auto max_value = static_cast(limit::max()); \ + CHECK( -limit::max() == mapnik::safe_cast(min_value) ); \ + CHECK( limit::max() == mapnik::safe_cast(max_value) ); \ + +TEST_CASE("saturated cast") { + + SECTION("int8") { CAST_ASSERT(std::int8_t); } + SECTION("int16") { CAST_ASSERT(std::int16_t); } + SECTION("int32") { CAST_ASSERT(std::int32_t); } + + SECTION("int64") { CAST_ASSERT2(std::int64_t); } + SECTION("intmax") { CAST_ASSERT2(std::intmax_t); } + SECTION("intptr") { CAST_ASSERT2(std::intptr_t); } + + SECTION("uint8") { CAST_ASSERT(std::uint8_t); } + SECTION("uint16") { CAST_ASSERT(std::uint16_t); } + SECTION("uint32") { CAST_ASSERT(std::uint32_t); } + + SECTION("uint64") { CAST_ASSERT3(std::uint64_t); } + SECTION("uintmax") { CAST_ASSERT3(std::uintmax_t); } + SECTION("uintptr") { CAST_ASSERT3(std::uintptr_t); } + + SECTION("float") { CAST_ASSERT4(float); } + + SECTION("freeform") { + + CHECK( static_cast(0) == mapnik::safe_cast(-1) ); + CHECK( static_cast(0) == mapnik::safe_cast(-1) ); + CHECK( static_cast(0) == mapnik::safe_cast(-1) ); + } + +} \ No newline at end of file diff --git a/tests/cpp_tests/agg_blend_src_over_test.cpp b/test/unit/pixel/agg_blend_src_over_test.cpp similarity index 75% rename from tests/cpp_tests/agg_blend_src_over_test.cpp rename to test/unit/pixel/agg_blend_src_over_test.cpp index eb86e4cad..235a23047 100644 --- a/tests/cpp_tests/agg_blend_src_over_test.cpp +++ b/test/unit/pixel/agg_blend_src_over_test.cpp @@ -1,4 +1,5 @@ -#include +#include "catch.hpp" + #include #include #include @@ -132,14 +133,9 @@ template struct comp_op_rgba_src_over2 } -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;i; using source_over = agg::comp_op_rgba_src_over; @@ -149,16 +145,16 @@ int main(int argc, char** argv) color white(255,255,255,255); color black(0,0,0,255); - BOOST_TEST_EQ( to_string(blend(white,white)), to_string(white) ); - BOOST_TEST_EQ( to_string(blend(white,black)), to_string(white) ); - BOOST_TEST_EQ( to_string(blend(black,white)), to_string(black) ); + REQUIRE( to_string(blend(white,white)) == to_string(white) ); + REQUIRE( to_string(blend(white,black)) == to_string(white) ); + REQUIRE( to_string(blend(black,white)) == to_string(black) ); color near_white(254,254,254,254); // Source color near_trans(1,1,1,1); // Dest color expected_color(253,253,253,255); // expected result - BOOST_TEST_EQ( to_string(blend(near_white,near_trans)), to_string(color(253,253,253,254)) ); - BOOST_TEST_EQ( to_string(blend(near_white,near_trans)), to_string(expected_color) ); - BOOST_TEST_EQ( to_string(normal_blend(near_white,near_trans)), to_string(expected_color) ); + REQUIRE( to_string(blend(near_white,near_trans)) == to_string(color(253,253,253,254)) ); + REQUIRE( to_string(blend(near_white,near_trans)) == to_string(expected_color) ); + REQUIRE( to_string(normal_blend(near_white,near_trans)) == to_string(expected_color) ); // using normal_blend as expected, compare a variety of other colors @@ -167,8 +163,8 @@ int main(int argc, char** argv) color dest(128,128,128,255); unsigned cover = 128; std::string expected_str = to_string(normal_blend(source,dest,cover)); - BOOST_TEST_EQ( to_string(blend(source,dest,cover)), expected_str ); - BOOST_TEST_EQ( to_string(blend(source,dest,cover)), expected_str ); + REQUIRE( to_string(blend(source,dest,cover)) == expected_str ); + REQUIRE( to_string(blend(source,dest,cover)) == expected_str ); } { @@ -176,8 +172,8 @@ int main(int argc, char** argv) color dest(128,128,128,255); unsigned cover = 245; std::string expected_str = to_string(normal_blend(source,dest,cover)); - BOOST_TEST_EQ( to_string(blend(source,dest,cover)), expected_str ); - BOOST_TEST_EQ( to_string(blend(source,dest,cover)), expected_str ); + REQUIRE( to_string(blend(source,dest,cover)) == expected_str ); + REQUIRE( to_string(blend(source,dest,cover)) == expected_str ); } // commenting until I study these failures more (dane) @@ -188,8 +184,8 @@ int main(int argc, char** argv) color dest(127,127,127,127); unsigned cover = 255; std::string expected_str = to_string(normal_blend(source,dest,cover)); - BOOST_TEST_EQ( to_string(blend(source,dest,cover)), expected_str ); - BOOST_TEST_EQ( to_string(blend(source,dest,cover)), expected_str ); + REQUIRE( to_string(blend(source,dest,cover)) == expected_str ); + REQUIRE( to_string(blend(source,dest,cover)) == expected_str ); } { @@ -198,23 +194,16 @@ int main(int argc, char** argv) color dest(128,128,128,128); unsigned cover = 128; std::string expected_str = to_string(normal_blend(source,dest,cover)); - BOOST_TEST_EQ( to_string(blend(source,dest,cover)), expected_str ); - BOOST_TEST_EQ( to_string(blend(source,dest,cover)), expected_str ); + REQUIRE( to_string(blend(source,dest,cover)) == expected_str ); + REQUIRE( to_string(blend(source,dest,cover)) == expected_str ); } */ } catch (std::exception const & ex) { std::clog << ex.what() << "\n"; - BOOST_TEST(false); - } - - if (!::boost::detail::test_errors()) { - if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; - else std::clog << "C++ AGG blending: \x1b[1;32m✓ \x1b[0m\n"; - ::boost::detail::report_errors_remind().called_report_errors_function = true; - } else { - std::clog << "C++ AGG blending: "; - return ::boost::report_errors(); + REQUIRE(false); } } + +} diff --git a/test/unit/pixel/palette.cpp b/test/unit/pixel/palette.cpp new file mode 100644 index 000000000..c45d06815 --- /dev/null +++ b/test/unit/pixel/palette.cpp @@ -0,0 +1,89 @@ +#include "catch.hpp" + +#include +#include +#include +#include +#include + +std::string get_file_contents(std::string const& filename) +{ + std::ifstream in(filename.c_str(), std::ios::in | std::ios::binary); + if (in) + { + std::ostringstream contents; + contents << in.rdbuf(); + in.close(); + return(contents.str()); + } + throw(errno); +} + +TEST_CASE("palette") +{ + +SECTION("rgb") +{ + mapnik::rgb a(1,2,3); + mapnik::rgba b_(1,2,3,4); + mapnik::rgb b(b_); + mapnik::rgb c(3,4,5); + CHECK(a == b); + CHECK_FALSE(a == c); + +} // END SECTION + + +SECTION("rgba") +{ + mapnik::rgba a(1,2,3,4); + mapnik::rgba a_copy(1,2,3,4); + mapnik::rgba b(255,255,255,255); + mapnik::rgba c(4,3,2,1); + mapnik::rgb d_(1,2,3); + mapnik::rgba d(d_); + + mapnik::rgba e(16909060); + + CHECK(e.r == 4); + CHECK(e.g == 3); + CHECK(e.b == 2); + CHECK(e.a == 1); + + CHECK(a == a_copy); + CHECK_FALSE(a == c); + CHECK(c == e); + + mapnik::rgba::mean_sort_cmp msc; + + CHECK_FALSE(msc(a,a_copy)); + CHECK(msc(a,b)); + CHECK_FALSE(msc(a,c)); + CHECK(msc(a,d)); + +} // END SECTION + +SECTION("rgba palette - exceptions and bad palettes") +{ + REQUIRE_THROWS(mapnik::rgba_palette("foo")); + REQUIRE_THROWS(mapnik::rgba_palette("fooo", mapnik::rgba_palette::PALETTE_RGB)); + REQUIRE_THROWS(mapnik::rgba_palette("foo", mapnik::rgba_palette::PALETTE_ACT)); +} // END SECTION + +SECTION("rgba palette - act pal_64") +{ + std::string pal_64 = get_file_contents("./test/data/palettes/palette64.act"); + mapnik::rgba_palette rgba_pal(pal_64, mapnik::rgba_palette::PALETTE_ACT); + CHECK(rgba_pal.to_string() == "[Palette 64 colors #494746 #c37631 #89827c #d1955c #7397b9 #fc9237 #a09f9c #fbc147 #9bb3ce #b7c9a1 #b5d29c #c4b9aa #cdc4a5 #d5c8a3 #c1d7aa #ccc4b6 #dbd19c #b2c4d5 #eae487 #c9c8c6 #e4db99 #c9dcb5 #dfd3ac #cbd2c2 #d6cdbc #dbd2b6 #c0ceda #ece597 #f7ef86 #d7d3c3 #dfcbc3 #d1d0cd #d1e2bf #d3dec1 #dbd3c4 #e6d8b6 #f4ef91 #d3d3cf #cad5de #ded7c9 #dfdbce #fcf993 #ffff8a #dbd9d7 #dbe7cd #d4dce2 #e4ded3 #ebe3c9 #e0e2e2 #f4edc3 #fdfcae #e9e5dc #f4edda #eeebe4 #fefdc5 #e7edf2 #edf4e5 #f2efe9 #f6ede7 #fefedd #f6f4f0 #f1f5f8 #fbfaf8 #ffffff]"); + +} // END SECTION + +SECTION("rgba palette - act pal_256") +{ + std::string pal_ = get_file_contents("./test/data/palettes/palette256.act"); + mapnik::rgba_palette rgba_pal(pal_, mapnik::rgba_palette::PALETTE_ACT); + CHECK(rgba_pal.to_string() == "[Palette 256 colors #272727 #3c3c3c #484847 #564b41 #605243 #6a523e #555555 #785941 #5d5d5d #746856 #676767 #956740 #ba712e #787777 #cb752a #c27c3d #b68049 #dc8030 #df9e10 #878685 #e1a214 #928b82 #a88a70 #ea8834 #e7a81d #cb8d55 #909090 #94938c #e18f48 #f68d36 #6f94b7 #e1ab2e #8e959b #c79666 #999897 #ff9238 #ef9447 #a99a88 #f1b32c #919ca6 #a1a09f #f0b04b #8aa4bf #f8bc39 #b3ac8f #d1a67a #e3b857 #a8a8a7 #ffc345 #a2adb9 #afaeab #f9ab69 #afbba4 #c4c48a #b4b2af #dec177 #9ab2cf #a3bebb #d7b491 #b6cd9e #b5d29c #b9c8a2 #f1c969 #c5c79e #bbbab9 #cabdaa #a6bcd1 #cec4a7 #e7cc89 #dad98a #d5c9a3 #fabd8a #c1d7aa #cec5b4 #d1d1a5 #d9cf9f #c5c4c3 #d3c7b5 #ddd59d #b4c6d6 #d1cbb4 #d1c7ba #d7d1aa #e1c6ab #cbc7c2 #dbd0a9 #e8e58a #fee178 #d3cbba #dfd7a3 #d2cfb9 #c9ddb5 #d2cbbe #c3cbce #d7cbba #dcceb2 #dfd3aa #e5dd9a #dbd3b1 #ceccc6 #d7cbbe #d7cfba #dfc3be #dfd3ae #cbcbcb #cbd3c3 #d3cfc0 #e0d8aa #d7cfbe #dbd3b8 #ebe596 #dfd8b0 #c0ceda #f1ee89 #decfbc #d7cfc4 #d7d3c3 #d1d0cd #d2dfc0 #dbd3c3 #e7c7c3 #e7d7b3 #f2ed92 #d1e2bf #dad7c3 #fef383 #d3d3cf #dbd3c7 #e0d3c2 #dfd7c0 #ebe4a8 #dbd7c7 #dfd3c7 #f7f38f #c9d4de #dcdcc5 #dfd7c7 #e7d5c2 #d6d5d4 #faf78e #d7dfca #fbfb8a #fffb86 #dfd7cb #e5ddc0 #dad7d2 #ecd6c1 #cfd7de #e8d0cc #fbfb8e #fffb8a #eae3b8 #e3d7cd #dfdbce #fffb8e #ffff8a #f5efa6 #dae6cc #e3dbcf #edddc3 #dddbd6 #d5dbdf #ffff91 #e3dbd3 #fefc99 #e7dbd2 #eaddcd #e3dfd3 #ebd7d3 #dddddd #d4dee6 #e2dfd7 #fcdcc0 #e7dbd7 #e7dfd3 #ebe4cb #f4eeb8 #e3dfdb #e7dfd7 #ebded5 #e7e3d7 #fefea6 #e1ecd6 #ece5d3 #e7e3db #dee3e5 #ebe3db #efdfdb #efe3d8 #f4efc9 #e6ecdb #ebe3df #ebe7db #f0ecd3 #e5e6e5 #efe7da #ebe7df #efe3df #fefeb8 #dfe7ef #ebe7e3 #edebde #efe7e0 #e8efe0 #e7f3df #ebebe3 #e7ebe8 #f5edd9 #efebe3 #e3ebf1 #e9efe7 #ebebea #efebe7 #f0efe2 #ecf3e5 #fefdc9 #efefe7 #f3efe7 #f5f3e1 #f2efe9 #e9eef4 #ffeddf #efefef #f3efeb #f3f3eb #f0f7eb #fbf7e1 #fefed8 #f3f3ef #f7f3eb #eef3f7 #f7f7ea #f3f3f3 #f3f7ef #f7f3ef #f3f3f7 #f7f3f3 #f7f7ef #fffee3 #f3f7f7 #f7f7f3 #fcf7ee #f7f7f7 #f7fbf4 #f5f7fb #fbf7f6 #fffeef #f7fbfb #fbfbf7 #fbfbfb #fbfbff #fbfffb #fffbfb #fbffff #fffffb #ffffff]"); + +} // END SECTION + +} // END TEST CASE diff --git a/test/unit/projection/proj_transform.cpp b/test/unit/projection/proj_transform.cpp new file mode 100644 index 000000000..d2a37893a --- /dev/null +++ b/test/unit/projection/proj_transform.cpp @@ -0,0 +1,122 @@ +#include "catch.hpp" + +#include +#include +#include + +#ifdef MAPNIK_USE_PROJ4 +// proj4 +#include +#endif + + +TEST_CASE("projection transform") +{ + +SECTION("Test bounding box transforms - 4326 to 3857") +{ + mapnik::projection proj_4326("+init=epsg:4326"); + mapnik::projection proj_3857("+init=epsg:3857"); + mapnik::proj_transform prj_trans(proj_4326, proj_3857); + + double minx = -45.0; + double miny = 55.0; + double maxx = -40.0; + double maxy = 75.0; + + mapnik::box2d bbox(minx, miny, maxx, maxy); + + prj_trans.forward(bbox); + INFO(bbox.to_string()); + CHECK(bbox.minx() == Approx(-5009377.085697311)); + CHECK(bbox.miny() == Approx(7361866.1130511891)); + CHECK(bbox.maxx() == Approx(-4452779.631730943)); + CHECK(bbox.maxy() == Approx(12932243.1119920239)); + + prj_trans.backward(bbox); + CHECK(bbox.minx() == Approx(minx)); + CHECK(bbox.miny() == Approx(miny)); + CHECK(bbox.maxx() == Approx(maxx)); + CHECK(bbox.maxy() == Approx(maxy)); + +} + + +#if defined(MAPNIK_USE_PROJ4) && PJ_VERSION >= 480 +SECTION("test pj_transform failure behavior") +{ + mapnik::projection proj_4269("+init=epsg:4269"); + mapnik::projection proj_3857("+init=epsg:3857"); + mapnik::proj_transform prj_trans(proj_4269, proj_3857); + mapnik::proj_transform prj_trans2(proj_3857, proj_4269); + + auto proj_ctx0 = pj_ctx_alloc(); + REQUIRE( proj_ctx0 != nullptr ); + auto proj0 = pj_init_plus_ctx(proj_ctx0, proj_4269.params().c_str()); + REQUIRE( proj0 != nullptr ); + + auto proj_ctx1 = pj_ctx_alloc(); + REQUIRE( proj_ctx1 != nullptr ); + auto proj1 = pj_init_plus_ctx(proj_ctx1, proj_3857.params().c_str()); + REQUIRE( proj1 != nullptr ); + + // first test valid values directly against proj + double x = -180.0; + double y = -60.0; + x *= DEG_TO_RAD; + y *= DEG_TO_RAD; + CHECK( x == Approx(-3.1415926536) ); + CHECK( y == Approx(-1.0471975512) ); + CHECK( 0 == pj_transform(proj0, proj1, 1, 0, &x, &y, nullptr) ); + CHECK( x == Approx(-20037508.3427892439) ); + CHECK( y == Approx(-8399737.8896366451) ); + + // now test mapnik class + double x0 = -180.0; + double y0 = -60.0; + CHECK( prj_trans.forward(&x0,&y0,nullptr,1,1) ); + CHECK( x0 == Approx(-20037508.3427892439) ); + CHECK( y0 == Approx(-8399737.8896366451) ); + double x1 = -180.0; + double y1 = -60.0; + CHECK( prj_trans2.backward(&x1,&y1,nullptr,1,1) ); + CHECK( x1 == Approx(-20037508.3427892439) ); + CHECK( y1 == Approx(-8399737.8896366451) ); + + // longitude value outside the value range for mercator + x = -181.0; + y = -91.0; + x *= DEG_TO_RAD; + y *= DEG_TO_RAD; + CHECK( x == Approx(-3.1590459461) ); + CHECK( y == Approx(-1.5882496193) ); + CHECK( 0 == pj_transform(proj0, proj1, 1, 0, &x, &y, nullptr) ); + CHECK( std::isinf(x) ); + CHECK( std::isinf(y) ); + + // now test mapnik class + double x2 = -181.0; + double y2 = -91.0; + CHECK( false == prj_trans.forward(&x2,&y2,nullptr,1,1) ); + CHECK( std::isinf(x2) ); + CHECK( std::isinf(y2) ); + double x3 = -181.0; + double y3 = -91.0; + CHECK( false == prj_trans2.backward(&x3,&y3,nullptr,1,1) ); + CHECK( std::isinf(x3) ); + CHECK( std::isinf(y3) ); + + // cleanup + pj_ctx_free(proj_ctx0); + proj_ctx0 = nullptr; + pj_free(proj0); + proj0 = nullptr; + pj_ctx_free(proj_ctx1); + proj_ctx1 = nullptr; + pj_free(proj1); + proj1 = nullptr; +} + +#endif + +} diff --git a/test/unit/run.cpp b/test/unit/run.cpp new file mode 100644 index 000000000..15ad0991a --- /dev/null +++ b/test/unit/run.cpp @@ -0,0 +1,13 @@ +#define CATCH_CONFIG_RUNNER +#include "catch.hpp" + +#include "cleanup.hpp" // run_cleanup() + +int main (int argc, char* const argv[]) +{ + int result = Catch::Session().run( argc, argv ); + + testing::run_cleanup(); + + return result; +} diff --git a/tests/cpp_tests/wkb_formats_test.cpp b/test/unit/serialization/wkb_formats_test.cpp similarity index 66% rename from tests/cpp_tests/wkb_formats_test.cpp rename to test/unit/serialization/wkb_formats_test.cpp index 29f963402..9e18b287b 100644 --- a/tests/cpp_tests/wkb_formats_test.cpp +++ b/test/unit/serialization/wkb_formats_test.cpp @@ -1,21 +1,20 @@ -#include +#include "catch.hpp" + #include #include #include #include +#include +#include +#include #include #include #include +#include +TEST_CASE("geometry formats") { -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;ipaths(), - (const char*)sp_valid_blob, - sizeof(sp_valid_blob) / sizeof(sp_valid_blob[0]), - mapnik::wkbSpatiaLite) - ); + mapnik::geometry::geometry geom = mapnik::geometry_utils::from_wkb((const char*)sp_valid_blob, + sizeof(sp_valid_blob) / sizeof(sp_valid_blob[0]), + mapnik::wkbSpatiaLite); + // winding order is not correct per OGC so we'll fix it + mapnik::geometry::correct(geom); +#if BOOST_VERSION >= 105600 + REQUIRE(mapnik::geometry::is_valid(geom)); + REQUIRE(mapnik::geometry::is_simple(geom)); +#endif - BOOST_TEST( - mapnik::geometry_utils::from_wkb(feature->paths(), - (const char*)sp_valid_blob, - sizeof(sp_valid_blob) / sizeof(sp_valid_blob[0]), - mapnik::wkbAuto) - ); + geom = mapnik::geometry_utils::from_wkb((const char*)sp_valid_blob, + sizeof(sp_valid_blob) / sizeof(sp_valid_blob[0]), + mapnik::wkbAuto); + mapnik::geometry::correct(geom); +#if BOOST_VERSION >= 105600 + REQUIRE(mapnik::geometry::is_valid(geom)); + REQUIRE(mapnik::geometry::is_simple(geom)); +#endif - BOOST_TEST( - mapnik::geometry_utils::from_wkb(feature->paths(), - (const char*)sp_invalid_blob, - sizeof(sp_invalid_blob) / sizeof(sp_invalid_blob[0]), - mapnik::wkbAuto) == false - ); + geom = mapnik::geometry_utils::from_wkb((const char*)sp_invalid_blob, + sizeof(sp_invalid_blob) / sizeof(sp_invalid_blob[0]), + mapnik::wkbAuto); + REQUIRE(geom.is()); // returns geometry_empty // sqlite generic wkb blob - BOOST_TEST( - mapnik::geometry_utils::from_wkb(feature->paths(), - (const char*)sq_valid_blob, - sizeof(sq_valid_blob) / sizeof(sq_valid_blob[0]), - mapnik::wkbGeneric) - ); - BOOST_TEST( - mapnik::geometry_utils::from_wkb(feature->paths(), - (const char*)sq_valid_blob, - sizeof(sq_valid_blob) / sizeof(sq_valid_blob[0]), - mapnik::wkbAuto) - ); + geom = mapnik::geometry_utils::from_wkb((const char*)sq_valid_blob, + sizeof(sq_valid_blob) / sizeof(sq_valid_blob[0]), + mapnik::wkbGeneric); +#if BOOST_VERSION >= 105600 + REQUIRE(mapnik::geometry::is_valid(geom)); + REQUIRE(mapnik::geometry::is_simple(geom)); +#endif + + geom = mapnik::geometry_utils::from_wkb( (const char*)sq_valid_blob, + sizeof(sq_valid_blob) / sizeof(sq_valid_blob[0]), + mapnik::wkbAuto); + +#if BOOST_VERSION >= 105600 + REQUIRE(mapnik::geometry::is_valid(geom)); + REQUIRE(mapnik::geometry::is_simple(geom)); +#endif + + geom = mapnik::geometry_utils::from_wkb((const char*)sq_invalid_blob, + sizeof(sq_invalid_blob) / sizeof(sq_invalid_blob[0]), + mapnik::wkbGeneric); + REQUIRE(geom.is()); // returns geometry_empty - BOOST_TEST( - mapnik::geometry_utils::from_wkb(feature->paths(), - (const char*)sq_invalid_blob, - sizeof(sq_invalid_blob) / sizeof(sq_invalid_blob[0]), - mapnik::wkbGeneric) == false - ); - } catch (std::exception const& ex) { - BOOST_TEST(false); + REQUIRE(false); std::clog << "threw: " << ex.what() << "\n"; } - - if (!::boost::detail::test_errors()) { - if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; - else std::clog << "C++ WKB formats test: \x1b[1;32m✓ \x1b[0m\n"; - ::boost::detail::report_errors_remind().called_report_errors_function = true; - } else { - return ::boost::report_errors(); - } +} } diff --git a/test/unit/serialization/xml_parser_trim.cpp b/test/unit/serialization/xml_parser_trim.cpp new file mode 100644 index 000000000..f79c75502 --- /dev/null +++ b/test/unit/serialization/xml_parser_trim.cpp @@ -0,0 +1,45 @@ +#include "catch.hpp" + +#include +#include +#include +#include +#include + +TEST_CASE("xml parser") { + + SECTION("trims whitespace") { + + // simple and non-valid mapnik XML reduced from the empty_parameter2.xml + // test case. this is to check that the xml parsing routine is trimming + // whitespace from text nodes as part of the parsing operation. + const std::string xml("" + " " + " " + " " + " " + " " + ""); + + mapnik::xml_tree tree; + tree.set_filename("xml_datasource_parameter_trim.cpp"); + REQUIRE_NOTHROW(read_xml_string(xml, tree.root(), "")); + + REQUIRE(tree.root().has_child("Map")); + mapnik::xml_node const &map = tree.root().get_child("Map"); + + REQUIRE(map.has_child("Layer")); + mapnik::xml_node const &layer = map.get_child("Layer"); + + REQUIRE(layer.has_child("Datasource")); + mapnik::xml_node const &datasource = layer.get_child("Datasource"); + + REQUIRE(datasource.has_child("Parameter")); + mapnik::xml_node const ¶meter = datasource.get_child("Parameter"); + + // parser should call mapnik::util::trim on the text content and + // this should result in an empty text string in the parameter. + REQUIRE(parameter.get_text() == ""); + } +} + diff --git a/test/unit/sql/sql_parse.cpp b/test/unit/sql/sql_parse.cpp new file mode 100644 index 000000000..43a6eb2d1 --- /dev/null +++ b/test/unit/sql/sql_parse.cpp @@ -0,0 +1,33 @@ + +#include "catch.hpp" + +#include + +TEST_CASE("sql parse") { + +SECTION("table") { + std::string subquery("table"); + REQUIRE( subquery == mapnik::sql_utils::table_from_sql(subquery) ); +} + +SECTION("complex sql 1") { + std::string subquery("(select * FROM table1, table2) AS data"); + REQUIRE( "table1" == mapnik::sql_utils::table_from_sql(subquery) ); +} + +SECTION("complex sql 2") { + std::string subquery("(select * FROM table1 , table2) AS data"); + REQUIRE( "table1" == mapnik::sql_utils::table_from_sql(subquery) ); +} + +SECTION("complex sql 3") { + std::string subquery("(select * FROM table1,table2) AS data"); + REQUIRE( "table1" == mapnik::sql_utils::table_from_sql(subquery) ); +} + +SECTION("complex sql 4") { + std::string subquery("(select * FROM table1) AS data"); + REQUIRE( "table1" == mapnik::sql_utils::table_from_sql(subquery) ); +} + +} diff --git a/test/unit/symbolizer/symbolizer_test.cpp b/test/unit/symbolizer/symbolizer_test.cpp new file mode 100644 index 000000000..582613ddf --- /dev/null +++ b/test/unit/symbolizer/symbolizer_test.cpp @@ -0,0 +1,30 @@ +#include "catch.hpp" + +#include +#include +#include +#include + +using namespace mapnik; + +TEST_CASE("symbolizer") { + +SECTION("enums") { + + try { + marker_multi_policy_enum policy_in = MARKER_WHOLE_MULTI; + REQUIRE(policy_in == MARKER_WHOLE_MULTI); + markers_symbolizer sym; + put(sym, keys::markers_multipolicy, policy_in); + REQUIRE(sym.properties.count(keys::markers_multipolicy) == static_cast(1)); + marker_multi_policy_enum policy_out = get(sym, keys::markers_multipolicy); + REQUIRE(policy_out == MARKER_WHOLE_MULTI); + } + catch (std::exception const & ex) + { + std::clog << ex.what() << std::endl; + REQUIRE(false); + } + +} +} diff --git a/test/unit/valgrind.supp b/test/unit/valgrind.supp new file mode 100644 index 000000000..51abafc71 --- /dev/null +++ b/test/unit/valgrind.supp @@ -0,0 +1,77 @@ +{ + catch1 + Memcheck:Addr1 + fun:strlen + fun:_ZL29____C_A_T_C_H____T_E_S_T____9v + fun:_ZN5Catch10RunContext20invokeActiveTestCaseEv + fun:_ZN5Catch10RunContext14runCurrentTestERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_ + fun:_ZN5Catch10RunContext7runTestERKNS_8TestCaseE + fun:_ZN5Catch6Runner8runTestsEv + fun:_ZN5Catch7Session3runEv + fun:main +} +{ + catch2 + Memcheck:Cond + fun:_platform_memchr$VARIANT$Haswell + fun:__sfvwrite + fun:fwrite + fun:_ZNSt3__111__stdoutbufIcE8overflowEi + fun:_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl + fun:_ZNSt3__116__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_ + fun:_ZNSt3__124__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m + fun:_ZN5Catch15ConsoleReporter11printTotalsERKNS_6TotalsE + fun:_ZN5Catch15ConsoleReporter12testRunEndedERKNS_12TestRunStatsE + fun:_ZN5Catch10RunContextD2Ev + fun:_ZN5Catch6Runner8runTestsEv + fun:_ZN5Catch7Session3runEv +} +{ + catch3 + Memcheck:Cond + fun:_platform_memchr$VARIANT$Haswell + fun:__sfvwrite + fun:fwrite + fun:_ZNSt3__111__stdoutbufIcE8overflowEi + fun:_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl + fun:_ZNSt3__116__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_ + fun:_ZNSt3__124__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m + fun:_ZN5Catch12_GLOBAL__N_115PosixColourImpl3useENS_6Colour4CodeE + fun:_ZN5Catch6Colour3useENS0_4CodeE + fun:_ZN5Catch15ConsoleReporter18printTotalsDividerERKNS_6TotalsE + fun:_ZN5Catch15ConsoleReporter12testRunEndedERKNS_12TestRunStatsE + fun:_ZN5Catch10RunContextD2Ev +} +{ + catch4 + Memcheck:Cond + fun:_platform_memchr$VARIANT$Haswell + fun:__sfvwrite + fun:fwrite + fun:_ZNSt3__111__stdoutbufIcE8overflowEi + fun:_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl + fun:_ZNSt3__116__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_ + fun:_ZNSt3__124__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m + fun:_ZN5Catch15ConsoleReporter18printTotalsDividerERKNS_6TotalsE + fun:_ZN5Catch15ConsoleReporter12testRunEndedERKNS_12TestRunStatsE + fun:_ZN5Catch10RunContextD2Ev + fun:_ZN5Catch6Runner8runTestsEv + fun:_ZN5Catch7Session3runEv +} +{ + pixman + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:_pixman_implementation_create + fun:_pixman_implementation_create_general + fun:_pixman_choose_implementation + fun:pixman_constructor + fun:_ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE + fun:_ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE + fun:_ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListERNS_15UninitedUpwardsE + fun:_ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListERNS_15UninitedUpwardsE + fun:_ZN11ImageLoader19processInitializersERKNS_11LinkContextEjRNS_21InitializerTimingListERNS_15UninitedUpwardsE + fun:_ZN11ImageLoader15runInitializersERKNS_11LinkContextERNS_21InitializerTimingListE + fun:_ZN4dyld24initializeMainExecutableEv +} diff --git a/tests/cpp_tests/clipping_test.cpp b/test/unit/vertex_adapter/clipping_test.cpp similarity index 68% rename from tests/cpp_tests/clipping_test.cpp rename to test/unit/vertex_adapter/clipping_test.cpp index c8116347d..14dd06afa 100644 --- a/tests/cpp_tests/clipping_test.cpp +++ b/test/unit/vertex_adapter/clipping_test.cpp @@ -1,13 +1,13 @@ +#include "catch.hpp" + // mapnik -#include #include #include - +#include // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" -#include #include #pragma GCC diagnostic pop @@ -22,10 +22,6 @@ // agg #include "agg_conv_clip_polygon.h" #include "agg_conv_clip_polyline.h" -//#include "agg_path_storage.h" -//#include "agg_conv_clipper.h" - -#include "utils.hpp" template std::string dump_path(T & path) @@ -46,15 +42,16 @@ std::string dump_path(T & path) } std::string clip_line(mapnik::box2d const& bbox, - mapnik::geometry_type & geom) + mapnik::path_type const& path) { - using line_clipper = agg::conv_clip_polyline; - line_clipper clipped(geom); + using line_clipper = agg::conv_clip_polyline; + mapnik::vertex_adapter va(path); + line_clipper clipped(va); clipped.clip_box(bbox.minx(),bbox.miny(),bbox.maxx(),bbox.maxy()); return dump_path(clipped); } -void parse_geom(mapnik::geometry_type & geom, +void parse_geom(mapnik::path_type & path, std::string const& geom_string) { std::vector vertices; boost::split(vertices, geom_string, boost::is_any_of(",")); @@ -73,7 +70,7 @@ void parse_geom(mapnik::geometry_type & geom, && mapnik::util::string2double(commands[1],y) && mapnik::util::string2int(commands[2],c)) { - geom.push_vertex(x,y,(mapnik::CommandType)c); + path.push_vertex(x,y,(mapnik::CommandType)c); } else { @@ -82,20 +79,13 @@ void parse_geom(mapnik::geometry_type & geom, } } -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;i #include #include -// boost -#include - // stl #include #include @@ -13,9 +13,6 @@ #include #include -// test -#include "utils.hpp" - struct fake_path { using coord_type = std::tuple; @@ -68,27 +65,6 @@ double dist(mapnik::pixel_position const &a, return std::sqrt(d.x*d.x + d.y*d.y); } -namespace boost { namespace detail { - -template -inline void test_leq_impl(char const * expr1, char const * expr2, - char const * file, int line, char const * function, - T const & t, U const & u) -{ - if( t > u ) - { - BOOST_LIGHTWEIGHT_TEST_OSTREAM - << file << "(" << line << "): test '" << expr1 << " == " << expr2 - << "' failed in function '" << function << "': " - << "'" << t << "' > '" << u << "'" << std::endl; - ++test_errors(); - } -} - -} } - -#define BOOST_TEST_LEQ(expr1,expr2) ( ::boost::detail::test_leq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) ) - void test_simple_segment(double const &offset) { const double dx = 0.01; @@ -101,7 +77,7 @@ void test_simple_segment(double const &offset) while (vc.move(dx)) { double pos = vc.linear_position(); double off_pos = off_vc.position_closest_to(vc.current_position()); - BOOST_TEST_LEQ(std::abs(pos - off_pos), 1.0e-6); + REQUIRE(std::abs(pos - off_pos) < 1.0e-6); } } @@ -117,7 +93,7 @@ void test_straight_line(double const &offset) { while (vc.move(dx)) { double pos = vc.linear_position(); double off_pos = off_vc.position_closest_to(vc.current_position()); - BOOST_TEST_LEQ(std::abs(pos - off_pos), 1.0e-6); + REQUIRE(std::abs(pos - off_pos) < 1.0e-6); } } @@ -140,14 +116,16 @@ void test_offset_curve(double const &offset) { off_vc.reset(); off_vc.next_subpath(); while (vc.move(dx)) { - double pos = vc.linear_position(); - double off_pos = off_vc.position_closest_to(vc.current_position()); + double mpos = vc.linear_position(); + double moff_pos = off_vc.position_closest_to(vc.current_position()); { mapnik::vertex_cache::scoped_state s(off_vc); - off_vc.move(off_pos); - BOOST_TEST_LEQ(dist(vc.current_position(), off_vc.current_position()), (1.001 * offset)); + off_vc.move(moff_pos); + auto eps = (1.001 * offset); + auto actual = dist(vc.current_position(), off_vc.current_position()); + REQUIRE(actual < eps); } - BOOST_TEST_LEQ(std::abs((pos / vc.length()) - (off_pos / off_vc.length())), 1.0e-3); + REQUIRE(std::abs((mpos / vc.length()) - (moff_pos / off_vc.length())) < 1.0e-3); } } @@ -176,28 +154,20 @@ void test_s_shaped_curve(double const &offset) { off_vc.reset(); off_vc.next_subpath(); while (vc.move(dx)) { - double off_pos = off_vc.position_closest_to(vc.current_position()); + double moff_pos = off_vc.position_closest_to(vc.current_position()); { mapnik::vertex_cache::scoped_state s(off_vc); - off_vc.move(off_pos); - BOOST_TEST_LEQ(dist(vc.current_position(), off_vc.current_position()), (1.002 * offset)); + off_vc.move(moff_pos); + REQUIRE(dist(vc.current_position(), off_vc.current_position()) < (1.002 * offset)); } } } -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;i offsets = { 0.01, 0.02, 0.1, 0.2 }; for (double offset : offsets) { // test simple straight line segment - should be easy to @@ -220,17 +190,7 @@ int main(int argc, char** argv) catch (std::exception const& ex) { std::cerr << ex.what() << "\n"; - BOOST_TEST(false); - } - - if (!::boost::detail::test_errors()) - { - if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; - else std::clog << "C++ line offset: \x1b[1;32m✓ \x1b[0m\n"; - ::boost::detail::report_errors_remind().called_report_errors_function = true; - } - else - { - return ::boost::report_errors(); + REQUIRE(false); } } +} diff --git a/test/unit/vertex_adapter/offset_converter.cpp b/test/unit/vertex_adapter/offset_converter.cpp new file mode 100644 index 000000000..38c91b5dc --- /dev/null +++ b/test/unit/vertex_adapter/offset_converter.cpp @@ -0,0 +1,329 @@ +#include "catch.hpp" + +// mapnik +#include +#include +#include +#include + +// stl +#include +#include +#include +#include +#include +#include + +namespace offset_test { + +struct fake_path +{ + using coord_type = std::tuple; + using cont_type = std::vector; + cont_type vertices_; + cont_type::iterator itr_; + + fake_path(std::initializer_list l) + : fake_path(l.begin(), l.size()) { + } + + fake_path(std::vector const &v) + : fake_path(v.begin(), v.size()) { + } + + template + fake_path(Itr itr, size_t sz) { + size_t num_coords = sz >> 1; + vertices_.reserve(num_coords); + + for (size_t i = 0; i < num_coords; ++i) { + double x = *itr++; + double y = *itr++; + unsigned cmd = (i == 0) ? mapnik::SEG_MOVETO : mapnik::SEG_LINETO; + vertices_.push_back(std::make_tuple(x, y, cmd)); + } + itr_ = vertices_.begin(); + } + + unsigned vertex(double *x, double *y) { + if (itr_ == vertices_.end()) { + return mapnik::SEG_END; + } + *x = std::get<0>(*itr_); + *y = std::get<1>(*itr_); + unsigned cmd = std::get<2>(*itr_); + ++itr_; + return cmd; + } + + void rewind(unsigned) { + itr_ = vertices_.begin(); + } +}; + +static double DELTA_BUFF = 0.5; + +double dist(double x0, double y0, double x1, double y1) +{ + double dx = x0 - x1; + double dy = y0 - y1; + return std::sqrt(dx*dx + dy*dy); +} + +void test_simple_segment(double const &offset) +{ + fake_path path = {0, 0, 1, 0}, off_path = {0, offset, 1, offset}; + mapnik::offset_converter off_path_new(path); + off_path_new.set_offset(offset); + + double x0, y0, x1, y1; + unsigned cmd0 = off_path_new.vertex(&x0, &y0); + unsigned cmd1 = off_path.vertex(&x1,&y1); + double d = dist(x0, y0, x1, y1); + while (true) { + if (d > (std::abs(offset) + DELTA_BUFF)) + { + cmd0 = off_path_new.vertex(&x0,&y0); + REQUIRE(cmd0 != mapnik::SEG_END); + d = dist(x0, y0, x1, y1); + REQUIRE(d <= (std::abs(offset) + DELTA_BUFF)); + } + else + { + REQUIRE(d <= (std::abs(offset) + DELTA_BUFF)); + + } + + cmd1 = off_path.vertex(&x1,&y1); + if (cmd1 == mapnik::SEG_END) break; + d = dist(x0, y0, x1, y1); + bool done = false; + while (d <= (std::abs(offset) + DELTA_BUFF)) + { + CHECK(true); + cmd0 = off_path_new.vertex(&x0,&y0); + if (cmd0 == mapnik::SEG_END) + { + done = true; + break; + } + } + if (done) break; + } +} + +void test_straight_line(double const &offset) { + fake_path path = {0, 0, 1, 0, 9, 0, 10, 0}, + off_path = {0, offset, 1, offset, 9, offset, 10, offset}; + mapnik::offset_converter off_path_new(path); + off_path_new.set_offset(offset); + + double x0, y0, x1, y1; + unsigned cmd0 = off_path_new.vertex(&x0, &y0); + unsigned cmd1 = off_path.vertex(&x1,&y1); + double d = dist(x0, y0, x1, y1); + while (true) { + if (d > (std::abs(offset) + DELTA_BUFF)) + { + cmd0 = off_path_new.vertex(&x0,&y0); + REQUIRE(cmd0 != mapnik::SEG_END); + d = dist(x0, y0, x1, y1); + REQUIRE(d <= (std::abs(offset) + DELTA_BUFF)); + } + else + { + REQUIRE(d <= (std::abs(offset) + DELTA_BUFF)); + + } + + cmd1 = off_path.vertex(&x1,&y1); + d = dist(x0, y0, x1, y1); + bool done = false; + while (d <= (std::abs(offset) + DELTA_BUFF)) + { + CHECK(true); + cmd0 = off_path_new.vertex(&x0,&y0); + if (cmd0 == mapnik::SEG_END) + { + done = true; + break; + } + } + if (done) break; + } +} + +void test_offset_curve(double const &offset) { + const double r = (1.0 + offset); + + std::vector pos, off_pos; + const size_t max_i = 1000; + for (size_t i = 0; i <= max_i; ++i) { + double x = M_PI * double(i) / max_i; + pos.push_back(-std::cos(x)); pos.push_back(std::sin(x)); + off_pos.push_back(-r * std::cos(x)); off_pos.push_back(r * std::sin(x)); + } + + fake_path path(pos), off_path(off_pos); + mapnik::offset_converter off_path_new(path); + off_path_new.set_offset(offset); + + double x0, y0, x1, y1; + unsigned cmd0 = off_path_new.vertex(&x0, &y0); + unsigned cmd1 = off_path.vertex(&x1,&y1); + double d = dist(x0, y0, x1, y1); + while (true) { + if (d > (std::abs(offset) + DELTA_BUFF)) + { + cmd0 = off_path_new.vertex(&x0,&y0); + REQUIRE(cmd0 != mapnik::SEG_END); + d = dist(x0, y0, x1, y1); + REQUIRE(d <= (std::abs(offset) + DELTA_BUFF)); + } + else + { + REQUIRE(d <= (std::abs(offset) + DELTA_BUFF)); + + } + + cmd1 = off_path.vertex(&x1,&y1); + d = dist(x0, y0, x1, y1); + bool done = false; + while (d <= (std::abs(offset) + DELTA_BUFF)) + { + CHECK(true); + cmd0 = off_path_new.vertex(&x0,&y0); + if (cmd0 == mapnik::SEG_END) + { + done = true; + break; + } + } + if (done) break; + } +} + +void test_s_shaped_curve(double const &offset) { + const double r = (1.0 + offset); + const double r2 = (1.0 - offset); + + std::vector pos, off_pos; + const size_t max_i = 1000; + for (size_t i = 0; i <= max_i; ++i) { + double x = M_PI * double(i) / max_i; + pos.push_back(-std::cos(x) - 1); pos.push_back(std::sin(x)); + off_pos.push_back(-r * std::cos(x) - 1); off_pos.push_back(r * std::sin(x)); + } + for (size_t i = 0; i <= max_i; ++i) { + double x = M_PI * double(i) / max_i; + pos.push_back(-std::cos(x) + 1); pos.push_back(-std::sin(x)); + off_pos.push_back(-r2 * std::cos(x) + 1); off_pos.push_back(-r2 * std::sin(x)); + } + + fake_path path(pos), off_path(off_pos); + mapnik::offset_converter off_path_new(path); + off_path_new.set_offset(offset); + + double x0, y0, x1, y1; + unsigned cmd0 = off_path_new.vertex(&x0, &y0); + unsigned cmd1 = off_path.vertex(&x1,&y1); + double d = dist(x0, y0, x1, y1); + while (true) { + if (d > (std::abs(offset) + DELTA_BUFF)) + { + cmd0 = off_path_new.vertex(&x0,&y0); + REQUIRE(cmd0 != mapnik::SEG_END); + d = dist(x0, y0, x1, y1); + REQUIRE(d <= (std::abs(offset) + DELTA_BUFF)); + } + else + { + REQUIRE(d <= (std::abs(offset) + DELTA_BUFF)); + + } + + cmd1 = off_path.vertex(&x1,&y1); + d = dist(x0, y0, x1, y1); + bool done = false; + while (d <= (std::abs(offset) + DELTA_BUFF)) + { + CHECK(true); + cmd0 = off_path_new.vertex(&x0,&y0); + if (cmd0 == mapnik::SEG_END) + { + done = true; + break; + } + } + if (done) break; + } +} + +} // END NS + +TEST_CASE("offset converter") { + +SECTION("simple segment") { + try { + + std::vector offsets = { 1, -1 }; + for (double offset : offsets) { + // test simple straight line segment - should be easy to + // find the correspondance here. + offset_test::test_simple_segment(offset); + } + } + catch (std::exception const& ex) + { + std::cerr << ex.what() << "\n"; + REQUIRE(false); + } +} + +SECTION("straight line") { + try { + + std::vector offsets = { 1, -1 }; + for (double offset : offsets) { + // test straight line consisting of more than one segment. + offset_test::test_straight_line(offset); + } + } + catch (std::exception const& ex) + { + std::cerr << ex.what() << "\n"; + REQUIRE(false); + } +} + +SECTION("curve") { + try { + + std::vector offsets = { 1, -1 }; + for (double offset : offsets) { + offset_test::test_offset_curve(offset); + } + } + catch (std::exception const& ex) + { + std::cerr << ex.what() << "\n"; + REQUIRE(false); + } +} + +SECTION("s curve") { + try { + + std::vector offsets = { 1, -1 }; + for (double offset : offsets) { + offset_test::test_s_shaped_curve(offset); + } + } + catch (std::exception const& ex) + { + std::cerr << ex.what() << "\n"; + REQUIRE(false); + } +} + +} diff --git a/tests/cpp_tests/simplify_converters_test.cpp b/test/unit/vertex_adapter/simplify_converters_test.cpp similarity index 75% rename from tests/cpp_tests/simplify_converters_test.cpp rename to test/unit/vertex_adapter/simplify_converters_test.cpp index b3923d0fc..a5f99b205 100644 --- a/tests/cpp_tests/simplify_converters_test.cpp +++ b/test/unit/vertex_adapter/simplify_converters_test.cpp @@ -1,9 +1,9 @@ -#include +#include "catch.hpp" + #include #include #include #include -#include "utils.hpp" #include #include @@ -17,6 +17,7 @@ // Convenience method for test cases void simplify(std::string const& wkt_in, double tolerance, std::string const& method, std::string const& expected) { +#if 0 // FIXME //grab the geom mapnik::geometry_container multi_input; if (!mapnik::from_wkt(wkt_in , multi_input)) @@ -24,7 +25,8 @@ void simplify(std::string const& wkt_in, double tolerance, std::string const& me throw std::runtime_error("Failed to parse WKT"); } //setup the generalization - mapnik::simplify_converter generalizer(multi_input.front()); + mapnik::vertex_adapter va(multi_input.front()); + mapnik::simplify_converter generalizer(va); generalizer.set_simplify_algorithm(mapnik::simplify_algorithm_from_string(method).get()); generalizer.set_simplify_tolerance(tolerance); //suck the vertices back out of it @@ -39,20 +41,14 @@ void simplify(std::string const& wkt_in, double tolerance, std::string const& me mapnik::geometry_container multi_out; multi_out.push_back(output); std::string wkt_out; - BOOST_TEST(mapnik::to_wkt(multi_out, wkt_out)); - BOOST_TEST_EQ(wkt_out, expected); + REQUIRE(mapnik::to_wkt(multi_out, wkt_out)); + REQUIRE(wkt_out == expected); +#endif } -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;i +#include + +TEST_CASE("vertex_adapters") { + +SECTION("polygon") { + mapnik::geometry::polygon g; + g.exterior_ring.add_coord(1,1); + g.exterior_ring.add_coord(2,2); + g.exterior_ring.add_coord(100,100); + g.exterior_ring.add_coord(1,1); + + mapnik::geometry::polygon_vertex_adapter va(g); + double x,y; + unsigned cmd; + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_MOVETO ); + REQUIRE( x == 1 ); + REQUIRE( y == 1 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == 2 ); + REQUIRE( y == 2 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == 100 ); + REQUIRE( y == 100 ); + + // close + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_CLOSE ); + REQUIRE( x == 0 ); + REQUIRE( y == 0 ); + + // end + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_END ); + REQUIRE( x == 0 ); + REQUIRE( y == 0 ); +} + +SECTION("polygon with hole") { + mapnik::geometry::polygon g; + g.exterior_ring.add_coord(0,0); + g.exterior_ring.add_coord(-10,0); + g.exterior_ring.add_coord(-10,10); + g.exterior_ring.add_coord(0,10); + g.exterior_ring.add_coord(0,0); + std::vector > interior_rings; + mapnik::geometry::linear_ring hole; + hole.add_coord(-7,7); + hole.add_coord(-7,3); + hole.add_coord(-3,3); + hole.add_coord(-3,7); + hole.add_coord(-7,7); + g.add_hole(std::move(hole)); + + mapnik::geometry::linear_ring hole_in_hole; + hole_in_hole.add_coord(-6,4); + hole_in_hole.add_coord(-6,6); + hole_in_hole.add_coord(-4,6); + hole_in_hole.add_coord(-4,4); + hole_in_hole.add_coord(-6,4); + g.add_hole(std::move(hole_in_hole)); + + mapnik::geometry::polygon_vertex_adapter va(g); + double x,y; + unsigned cmd; + + // exterior ring + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_MOVETO ); + REQUIRE( x == 0 ); + REQUIRE( y == 0 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -10 ); + REQUIRE( y == 0 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -10 ); + REQUIRE( y == 10 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == 0 ); + REQUIRE( y == 10 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_CLOSE ); + REQUIRE( x == 0 ); + REQUIRE( y == 0 ); + + // exterior ring via ring_vertex_adapter + mapnik::geometry::ring_vertex_adapter va2(g.exterior_ring); + cmd = va2.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_MOVETO ); + REQUIRE( x == 0 ); + REQUIRE( y == 0 ); + + cmd = va2.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -10 ); + REQUIRE( y == 0 ); + + cmd = va2.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -10 ); + REQUIRE( y == 10 ); + + cmd = va2.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == 0 ); + REQUIRE( y == 10 ); + + cmd = va2.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_CLOSE ); + REQUIRE( x == 0 ); + REQUIRE( y == 0 ); + + // since ring adapter is only for exterior, next should be END + cmd = va2.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_END ); + REQUIRE( x == 0 ); + REQUIRE( y == 0 ); + + // first hole for polygon_adapter + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_MOVETO ); + REQUIRE( x == -7 ); + REQUIRE( y == 7 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -7 ); + REQUIRE( y == 3 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -3 ); + REQUIRE( y == 3 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -3 ); + REQUIRE( y == 7 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_CLOSE ); + REQUIRE( x == 0 ); + REQUIRE( y == 0 ); + + // second hole + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_MOVETO ); + REQUIRE( x == -6 ); + REQUIRE( y == 4 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -6 ); + REQUIRE( y == 6 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -4 ); + REQUIRE( y == 6 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -4 ); + REQUIRE( y == 4 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_CLOSE ); + REQUIRE( x == 0 ); + REQUIRE( y == 0 ); + + mapnik::geometry::correct(g); + + va.rewind(0); + + // exterior ring: flipped winding order from correct + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_MOVETO ); + REQUIRE( x == 0 ); + REQUIRE( y == 0 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == 0 ); + REQUIRE( y == 10 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -10 ); + REQUIRE( y == 10 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -10 ); + REQUIRE( y == 0 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_CLOSE ); + REQUIRE( x == 0 ); + REQUIRE( y == 0 ); + + // first hole: flipped winding order from correct + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_MOVETO ); + REQUIRE( x == -7 ); + REQUIRE( y == 7 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -3 ); + REQUIRE( y == 7 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -3 ); + REQUIRE( y == 3 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -7 ); + REQUIRE( y == 3 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_CLOSE ); + REQUIRE( x == 0 ); + REQUIRE( y == 0 ); + + // second hole: correct appears not to have changed winding order + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_MOVETO ); + REQUIRE( x == -6 ); + REQUIRE( y == 4 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -6 ); + REQUIRE( y == 6 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -4 ); + REQUIRE( y == 6 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_LINETO ); + REQUIRE( x == -4 ); + REQUIRE( y == 4 ); + + cmd = va.vertex(&x,&y); + REQUIRE( cmd == mapnik::SEG_CLOSE ); + REQUIRE( x == 0 ); + REQUIRE( y == 0 ); +} + +} diff --git a/test/visual/compare_images.hpp b/test/visual/compare_images.hpp new file mode 100644 index 000000000..d227d7864 --- /dev/null +++ b/test/visual/compare_images.hpp @@ -0,0 +1,53 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 COMPARE_IMAGES_HPP +#define COMPARE_IMAGES_HPP + +// stl +#include + +// mapnik +#include +#include + +namespace visual_tests +{ + +template +unsigned compare_images(Image const & actual, std::string const & reference) +{ + std::unique_ptr reader(mapnik::get_image_reader(reference, "png")); + if (!reader.get()) + { + throw mapnik::image_reader_exception("Failed to load: " + reference); + } + + mapnik::image_any ref_image_any = reader->read(0, 0, reader->width(), reader->height()); + Image const & reference_image = mapnik::util::get(ref_image_any); + + return mapnik::compare(actual, reference_image, 0, true); +} + +} + +#endif diff --git a/test/visual/config.hpp b/test/visual/config.hpp new file mode 100644 index 000000000..8353d4b2e --- /dev/null +++ b/test/visual/config.hpp @@ -0,0 +1,80 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 CONFIG_HPP +#define CONFIG_HPP + +// stl +#include +#include + +// boost +#include + +namespace visual_tests +{ + +struct map_size +{ + map_size(int _width, int _height) : width(_width), height(_height) { } + map_size() { } + unsigned width = 0; + unsigned height = 0; +}; + +struct config +{ + config() : status(true), + scales({ 1.0, 2.0 }), + sizes({ { 500, 100 } }) { } + + bool status; + std::vector scales; + std::vector sizes; +}; + +enum result_state : std::uint8_t +{ + STATE_OK, + STATE_FAIL, + STATE_ERROR, + STATE_OVERWRITE +}; + +struct result +{ + std::string name; + result_state state; + std::string renderer_name; + map_size size; + double scale_factor; + boost::filesystem::path actual_image_path; + boost::filesystem::path reference_image_path; + std::string error_message; + unsigned diff; +}; + +using result_list = std::vector; + +} + +#endif diff --git a/bindings/python/mapnik_gamma_method.cpp b/test/visual/map_sizes_grammar.hpp similarity index 56% rename from bindings/python/mapnik_gamma_method.cpp rename to test/visual/map_sizes_grammar.hpp index 82b74d487..10d33503c 100644 --- a/bindings/python/mapnik_gamma_method.cpp +++ b/test/visual/map_sizes_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,30 +20,45 @@ * *****************************************************************************/ -#include +#ifndef MAP_SIZES_GRAMMAR_HPP +#define MAP_SIZES_GRAMMAR_HPP // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #pragma GCC diagnostic ignored "-Wmissing-field-initializers" - -#include +#pragma GCC diagnostic ignored "-Wsign-conversion" +#include +#include #pragma GCC diagnostic pop -#include -#include "mapnik_enumeration.hpp" - -void export_gamma_method() +namespace visual_tests { - using namespace boost::python; - mapnik::enumeration_("gamma_method") - .value("POWER", mapnik::GAMMA_POWER) - .value("LINEAR",mapnik::GAMMA_LINEAR) - .value("NONE", mapnik::GAMMA_NONE) - .value("THRESHOLD", mapnik::GAMMA_THRESHOLD) - .value("MULTIPLY", mapnik::GAMMA_MULTIPLY) - ; +namespace qi = boost::spirit::qi; +namespace ascii = boost::spirit::ascii; + +template +struct map_sizes_grammar : qi::grammar(), ascii::space_type> +{ + map_sizes_grammar() : map_sizes_grammar::base_type(start) + { + using namespace boost::spirit::qi; + using namespace boost::phoenix; + + int_type int_; + _1_type _1; + _2_type _2; + _val_type _val; + + start = (int_ >> ',' >> int_)[push_back(_val, construct(_1, _2))] % ';'; + } + + qi::rule(), ascii::space_type> start; +}; } + +#endif diff --git a/test/visual/renderer.hpp b/test/visual/renderer.hpp new file mode 100644 index 000000000..f097dac2b --- /dev/null +++ b/test/visual/renderer.hpp @@ -0,0 +1,259 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 RENDERER_HPP +#define RENDERER_HPP + +#include "compare_images.hpp" + +// stl +#include +#include +#include + +// mapnik +#include +#include +#if defined(GRID_RENDERER) +#include +#endif +#if defined(HAVE_CAIRO) +#include +#include +#endif +#if defined(SVG_RENDERER) +#include +#endif + +// boost +#include + +namespace visual_tests +{ + +template +struct renderer_base +{ + using image_type = ImageType; + + static constexpr const char * ext = ".png"; + + unsigned compare(image_type const & actual, boost::filesystem::path const& reference) const + { + return compare_images(actual, reference.string()); + } + + void save(image_type const & image, boost::filesystem::path const& path) const + { + mapnik::save_to_file(image, path.string(), "png32"); + } +}; + +struct agg_renderer : renderer_base +{ + static constexpr const char * name = "agg"; + + image_type render(mapnik::Map const & map, double scale_factor) const + { + image_type image(map.width(), map.height()); + mapnik::agg_renderer ren(map, image, scale_factor); + ren.apply(); + return image; + } +}; + +#if defined(HAVE_CAIRO) +struct cairo_renderer : renderer_base +{ + static constexpr const char * name = "cairo"; + + image_type render(mapnik::Map const & map, double scale_factor) const + { + mapnik::cairo_surface_ptr image_surface( + cairo_image_surface_create(CAIRO_FORMAT_ARGB32, map.width(), map.height()), + mapnik::cairo_surface_closer()); + mapnik::cairo_ptr image_context(mapnik::create_context(image_surface)); + mapnik::cairo_renderer ren(map, image_context, scale_factor); + ren.apply(); + image_type image(map.width(), map.height()); + mapnik::cairo_image_to_rgba8(image, image_surface); + return image; + } +}; +#endif + +#if defined(SVG_RENDERER) +struct svg_renderer : renderer_base +{ + static constexpr const char * name = "svg"; + static constexpr const char * ext = ".svg"; + + image_type render(mapnik::Map const & map, double scale_factor) const + { + std::stringstream ss; + std::ostream_iterator output_stream_iterator(ss); + mapnik::svg_renderer> ren(map, output_stream_iterator, scale_factor); + ren.apply(); + return ss.str(); + } + + unsigned compare(image_type const & actual, boost::filesystem::path const& reference) const + { + std::ifstream stream(reference.string().c_str(),std::ios_base::in|std::ios_base::binary); + if (!stream.is_open()) + { + throw std::runtime_error("could not open: '" + reference.string() + "'"); + } + std::string expected(std::istreambuf_iterator(stream.rdbuf()),(std::istreambuf_iterator())); + stream.close(); + return std::fabs(actual.size() - expected.size()); + } + + void save(image_type const & image, boost::filesystem::path const& path) const + { + std::ofstream file(path.string().c_str(), std::ios::out | std::ios::trunc | std::ios::binary); + if (!file) { + throw std::runtime_error((std::string("cannot open file for writing file ") + path.string()).c_str()); + } else { + file << image; + file.close(); + } + } + +}; +#endif + +#if defined(GRID_RENDERER) +struct grid_renderer : renderer_base +{ + static constexpr const char * name = "grid"; + + void convert(mapnik::grid::data_type const & grid, image_type & image) const + { + for (std::size_t y = 0; y < grid.height(); ++y) + { + mapnik::grid::value_type const * grid_row = grid.get_row(y); + image_type::pixel_type * image_row = image.get_row(y); + for (std::size_t x = 0; x < grid.width(); ++x) + { + mapnik::grid::value_type val = grid_row[x]; + + if (val == mapnik::grid::base_mask) + { + image_row[x] = 0; + continue; + } + if (val < 0) + { + throw std::runtime_error("grid renderer: feature id is negative."); + } + + val *= 100; + + if (val > 0x00ffffff) + { + throw std::runtime_error("grid renderer: feature id is too high."); + } + + image_row[x] = val | 0xff000000; + } + } + } + + image_type render(mapnik::Map const & map, double scale_factor) const + { + mapnik::grid grid(map.width(), map.height(), "__id__"); + mapnik::grid_renderer ren(map, grid, scale_factor); + ren.apply(); + image_type image(map.width(), map.height()); + convert(grid.data(), image); + return image; + } +}; +#endif + +template +class renderer +{ +public: + renderer(boost::filesystem::path const & _output_dir, boost::filesystem::path const & _reference_dir, bool _overwrite) + : ren(), output_dir(_output_dir), reference_dir(_reference_dir), overwrite(_overwrite) + { + } + + result test(std::string const & name, mapnik::Map const & map, double scale_factor) const + { + typename Renderer::image_type image(ren.render(map, scale_factor)); + boost::filesystem::path reference = reference_dir / image_file_name(name, map.width(), map.height(), scale_factor, true, Renderer::ext); + bool reference_exists = boost::filesystem::exists(reference); + result res; + + res.state = reference_exists ? STATE_OK : STATE_OVERWRITE; + res.name = name; + res.renderer_name = Renderer::name; + res.scale_factor = scale_factor; + res.size = map_size(map.width(), map.height()); + res.reference_image_path = reference; + res.diff = reference_exists ? ren.compare(image, reference) : 0; + + if (res.diff) + { + boost::filesystem::create_directories(output_dir); + boost::filesystem::path path = output_dir / image_file_name(name, map.width(), map.height(), scale_factor, false, Renderer::ext); + res.actual_image_path = path; + res.state = STATE_FAIL; + ren.save(image, path); + } + + if ((res.diff && overwrite) || !reference_exists) + { + ren.save(image, reference); + res.state = STATE_OVERWRITE; + } + + return res; + } + +private: + std::string image_file_name(std::string const & test_name, + double width, + double height, + double scale_factor, + bool reference, + std::string const& ext) const + { + std::stringstream s; + s << test_name << '-' << width << '-' << height << '-' + << std::fixed << std::setprecision(1) << scale_factor + << '-' << Renderer::name << (reference ? "-reference" : "") << ext; + return s.str(); + } + + const Renderer ren; + boost::filesystem::path const & output_dir; + boost::filesystem::path const & reference_dir; + const bool overwrite; +}; + +} + +#endif diff --git a/test/visual/report.cpp b/test/visual/report.cpp new file mode 100644 index 000000000..aeca371a0 --- /dev/null +++ b/test/visual/report.cpp @@ -0,0 +1,200 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +// stl +#include +#include +#include + +#include "report.hpp" + +namespace visual_tests +{ + +void console_report::report(result const & r) +{ + s << '"' << r.name << '-' << r.size.width << '-' << r.size.height << '-' << std::fixed << + std::setprecision(1) << r.scale_factor << "\" with " << r.renderer_name << "... "; + + switch (r.state) + { + case STATE_OK: + s << "OK"; + break; + case STATE_FAIL: + s << "FAILED (" << r.diff << " different pixels)"; + break; + case STATE_OVERWRITE: + s << "OVERWRITTEN (" << r.diff << " different pixels)"; + break; + case STATE_ERROR: + s << "ERROR (" << r.error_message << ")"; + break; + } + + s << std::endl; +} + +unsigned console_report::summary(result_list const & results) +{ + unsigned ok = 0; + unsigned error = 0; + unsigned fail = 0; + unsigned overwrite = 0; + + for (auto const & r : results) + { + switch (r.state) + { + case STATE_OK: ok++; break; + case STATE_FAIL: fail++; break; + case STATE_ERROR: error++; break; + case STATE_OVERWRITE: overwrite++; break; + } + } + + s << std::endl; + s << "Visual rendering: " << fail << " failed / " << ok << " passed / " + << overwrite << " overwritten / " << error << " errors" << std::endl; + + return fail + error; +} + +void console_short_report::report(result const & r) +{ + switch (r.state) + { + case STATE_OK: + s << "."; + break; + case STATE_FAIL: + s << "✘"; + break; + case STATE_OVERWRITE: + s << "✓"; + break; + case STATE_ERROR: + s << "ERROR (" << r.error_message << ")\n"; + break; + } +} + +void html_report::report(result const & r, boost::filesystem::path const & output_dir) +{ + if (r.state == STATE_ERROR) + { + s << "
Failed to render: " << r.name << "
" << r.error_message << "
\n"; + } + else if (r.state == STATE_FAIL) + { + using namespace boost::filesystem; + + path reference = output_dir / r.reference_image_path.filename(); + path actual = output_dir / r.actual_image_path.filename(); + + if (exists(reference)) + { + remove(reference); + } + if (exists(actual)) + { + remove(actual); + } + copy_file(r.reference_image_path, reference); + copy_file(r.actual_image_path, actual); + + s << "
\n" + " \n" + " \n" + " \n" + "
\n" + "
" << r.diff << "
\n" + "
\n" + " \n" + " \n" + " \n" + "
\n"; + } +} + +constexpr const char * html_header = R"template( + + + + + + +
+
expected
+
% difference
+
actual
+)template"; + +constexpr const char * html_footer = R"template(
+ +)template"; + +void html_report::summary(result_list const & results, boost::filesystem::path const & output_dir) +{ + s << html_header; + + for (auto const & r : results) + { + if (r.state != STATE_OK) + { + report(r, output_dir); + } + } + + s << html_footer; +} + +void html_summary(result_list const & results, boost::filesystem::path output_dir) +{ + boost::filesystem::path html_root = output_dir / "visual-test-results"; + boost::filesystem::create_directories(html_root); + boost::filesystem::path html_report_path = html_root / "index.html"; + std::clog << "View failure report at " << html_report_path << "\n"; + std::ofstream output_file(html_report_path.string()); + html_report report(output_file); + report.summary(results, html_root); +} + +} diff --git a/test/visual/report.hpp b/test/visual/report.hpp new file mode 100644 index 000000000..3b6146ec5 --- /dev/null +++ b/test/visual/report.hpp @@ -0,0 +1,124 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 CONSOLE_REPORT_HPP +#define CONSOLE_REPORT_HPP + +// stl +#include + +#include + +#include "config.hpp" + +namespace visual_tests +{ + +class console_report +{ +public: + console_report() : s(std::clog) + { + } + + console_report(std::ostream & _s) : s(_s) + { + } + + void report(result const & r); + unsigned summary(result_list const & results); + +protected: + std::ostream & s; +}; + +class console_short_report : public console_report +{ +public: + console_short_report() : console_report() + { + } + + console_short_report(std::ostream & s) : console_report(s) + { + } + + void report(result const & r); +}; + +class html_report +{ +public: + html_report(std::ostream & _s) : s(_s) + { + } + + void report(result const & r, boost::filesystem::path const & output_dir); + void summary(result_list const & results, boost::filesystem::path const & output_dir); + +protected: + std::ostream & s; +}; + +using report_type = mapnik::util::variant; + +class report_visitor +{ +public: + report_visitor(result const & r) + : result_(r) + { + } + + template + void operator()(T & report) const + { + return report.report(result_); + } + +private: + result const & result_; +}; + +class summary_visitor +{ +public: + summary_visitor(result_list const & r) + : result_(r) + { + } + + template + unsigned operator()(T & report) const + { + return report.summary(result_); + } + +private: + result_list const & result_; +}; + +void html_summary(result_list const & results, boost::filesystem::path output_dir); + +} + +#endif diff --git a/test/visual/run.cpp b/test/visual/run.cpp new file mode 100644 index 000000000..d44508188 --- /dev/null +++ b/test/visual/run.cpp @@ -0,0 +1,142 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +#include "runner.hpp" +#include "config.hpp" + +#include +#include + +// boost +#include + +#include "cleanup.hpp" // run_cleanup() + +#ifdef MAPNIK_LOG +using log_levels_map = std::map; + +log_levels_map log_levels +{ + { "debug", mapnik::logger::severity_type::debug }, + { "warn", mapnik::logger::severity_type::warn }, + { "error", mapnik::logger::severity_type::error }, + { "none", mapnik::logger::severity_type::none } +}; +#endif + +int main(int argc, char** argv) +{ + using namespace visual_tests; + namespace po = boost::program_options; + + po::options_description desc("visual test runner"); + desc.add_options() + ("help,h", "produce usage message") + ("verbose,v", "verbose output") + ("overwrite,o", "overwrite reference image") + ("jobs,j", po::value()->default_value(1), "number of parallel threads") + ("styles-dir", po::value()->default_value("test/data-visual/styles"), "directory with styles") + ("images-dir", po::value()->default_value("test/data-visual/images"), "directory with reference images") + ("output-dir", po::value()->default_value("/tmp/mapnik-visual-images"), "directory for output files") + ("unique-subdir,u", "write output files to subdirectory with unique name") + ("styles", po::value>(), "selected styles to test") + ("fonts", po::value()->default_value("fonts"), "font search path") + ("plugins", po::value()->default_value("plugins/input"), "input plugins search path") +#ifdef MAPNIK_LOG + ("log", po::value()->default_value(std::find_if(log_levels.begin(), log_levels.end(), + [](log_levels_map::value_type const & level) { return level.second == mapnik::logger::get_severity(); } )->first), + "log level (debug, warn, error, none)") +#endif + ; + + po::positional_options_description p; + p.add("styles", -1); + po::variables_map vm; + po::store(po::command_line_parser(argc, argv).options(desc).positional(p).run(), vm); + po::notify(vm); + + if (vm.count("help")) + { + std::clog << desc << std::endl; + return 1; + } + +#ifdef MAPNIK_LOG + std::string log_level(vm["log"].as()); + log_levels_map::const_iterator level_iter = log_levels.find(log_level); + if (level_iter == log_levels.end()) + { + std::cerr << "Error: Unknown log level: " << log_level << std::endl; + return 1; + } + else + { + mapnik::logger::set_severity(level_iter->second); + } +#endif + + mapnik::freetype_engine::register_fonts(vm["fonts"].as(), true); + mapnik::datasource_cache::instance().register_datasources(vm["plugins"].as()); + + boost::filesystem::path output_dir(vm["output-dir"].as()); + + if (vm.count("unique-subdir")) + { + output_dir /= boost::filesystem::unique_path(); + } + + runner run(vm["styles-dir"].as(), + output_dir, + vm["images-dir"].as(), + vm.count("overwrite"), + vm["jobs"].as()); + report_type report = vm.count("verbose") ? report_type((console_report())) : report_type((console_short_report())); + result_list results; + + try + { + if (vm.count("styles")) + { + results = run.test(vm["styles"].as>(), report); + } + else + { + results = run.test_all(report); + } + } + catch (std::exception & e) + { + std::cerr << "Error runnig tests: " << e.what() << std::endl; + return 1; + } + + unsigned failed_count = mapnik::util::apply_visitor(summary_visitor(results), report); + + if (failed_count) + { + html_summary(results, output_dir); + } + + testing::run_cleanup(); + + return failed_count; +} diff --git a/test/visual/runner.cpp b/test/visual/runner.cpp new file mode 100644 index 000000000..f2562c197 --- /dev/null +++ b/test/visual/runner.cpp @@ -0,0 +1,256 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 + * + *****************************************************************************/ + +// stl +#include +#include + +#include + +#include "runner.hpp" + +namespace visual_tests +{ + +class renderer_visitor +{ +public: + renderer_visitor(std::string const & name, mapnik::Map const & map, double scale_factor) + : name_(name), map_(map), scale_factor_(scale_factor) + { + } + + template + result operator()(T const & renderer) const + { + return renderer.test(name_, map_, scale_factor_); + } + +private: + std::string const & name_; + mapnik::Map const & map_; + double scale_factor_; +}; + +runner::runner(runner::path_type const & styles_dir, + runner::path_type const & output_dir, + runner::path_type const & reference_dir, + bool overwrite, + std::size_t jobs) + : styles_dir_(styles_dir), + output_dir_(output_dir), + reference_dir_(reference_dir), + jobs_(jobs), + renderers_{ renderer(output_dir_, reference_dir_, overwrite) +#if defined(HAVE_CAIRO) + ,renderer(output_dir_, reference_dir_, overwrite) +#endif +#if defined(SVG_RENDERER) + ,renderer(output_dir_, reference_dir_, overwrite) +#endif +#if defined(GRID_RENDERER) + ,renderer(output_dir_, reference_dir_, overwrite) +#endif + } +{ +} + +result_list runner::test_all(report_type & report) const +{ + boost::filesystem::directory_iterator begin(styles_dir_); + boost::filesystem::directory_iterator end; + std::vector files(begin, end); + return test_parallel(files, report, jobs_); +} + +result_list runner::test(std::vector const & style_names, report_type & report) const +{ + std::vector files(style_names.size()); + std::transform(style_names.begin(), style_names.end(), std::back_inserter(files), + [&](runner::path_type const & name) + { + return (name.extension() == ".xml") ? name : (styles_dir_ / (name.string() + ".xml")); + }); + return test_parallel(files, report, jobs_); +} + +result_list runner::test_parallel(std::vector const & files, report_type & report, std::size_t jobs) const +{ + result_list results; + + if (files.empty()) + { + return results; + } + + if (jobs == 0) + { + jobs = 1; + } + + std::size_t chunk_size = files.size() / jobs; + + if (chunk_size == 0) + { + chunk_size = files.size(); + jobs = 1; + } + + std::launch launch(jobs == 1 ? std::launch::deferred : std::launch::async); + std::vector> futures(jobs); + + for (std::size_t i = 0; i < jobs; i++) + { + files_iterator begin(files.begin() + i * chunk_size); + files_iterator end(files.begin() + (i + 1) * chunk_size); + + // Handle remainder of files.size() / jobs + if (i == jobs - 1) + { + end = files.end(); + } + + futures[i] = std::async(launch, &runner::test_range, this, begin, end, std::ref(report)); + } + + for (auto & f : futures) + { + result_list r = f.get(); + std::move(r.begin(), r.end(), std::back_inserter(results)); + } + + return results; +} + +result_list runner::test_range(files_iterator begin, files_iterator end, std::reference_wrapper report) const +{ + config defaults; + result_list results; + + for (runner::files_iterator i = begin; i != end; i++) + { + runner::path_type const & file = *i; + if (file.extension() == ".xml") + { + try + { + result_list r = test_one(file, defaults, report); + std::move(r.begin(), r.end(), std::back_inserter(results)); + } + catch (std::exception const& ex) + { + result r; + r.state = STATE_ERROR; + r.name = file.string(); + r.error_message = ex.what(); + results.emplace_back(r); + mapnik::util::apply_visitor(report_visitor(r), report.get()); + } + } + } + + return results; +} + +result_list runner::test_one(runner::path_type const& style_path, config cfg, report_type & report) const +{ + mapnik::Map m(cfg.sizes.front().width, cfg.sizes.front().height); + result_list results; + + try + { + mapnik::load_map(m, style_path.string(), true); + } + catch (std::exception const& ex) + { + std::string what = ex.what(); + if (what.find("Could not create datasource") != std::string::npos || + what.find("Postgis Plugin: could not connect to server") != std::string::npos) + { + return results; + } + throw; + } + + mapnik::parameters const & params = m.get_extra_parameters(); + + boost::optional status = params.get("status", cfg.status); + + if (!*status) + { + return results; + } + + boost::optional sizes = params.get("sizes"); + + if (sizes) + { + cfg.sizes.clear(); + parse_map_sizes(*sizes, cfg.sizes); + } + + std::string name(style_path.stem().string()); + + for (map_size const & size : cfg.sizes) + { + m.resize(size.width, size.height); + + boost::optional bbox_string = params.get("bbox"); + + if (bbox_string) + { + mapnik::box2d bbox; + bbox.from_string(*bbox_string); + m.zoom_to_box(bbox); + } + else + { + m.zoom_all(); + } + + for (double const & scale_factor : cfg.scales) + { + for(auto const& ren : renderers_) + { + result r = mapnik::util::apply_visitor(renderer_visitor(name, m, scale_factor), ren); + results.emplace_back(r); + mapnik::util::apply_visitor(report_visitor(r), report); + } + } + } + + return results; +} + +void runner::parse_map_sizes(std::string const & str, std::vector & sizes) const +{ + boost::spirit::ascii::space_type space; + std::string::const_iterator iter = str.begin(); + std::string::const_iterator end = str.end(); + if (!boost::spirit::qi::phrase_parse(iter, end, map_sizes_parser_, space, sizes)) + { + throw std::runtime_error("Failed to parse list of sizes: '" + str + "'"); + } +} + +} + diff --git a/test/visual/runner.hpp b/test/visual/runner.hpp new file mode 100644 index 000000000..77949e46e --- /dev/null +++ b/test/visual/runner.hpp @@ -0,0 +1,78 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 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 VISUAL_TEST_RUNNER_HPP +#define VISUAL_TEST_RUNNER_HPP + +#include + +#include "config.hpp" +#include "report.hpp" +#include "renderer.hpp" +#include "map_sizes_grammar.hpp" + +namespace visual_tests +{ + +class runner +{ + using renderer_type = mapnik::util::variant +#if defined(HAVE_CAIRO) + ,renderer +#endif +#if defined(SVG_RENDERER) + ,renderer +#endif +#if defined(GRID_RENDERER) + ,renderer +#endif + >; + using path_type = boost::filesystem::path; + using files_iterator = std::vector::const_iterator; + +public: + runner(path_type const & styles_dir, + path_type const & output_dir, + path_type const & reference_dir, + bool overwrite, + std::size_t jobs); + + result_list test_all(report_type & report) const; + result_list test(std::vector const & style_names, report_type & report) const; + +private: + result_list test_parallel(std::vector const & files, report_type & report, std::size_t jobs) const; + result_list test_range(files_iterator begin, files_iterator end, std::reference_wrapper report) const; + result_list test_one(path_type const & style_path, config cfg, report_type & report) const; + void parse_map_sizes(std::string const & str, std::vector & sizes) const; + + const map_sizes_grammar map_sizes_parser_; + const path_type styles_dir_; + const path_type output_dir_; + const path_type reference_dir_; + const std::size_t jobs_; + const renderer_type renderers_[boost::mpl::size::value]; +}; + +} + +#endif diff --git a/tests/cpp_tests/build.py b/tests/cpp_tests/build.py deleted file mode 100644 index 88ea7b3af..000000000 --- a/tests/cpp_tests/build.py +++ /dev/null @@ -1,52 +0,0 @@ -import os -import glob -from copy import copy - -Import ('env') - -test_env = env.Clone() - -if not env['CPP_TESTS']: - for cpp_test_bin in glob.glob('*-bin'): - os.unlink(cpp_test_bin) -else: - test_env['LIBS'] = [env['MAPNIK_NAME']] - test_env.AppendUnique(LIBS=copy(env['LIBMAPNIK_LIBS'])) - test_env.AppendUnique(LIBS='mapnik-wkt') - test_env.AppendUnique(LIBS='mapnik-json') - if env['RUNTIME_LINK'] == 'static' and env['PLATFORM'] == 'Linux': - test_env.AppendUnique(LIBS='dl') - test_env.AppendUnique(CXXFLAGS='-g') - test_env['CXXFLAGS'] = copy(test_env['LIBMAPNIK_CXXFLAGS']) - test_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES']) - if test_env['HAS_CAIRO']: - test_env.PrependUnique(CPPPATH=test_env['CAIRO_CPPPATHS']) - test_env.Append(CPPDEFINES = '-DHAVE_CAIRO') - for cpp_test in glob.glob('*_test.cpp'): - name = cpp_test.replace('.cpp','-bin') - source_files = [cpp_test] - test_program = None - # enable for faster compile while developing just this test - #if 'agg_blend_src_over_test' in cpp_test: - if False: - # customization here for faster compile - agg_env = Environment(ENV=os.environ) - agg_env['CXX'] = env['CXX'] - agg_env['CXXFLAGS'] = env['CXXFLAGS'] - if 'agg' in test_env['LIBS']: - agg_env.AppendUnique(LIBS='agg') - agg_env.Append(CPPPATH = '#deps/agg/include') - agg_env.Append(LIBPATH = '#deps/agg') - agg_env['CPPPATH'] = ['#deps/agg/include',env['BOOST_INCLUDES']] - test_program = agg_env.Program(name, source=source_files) - else: - test_env_local = test_env.Clone() - if 'csv_parse' in cpp_test: - source_files += glob.glob('../../plugins/input/csv/' + '*.cpp') - test_program = test_env_local.Program(name, source=source_files) - Depends(test_program, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME'])) - Depends(test_program, env.subst('../../src/json/libmapnik-json${LIBSUFFIX}')) - Depends(test_program, env.subst('../../src/wkt/libmapnik-wkt${LIBSUFFIX}')) - # build locally if installing - if 'install' in COMMAND_LINE_TARGETS: - env.Alias('install',test_program) diff --git a/tests/cpp_tests/copy_move_test.cpp b/tests/cpp_tests/copy_move_test.cpp deleted file mode 100644 index 665483e70..000000000 --- a/tests/cpp_tests/copy_move_test.cpp +++ /dev/null @@ -1,92 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;i -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include "utils.hpp" - -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;i
"); - BOOST_TEST( m3.get_font_memory_cache().size() == 0 ); - BOOST_TEST( m3.load_fonts() ); - BOOST_TEST( m3.get_font_memory_cache().size() == 1 ); - - std::vector face_names; - std::string foo("foo"); - // fake directories - BOOST_TEST( !mapnik::freetype_engine::register_fonts(foo , true ) ); - face_names = mapnik::freetype_engine::face_names(); - BOOST_TEST( face_names.size() == 0 ); - BOOST_TEST( !mapnik::freetype_engine::register_fonts(foo) ); - face_names = mapnik::freetype_engine::face_names(); - BOOST_TEST( face_names.size() == 0 ); - - // directories without fonts - // silence warnings here by altering the logging severity - logger.set_severity(mapnik::logger::none); - std::string src("src"); - // an empty directory will not return true - // we need to register at least one font and not fail on any - // to return true - BOOST_TEST( mapnik::freetype_engine::register_font(src) == false ); - BOOST_TEST( mapnik::freetype_engine::register_fonts(src, true) == false ); - BOOST_TEST( mapnik::freetype_engine::face_names().size() == 0 ); - - // bogus, emtpy file that looks like font - BOOST_TEST( mapnik::freetype_engine::register_font("tests/data/fonts/fake.ttf") == false ); - BOOST_TEST( mapnik::freetype_engine::register_fonts("tests/data/fonts/fake.ttf") == false ); - BOOST_TEST( mapnik::freetype_engine::face_names().size() == 0 ); - - BOOST_TEST( mapnik::freetype_engine::register_font("tests/data/fonts/intentionally-broken.ttf") == false ); - BOOST_TEST( mapnik::freetype_engine::register_fonts("tests/data/fonts/intentionally-broken.ttf") == false ); - BOOST_TEST( mapnik::freetype_engine::face_names().size() == 0 ); - - // now restore the original severity - logger.set_severity(original_severity); - - // register unifont, since we know it sits in the root fonts/ dir - BOOST_TEST( mapnik::freetype_engine::register_fonts(fontdir) ); - face_names = mapnik::freetype_engine::face_names(); - BOOST_TEST( face_names.size() > 0 ); - BOOST_TEST( face_names.size() == 1 ); - - // re-register unifont, should not have any affect - BOOST_TEST( mapnik::freetype_engine::register_fonts(fontdir, false) ); - face_names = mapnik::freetype_engine::face_names(); - BOOST_TEST( face_names.size() == 1 ); - - // single dejavu font in separate location - std::string dejavu_bold_oblique("tests/data/fonts/DejaVuSansMono-BoldOblique.ttf"); - BOOST_TEST( mapnik::freetype_engine::register_font(dejavu_bold_oblique) ); - face_names = mapnik::freetype_engine::face_names(); - BOOST_TEST( face_names.size() == 2 ); - - // now, inspect font mapping and confirm the correct 'DejaVu Sans Mono Bold Oblique' is registered - using font_file_mapping = std::map >; - font_file_mapping const& name2file = mapnik::freetype_engine::get_mapping(); - bool found_dejavu = false; - for (auto const& item : name2file) - { - if (item.first == "DejaVu Sans Mono Bold Oblique") - { - found_dejavu = true; - BOOST_TEST( item.second.first == 0 ); - BOOST_TEST( item.second.second == dejavu_bold_oblique ); - } - } - BOOST_TEST( found_dejavu ); - - // recurse to find all dejavu fonts - BOOST_TEST( mapnik::freetype_engine::register_fonts(fontdir, true) ); - face_names = mapnik::freetype_engine::face_names(); - BOOST_TEST( face_names.size() == 22 ); - - // we should have re-registered 'DejaVu Sans Mono Bold Oblique' again, - // but now at a new path - bool found_dejavu2 = false; - for (auto const& item : name2file) - { - if (item.first == "DejaVu Sans Mono Bold Oblique") - { - found_dejavu2 = true; - BOOST_TEST( item.second.first == 0 ); - // path should be different - BOOST_TEST( item.second.second != dejavu_bold_oblique ); - } - } - BOOST_TEST( found_dejavu2 ); - - // now that global registry is populated - // now test that a map only loads new fonts - mapnik::Map m4(1,1); - BOOST_TEST( m4.register_fonts(fontdir , true ) ); - BOOST_TEST( m4.get_font_memory_cache().size() == 0 ); - BOOST_TEST( m4.get_font_file_mapping().size() == 22 ); - BOOST_TEST( !m4.load_fonts() ); - BOOST_TEST( m4.get_font_memory_cache().size() == 0 ); - BOOST_TEST( m4.register_fonts(dejavu_bold_oblique, false) ); - BOOST_TEST( m4.load_fonts() ); - BOOST_TEST( m4.get_font_memory_cache().size() == 1 ); - - // check that we can correctly read a .ttc containing - // multiple valid faces - // https://github.com/mapnik/mapnik/issues/2274 - BOOST_TEST( mapnik::freetype_engine::register_font("tests/data/fonts/NotoSans-Regular.ttc") ); - face_names = mapnik::freetype_engine::face_names(); - BOOST_TEST( face_names.size() == 24 ); - - // now blindly register as many system fonts as possible - // the goal here to make sure we don't crash - // linux - mapnik::freetype_engine::register_fonts("/usr/share/fonts/", true); - mapnik::freetype_engine::register_fonts("/usr/local/share/fonts/", true); - // osx - mapnik::freetype_engine::register_fonts("/Library/Fonts/", true); - mapnik::freetype_engine::register_fonts("/System/Library/Fonts/", true); - // windows - mapnik::freetype_engine::register_fonts("C:\\Windows\\Fonts", true); - face_names = mapnik::freetype_engine::face_names(); - BOOST_TEST( face_names.size() > 22 ); - } - catch (std::exception const & ex) - { - std::clog << ex.what() << "\n"; - BOOST_TEST(false); - } - - if (!::boost::detail::test_errors()) { - if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; - else std::clog << "C++ fonts registration: \x1b[1;32m✓ \x1b[0m\n"; - ::boost::detail::report_errors_remind().called_report_errors_function = true; - } else { - return ::boost::report_errors(); - } -} diff --git a/tests/cpp_tests/image_io_test.cpp b/tests/cpp_tests/image_io_test.cpp deleted file mode 100644 index f7cb158f6..000000000 --- a/tests/cpp_tests/image_io_test.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(HAVE_CAIRO) -#include -#include -#endif - -#include "utils.hpp" - -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;i type; - try - { - BOOST_TEST(set_working_dir(args)); -#if defined(HAVE_JPEG) - should_throw = "./tests/cpp_tests/data/blank.jpg"; - BOOST_TEST( mapnik::util::exists( should_throw ) ); - type = mapnik::type_from_filename(should_throw); - BOOST_TEST( type ); - try - { - std::unique_ptr reader(mapnik::get_image_reader(should_throw,*type)); - BOOST_TEST( false ); - } - catch (std::exception const&) - { - BOOST_TEST( true ); - } -#endif - - try - { - mapnik::image_32 im(-10,-10); // should throw rather than overflow - BOOST_TEST( im.width() < 10 ); // should not get here, but if we did this test should fail - } - catch (std::exception const& ex) - { - BOOST_TEST( true ); // should hit bad alloc here - } - - try - { - mapnik::image_data_rgba8 im(-10,-10); // should throw rather than overflow - BOOST_TEST( im.width() < 10 ); // should not get here, but if we did this test should fail - } - catch (std::exception const& ex) - { - BOOST_TEST( true ); // should hit bad alloc here - } - -#if defined(HAVE_CAIRO) - mapnik::cairo_surface_ptr image_surface( - cairo_image_surface_create(CAIRO_FORMAT_ARGB32,256,257), - mapnik::cairo_surface_closer()); - mapnik::image_data_rgba8 im_data(cairo_image_surface_get_width(&*image_surface), cairo_image_surface_get_height(&*image_surface)); - im_data.set(1); - BOOST_TEST( (unsigned)im_data(0,0) == unsigned(1) ); - // Should set back to fully transparent - mapnik::cairo_image_to_rgba8(im_data, image_surface); - BOOST_TEST( (unsigned)im_data(0,0) == unsigned(0) ); -#endif - -#if defined(HAVE_PNG) - should_throw = "./tests/cpp_tests/data/blank.png"; - BOOST_TEST( mapnik::util::exists( should_throw ) ); - type = mapnik::type_from_filename(should_throw); - BOOST_TEST( type ); - try - { - std::unique_ptr reader(mapnik::get_image_reader(should_throw,*type)); - BOOST_TEST( false ); - } - catch (std::exception const&) - { - BOOST_TEST( true ); - } - - should_throw = "./tests/data/images/xcode-CgBI.png"; - BOOST_TEST( mapnik::util::exists( should_throw ) ); - type = mapnik::type_from_filename(should_throw); - BOOST_TEST( type ); - try - { - std::unique_ptr reader(mapnik::get_image_reader(should_throw,*type)); - BOOST_TEST( false ); - } - catch (std::exception const&) - { - BOOST_TEST( true ); - } -#endif - -#if defined(HAVE_TIFF) - should_throw = "./tests/cpp_tests/data/blank.tiff"; - BOOST_TEST( mapnik::util::exists( should_throw ) ); - type = mapnik::type_from_filename(should_throw); - BOOST_TEST( type ); - try - { - std::unique_ptr reader(mapnik::get_image_reader(should_throw,*type)); - BOOST_TEST( false ); - } - catch (std::exception const&) - { - BOOST_TEST( true ); - } -#endif - -#if defined(HAVE_WEBP) - should_throw = "./tests/cpp_tests/data/blank.webp"; - BOOST_TEST( mapnik::util::exists( should_throw ) ); - type = mapnik::type_from_filename(should_throw); - BOOST_TEST( type ); - try - { - std::unique_ptr reader(mapnik::get_image_reader(should_throw,*type)); - BOOST_TEST( false ); - } - catch (std::exception const&) - { - BOOST_TEST( true ); - } -#endif - } - catch (std::exception const & ex) - { - std::clog << ex.what() << "\n"; - BOOST_TEST(false); - } - - if (!::boost::detail::test_errors()) { - if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; - else std::clog << "C++ image i/o: \x1b[1;32m✓ \x1b[0m\n"; - ::boost::detail::report_errors_remind().called_report_errors_function = true; - } else { - return ::boost::report_errors(); - } -} diff --git a/tests/cpp_tests/image_painted_test.cpp b/tests/cpp_tests/image_painted_test.cpp deleted file mode 100644 index 946c21124..000000000 --- a/tests/cpp_tests/image_painted_test.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -int main(int argc, char** argv) -{ - std::vector args; - for (int i = 1; i < argc; ++i) - { - args.push_back(argv[i]); - } - bool quiet = std::find(args.begin(), args.end(), "-q") != args.end(); - - using namespace mapnik; - - try - { - datasource_cache::instance().register_datasources("plugins/input/csv.input"); - - Map m(256, 256); - - feature_type_style lines_style; - { - rule r; - line_symbolizer line_sym; - r.append(std::move(line_sym)); - lines_style.add_rule(std::move(r)); - } - m.insert_style("lines", std::move(lines_style)); - - feature_type_style markers_style; - { - rule r; - r.set_filter(parse_expression("False")); - markers_symbolizer mark_sym; - r.append(std::move(mark_sym)); - markers_style.add_rule(std::move(r)); - } - m.insert_style("markers", std::move(markers_style)); - - parameters p; - p["type"] = "csv"; - p["separator"] = "|"; - p["inline"] = "wkt\nLINESTRING(-10 0, 0 20, 10 0, 15 5)"; - - layer lyr("layer"); - lyr.set_datasource(datasource_cache::instance().create(p)); - lyr.add_style("lines"); - lyr.add_style("markers"); - m.add_layer(lyr); - - m.zoom_all(); - - image_32 image(m.width(), m.height()); - agg_renderer ren(m, image); - ren.apply(); - - BOOST_TEST_EQ(image.painted(), true); - } - catch (std::exception const & ex) - { - std::clog << ex.what() << std::endl; - BOOST_TEST(false); - } - - if (::boost::detail::test_errors()) - { - return ::boost::report_errors(); - } - else - { - if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; - else std::clog << "C++ image painted: \x1b[1;32m✓ \x1b[0m\n"; - ::boost::detail::report_errors_remind().called_report_errors_function = true; - } -} diff --git a/tests/cpp_tests/label_algo_test.cpp b/tests/cpp_tests/label_algo_test.cpp deleted file mode 100644 index 819fd529e..000000000 --- a/tests/cpp_tests/label_algo_test.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include -#include -#include -#include -#include -#include - -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;i - -#include -#include -#include -#include -#if defined(HAVE_CAIRO) -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include "utils.hpp" - -bool compare_images(std::string const& src_fn,std::string const& dest_fn) -{ - using namespace mapnik; - std::unique_ptr reader1(mapnik::get_image_reader(dest_fn,"png")); - if (!reader1.get()) - { - throw mapnik::image_reader_exception("Failed to load: " + dest_fn); - } - std::shared_ptr image_ptr1 = std::make_shared(reader1->width(),reader1->height()); - reader1->read(0,0,image_ptr1->data()); - - std::unique_ptr reader2(mapnik::get_image_reader(src_fn,"png")); - if (!reader2.get()) - { - throw mapnik::image_reader_exception("Failed to load: " + src_fn); - } - std::shared_ptr image_ptr2 = std::make_shared(reader2->width(),reader2->height()); - reader2->read(0,0,image_ptr2->data()); - - image_data_rgba8 const& dest = image_ptr1->data(); - image_data_rgba8 const& src = image_ptr2->data(); - - unsigned int width = src.width(); - unsigned int height = src.height(); - if ((width != dest.width()) || height != dest.height()) return false; - for (unsigned int y = 0; y < height; ++y) - { - const unsigned int* row_from = src.getRow(y); - const unsigned int* row_to = dest.getRow(y); - for (unsigned int x = 0; x < width; ++x) - { - if (row_from[x] != row_to[x]) return false; - } - } - return true; -} - -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;i renderer1(m,im,scale_factor); - renderer1.apply(); - std::string actual1("/tmp/map-request-marker-text-line-actual1.png"); - //mapnik::save_to_file(im.data(),expected); - mapnik::save_to_file(im.data(),actual1); - // TODO - re-enable if we can control the freetype/cairo versions used - // https://github.com/mapnik/mapnik/issues/1868 - //BOOST_TEST(compare_images(actual1,expected)); - - // reset image - im.clear(); - - // set up a mapnik::request object - mapnik::request req(m.width(),m.height(),m.get_current_extent()); - req.set_buffer_size(m.buffer_size()); - - // render using apply() and mapnik::request - mapnik::attributes vars; - mapnik::agg_renderer renderer2(m,req,vars,im,scale_factor); - renderer2.apply(); - std::string actual2("/tmp/map-request-marker-text-line-actual2.png"); - mapnik::save_to_file(im.data(),actual2); - // TODO - re-enable if we can control the freetype/cairo versions used - // https://github.com/mapnik/mapnik/issues/1868 - //BOOST_TEST(compare_images(actual2,expected)); - - // reset image - im.clear(); - - // render with apply_to_layer api and mapnik::request params passed to apply_to_layer - mapnik::agg_renderer renderer3(m,req,vars,im,scale_factor); - renderer3.start_map_processing(m); - mapnik::projection map_proj(m.srs(),true); - double scale_denom = mapnik::scale_denominator(req.scale(),map_proj.is_geographic()); - scale_denom *= scale_factor; - for (mapnik::layer const& lyr : m.layers() ) - { - if (lyr.visible(scale_denom)) - { - std::set names; - renderer3.apply_to_layer(lyr, - renderer3, - map_proj, - req.scale(), - scale_denom, - req.width(), - req.height(), - req.extent(), - req.buffer_size(), - names); - - } - } - renderer3.end_map_processing(m); - std::string actual3("/tmp/map-request-marker-text-line-actual3.png"); - mapnik::save_to_file(im.data(),actual3); - // TODO - re-enable if we can control the freetype/cairo versions used - // https://github.com/mapnik/mapnik/issues/1868 - //BOOST_TEST(compare_images(actual3,expected)); - - // also test cairo -#if defined(HAVE_CAIRO) - mapnik::cairo_surface_ptr image_surface( - cairo_image_surface_create(CAIRO_FORMAT_ARGB32,req.width(),req.height()), - mapnik::cairo_surface_closer()); - mapnik::cairo_ptr image_context = (mapnik::create_context(image_surface)); - mapnik::cairo_renderer png_render(m,req,vars,image_context,scale_factor); - png_render.apply(); - //cairo_surface_write_to_png(&*image_surface, expected_cairo.c_str()); - std::string actual_cairo("/tmp/map-request-marker-text-line-actual4.png"); - cairo_surface_write_to_png(&*image_surface, actual_cairo.c_str()); - // TODO - re-enable if we can control the freetype/cairo versions used - // https://github.com/mapnik/mapnik/issues/1868 - //BOOST_TEST(compare_images(actual_cairo,expected_cairo)); -#endif - // TODO - test grid_renderer - - } catch (std::exception const& ex) { - std::clog << ex.what() << "\n"; - } - if (!::boost::detail::test_errors()) { - if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; - else std::clog << "C++ Map Request rendering hook: \x1b[1;32m✓ \x1b[0m\n"; - ::boost::detail::report_errors_remind().called_report_errors_function = true; - } else { - return ::boost::report_errors(); - } -} diff --git a/tests/cpp_tests/params_test.cpp b/tests/cpp_tests/params_test.cpp deleted file mode 100644 index 0e83a805e..000000000 --- a/tests/cpp_tests/params_test.cpp +++ /dev/null @@ -1,124 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -namespace detail { - -class string_holder { - public: - string_holder() : - member_("member") {} - std::string const& get_string() const - { - return member_; - } - private: - std::string member_; -}; - -} - -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;i("bool") && *params.get("bool") == true)); - - params["bool"] = "true"; - BOOST_TEST( (params.get("bool") && *params.get("bool") == true)); - - params["bool"] = mapnik::value_integer(1); - BOOST_TEST( (params.get("bool") && *params.get("bool") == true)); - - params["bool"] = "1"; - BOOST_TEST( (params.get("bool") && *params.get("bool") == true)); - - params["bool"] = "True"; - BOOST_TEST( (params.get("bool") && *params.get("bool") == true)); - - params["bool"] = "on"; - BOOST_TEST( (params.get("bool") && *params.get("bool") == true)); - - params["bool"] = "yes"; - BOOST_TEST( (params.get("bool") && *params.get("bool") == true)); - - // false - params["bool"] = mapnik::value_integer(false); - BOOST_TEST( (params.get("bool") && *params.get("bool") == false) ); - - params["bool"] = "false"; - BOOST_TEST( (params.get("bool") && *params.get("bool") == false) ); - - params["bool"] = mapnik::value_integer(0); - BOOST_TEST( (params.get("bool") && *params.get("bool") == false)); - - params["bool"] = "0"; - BOOST_TEST( (params.get("bool") && *params.get("bool") == false)); - - params["bool"] = "False"; - BOOST_TEST( (params.get("bool") && *params.get("bool") == false)); - - params["bool"] = "off"; - BOOST_TEST( (params.get("bool") && *params.get("bool") == false)); - - params["bool"] = "no"; - BOOST_TEST( (params.get("bool") && *params.get("bool") == false)); - - // strings - params["string"] = "hello"; - BOOST_TEST( (params.get("string") && *params.get("string") == "hello") ); - - // int - params["int"] = mapnik::value_integer(1); - BOOST_TEST( (params.get("int") && *params.get("int") == 1) ); - - // double - params["double"] = 1.5; - BOOST_TEST( (params.get("double") && *params.get("double") == 1.5) ); - - // value_null - params["null"] = mapnik::value_null(); - // https://github.com/mapnik/mapnik/issues/2471 - //BOOST_TEST( (params.get("null") && *params.get("null") == mapnik::value_null()) ); - - std::string value("value"); - params["value"] = value; - BOOST_TEST(params.get("value") == std::string("value")); - BOOST_TEST(value == std::string("value")); - - // ensure that const member is not moved incorrectly when added to params - detail::string_holder holder; - std::string const& holder_member = holder.get_string(); - params["member"] = holder_member; - BOOST_TEST(params.get("member") == std::string("member")); - BOOST_TEST(holder_member == std::string("member")); - } - catch (std::exception const& ex) - { - std::cerr << ex.what() << "\n"; - BOOST_TEST(false); - } - - if (!::boost::detail::test_errors()) { - if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; - else std::clog << "C++ parameters: \x1b[1;32m✓ \x1b[0m\n"; - ::boost::detail::report_errors_remind().called_report_errors_function = true; - } else { - return ::boost::report_errors(); - } -} diff --git a/tests/cpp_tests/run b/tests/cpp_tests/run deleted file mode 100755 index 34a15fc40..000000000 --- a/tests/cpp_tests/run +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -cd "$( dirname "${BASH_SOURCE[0]}" )" -cd ../../ -source ./localize.sh - -failures=0 -if [ -n "$(find tests/cpp_tests/ -maxdepth 1 -name '*-bin' -print -quit)" ]; then - for FILE in tests/cpp_tests/*-bin; do - ${FILE} -q -d .; - failures=$((failures+$?)) - done - echo -else - echo 'warning: no c++ tests found' -fi -exit $failures - diff --git a/tests/cpp_tests/support/map-request-marker-text-line-expected-cairo.png b/tests/cpp_tests/support/map-request-marker-text-line-expected-cairo.png deleted file mode 100644 index cb8e47826..000000000 Binary files a/tests/cpp_tests/support/map-request-marker-text-line-expected-cairo.png and /dev/null differ diff --git a/tests/cpp_tests/support/map-request-marker-text-line-expected.png b/tests/cpp_tests/support/map-request-marker-text-line-expected.png deleted file mode 100644 index 9de752a29..000000000 Binary files a/tests/cpp_tests/support/map-request-marker-text-line-expected.png and /dev/null differ diff --git a/tests/cpp_tests/symbolizer_test.cpp b/tests/cpp_tests/symbolizer_test.cpp deleted file mode 100644 index c6877ac57..000000000 --- a/tests/cpp_tests/symbolizer_test.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include -#include -#include -#include -#include - -using namespace mapnik; - -int main(int argc, char** argv) -{ - std::vector args; - for (int i=1;i(1)); - marker_multi_policy_enum policy_out = get(sym, keys::markers_multipolicy); - BOOST_TEST_EQ(policy_out,MARKER_WHOLE_MULTI); - } - catch (std::exception const & ex) - { - std::clog << ex.what() << std::endl; - BOOST_TEST(false); - } - - if (!::boost::detail::test_errors()) { - if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; - else std::clog << "C++ symbolizer test: \x1b[1;32m✓ \x1b[0m\n"; - ::boost::detail::report_errors_remind().called_report_errors_function = true; - } else { - return ::boost::report_errors(); - } -} diff --git a/tests/cpp_tests/utils.hpp b/tests/cpp_tests/utils.hpp deleted file mode 100644 index e82281635..000000000 --- a/tests/cpp_tests/utils.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include -#include -#include -#include - -inline static bool set_working_dir(std::vector args) -{ - std::vector::iterator itr = std::find(args.begin(), args.end(), "-d"); - if (itr!=args.end()) - { - unsigned dist = std::distance(args.begin(),itr); - if (args.size() > dist+1) - { - std::string chdir = args.at(dist+1); - bool exists = mapnik::util::exists( chdir ); - if (exists) - { - boost::filesystem::current_path(chdir); - return true; - } - } - return false; - } - return true; -} \ No newline at end of file diff --git a/tests/cxx/README.md b/tests/cxx/README.md deleted file mode 100644 index 273cade25..000000000 --- a/tests/cxx/README.md +++ /dev/null @@ -1,11 +0,0 @@ - -Catch C++ tests - -### Building - - python scons/scons.py tests/cxx/run - - -### Running - - ./tests/cxx/run \ No newline at end of file diff --git a/tests/cxx/build.py b/tests/cxx/build.py deleted file mode 100644 index 6626f03c4..000000000 --- a/tests/cxx/build.py +++ /dev/null @@ -1,32 +0,0 @@ -import os -import glob -from copy import copy - -Import ('env') - -test_env = env.Clone() - -if not env['CPP_TESTS']: - for cpp_test_bin in glob.glob('*-bin'): - os.unlink(cpp_test_bin) -else: - test_env['LIBS'] = [env['MAPNIK_NAME']] - test_env.AppendUnique(LIBS=copy(env['LIBMAPNIK_LIBS'])) - test_env.AppendUnique(LIBS='mapnik-wkt') - test_env.AppendUnique(LIBS='mapnik-json') - if env['RUNTIME_LINK'] == 'static' and env['PLATFORM'] == 'Linux': - test_env.AppendUnique(LIBS='dl') - test_env.AppendUnique(CXXFLAGS='-g') - test_env['CXXFLAGS'] = copy(test_env['LIBMAPNIK_CXXFLAGS']) - test_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES']) - if test_env['HAS_CAIRO']: - test_env.PrependUnique(CPPPATH=test_env['CAIRO_CPPPATHS']) - test_env.Append(CPPDEFINES = '-DHAVE_CAIRO') - test_env_local = test_env.Clone() - test_program = test_env_local.Program("run", source=glob.glob('*.cpp')) - Depends(test_program, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME'])) - Depends(test_program, env.subst('../../src/json/libmapnik-json${LIBSUFFIX}')) - Depends(test_program, env.subst('../../src/wkt/libmapnik-wkt${LIBSUFFIX}')) - # build locally if installing - if 'install' in COMMAND_LINE_TARGETS: - env.Alias('install',test_program) diff --git a/tests/cxx/test_main.cpp b/tests/cxx/test_main.cpp deleted file mode 100644 index 063e87874..000000000 --- a/tests/cxx/test_main.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#define CATCH_CONFIG_MAIN -#include "catch.hpp" \ No newline at end of file diff --git a/tests/cxx/valgrind.supp b/tests/cxx/valgrind.supp deleted file mode 100644 index 2f6d70bd7..000000000 --- a/tests/cxx/valgrind.supp +++ /dev/null @@ -1,31 +0,0 @@ -{ - dl_error1 - Memcheck:Cond - fun:index - fun:expand_dynamic_string_token - fun:fillin_rpath - fun:_dl_init_paths - fun:dl_main - fun:_dl_sysdep_start - fun:_dl_start -} -{ - dl_error2 - Memcheck:Cond - fun:index - fun:expand_dynamic_string_token - fun:_dl_map_object - fun:map_doit - fun:_dl_catch_error - fun:do_preload - fun:dl_main - fun:_dl_sysdep_start - fun:_dl_start -} -{ - tmpfile - Memcheck:Leak - fun:malloc - fun:fdopen@@GLIBC_* - fun:tmpfile@@GLIBC_* -} diff --git a/tests/data/broken_maps/amenity.xml b/tests/data/broken_maps/amenity.xml deleted file mode 100644 index 450f29dbe..000000000 --- a/tests/data/broken_maps/amenity.xml +++ /dev/null @@ -1,85 +0,0 @@ - \ No newline at end of file diff --git a/tests/data/broken_maps/bgcolor_broken.xml b/tests/data/broken_maps/bgcolor_broken.xml deleted file mode 100644 index ea93683f1..000000000 --- a/tests/data/broken_maps/bgcolor_broken.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/tests/data/broken_maps/bool_value_broken.xml b/tests/data/broken_maps/bool_value_broken.xml deleted file mode 100644 index c17b8c2b3..000000000 --- a/tests/data/broken_maps/bool_value_broken.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/css_value_broken.xml b/tests/data/broken_maps/css_value_broken.xml deleted file mode 100644 index 2926b15f7..000000000 --- a/tests/data/broken_maps/css_value_broken.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/datasource_type_broken.xml b/tests/data/broken_maps/datasource_type_broken.xml deleted file mode 100644 index 7d1a1a521..000000000 --- a/tests/data/broken_maps/datasource_type_broken.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - foobar_db - some_one - SECRET - gis - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/datasource_type_missing.xml b/tests/data/broken_maps/datasource_type_missing.xml deleted file mode 100644 index 3aeef3e94..000000000 --- a/tests/data/broken_maps/datasource_type_missing.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - some_one - SECRET - gis - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/db_host_broken.xml b/tests/data/broken_maps/db_host_broken.xml deleted file mode 100644 index 551c2184f..000000000 --- a/tests/data/broken_maps/db_host_broken.xml +++ /dev/null @@ -1,15 +0,0 @@ - - -]> - - - - postgis - /no/socket/here - SECRET - gis - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/db_user_broken.xml b/tests/data/broken_maps/db_user_broken.xml deleted file mode 100644 index b46733052..000000000 --- a/tests/data/broken_maps/db_user_broken.xml +++ /dev/null @@ -1,15 +0,0 @@ - - -]> - - - - postgis - foobar - SECRET - gis - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/empty_stylename.xml b/tests/data/broken_maps/empty_stylename.xml deleted file mode 100755 index 1620849e9..000000000 --- a/tests/data/broken_maps/empty_stylename.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/tests/data/broken_maps/expression_broken.xml b/tests/data/broken_maps/expression_broken.xml deleted file mode 100644 index b8f88c6b8..000000000 --- a/tests/data/broken_maps/expression_broken.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/font_name_broken.xml b/tests/data/broken_maps/font_name_broken.xml deleted file mode 100644 index b803fe018..000000000 --- a/tests/data/broken_maps/font_name_broken.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/in_valid_whitespace.xml b/tests/data/broken_maps/in_valid_whitespace.xml deleted file mode 100644 index 6ce5452b6..000000000 --- a/tests/data/broken_maps/in_valid_whitespace.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/invalid-scale-hsla-filter.xml b/tests/data/broken_maps/invalid-scale-hsla-filter.xml deleted file mode 100644 index fec9d9eb0..000000000 --- a/tests/data/broken_maps/invalid-scale-hsla-filter.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - \ No newline at end of file diff --git a/tests/data/broken_maps/invalid_layer_srs.xml b/tests/data/broken_maps/invalid_layer_srs.xml deleted file mode 100644 index 2fbc25fc8..000000000 --- a/tests/data/broken_maps/invalid_layer_srs.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/tests/data/broken_maps/invalid_map_srs.xml b/tests/data/broken_maps/invalid_map_srs.xml deleted file mode 100644 index 16dbf335d..000000000 --- a/tests/data/broken_maps/invalid_map_srs.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/tests/data/broken_maps/line_cap_style_broken.xml b/tests/data/broken_maps/line_cap_style_broken.xml deleted file mode 100644 index 0867233a9..000000000 --- a/tests/data/broken_maps/line_cap_style_broken.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/line_join_style_broken.xml b/tests/data/broken_maps/line_join_style_broken.xml deleted file mode 100644 index 281b835e6..000000000 --- a/tests/data/broken_maps/line_join_style_broken.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/mapnik_min_version.xml b/tests/data/broken_maps/mapnik_min_version.xml deleted file mode 100644 index 877603dfe..000000000 --- a/tests/data/broken_maps/mapnik_min_version.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/tests/data/broken_maps/max_scale_denom_broken.xml b/tests/data/broken_maps/max_scale_denom_broken.xml deleted file mode 100644 index 441cfd143..000000000 --- a/tests/data/broken_maps/max_scale_denom_broken.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/min_scale_denom_broken.xml b/tests/data/broken_maps/min_scale_denom_broken.xml deleted file mode 100644 index 0604f7f53..000000000 --- a/tests/data/broken_maps/min_scale_denom_broken.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/missing_fontset.xml b/tests/data/broken_maps/missing_fontset.xml deleted file mode 100644 index f36337d77..000000000 --- a/tests/data/broken_maps/missing_fontset.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/data/broken_maps/polygon_pattern_symbolizer_broken.xml b/tests/data/broken_maps/polygon_pattern_symbolizer_broken.xml deleted file mode 100644 index 070b7bc89..000000000 --- a/tests/data/broken_maps/polygon_pattern_symbolizer_broken.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/shield_symbolizer_broken.xml b/tests/data/broken_maps/shield_symbolizer_broken.xml deleted file mode 100644 index 2df840e51..000000000 --- a/tests/data/broken_maps/shield_symbolizer_broken.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/stroke_dasharray_broken.xml b/tests/data/broken_maps/stroke_dasharray_broken.xml deleted file mode 100644 index 770015a77..000000000 --- a/tests/data/broken_maps/stroke_dasharray_broken.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/tests/data/broken_maps/style_name_missing.xml b/tests/data/broken_maps/style_name_missing.xml deleted file mode 100644 index 5e9392f01..000000000 --- a/tests/data/broken_maps/style_name_missing.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/broken_maps/xml_tag_mismatch.xml b/tests/data/broken_maps/xml_tag_mismatch.xml deleted file mode 100644 index c203cdd2d..000000000 --- a/tests/data/broken_maps/xml_tag_mismatch.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - \ No newline at end of file diff --git a/tests/data/fonts/DejaVuSansMono-BoldOblique.ttf b/tests/data/fonts/DejaVuSansMono-BoldOblique.ttf deleted file mode 100644 index 5e2ee0339..000000000 Binary files a/tests/data/fonts/DejaVuSansMono-BoldOblique.ttf and /dev/null differ diff --git a/tests/data/fonts/LICENCE.txt b/tests/data/fonts/LICENCE.txt deleted file mode 100644 index 8850d836d..000000000 --- a/tests/data/fonts/LICENCE.txt +++ /dev/null @@ -1,3 +0,0 @@ -XB Fonts.ttf from http://wiki.irmug.org/index.php/X_Series_2 - -NotoSans-Regular.tcc is Apache License Version 2.0: https://code.google.com/p/noto/source/browse/LICENSE \ No newline at end of file diff --git a/tests/data/fonts/NotoSans-Regular.ttc b/tests/data/fonts/NotoSans-Regular.ttc deleted file mode 100644 index 5939684eb..000000000 Binary files a/tests/data/fonts/NotoSans-Regular.ttc and /dev/null differ diff --git a/tests/data/fonts/XB Zar.ttf b/tests/data/fonts/XB Zar.ttf deleted file mode 100644 index 7a168b6ee..000000000 Binary files a/tests/data/fonts/XB Zar.ttf and /dev/null differ diff --git a/tests/data/fonts/fake.ttf b/tests/data/fonts/fake.ttf deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/data/fonts/intentionally-broken.ttf b/tests/data/fonts/intentionally-broken.ttf deleted file mode 100644 index 887230d76..000000000 Binary files a/tests/data/fonts/intentionally-broken.ttf and /dev/null differ diff --git a/tests/data/good_maps/agg_poly_gamma_map.xml b/tests/data/good_maps/agg_poly_gamma_map.xml deleted file mode 100644 index e7089ca5e..000000000 --- a/tests/data/good_maps/agg_poly_gamma_map.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - style - - ../../data/shp/world_merc - shape - - - \ No newline at end of file diff --git a/tests/data/good_maps/agg_stack_blur.xml b/tests/data/good_maps/agg_stack_blur.xml deleted file mode 100644 index a8511c794..000000000 --- a/tests/data/good_maps/agg_stack_blur.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - style - style2 - - ../../data/shp/world_merc - shape - - - \ No newline at end of file diff --git a/tests/data/good_maps/also_and_else_filter.xml b/tests/data/good_maps/also_and_else_filter.xml deleted file mode 100644 index 0616e3d2a..000000000 --- a/tests/data/good_maps/also_and_else_filter.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - diff --git a/tests/data/good_maps/background-image.xml b/tests/data/good_maps/background-image.xml deleted file mode 100644 index 1b09e01f5..000000000 --- a/tests/data/good_maps/background-image.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/tests/data/good_maps/bool_values.xml b/tests/data/good_maps/bool_values.xml deleted file mode 100644 index 5e4742dba..000000000 --- a/tests/data/good_maps/bool_values.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/tests/data/good_maps/bounds_clipping.xml b/tests/data/good_maps/bounds_clipping.xml deleted file mode 100644 index f6434f67d..000000000 --- a/tests/data/good_maps/bounds_clipping.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - style - - shape - ../shp/world_merc2.shp - - - - \ No newline at end of file diff --git a/tests/data/good_maps/building_symbolizer.xml b/tests/data/good_maps/building_symbolizer.xml deleted file mode 100644 index 85abf178e..000000000 --- a/tests/data/good_maps/building_symbolizer.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - test - - shape - ../../data/shp/poly.shp - - - - \ No newline at end of file diff --git a/tests/data/good_maps/datasource.xml b/tests/data/good_maps/datasource.xml deleted file mode 100644 index 87c705734..000000000 --- a/tests/data/good_maps/datasource.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - shape - ../../data/shp/ - - - - test - - poly.shp - - - - \ No newline at end of file diff --git a/tests/data/good_maps/empty_parameter1.xml b/tests/data/good_maps/empty_parameter1.xml deleted file mode 100755 index eb52e65dc..000000000 --- a/tests/data/good_maps/empty_parameter1.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - csv - - x,y - 0,0 - - - - - diff --git a/tests/data/good_maps/empty_parameter2.xml b/tests/data/good_maps/empty_parameter2.xml deleted file mode 100755 index e9203e7e2..000000000 --- a/tests/data/good_maps/empty_parameter2.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - csv - - x,y - 0,0 - - - - - diff --git a/tests/data/good_maps/empty_parameter3.xml b/tests/data/good_maps/empty_parameter3.xml deleted file mode 100755 index eb52e65dc..000000000 --- a/tests/data/good_maps/empty_parameter3.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - csv - - x,y - 0,0 - - - - - diff --git a/tests/data/good_maps/empty_parameter4.xml b/tests/data/good_maps/empty_parameter4.xml deleted file mode 100755 index 5f31b8520..000000000 --- a/tests/data/good_maps/empty_parameter4.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - csv - - x,y - 0,0 - - - - - diff --git a/tests/data/good_maps/empty_parameter5.xml b/tests/data/good_maps/empty_parameter5.xml deleted file mode 100755 index 7dc9078cc..000000000 --- a/tests/data/good_maps/empty_parameter5.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - csv - - x,y - 0,0 - - '' - - - diff --git a/tests/data/good_maps/empty_text_symbolizer.xml b/tests/data/good_maps/empty_text_symbolizer.xml deleted file mode 100644 index 1582583ee..000000000 --- a/tests/data/good_maps/empty_text_symbolizer.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - labels - - - \ No newline at end of file diff --git a/tests/data/good_maps/extra_arbitary_map_parameters.xml b/tests/data/good_maps/extra_arbitary_map_parameters.xml deleted file mode 100644 index d10979ff1..000000000 --- a/tests/data/good_maps/extra_arbitary_map_parameters.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/data/good_maps/extra_known_map_attributes.xml b/tests/data/good_maps/extra_known_map_attributes.xml deleted file mode 100644 index 0c88449a8..000000000 --- a/tests/data/good_maps/extra_known_map_attributes.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - \ No newline at end of file diff --git a/tests/data/good_maps/filesource.xml b/tests/data/good_maps/filesource.xml deleted file mode 100644 index ec8b9c273..000000000 --- a/tests/data/good_maps/filesource.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - ../images/ - - - - - test - - shape - ../../data/shp/ - poly.shp - - - - \ No newline at end of file diff --git a/tests/data/good_maps/fontset.xml b/tests/data/good_maps/fontset.xml deleted file mode 100644 index 80ab2cd60..000000000 --- a/tests/data/good_maps/fontset.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/tests/data/good_maps/frame.xml b/tests/data/good_maps/frame.xml deleted file mode 100644 index 29e3626a9..000000000 --- a/tests/data/good_maps/frame.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - \ No newline at end of file diff --git a/tests/data/good_maps/geometry-transform.xml b/tests/data/good_maps/geometry-transform.xml deleted file mode 100644 index c5872fe2f..000000000 --- a/tests/data/good_maps/geometry-transform.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - style - base - - ../../data/shp/world_merc - shape - - - \ No newline at end of file diff --git a/tests/data/good_maps/interior_point.xml b/tests/data/good_maps/interior_point.xml deleted file mode 100644 index bfc03980f..000000000 --- a/tests/data/good_maps/interior_point.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - multipolygon_style - - sqlite - ../sqlite/qgis_spatiallite.sqlite - multipolygon - - - \ No newline at end of file diff --git a/tests/data/good_maps/layer_buffer_size_reduction.xml b/tests/data/good_maps/layer_buffer_size_reduction.xml deleted file mode 100644 index a6f93fd76..000000000 --- a/tests/data/good_maps/layer_buffer_size_reduction.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - point_style - - sqlite - ../sqlite/qgis_spatiallite.sqlite - point - - - - diff --git a/tests/data/good_maps/line_symbolizer.xml b/tests/data/good_maps/line_symbolizer.xml deleted file mode 100644 index 7a4944aea..000000000 --- a/tests/data/good_maps/line_symbolizer.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - test - - shape - ../../data/shp/poly.shp - - - - \ No newline at end of file diff --git a/tests/data/good_maps/line_symbolizer2.xml b/tests/data/good_maps/line_symbolizer2.xml deleted file mode 100644 index fbcdd0b4e..000000000 --- a/tests/data/good_maps/line_symbolizer2.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - sqlite - ../sqlite/qgis_spatiallite.sqlite - - - - - - polygon_style - - multipolygon - - - - - - - line_style - - lines - - - - \ No newline at end of file diff --git a/tests/data/good_maps/line_symbolizer_offset.xml b/tests/data/good_maps/line_symbolizer_offset.xml deleted file mode 100644 index c796add74..000000000 --- a/tests/data/good_maps/line_symbolizer_offset.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - style - - csv - - wkt,name - "MULTILINESTRING ((10 10, 20 20, 10 40),(40 40, 30 30, 40 20, 30 10))",line - - - - \ No newline at end of file diff --git a/tests/data/good_maps/marker-text-line.xml b/tests/data/good_maps/marker-text-line.xml deleted file mode 100644 index 776a87341..000000000 --- a/tests/data/good_maps/marker-text-line.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - ellipse - - csv - -x,y -2.5,2.5 - - - - - - line - - csv - -wkt -"LINESTRING(0 0, 2.5 2.5, 5 5)" -"LINESTRING(0 5, 2.5 2.5, 5 0)" - - - - - - text - - csv - -x,y -2,2.5 -3,2.5 - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - \ No newline at end of file diff --git a/tests/data/good_maps/marker_ellipse_transform.xml b/tests/data/good_maps/marker_ellipse_transform.xml deleted file mode 100644 index a5c7ffeac..000000000 --- a/tests/data/good_maps/marker_ellipse_transform.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - ellipse - - csv - -x,y -2.5,2.5 - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - \ No newline at end of file diff --git a/tests/data/good_maps/marker_ellipse_transform2.xml b/tests/data/good_maps/marker_ellipse_transform2.xml deleted file mode 100644 index 5449009a5..000000000 --- a/tests/data/good_maps/marker_ellipse_transform2.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - ellipse - - csv - -x,y -2.5,2.5 - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - \ No newline at end of file diff --git a/tests/data/good_maps/markers_symbolizer_lines.xml b/tests/data/good_maps/markers_symbolizer_lines.xml deleted file mode 100644 index 6cfc5ad46..000000000 --- a/tests/data/good_maps/markers_symbolizer_lines.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - 1 - - sqlite - ../sqlite/qgis_spatiallite.sqlite - lines - - - - \ No newline at end of file diff --git a/tests/data/good_maps/markers_symbolizer_lines_file.xml b/tests/data/good_maps/markers_symbolizer_lines_file.xml deleted file mode 100644 index 1df88426a..000000000 --- a/tests/data/good_maps/markers_symbolizer_lines_file.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - 1 - - sqlite - ../sqlite/qgis_spatiallite.sqlite - lines - - - - \ No newline at end of file diff --git a/tests/data/good_maps/markers_symbolizer_points.xml b/tests/data/good_maps/markers_symbolizer_points.xml deleted file mode 100644 index 2984cc387..000000000 --- a/tests/data/good_maps/markers_symbolizer_points.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 1 - - sqlite - ../sqlite/qgis_spatiallite.sqlite - point - - - \ No newline at end of file diff --git a/tests/data/good_maps/markers_symbolizer_points_file.xml b/tests/data/good_maps/markers_symbolizer_points_file.xml deleted file mode 100644 index d4b63a98a..000000000 --- a/tests/data/good_maps/markers_symbolizer_points_file.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - 1 - - sqlite - ../sqlite/qgis_spatiallite.sqlite - point - - - \ No newline at end of file diff --git a/tests/data/good_maps/markers_symbolizer_points_gradient.xml b/tests/data/good_maps/markers_symbolizer_points_gradient.xml deleted file mode 100644 index 06ca8183c..000000000 --- a/tests/data/good_maps/markers_symbolizer_points_gradient.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - 1 - - sqlite - ../sqlite/qgis_spatiallite.sqlite - point - spatialite - - - \ No newline at end of file diff --git a/tests/data/good_maps/markers_symbolizer_points_stacked.xml b/tests/data/good_maps/markers_symbolizer_points_stacked.xml deleted file mode 100644 index 10c71a0bf..000000000 --- a/tests/data/good_maps/markers_symbolizer_points_stacked.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - 1 - - sqlite - ../sqlite/qgis_spatiallite.sqlite - point - - - \ No newline at end of file diff --git a/tests/data/good_maps/merc2wgs84_reprojection.xml b/tests/data/good_maps/merc2wgs84_reprojection.xml deleted file mode 100644 index 161932e89..000000000 --- a/tests/data/good_maps/merc2wgs84_reprojection.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - My Style - - shape - ../shp/world_merc.shp - - - \ No newline at end of file diff --git a/tests/data/good_maps/osm-styles.xml b/tests/data/good_maps/osm-styles.xml deleted file mode 100644 index 49f8a70cd..000000000 --- a/tests/data/good_maps/osm-styles.xml +++ /dev/null @@ -1,752 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/data/good_maps/osm_nodes_ways.xml b/tests/data/good_maps/osm_nodes_ways.xml deleted file mode 100644 index 814396aa2..000000000 --- a/tests/data/good_maps/osm_nodes_ways.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - red - - osm - ../osm/ways.osm - - - - - green - - osm - ../osm/nodes.osm - - - - - \ No newline at end of file diff --git a/tests/data/good_maps/path_expression.xml b/tests/data/good_maps/path_expression.xml deleted file mode 100644 index a1c825aef..000000000 --- a/tests/data/good_maps/path_expression.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - test - - - x,y,path1,path2,filename - 0,0,data,images,dummy.png - 1,1,data,images,dummy.png - - csv - - - \ No newline at end of file diff --git a/tests/data/good_maps/point_csv.xml b/tests/data/good_maps/point_csv.xml deleted file mode 100644 index 7949a7b1b..000000000 --- a/tests/data/good_maps/point_csv.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - 1 - - ../vrt/points.vrt - 0 - ogr - - - - \ No newline at end of file diff --git a/tests/data/good_maps/point_json.xml b/tests/data/good_maps/point_json.xml deleted file mode 100644 index aa2efd141..000000000 --- a/tests/data/good_maps/point_json.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - 1 - - ../json/points.geojson - 0 - ogr - - - - \ No newline at end of file diff --git a/tests/data/good_maps/point_json_inline.xml b/tests/data/good_maps/point_json_inline.xml deleted file mode 100644 index add0547f1..000000000 --- a/tests/data/good_maps/point_json_inline.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 1 - - - - { - - "type": "FeatureCollection", - - /* comment */ - - "features": [ - - { "type": "Feature", - - "properties": { "x": 0, "y": 0, "label": "0,0" }, - "geometry" : { "type": "Point", "coordinates": [ 0, 0 ] } - }, - { "type": "Feature", - - "properties": { "x": 5, "y": 5, "label": "5,5" }, - "geometry" : { "type": "Point", "coordinates": [ 5, 5 ] } - }, - { "type": "Feature", - - "properties": { "x": 0, "y": 0, "label": "0,5" }, - "geometry" : { "type": "Point", "coordinates": [ 0, 5 ] } - }, - { "type": "Feature", - - "properties": { "x": 5, "y": 0, "label": "5,0" }, - "geometry" : { "type": "Point", "coordinates": [ 5, 0 ] } - }, - { "type": "Feature", - - "properties": { "x": 2.5, "y": 2.5, "label": "2.5,2.5" }, - "geometry" : { "type": "Point", "coordinates": [ 2.5, 2.5 ] } - }, - - ] - } - - - GeoJson - 0 - ogr - - - - \ No newline at end of file diff --git a/tests/data/good_maps/point_symbolizer.xml b/tests/data/good_maps/point_symbolizer.xml deleted file mode 100644 index 438c391b6..000000000 --- a/tests/data/good_maps/point_symbolizer.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1 - - sqlite - ../sqlite/qgis_spatiallite.sqlite - point - - - - \ No newline at end of file diff --git a/tests/data/good_maps/point_symbolizer_ignore_placements.xml b/tests/data/good_maps/point_symbolizer_ignore_placements.xml deleted file mode 100644 index b56ebfe99..000000000 --- a/tests/data/good_maps/point_symbolizer_ignore_placements.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - 1 - - sqlite - ../sqlite/qgis_spatiallite.sqlite - point - - - - \ No newline at end of file diff --git a/tests/data/good_maps/point_symbolizer_on_polygon_map.xml b/tests/data/good_maps/point_symbolizer_on_polygon_map.xml deleted file mode 100644 index 901418ddc..000000000 --- a/tests/data/good_maps/point_symbolizer_on_polygon_map.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - test - - ../../data/shp/world_merc - shape - - - \ No newline at end of file diff --git a/tests/data/good_maps/polygon_pattern_seamless.xml b/tests/data/good_maps/polygon_pattern_seamless.xml deleted file mode 100644 index f026f2eda..000000000 --- a/tests/data/good_maps/polygon_pattern_seamless.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - style - - ../../data/shp/world_merc - shape - - - \ No newline at end of file diff --git a/tests/data/good_maps/polygon_pattern_symbolizer.xml b/tests/data/good_maps/polygon_pattern_symbolizer.xml deleted file mode 100644 index d755c926c..000000000 --- a/tests/data/good_maps/polygon_pattern_symbolizer.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - ../images/ - - - - - 1 - - shape - ../../data/shp/ - poly.shp - - - - \ No newline at end of file diff --git a/tests/data/good_maps/polygon_symbolizer.xml b/tests/data/good_maps/polygon_symbolizer.xml deleted file mode 100644 index 4fcf9fc9c..000000000 --- a/tests/data/good_maps/polygon_symbolizer.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - ../images/ - - - - - test - - shape - ../../data/shp/ - poly.shp - - - - \ No newline at end of file diff --git a/tests/data/good_maps/rtl_text_map.xml b/tests/data/good_maps/rtl_text_map.xml deleted file mode 100644 index 22da9eb96..000000000 --- a/tests/data/good_maps/rtl_text_map.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - custom_font - - ../shp/farsi-labels - shape - - - - \ No newline at end of file diff --git a/tests/data/good_maps/shield_symbolizer.xml b/tests/data/good_maps/shield_symbolizer.xml deleted file mode 100644 index 716875c24..000000000 --- a/tests/data/good_maps/shield_symbolizer.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - 2 - - ../json/lines.geojson - 0 - ogr - - - - - 1 - - ../json/points.geojson - 0 - ogr - - - - diff --git a/tests/data/good_maps/sqlite.xml b/tests/data/good_maps/sqlite.xml deleted file mode 100644 index 014506998..000000000 --- a/tests/data/good_maps/sqlite.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - world_borders_style1 - world_borders_style2 - - sqlite - ../sqlite/world.sqlite - world_merc - - - - - - - - point_style - - sqlite - ../sqlite/qgis_spatiallite.sqlite - point - - - \ No newline at end of file diff --git a/tests/data/good_maps/sqlite_attachdb.xml b/tests/data/good_maps/sqlite_attachdb.xml deleted file mode 100644 index 0fbb74466..000000000 --- a/tests/data/good_maps/sqlite_attachdb.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - world - - sqlite - ../sqlite/world.sqlite - - true - - - OGC_FID - - (SELECT *,world_merc.rowid FROM world_merc INNER JOIN business ON business.ISO3 = world_merc.iso3) as s - - - business@business.sqlite - - - - - diff --git a/tests/data/good_maps/style_level_comp_op.xml b/tests/data/good_maps/style_level_comp_op.xml deleted file mode 100644 index fa4a0fe87..000000000 --- a/tests/data/good_maps/style_level_comp_op.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - land - - shape - ../shp/new_zealand/ne_50m_land.shp - - - - - markers - - shape - ../shp/new_zealand/ne_50m_populated_places_simple.shp - - - - diff --git a/tests/data/good_maps/style_level_image_filter.xml b/tests/data/good_maps/style_level_image_filter.xml deleted file mode 100644 index 32d58876f..000000000 --- a/tests/data/good_maps/style_level_image_filter.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - land - - shape - ../shp/new_zealand/ne_50m_land.shp - - - - - markers - labels - - shape - ../shp/new_zealand/ne_50m_populated_places_simple.shp - - - - diff --git a/tests/data/good_maps/style_level_opacity_and_blur.xml b/tests/data/good_maps/style_level_opacity_and_blur.xml deleted file mode 100644 index e369db503..000000000 --- a/tests/data/good_maps/style_level_opacity_and_blur.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - style - style2 - - ../shp/world_merc - shape - - - \ No newline at end of file diff --git a/tests/data/good_maps/text-placement-type-dummy.xml b/tests/data/good_maps/text-placement-type-dummy.xml deleted file mode 100644 index 9b4379969..000000000 --- a/tests/data/good_maps/text-placement-type-dummy.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/tests/data/good_maps/text_breaks.xml b/tests/data/good_maps/text_breaks.xml deleted file mode 100644 index 525235877..000000000 --- a/tests/data/good_maps/text_breaks.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1 - - - - { - - "type": "FeatureCollection", - - /* comment */ - - "features": [ - - { "type": "Feature", - - "properties": { "x": 0, "y": 0, "label": "0\n0" }, - "geometry" : { "type": "Point", "coordinates": [ 0, 0 ] } - }, - { "type": "Feature", - - "properties": { "x": 5, "y": 5, "label": "5\n5" }, - "geometry" : { "type": "Point", "coordinates": [ 5, 5 ] } - }, - { "type": "Feature", - - "properties": { "x": 0, "y": 0, "label": "0,5" }, - "geometry" : { "type": "Point", "coordinates": [ 0, 5 ] } - }, - { "type": "Feature", - - "properties": { "x": 5, "y": 0, "label": "5,0" }, - "geometry" : { "type": "Point", "coordinates": [ 5, 0 ] } - }, - { "type": "Feature", - - "properties": { "x": 2.5, "y": 2.5, "label": "center" }, - "geometry" : { "type": "Point", "coordinates": [ 2.5, 2.5 ] } - }, - - ] - } - - - 0 - ogr - - - - \ No newline at end of file diff --git a/tests/data/good_maps/text_halo_and_collision.xml b/tests/data/good_maps/text_halo_and_collision.xml deleted file mode 100644 index 63daf2fbd..000000000 --- a/tests/data/good_maps/text_halo_and_collision.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - labels - - csv - -x,y -2,2 -2,2.3 - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - \ No newline at end of file diff --git a/tests/data/good_maps/text_rotation.xml b/tests/data/good_maps/text_rotation.xml deleted file mode 100644 index 9d0090b7b..000000000 --- a/tests/data/good_maps/text_rotation.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - labels - - sqlite - ../sqlite/qgis_spatiallite.sqlite - geometry - point - - - - \ No newline at end of file diff --git a/tests/data/good_maps/unique_filter_map.xml b/tests/data/good_maps/unique_filter_map.xml deleted file mode 100644 index 796d90c6d..000000000 --- a/tests/data/good_maps/unique_filter_map.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - poly20090929162130952_style - - ../../data/shp/poly.shp - shape - - - diff --git a/tests/data/good_maps/wgs842merc_reprojection.xml b/tests/data/good_maps/wgs842merc_reprojection.xml deleted file mode 100644 index 50075d9f4..000000000 --- a/tests/data/good_maps/wgs842merc_reprojection.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - My Style - - shape - - ../shp/ne_110m_admin_0_countries.shp - - - \ No newline at end of file diff --git a/tests/data/good_maps/whitespace_at_end_of_filter_expression.xml b/tests/data/good_maps/whitespace_at_end_of_filter_expression.xml deleted file mode 100644 index 114e61215..000000000 --- a/tests/data/good_maps/whitespace_at_end_of_filter_expression.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/good_maps/xinclude/layers.xml b/tests/data/good_maps/xinclude/layers.xml deleted file mode 100644 index 83234f06a..000000000 --- a/tests/data/good_maps/xinclude/layers.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - world_borders_style - point_style - - ../../shp/world_merc.shp - shape - - - - \ No newline at end of file diff --git a/tests/data/good_maps/xinclude/layers_with_entities.xml b/tests/data/good_maps/xinclude/layers_with_entities.xml deleted file mode 100644 index 78f91c9a8..000000000 --- a/tests/data/good_maps/xinclude/layers_with_entities.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - world_borders_style - point_style - - ../../shp/world_merc.shp - shape - - - - \ No newline at end of file diff --git a/tests/data/good_maps/xinclude/map.xml b/tests/data/good_maps/xinclude/map.xml deleted file mode 100644 index add6415ac..000000000 --- a/tests/data/good_maps/xinclude/map.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/tests/data/good_maps/xinclude/map_with_entities_and_includes.xml b/tests/data/good_maps/xinclude/map_with_entities_and_includes.xml deleted file mode 100644 index a2d51664a..000000000 --- a/tests/data/good_maps/xinclude/map_with_entities_and_includes.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/tests/data/good_maps/xinclude/styles.xml b/tests/data/good_maps/xinclude/styles.xml deleted file mode 100644 index b970ff6b8..000000000 --- a/tests/data/good_maps/xinclude/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - diff --git a/tests/data/good_maps/xinclude/zoom_scales.xml b/tests/data/good_maps/xinclude/zoom_scales.xml deleted file mode 100644 index 8b0d4397c..000000000 --- a/tests/data/good_maps/xinclude/zoom_scales.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/data/gpx/empty.gpx b/tests/data/gpx/empty.gpx deleted file mode 100644 index dd03718e2..000000000 --- a/tests/data/gpx/empty.gpx +++ /dev/null @@ -1,9 +0,0 @@ - - -Empty GPX - - - 0 - - - \ No newline at end of file diff --git a/tests/data/images/12_654_1580.png b/tests/data/images/12_654_1580.png deleted file mode 100644 index 0f15a353c..000000000 Binary files a/tests/data/images/12_654_1580.png and /dev/null differ diff --git a/tests/data/images/13_4194_2747.png b/tests/data/images/13_4194_2747.png deleted file mode 100644 index 88139204f..000000000 Binary files a/tests/data/images/13_4194_2747.png and /dev/null differ diff --git a/tests/data/images/checker.jpg b/tests/data/images/checker.jpg deleted file mode 100644 index 6d5549e9a..000000000 Binary files a/tests/data/images/checker.jpg and /dev/null differ diff --git a/tests/data/images/crosshair16x16.png b/tests/data/images/crosshair16x16.png deleted file mode 100644 index efbac0e0a..000000000 Binary files a/tests/data/images/crosshair16x16.png and /dev/null differ diff --git a/tests/data/images/dummy.jpeg b/tests/data/images/dummy.jpeg deleted file mode 100644 index 81e1a8095..000000000 Binary files a/tests/data/images/dummy.jpeg and /dev/null differ diff --git a/tests/data/images/dummy.jpg b/tests/data/images/dummy.jpg deleted file mode 100644 index 81e1a8095..000000000 Binary files a/tests/data/images/dummy.jpg and /dev/null differ diff --git a/tests/data/images/dummy.png b/tests/data/images/dummy.png deleted file mode 100644 index 8b8c5fd22..000000000 Binary files a/tests/data/images/dummy.png and /dev/null differ diff --git a/tests/data/images/dummy.tif b/tests/data/images/dummy.tif deleted file mode 100644 index 7c20279e5..000000000 Binary files a/tests/data/images/dummy.tif and /dev/null differ diff --git a/tests/data/images/dummy.tiff b/tests/data/images/dummy.tiff deleted file mode 100644 index 7c20279e5..000000000 Binary files a/tests/data/images/dummy.tiff and /dev/null differ diff --git a/tests/data/images/marker.png b/tests/data/images/marker.png deleted file mode 100644 index 3e3ea2967..000000000 Binary files a/tests/data/images/marker.png and /dev/null differ diff --git a/tests/data/images/stripes_pattern.png b/tests/data/images/stripes_pattern.png deleted file mode 100644 index 08b5098f7..000000000 Binary files a/tests/data/images/stripes_pattern.png and /dev/null differ diff --git a/tests/data/images/xcode-CgBI.png b/tests/data/images/xcode-CgBI.png deleted file mode 100644 index 243d9188a..000000000 Binary files a/tests/data/images/xcode-CgBI.png and /dev/null differ diff --git a/tests/data/images/yellow_half_trans.png b/tests/data/images/yellow_half_trans.png deleted file mode 100644 index 48d7ae399..000000000 Binary files a/tests/data/images/yellow_half_trans.png and /dev/null differ diff --git a/tests/data/json/escaped.geojson b/tests/data/json/escaped.geojson deleted file mode 100644 index 524820af0..000000000 --- a/tests/data/json/escaped.geojson +++ /dev/null @@ -1,30 +0,0 @@ -{ - "type":"FeatureCollection", - "features": - [ - { - "type":"Feature", - "geometry": - { - "type":"Point", - "coordinates": - [ - -81.705583, - 41.480573 - ] - }, - "properties": - { - "name":"Test", - "int":1, - "description":"Test: \u005C", - "spaces":"this has spaces", - "double":1.1, - "boolean":true, - "NOM_FR":"Québec", - "object": {"value":{"type":"\u041c\u0430pni\u043a","array": [3,0,"x"]}}, - "array" : [ [ [1], ["deux"]],[["\u0442\u0440\u0438","four","\u4e94"]]] - } - } - ] -} \ No newline at end of file diff --git a/tests/data/json/escaped.topojson b/tests/data/json/escaped.topojson deleted file mode 100644 index ef9ea07aa..000000000 --- a/tests/data/json/escaped.topojson +++ /dev/null @@ -1,39 +0,0 @@ -{ - "type": "Topology", - "objects": { - "escaped": { - "type": "GeometryCollection", - "geometries": [ - { - "type": "Point", - "properties": { - "name": "Test", - "int": 1, - "description": "Test: \\", - "spaces": "this has spaces", - "double": 1.1, - "boolean": true, - "NOM_FR": "Québec" - }, - "coordinates": [ - 0, - 0 - ] - } - ] - } - }, - "arcs": [ - - ], - "transform": { - "scale": [ - 1, - 1 - ], - "translate": [ - -81.705583, - 41.480573 - ] - } -} diff --git a/tests/data/json/feature_collection_level_properties.json b/tests/data/json/feature_collection_level_properties.json deleted file mode 100644 index 320cfc4eb..000000000 --- a/tests/data/json/feature_collection_level_properties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "FeatureCollection", - "properties": { - "fc_name": "fc_value" - }, - "features": [ - { - "type": "Feature", - "properties": { - "feat_name": "feat_value" - }, - "geometry": { - "type": "Point", - "coordinates": [ -122, 48 ] - } - } - ] -} \ No newline at end of file diff --git a/tests/data/json/lines.geojson b/tests/data/json/lines.geojson deleted file mode 100644 index 34e9bae27..000000000 --- a/tests/data/json/lines.geojson +++ /dev/null @@ -1,19 +0,0 @@ -{ - -"type": "FeatureCollection", - -"features": [ - - { "type": "Feature", - - "properties": { "x": 0, "y": 0, "label": "D" }, - "geometry" : { "type": "LineString", "coordinates": [ [1, 0], [2, 1], [3, 2], [4, 3], [5, 4], [6, 5] ] } - }, - { "type": "Feature", - - "properties": { "x": 2, "y": 0, "label": "V" }, - "geometry" : { "type": "LineString", "coordinates": [ [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [2, 5] ] } - } - -] -} diff --git a/tests/data/json/null_feature.geojson b/tests/data/json/null_feature.geojson deleted file mode 100644 index bf03457b7..000000000 --- a/tests/data/json/null_feature.geojson +++ /dev/null @@ -1,12 +0,0 @@ -{ "type": "FeatureCollection", - "features": [ - { "type": "Feature", - "geometry": {"type": "Point"}, - "properties": {"feat_id": 0} - }, - { "type": "Feature", - "geometry": {"type": "Point", "coordinates":[0,0]}, - "properties": {"feat_id": 1} - } -] -} \ No newline at end of file diff --git a/tests/data/json/points.geojson b/tests/data/json/points.geojson deleted file mode 100644 index 36dc8597c..000000000 --- a/tests/data/json/points.geojson +++ /dev/null @@ -1,34 +0,0 @@ -{ - -"type": "FeatureCollection", - -"features": [ - - { "type": "Feature", - - "properties": { "x": 0, "y": 0, "label": "0,0" }, - "geometry" : { "type": "Point", "coordinates": [ 0, 0 ] } - }, - { "type": "Feature", - - "properties": { "x": 5, "y": 5, "label": "5,5" }, - "geometry" : { "type": "Point", "coordinates": [ 5, 5 ] } - }, - { "type": "Feature", - - "properties": { "x": 0, "y": 5, "label": "0,5" }, - "geometry" : { "type": "Point", "coordinates": [ 0, 5 ] } - }, - { "type": "Feature", - - "properties": { "x": 5, "y": 0, "label": "5,0" }, - "geometry" : { "type": "Point", "coordinates": [ 5, 0 ] } - }, - { "type": "Feature", - - "properties": { "x": 2.5, "y": 2.5, "label": "2.5,2.5" }, - "geometry" : { "type": "Point", "coordinates": [ 2.5, 2.5 ] } - } - -] -} diff --git a/tests/data/osm/64bit.osm b/tests/data/osm/64bit.osm deleted file mode 100644 index 9727d3dd6..000000000 --- a/tests/data/osm/64bit.osm +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/data/osm/nodes.osm b/tests/data/osm/nodes.osm deleted file mode 100644 index ce062313c..000000000 --- a/tests/data/osm/nodes.osm +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/data/osm/t.png b/tests/data/osm/t.png deleted file mode 100644 index 5e6d15177..000000000 Binary files a/tests/data/osm/t.png and /dev/null differ diff --git a/tests/data/osm/ways.osm b/tests/data/osm/ways.osm deleted file mode 100644 index f25b357d2..000000000 --- a/tests/data/osm/ways.osm +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/data/palettes/palette256.act b/tests/data/palettes/palette256.act deleted file mode 100644 index 60ab72c45..000000000 Binary files a/tests/data/palettes/palette256.act and /dev/null differ diff --git a/tests/data/palettes/palette64.act b/tests/data/palettes/palette64.act deleted file mode 100644 index da0c772b3..000000000 Binary files a/tests/data/palettes/palette64.act and /dev/null differ diff --git a/tests/data/pngsuite/PngSuite.LICENSE b/tests/data/pngsuite/PngSuite.LICENSE deleted file mode 100644 index 8d4d1d077..000000000 --- a/tests/data/pngsuite/PngSuite.LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -PngSuite --------- - -Permission to use, copy, modify and distribute these images for any -purpose and without fee is hereby granted. - - -(c) Willem van Schaik, 1996, 2011 - diff --git a/tests/data/pngsuite/PngSuite.README b/tests/data/pngsuite/PngSuite.README deleted file mode 100644 index 3ef8f24db..000000000 --- a/tests/data/pngsuite/PngSuite.README +++ /dev/null @@ -1,25 +0,0 @@ - PNGSUITE ----------------- - - testset for PNG-(de)coders - created by Willem van Schaik ------------------------------------- - -This is a collection of graphics images created to test the png applications -like viewers, converters and editors. All (as far as that is possible) -formats supported by the PNG standard are represented. - -The suite consists of the following files: - -- PngSuite.README - this file -- PngSuite.LICENSE - the PngSuite is freeware -- PngSuite.png - image with PngSuite logo -- PngSuite.tgz - archive of all PNG testfiles -- PngSuite.zip - same in .zip format for PCs - - --------- - (c) Willem van Schaik - willem@schaik.com - Calgary, April 2011 - diff --git a/tests/data/pngsuite/PngSuite.png b/tests/data/pngsuite/PngSuite.png deleted file mode 100644 index 205460d82..000000000 Binary files a/tests/data/pngsuite/PngSuite.png and /dev/null differ diff --git a/tests/data/pngsuite/basi0g01.png b/tests/data/pngsuite/basi0g01.png deleted file mode 100644 index 556fa7270..000000000 Binary files a/tests/data/pngsuite/basi0g01.png and /dev/null differ diff --git a/tests/data/pngsuite/basi0g02.png b/tests/data/pngsuite/basi0g02.png deleted file mode 100644 index ce09821ef..000000000 Binary files a/tests/data/pngsuite/basi0g02.png and /dev/null differ diff --git a/tests/data/pngsuite/basi0g04.png b/tests/data/pngsuite/basi0g04.png deleted file mode 100644 index 3853273f9..000000000 Binary files a/tests/data/pngsuite/basi0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/basi0g08.png b/tests/data/pngsuite/basi0g08.png deleted file mode 100644 index faed8bec4..000000000 Binary files a/tests/data/pngsuite/basi0g08.png and /dev/null differ diff --git a/tests/data/pngsuite/basi0g16.png b/tests/data/pngsuite/basi0g16.png deleted file mode 100644 index a9f28165e..000000000 Binary files a/tests/data/pngsuite/basi0g16.png and /dev/null differ diff --git a/tests/data/pngsuite/basi2c08.png b/tests/data/pngsuite/basi2c08.png deleted file mode 100644 index 2aab44d42..000000000 Binary files a/tests/data/pngsuite/basi2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/basi2c16.png b/tests/data/pngsuite/basi2c16.png deleted file mode 100644 index cd7e50f91..000000000 Binary files a/tests/data/pngsuite/basi2c16.png and /dev/null differ diff --git a/tests/data/pngsuite/basi3p01.png b/tests/data/pngsuite/basi3p01.png deleted file mode 100644 index 00a7cea6c..000000000 Binary files a/tests/data/pngsuite/basi3p01.png and /dev/null differ diff --git a/tests/data/pngsuite/basi3p02.png b/tests/data/pngsuite/basi3p02.png deleted file mode 100644 index bb16b44b3..000000000 Binary files a/tests/data/pngsuite/basi3p02.png and /dev/null differ diff --git a/tests/data/pngsuite/basi3p04.png b/tests/data/pngsuite/basi3p04.png deleted file mode 100644 index b4e888e24..000000000 Binary files a/tests/data/pngsuite/basi3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/basi3p08.png b/tests/data/pngsuite/basi3p08.png deleted file mode 100644 index 50a6d1cac..000000000 Binary files a/tests/data/pngsuite/basi3p08.png and /dev/null differ diff --git a/tests/data/pngsuite/basi4a08.png b/tests/data/pngsuite/basi4a08.png deleted file mode 100644 index 398132be5..000000000 Binary files a/tests/data/pngsuite/basi4a08.png and /dev/null differ diff --git a/tests/data/pngsuite/basi4a16.png b/tests/data/pngsuite/basi4a16.png deleted file mode 100644 index 51192e731..000000000 Binary files a/tests/data/pngsuite/basi4a16.png and /dev/null differ diff --git a/tests/data/pngsuite/basi6a08.png b/tests/data/pngsuite/basi6a08.png deleted file mode 100644 index aecb32e0d..000000000 Binary files a/tests/data/pngsuite/basi6a08.png and /dev/null differ diff --git a/tests/data/pngsuite/basi6a16.png b/tests/data/pngsuite/basi6a16.png deleted file mode 100644 index 4181533ad..000000000 Binary files a/tests/data/pngsuite/basi6a16.png and /dev/null differ diff --git a/tests/data/pngsuite/basn0g01.png b/tests/data/pngsuite/basn0g01.png deleted file mode 100644 index 1d722423a..000000000 Binary files a/tests/data/pngsuite/basn0g01.png and /dev/null differ diff --git a/tests/data/pngsuite/basn0g02.png b/tests/data/pngsuite/basn0g02.png deleted file mode 100644 index 508332418..000000000 Binary files a/tests/data/pngsuite/basn0g02.png and /dev/null differ diff --git a/tests/data/pngsuite/basn0g04.png b/tests/data/pngsuite/basn0g04.png deleted file mode 100644 index 0bf368786..000000000 Binary files a/tests/data/pngsuite/basn0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/basn0g08.png b/tests/data/pngsuite/basn0g08.png deleted file mode 100644 index 23c82379a..000000000 Binary files a/tests/data/pngsuite/basn0g08.png and /dev/null differ diff --git a/tests/data/pngsuite/basn0g16.png b/tests/data/pngsuite/basn0g16.png deleted file mode 100644 index e7c82f78e..000000000 Binary files a/tests/data/pngsuite/basn0g16.png and /dev/null differ diff --git a/tests/data/pngsuite/basn2c08.png b/tests/data/pngsuite/basn2c08.png deleted file mode 100644 index db5ad1586..000000000 Binary files a/tests/data/pngsuite/basn2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/basn2c16.png b/tests/data/pngsuite/basn2c16.png deleted file mode 100644 index 50c1cb91a..000000000 Binary files a/tests/data/pngsuite/basn2c16.png and /dev/null differ diff --git a/tests/data/pngsuite/basn3p01.png b/tests/data/pngsuite/basn3p01.png deleted file mode 100644 index b145c2b8e..000000000 Binary files a/tests/data/pngsuite/basn3p01.png and /dev/null differ diff --git a/tests/data/pngsuite/basn3p02.png b/tests/data/pngsuite/basn3p02.png deleted file mode 100644 index 8985b3d81..000000000 Binary files a/tests/data/pngsuite/basn3p02.png and /dev/null differ diff --git a/tests/data/pngsuite/basn3p04.png b/tests/data/pngsuite/basn3p04.png deleted file mode 100644 index 0fbf9e827..000000000 Binary files a/tests/data/pngsuite/basn3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/basn3p08.png b/tests/data/pngsuite/basn3p08.png deleted file mode 100644 index 0ddad07e5..000000000 Binary files a/tests/data/pngsuite/basn3p08.png and /dev/null differ diff --git a/tests/data/pngsuite/basn4a08.png b/tests/data/pngsuite/basn4a08.png deleted file mode 100644 index 3e1305220..000000000 Binary files a/tests/data/pngsuite/basn4a08.png and /dev/null differ diff --git a/tests/data/pngsuite/basn4a16.png b/tests/data/pngsuite/basn4a16.png deleted file mode 100644 index 8243644d0..000000000 Binary files a/tests/data/pngsuite/basn4a16.png and /dev/null differ diff --git a/tests/data/pngsuite/basn6a08.png b/tests/data/pngsuite/basn6a08.png deleted file mode 100644 index e60873876..000000000 Binary files a/tests/data/pngsuite/basn6a08.png and /dev/null differ diff --git a/tests/data/pngsuite/basn6a16.png b/tests/data/pngsuite/basn6a16.png deleted file mode 100644 index 984a99525..000000000 Binary files a/tests/data/pngsuite/basn6a16.png and /dev/null differ diff --git a/tests/data/pngsuite/bgai4a08.png b/tests/data/pngsuite/bgai4a08.png deleted file mode 100644 index 398132be5..000000000 Binary files a/tests/data/pngsuite/bgai4a08.png and /dev/null differ diff --git a/tests/data/pngsuite/bgai4a16.png b/tests/data/pngsuite/bgai4a16.png deleted file mode 100644 index 51192e731..000000000 Binary files a/tests/data/pngsuite/bgai4a16.png and /dev/null differ diff --git a/tests/data/pngsuite/bgan6a08.png b/tests/data/pngsuite/bgan6a08.png deleted file mode 100644 index e60873876..000000000 Binary files a/tests/data/pngsuite/bgan6a08.png and /dev/null differ diff --git a/tests/data/pngsuite/bgan6a16.png b/tests/data/pngsuite/bgan6a16.png deleted file mode 100644 index 984a99525..000000000 Binary files a/tests/data/pngsuite/bgan6a16.png and /dev/null differ diff --git a/tests/data/pngsuite/bgbn4a08.png b/tests/data/pngsuite/bgbn4a08.png deleted file mode 100644 index 7cbefc3bf..000000000 Binary files a/tests/data/pngsuite/bgbn4a08.png and /dev/null differ diff --git a/tests/data/pngsuite/bggn4a16.png b/tests/data/pngsuite/bggn4a16.png deleted file mode 100644 index 13fd85ba1..000000000 Binary files a/tests/data/pngsuite/bggn4a16.png and /dev/null differ diff --git a/tests/data/pngsuite/bgwn6a08.png b/tests/data/pngsuite/bgwn6a08.png deleted file mode 100644 index a67ff205b..000000000 Binary files a/tests/data/pngsuite/bgwn6a08.png and /dev/null differ diff --git a/tests/data/pngsuite/bgyn6a16.png b/tests/data/pngsuite/bgyn6a16.png deleted file mode 100644 index ae3e9be58..000000000 Binary files a/tests/data/pngsuite/bgyn6a16.png and /dev/null differ diff --git a/tests/data/pngsuite/ccwn2c08.png b/tests/data/pngsuite/ccwn2c08.png deleted file mode 100644 index 47c24817b..000000000 Binary files a/tests/data/pngsuite/ccwn2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/ccwn3p08.png b/tests/data/pngsuite/ccwn3p08.png deleted file mode 100644 index 8bb2c1098..000000000 Binary files a/tests/data/pngsuite/ccwn3p08.png and /dev/null differ diff --git a/tests/data/pngsuite/cdfn2c08.png b/tests/data/pngsuite/cdfn2c08.png deleted file mode 100644 index 559e5261e..000000000 Binary files a/tests/data/pngsuite/cdfn2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/cdhn2c08.png b/tests/data/pngsuite/cdhn2c08.png deleted file mode 100644 index 3e07e8ecb..000000000 Binary files a/tests/data/pngsuite/cdhn2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/cdsn2c08.png b/tests/data/pngsuite/cdsn2c08.png deleted file mode 100644 index 076c32cc0..000000000 Binary files a/tests/data/pngsuite/cdsn2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/cdun2c08.png b/tests/data/pngsuite/cdun2c08.png deleted file mode 100644 index 846033be6..000000000 Binary files a/tests/data/pngsuite/cdun2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/ch1n3p04.png b/tests/data/pngsuite/ch1n3p04.png deleted file mode 100644 index 17cd12dfc..000000000 Binary files a/tests/data/pngsuite/ch1n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/ch2n3p08.png b/tests/data/pngsuite/ch2n3p08.png deleted file mode 100644 index 25c17987a..000000000 Binary files a/tests/data/pngsuite/ch2n3p08.png and /dev/null differ diff --git a/tests/data/pngsuite/cm0n0g04.png b/tests/data/pngsuite/cm0n0g04.png deleted file mode 100644 index 9fba5db3b..000000000 Binary files a/tests/data/pngsuite/cm0n0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/cm7n0g04.png b/tests/data/pngsuite/cm7n0g04.png deleted file mode 100644 index f7dc46e68..000000000 Binary files a/tests/data/pngsuite/cm7n0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/cm9n0g04.png b/tests/data/pngsuite/cm9n0g04.png deleted file mode 100644 index dd70911ad..000000000 Binary files a/tests/data/pngsuite/cm9n0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/cs3n2c16.png b/tests/data/pngsuite/cs3n2c16.png deleted file mode 100644 index bf5fd20a2..000000000 Binary files a/tests/data/pngsuite/cs3n2c16.png and /dev/null differ diff --git a/tests/data/pngsuite/cs3n3p08.png b/tests/data/pngsuite/cs3n3p08.png deleted file mode 100644 index f4a66237b..000000000 Binary files a/tests/data/pngsuite/cs3n3p08.png and /dev/null differ diff --git a/tests/data/pngsuite/cs5n2c08.png b/tests/data/pngsuite/cs5n2c08.png deleted file mode 100644 index 40f947c33..000000000 Binary files a/tests/data/pngsuite/cs5n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/cs5n3p08.png b/tests/data/pngsuite/cs5n3p08.png deleted file mode 100644 index dfd6e6e6e..000000000 Binary files a/tests/data/pngsuite/cs5n3p08.png and /dev/null differ diff --git a/tests/data/pngsuite/cs8n2c08.png b/tests/data/pngsuite/cs8n2c08.png deleted file mode 100644 index 8e01d3294..000000000 Binary files a/tests/data/pngsuite/cs8n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/cs8n3p08.png b/tests/data/pngsuite/cs8n3p08.png deleted file mode 100644 index a44066eb6..000000000 Binary files a/tests/data/pngsuite/cs8n3p08.png and /dev/null differ diff --git a/tests/data/pngsuite/ct0n0g04.png b/tests/data/pngsuite/ct0n0g04.png deleted file mode 100644 index 40d1e062f..000000000 Binary files a/tests/data/pngsuite/ct0n0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/ct1n0g04.png b/tests/data/pngsuite/ct1n0g04.png deleted file mode 100644 index 3ba110aa7..000000000 Binary files a/tests/data/pngsuite/ct1n0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/cten0g04.png b/tests/data/pngsuite/cten0g04.png deleted file mode 100644 index 2f2d0c811..000000000 Binary files a/tests/data/pngsuite/cten0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/ctfn0g04.png b/tests/data/pngsuite/ctfn0g04.png deleted file mode 100644 index ddac7f446..000000000 Binary files a/tests/data/pngsuite/ctfn0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/ctgn0g04.png b/tests/data/pngsuite/ctgn0g04.png deleted file mode 100644 index baceb0cc8..000000000 Binary files a/tests/data/pngsuite/ctgn0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/cthn0g04.png b/tests/data/pngsuite/cthn0g04.png deleted file mode 100644 index 11580f8ae..000000000 Binary files a/tests/data/pngsuite/cthn0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/ctjn0g04.png b/tests/data/pngsuite/ctjn0g04.png deleted file mode 100644 index 2d303720c..000000000 Binary files a/tests/data/pngsuite/ctjn0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/ctzn0g04.png b/tests/data/pngsuite/ctzn0g04.png deleted file mode 100644 index b4401c9cf..000000000 Binary files a/tests/data/pngsuite/ctzn0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/f00n0g08.png b/tests/data/pngsuite/f00n0g08.png deleted file mode 100644 index 45a007596..000000000 Binary files a/tests/data/pngsuite/f00n0g08.png and /dev/null differ diff --git a/tests/data/pngsuite/f00n2c08.png b/tests/data/pngsuite/f00n2c08.png deleted file mode 100644 index d6a1ffff6..000000000 Binary files a/tests/data/pngsuite/f00n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/f01n0g08.png b/tests/data/pngsuite/f01n0g08.png deleted file mode 100644 index 4a1107b46..000000000 Binary files a/tests/data/pngsuite/f01n0g08.png and /dev/null differ diff --git a/tests/data/pngsuite/f01n2c08.png b/tests/data/pngsuite/f01n2c08.png deleted file mode 100644 index 26fee958c..000000000 Binary files a/tests/data/pngsuite/f01n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/f02n0g08.png b/tests/data/pngsuite/f02n0g08.png deleted file mode 100644 index bfe410c5e..000000000 Binary files a/tests/data/pngsuite/f02n0g08.png and /dev/null differ diff --git a/tests/data/pngsuite/f02n2c08.png b/tests/data/pngsuite/f02n2c08.png deleted file mode 100644 index e590f1234..000000000 Binary files a/tests/data/pngsuite/f02n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/f03n0g08.png b/tests/data/pngsuite/f03n0g08.png deleted file mode 100644 index ed01e2923..000000000 Binary files a/tests/data/pngsuite/f03n0g08.png and /dev/null differ diff --git a/tests/data/pngsuite/f03n2c08.png b/tests/data/pngsuite/f03n2c08.png deleted file mode 100644 index 758115059..000000000 Binary files a/tests/data/pngsuite/f03n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/f04n0g08.png b/tests/data/pngsuite/f04n0g08.png deleted file mode 100644 index 663fdae3e..000000000 Binary files a/tests/data/pngsuite/f04n0g08.png and /dev/null differ diff --git a/tests/data/pngsuite/f04n2c08.png b/tests/data/pngsuite/f04n2c08.png deleted file mode 100644 index 3c8b5116e..000000000 Binary files a/tests/data/pngsuite/f04n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/f99n0g04.png b/tests/data/pngsuite/f99n0g04.png deleted file mode 100644 index 0b521c1d5..000000000 Binary files a/tests/data/pngsuite/f99n0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/g03n0g16.png b/tests/data/pngsuite/g03n0g16.png deleted file mode 100644 index 41083ca80..000000000 Binary files a/tests/data/pngsuite/g03n0g16.png and /dev/null differ diff --git a/tests/data/pngsuite/g03n2c08.png b/tests/data/pngsuite/g03n2c08.png deleted file mode 100644 index a9354dbee..000000000 Binary files a/tests/data/pngsuite/g03n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/g03n3p04.png b/tests/data/pngsuite/g03n3p04.png deleted file mode 100644 index 60396c95a..000000000 Binary files a/tests/data/pngsuite/g03n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/g04n0g16.png b/tests/data/pngsuite/g04n0g16.png deleted file mode 100644 index 32395b76c..000000000 Binary files a/tests/data/pngsuite/g04n0g16.png and /dev/null differ diff --git a/tests/data/pngsuite/g04n2c08.png b/tests/data/pngsuite/g04n2c08.png deleted file mode 100644 index a652b0ce8..000000000 Binary files a/tests/data/pngsuite/g04n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/g04n3p04.png b/tests/data/pngsuite/g04n3p04.png deleted file mode 100644 index 5661cc313..000000000 Binary files a/tests/data/pngsuite/g04n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/g05n0g16.png b/tests/data/pngsuite/g05n0g16.png deleted file mode 100644 index 70b37f01e..000000000 Binary files a/tests/data/pngsuite/g05n0g16.png and /dev/null differ diff --git a/tests/data/pngsuite/g05n2c08.png b/tests/data/pngsuite/g05n2c08.png deleted file mode 100644 index 932c13653..000000000 Binary files a/tests/data/pngsuite/g05n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/g05n3p04.png b/tests/data/pngsuite/g05n3p04.png deleted file mode 100644 index 961993058..000000000 Binary files a/tests/data/pngsuite/g05n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/g07n0g16.png b/tests/data/pngsuite/g07n0g16.png deleted file mode 100644 index d6a47c2d5..000000000 Binary files a/tests/data/pngsuite/g07n0g16.png and /dev/null differ diff --git a/tests/data/pngsuite/g07n2c08.png b/tests/data/pngsuite/g07n2c08.png deleted file mode 100644 index 597346460..000000000 Binary files a/tests/data/pngsuite/g07n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/g07n3p04.png b/tests/data/pngsuite/g07n3p04.png deleted file mode 100644 index c73fb6136..000000000 Binary files a/tests/data/pngsuite/g07n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/g10n0g16.png b/tests/data/pngsuite/g10n0g16.png deleted file mode 100644 index 85f2c958e..000000000 Binary files a/tests/data/pngsuite/g10n0g16.png and /dev/null differ diff --git a/tests/data/pngsuite/g10n2c08.png b/tests/data/pngsuite/g10n2c08.png deleted file mode 100644 index b3039970c..000000000 Binary files a/tests/data/pngsuite/g10n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/g10n3p04.png b/tests/data/pngsuite/g10n3p04.png deleted file mode 100644 index 1b6a6be2c..000000000 Binary files a/tests/data/pngsuite/g10n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/g25n0g16.png b/tests/data/pngsuite/g25n0g16.png deleted file mode 100644 index a9f6787c7..000000000 Binary files a/tests/data/pngsuite/g25n0g16.png and /dev/null differ diff --git a/tests/data/pngsuite/g25n2c08.png b/tests/data/pngsuite/g25n2c08.png deleted file mode 100644 index 03f505a64..000000000 Binary files a/tests/data/pngsuite/g25n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/g25n3p04.png b/tests/data/pngsuite/g25n3p04.png deleted file mode 100644 index 4f943c617..000000000 Binary files a/tests/data/pngsuite/g25n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/linepattern.png b/tests/data/pngsuite/linepattern.png deleted file mode 100644 index 9a89f215f..000000000 Binary files a/tests/data/pngsuite/linepattern.png and /dev/null differ diff --git a/tests/data/pngsuite/linepattern1.png b/tests/data/pngsuite/linepattern1.png deleted file mode 100644 index 73234b743..000000000 Binary files a/tests/data/pngsuite/linepattern1.png and /dev/null differ diff --git a/tests/data/pngsuite/oi1n0g16.png b/tests/data/pngsuite/oi1n0g16.png deleted file mode 100644 index e7c82f78e..000000000 Binary files a/tests/data/pngsuite/oi1n0g16.png and /dev/null differ diff --git a/tests/data/pngsuite/oi1n2c16.png b/tests/data/pngsuite/oi1n2c16.png deleted file mode 100644 index 50c1cb91a..000000000 Binary files a/tests/data/pngsuite/oi1n2c16.png and /dev/null differ diff --git a/tests/data/pngsuite/oi2n0g16.png b/tests/data/pngsuite/oi2n0g16.png deleted file mode 100644 index 14d64c583..000000000 Binary files a/tests/data/pngsuite/oi2n0g16.png and /dev/null differ diff --git a/tests/data/pngsuite/oi2n2c16.png b/tests/data/pngsuite/oi2n2c16.png deleted file mode 100644 index 4c2e3e335..000000000 Binary files a/tests/data/pngsuite/oi2n2c16.png and /dev/null differ diff --git a/tests/data/pngsuite/oi4n0g16.png b/tests/data/pngsuite/oi4n0g16.png deleted file mode 100644 index 69e73ede3..000000000 Binary files a/tests/data/pngsuite/oi4n0g16.png and /dev/null differ diff --git a/tests/data/pngsuite/oi4n2c16.png b/tests/data/pngsuite/oi4n2c16.png deleted file mode 100644 index 93691e373..000000000 Binary files a/tests/data/pngsuite/oi4n2c16.png and /dev/null differ diff --git a/tests/data/pngsuite/oi9n0g16.png b/tests/data/pngsuite/oi9n0g16.png deleted file mode 100644 index 924841357..000000000 Binary files a/tests/data/pngsuite/oi9n0g16.png and /dev/null differ diff --git a/tests/data/pngsuite/oi9n2c16.png b/tests/data/pngsuite/oi9n2c16.png deleted file mode 100644 index f0512e49f..000000000 Binary files a/tests/data/pngsuite/oi9n2c16.png and /dev/null differ diff --git a/tests/data/pngsuite/pp0n2c16.png b/tests/data/pngsuite/pp0n2c16.png deleted file mode 100644 index 8f2aad733..000000000 Binary files a/tests/data/pngsuite/pp0n2c16.png and /dev/null differ diff --git a/tests/data/pngsuite/pp0n6a08.png b/tests/data/pngsuite/pp0n6a08.png deleted file mode 100644 index 4ed7a30e4..000000000 Binary files a/tests/data/pngsuite/pp0n6a08.png and /dev/null differ diff --git a/tests/data/pngsuite/ps1n0g08.png b/tests/data/pngsuite/ps1n0g08.png deleted file mode 100644 index 99625fa4b..000000000 Binary files a/tests/data/pngsuite/ps1n0g08.png and /dev/null differ diff --git a/tests/data/pngsuite/ps1n2c16.png b/tests/data/pngsuite/ps1n2c16.png deleted file mode 100644 index 0c7a6b380..000000000 Binary files a/tests/data/pngsuite/ps1n2c16.png and /dev/null differ diff --git a/tests/data/pngsuite/ps2n0g08.png b/tests/data/pngsuite/ps2n0g08.png deleted file mode 100644 index 90b297968..000000000 Binary files a/tests/data/pngsuite/ps2n0g08.png and /dev/null differ diff --git a/tests/data/pngsuite/ps2n2c16.png b/tests/data/pngsuite/ps2n2c16.png deleted file mode 100644 index a4a181e4e..000000000 Binary files a/tests/data/pngsuite/ps2n2c16.png and /dev/null differ diff --git a/tests/data/pngsuite/s01i3p01.png b/tests/data/pngsuite/s01i3p01.png deleted file mode 100644 index 6c0fad1fc..000000000 Binary files a/tests/data/pngsuite/s01i3p01.png and /dev/null differ diff --git a/tests/data/pngsuite/s01n3p01.png b/tests/data/pngsuite/s01n3p01.png deleted file mode 100644 index cb2c8c782..000000000 Binary files a/tests/data/pngsuite/s01n3p01.png and /dev/null differ diff --git a/tests/data/pngsuite/s02i3p01.png b/tests/data/pngsuite/s02i3p01.png deleted file mode 100644 index 2defaed91..000000000 Binary files a/tests/data/pngsuite/s02i3p01.png and /dev/null differ diff --git a/tests/data/pngsuite/s02n3p01.png b/tests/data/pngsuite/s02n3p01.png deleted file mode 100644 index 2b1b66964..000000000 Binary files a/tests/data/pngsuite/s02n3p01.png and /dev/null differ diff --git a/tests/data/pngsuite/s03i3p01.png b/tests/data/pngsuite/s03i3p01.png deleted file mode 100644 index c23fdc463..000000000 Binary files a/tests/data/pngsuite/s03i3p01.png and /dev/null differ diff --git a/tests/data/pngsuite/s03n3p01.png b/tests/data/pngsuite/s03n3p01.png deleted file mode 100644 index 6d96ee4f8..000000000 Binary files a/tests/data/pngsuite/s03n3p01.png and /dev/null differ diff --git a/tests/data/pngsuite/s04i3p01.png b/tests/data/pngsuite/s04i3p01.png deleted file mode 100644 index 0e710c2c3..000000000 Binary files a/tests/data/pngsuite/s04i3p01.png and /dev/null differ diff --git a/tests/data/pngsuite/s04n3p01.png b/tests/data/pngsuite/s04n3p01.png deleted file mode 100644 index 956396c45..000000000 Binary files a/tests/data/pngsuite/s04n3p01.png and /dev/null differ diff --git a/tests/data/pngsuite/s05i3p02.png b/tests/data/pngsuite/s05i3p02.png deleted file mode 100644 index d14cbd351..000000000 Binary files a/tests/data/pngsuite/s05i3p02.png and /dev/null differ diff --git a/tests/data/pngsuite/s05n3p02.png b/tests/data/pngsuite/s05n3p02.png deleted file mode 100644 index bf940f057..000000000 Binary files a/tests/data/pngsuite/s05n3p02.png and /dev/null differ diff --git a/tests/data/pngsuite/s06i3p02.png b/tests/data/pngsuite/s06i3p02.png deleted file mode 100644 index 456ada320..000000000 Binary files a/tests/data/pngsuite/s06i3p02.png and /dev/null differ diff --git a/tests/data/pngsuite/s06n3p02.png b/tests/data/pngsuite/s06n3p02.png deleted file mode 100644 index 501064dc2..000000000 Binary files a/tests/data/pngsuite/s06n3p02.png and /dev/null differ diff --git a/tests/data/pngsuite/s07i3p02.png b/tests/data/pngsuite/s07i3p02.png deleted file mode 100644 index 44b66bab9..000000000 Binary files a/tests/data/pngsuite/s07i3p02.png and /dev/null differ diff --git a/tests/data/pngsuite/s07n3p02.png b/tests/data/pngsuite/s07n3p02.png deleted file mode 100644 index 6a582593d..000000000 Binary files a/tests/data/pngsuite/s07n3p02.png and /dev/null differ diff --git a/tests/data/pngsuite/s08i3p02.png b/tests/data/pngsuite/s08i3p02.png deleted file mode 100644 index acf74f3fc..000000000 Binary files a/tests/data/pngsuite/s08i3p02.png and /dev/null differ diff --git a/tests/data/pngsuite/s08n3p02.png b/tests/data/pngsuite/s08n3p02.png deleted file mode 100644 index b7094e1b4..000000000 Binary files a/tests/data/pngsuite/s08n3p02.png and /dev/null differ diff --git a/tests/data/pngsuite/s09i3p02.png b/tests/data/pngsuite/s09i3p02.png deleted file mode 100644 index 0bfae8e45..000000000 Binary files a/tests/data/pngsuite/s09i3p02.png and /dev/null differ diff --git a/tests/data/pngsuite/s09n3p02.png b/tests/data/pngsuite/s09n3p02.png deleted file mode 100644 index 711ab8245..000000000 Binary files a/tests/data/pngsuite/s09n3p02.png and /dev/null differ diff --git a/tests/data/pngsuite/s32i3p04.png b/tests/data/pngsuite/s32i3p04.png deleted file mode 100644 index 0841910b7..000000000 Binary files a/tests/data/pngsuite/s32i3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s32n3p04.png b/tests/data/pngsuite/s32n3p04.png deleted file mode 100644 index fa58e3e3f..000000000 Binary files a/tests/data/pngsuite/s32n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s33i3p04.png b/tests/data/pngsuite/s33i3p04.png deleted file mode 100644 index ab0dc14ab..000000000 Binary files a/tests/data/pngsuite/s33i3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s33n3p04.png b/tests/data/pngsuite/s33n3p04.png deleted file mode 100644 index 764f1a3dc..000000000 Binary files a/tests/data/pngsuite/s33n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s34i3p04.png b/tests/data/pngsuite/s34i3p04.png deleted file mode 100644 index bd99039be..000000000 Binary files a/tests/data/pngsuite/s34i3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s34n3p04.png b/tests/data/pngsuite/s34n3p04.png deleted file mode 100644 index 9cbc68b3b..000000000 Binary files a/tests/data/pngsuite/s34n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s35i3p04.png b/tests/data/pngsuite/s35i3p04.png deleted file mode 100644 index e2a5e0a65..000000000 Binary files a/tests/data/pngsuite/s35i3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s35n3p04.png b/tests/data/pngsuite/s35n3p04.png deleted file mode 100644 index 90b892eba..000000000 Binary files a/tests/data/pngsuite/s35n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s36i3p04.png b/tests/data/pngsuite/s36i3p04.png deleted file mode 100644 index eb61b6f9a..000000000 Binary files a/tests/data/pngsuite/s36i3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s36n3p04.png b/tests/data/pngsuite/s36n3p04.png deleted file mode 100644 index b38d17977..000000000 Binary files a/tests/data/pngsuite/s36n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s37i3p04.png b/tests/data/pngsuite/s37i3p04.png deleted file mode 100644 index 6e2b1e9b7..000000000 Binary files a/tests/data/pngsuite/s37i3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s37n3p04.png b/tests/data/pngsuite/s37n3p04.png deleted file mode 100644 index 4d3054da5..000000000 Binary files a/tests/data/pngsuite/s37n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s38i3p04.png b/tests/data/pngsuite/s38i3p04.png deleted file mode 100644 index a0a8a140a..000000000 Binary files a/tests/data/pngsuite/s38i3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s38n3p04.png b/tests/data/pngsuite/s38n3p04.png deleted file mode 100644 index 1233ed048..000000000 Binary files a/tests/data/pngsuite/s38n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s39i3p04.png b/tests/data/pngsuite/s39i3p04.png deleted file mode 100644 index 04fee93ea..000000000 Binary files a/tests/data/pngsuite/s39i3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s39n3p04.png b/tests/data/pngsuite/s39n3p04.png deleted file mode 100644 index c750100d5..000000000 Binary files a/tests/data/pngsuite/s39n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s40i3p04.png b/tests/data/pngsuite/s40i3p04.png deleted file mode 100644 index 68f358b82..000000000 Binary files a/tests/data/pngsuite/s40i3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/s40n3p04.png b/tests/data/pngsuite/s40n3p04.png deleted file mode 100644 index 864b6b967..000000000 Binary files a/tests/data/pngsuite/s40n3p04.png and /dev/null differ diff --git a/tests/data/pngsuite/tbbn0g04.png b/tests/data/pngsuite/tbbn0g04.png deleted file mode 100644 index 39a7050d2..000000000 Binary files a/tests/data/pngsuite/tbbn0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/tbbn2c16.png b/tests/data/pngsuite/tbbn2c16.png deleted file mode 100644 index dd3168e5c..000000000 Binary files a/tests/data/pngsuite/tbbn2c16.png and /dev/null differ diff --git a/tests/data/pngsuite/tbbn3p08.png b/tests/data/pngsuite/tbbn3p08.png deleted file mode 100644 index 0ede3574d..000000000 Binary files a/tests/data/pngsuite/tbbn3p08.png and /dev/null differ diff --git a/tests/data/pngsuite/tbgn2c16.png b/tests/data/pngsuite/tbgn2c16.png deleted file mode 100644 index 85cec395c..000000000 Binary files a/tests/data/pngsuite/tbgn2c16.png and /dev/null differ diff --git a/tests/data/pngsuite/tbgn3p08.png b/tests/data/pngsuite/tbgn3p08.png deleted file mode 100644 index 8cf2e6fb6..000000000 Binary files a/tests/data/pngsuite/tbgn3p08.png and /dev/null differ diff --git a/tests/data/pngsuite/tbrn2c08.png b/tests/data/pngsuite/tbrn2c08.png deleted file mode 100644 index 5cca0d621..000000000 Binary files a/tests/data/pngsuite/tbrn2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/tbwn0g16.png b/tests/data/pngsuite/tbwn0g16.png deleted file mode 100644 index 99bdeed2b..000000000 Binary files a/tests/data/pngsuite/tbwn0g16.png and /dev/null differ diff --git a/tests/data/pngsuite/tbwn3p08.png b/tests/data/pngsuite/tbwn3p08.png deleted file mode 100644 index eacab7a14..000000000 Binary files a/tests/data/pngsuite/tbwn3p08.png and /dev/null differ diff --git a/tests/data/pngsuite/tbyn3p08.png b/tests/data/pngsuite/tbyn3p08.png deleted file mode 100644 index 656db0989..000000000 Binary files a/tests/data/pngsuite/tbyn3p08.png and /dev/null differ diff --git a/tests/data/pngsuite/tp0n0g08.png b/tests/data/pngsuite/tp0n0g08.png deleted file mode 100644 index 333465fcd..000000000 Binary files a/tests/data/pngsuite/tp0n0g08.png and /dev/null differ diff --git a/tests/data/pngsuite/tp0n2c08.png b/tests/data/pngsuite/tp0n2c08.png deleted file mode 100644 index fc6e42cb4..000000000 Binary files a/tests/data/pngsuite/tp0n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/tp0n3p08.png b/tests/data/pngsuite/tp0n3p08.png deleted file mode 100644 index 69a69e587..000000000 Binary files a/tests/data/pngsuite/tp0n3p08.png and /dev/null differ diff --git a/tests/data/pngsuite/tp1n3p08.png b/tests/data/pngsuite/tp1n3p08.png deleted file mode 100644 index a6c9f35a8..000000000 Binary files a/tests/data/pngsuite/tp1n3p08.png and /dev/null differ diff --git a/tests/data/pngsuite/xc1n0g08.png b/tests/data/pngsuite/xc1n0g08.png deleted file mode 100644 index 940422737..000000000 Binary files a/tests/data/pngsuite/xc1n0g08.png and /dev/null differ diff --git a/tests/data/pngsuite/xc9n2c08.png b/tests/data/pngsuite/xc9n2c08.png deleted file mode 100644 index b11c2a7b4..000000000 Binary files a/tests/data/pngsuite/xc9n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/xcrn0g04.png b/tests/data/pngsuite/xcrn0g04.png deleted file mode 100644 index 48abba193..000000000 Binary files a/tests/data/pngsuite/xcrn0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/xd0n2c08.png b/tests/data/pngsuite/xd0n2c08.png deleted file mode 100644 index 2f001610a..000000000 Binary files a/tests/data/pngsuite/xd0n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/xd3n2c08.png b/tests/data/pngsuite/xd3n2c08.png deleted file mode 100644 index 9e4a3ff7a..000000000 Binary files a/tests/data/pngsuite/xd3n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/xd9n2c08.png b/tests/data/pngsuite/xd9n2c08.png deleted file mode 100644 index 2c3b91aa4..000000000 Binary files a/tests/data/pngsuite/xd9n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/xdtn0g01.png b/tests/data/pngsuite/xdtn0g01.png deleted file mode 100644 index 1a81abef8..000000000 Binary files a/tests/data/pngsuite/xdtn0g01.png and /dev/null differ diff --git a/tests/data/pngsuite/xlfn0g04.png b/tests/data/pngsuite/xlfn0g04.png deleted file mode 100644 index d9ec53ed9..000000000 Binary files a/tests/data/pngsuite/xlfn0g04.png and /dev/null differ diff --git a/tests/data/pngsuite/xs1n0g01.png b/tests/data/pngsuite/xs1n0g01.png deleted file mode 100644 index 1817c5144..000000000 Binary files a/tests/data/pngsuite/xs1n0g01.png and /dev/null differ diff --git a/tests/data/pngsuite/xs2n0g01.png b/tests/data/pngsuite/xs2n0g01.png deleted file mode 100644 index b8147f2a8..000000000 Binary files a/tests/data/pngsuite/xs2n0g01.png and /dev/null differ diff --git a/tests/data/pngsuite/xs4n0g01.png b/tests/data/pngsuite/xs4n0g01.png deleted file mode 100644 index 45237a1d2..000000000 Binary files a/tests/data/pngsuite/xs4n0g01.png and /dev/null differ diff --git a/tests/data/pngsuite/xs7n0g01.png b/tests/data/pngsuite/xs7n0g01.png deleted file mode 100644 index 3f307f14e..000000000 Binary files a/tests/data/pngsuite/xs7n0g01.png and /dev/null differ diff --git a/tests/data/pngsuite/z00n2c08.png b/tests/data/pngsuite/z00n2c08.png deleted file mode 100644 index 7669eb838..000000000 Binary files a/tests/data/pngsuite/z00n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/z03n2c08.png b/tests/data/pngsuite/z03n2c08.png deleted file mode 100644 index bfb10de8d..000000000 Binary files a/tests/data/pngsuite/z03n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/z06n2c08.png b/tests/data/pngsuite/z06n2c08.png deleted file mode 100644 index b90ebc10f..000000000 Binary files a/tests/data/pngsuite/z06n2c08.png and /dev/null differ diff --git a/tests/data/pngsuite/z09n2c08.png b/tests/data/pngsuite/z09n2c08.png deleted file mode 100644 index 5f191a78e..000000000 Binary files a/tests/data/pngsuite/z09n2c08.png and /dev/null differ diff --git a/tests/data/python_plugin/python_circle_datasource.xml b/tests/data/python_plugin/python_circle_datasource.xml deleted file mode 100644 index c8d7d8b17..000000000 --- a/tests/data/python_plugin/python_circle_datasource.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - 1 - - python - python_plugin_test:CirclesDatasource - - - - - 2 - - python - python_plugin_test:CirclesDatasource - -20 - 50 - - - - - 3 - - python - python_plugin_test:CirclesDatasource - 60 - 140 - 20 - - - - diff --git a/tests/data/python_plugin/python_point_datasource.xml b/tests/data/python_plugin/python_point_datasource.xml deleted file mode 100644 index 249e5ce33..000000000 --- a/tests/data/python_plugin/python_point_datasource.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - 1 - - python - python_plugin_test:PointDatasource - - - - diff --git a/tests/data/raster/dataraster-small.tif b/tests/data/raster/dataraster-small.tif deleted file mode 100644 index 1e5dbd5db..000000000 Binary files a/tests/data/raster/dataraster-small.tif and /dev/null differ diff --git a/tests/data/raster/dataraster.tif b/tests/data/raster/dataraster.tif deleted file mode 100644 index 778b32113..000000000 Binary files a/tests/data/raster/dataraster.tif and /dev/null differ diff --git a/tests/data/raster/dataraster.vrt b/tests/data/raster/dataraster.vrt deleted file mode 100644 index 26f6b5cfe..000000000 --- a/tests/data/raster/dataraster.vrt +++ /dev/null @@ -1,45 +0,0 @@ - - PROJCS["WGS 84 / UTM zone 30N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","32630"]] - -1.4637000000000000e+04, 5.0000000000000000e+02, 0.0000000000000000e+00, 4.8596780000000000e+06, 0.0000000000000000e+00, -5.0000000000000000e+02 - - -9.99000000000000E+02 - 0 - Palette - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dataraster.tif - 1 - - - - -999 - - - diff --git a/tests/data/raster/missing_raster.vrt b/tests/data/raster/missing_raster.vrt deleted file mode 100644 index 98d0bea30..000000000 --- a/tests/data/raster/missing_raster.vrt +++ /dev/null @@ -1,45 +0,0 @@ - - PROJCS["WGS 84 / UTM zone 30N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","32630"]] - -1.4637000000000000e+04, 5.0000000000000000e+02, 0.0000000000000000e+00, 4.8596780000000000e+06, 0.0000000000000000e+00, -5.0000000000000000e+02 - - -9.99000000000000E+02 - 0 - Palette - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - this_file_should_not_exist.tif - 1 - - - - -999 - - - diff --git a/tests/data/raster/nodata-edge.tif b/tests/data/raster/nodata-edge.tif deleted file mode 100644 index d3bd7e469..000000000 Binary files a/tests/data/raster/nodata-edge.tif and /dev/null differ diff --git a/tests/data/raster/river.tiff b/tests/data/raster/river.tiff deleted file mode 100644 index 1f68f396d..000000000 Binary files a/tests/data/raster/river.tiff and /dev/null differ diff --git a/tests/data/raster/river_merc.tiff b/tests/data/raster/river_merc.tiff deleted file mode 100644 index 447263f4b..000000000 Binary files a/tests/data/raster/river_merc.tiff and /dev/null differ diff --git a/tests/data/raster/river_wgs.tiff b/tests/data/raster/river_wgs.tiff deleted file mode 100644 index 60fe5577f..000000000 Binary files a/tests/data/raster/river_wgs.tiff and /dev/null differ diff --git a/tests/data/raster/transp.tiff b/tests/data/raster/transp.tiff deleted file mode 100644 index f8a098b42..000000000 Binary files a/tests/data/raster/transp.tiff and /dev/null differ diff --git a/tests/data/raster/white-alpha-assoc-alpha-correct.tiff b/tests/data/raster/white-alpha-assoc-alpha-correct.tiff deleted file mode 100644 index 2085393c4..000000000 Binary files a/tests/data/raster/white-alpha-assoc-alpha-correct.tiff and /dev/null differ diff --git a/tests/data/raster/white-alpha-assoc-alpha-wrong.tiff b/tests/data/raster/white-alpha-assoc-alpha-wrong.tiff deleted file mode 100644 index b25998986..000000000 Binary files a/tests/data/raster/white-alpha-assoc-alpha-wrong.tiff and /dev/null differ diff --git a/tests/data/raster/white-alpha.png b/tests/data/raster/white-alpha.png deleted file mode 100755 index 40ed38154..000000000 Binary files a/tests/data/raster/white-alpha.png and /dev/null differ diff --git a/tests/data/raster_tiles/000/000/000/000/000/000.tif b/tests/data/raster_tiles/000/000/000/000/000/000.tif deleted file mode 100644 index d43cebc82..000000000 Binary files a/tests/data/raster_tiles/000/000/000/000/000/000.tif and /dev/null differ diff --git a/tests/data/raster_tiles/000/000/000/000/000/001.tif b/tests/data/raster_tiles/000/000/000/000/000/001.tif deleted file mode 100644 index 67d3bb67a..000000000 Binary files a/tests/data/raster_tiles/000/000/000/000/000/001.tif and /dev/null differ diff --git a/tests/data/raster_tiles/000/000/001/000/000/000.tif b/tests/data/raster_tiles/000/000/001/000/000/000.tif deleted file mode 100644 index 0868eeaf0..000000000 Binary files a/tests/data/raster_tiles/000/000/001/000/000/000.tif and /dev/null differ diff --git a/tests/data/raster_tiles/000/000/001/000/000/001.tif b/tests/data/raster_tiles/000/000/001/000/000/001.tif deleted file mode 100644 index 95eee548c..000000000 Binary files a/tests/data/raster_tiles/000/000/001/000/000/001.tif and /dev/null differ diff --git a/tests/data/rasterlite/globe.sqlite b/tests/data/rasterlite/globe.sqlite deleted file mode 100644 index 1804ecfd7..000000000 Binary files a/tests/data/rasterlite/globe.sqlite and /dev/null differ diff --git a/tests/data/shp/arrows.dbf b/tests/data/shp/arrows.dbf deleted file mode 100644 index 64b2c241e..000000000 Binary files a/tests/data/shp/arrows.dbf and /dev/null differ diff --git a/tests/data/shp/arrows.shp b/tests/data/shp/arrows.shp deleted file mode 100644 index 27247e1d4..000000000 Binary files a/tests/data/shp/arrows.shp and /dev/null differ diff --git a/tests/data/shp/arrows.shx b/tests/data/shp/arrows.shx deleted file mode 100644 index f6038c9f4..000000000 Binary files a/tests/data/shp/arrows.shx and /dev/null differ diff --git a/tests/data/shp/charplacement.dbf b/tests/data/shp/charplacement.dbf deleted file mode 100644 index c143baa95..000000000 Binary files a/tests/data/shp/charplacement.dbf and /dev/null differ diff --git a/tests/data/shp/charplacement.shp b/tests/data/shp/charplacement.shp deleted file mode 100644 index ccdfcf4bc..000000000 Binary files a/tests/data/shp/charplacement.shp and /dev/null differ diff --git a/tests/data/shp/charplacement.shx b/tests/data/shp/charplacement.shx deleted file mode 100644 index 65b8dab8f..000000000 Binary files a/tests/data/shp/charplacement.shx and /dev/null differ diff --git a/tests/data/shp/displacement.dbf b/tests/data/shp/displacement.dbf deleted file mode 100644 index 06ec3206c..000000000 Binary files a/tests/data/shp/displacement.dbf and /dev/null differ diff --git a/tests/data/shp/displacement.shp b/tests/data/shp/displacement.shp deleted file mode 100644 index 899b16370..000000000 Binary files a/tests/data/shp/displacement.shp and /dev/null differ diff --git a/tests/data/shp/displacement.shx b/tests/data/shp/displacement.shx deleted file mode 100644 index 359820de4..000000000 Binary files a/tests/data/shp/displacement.shx and /dev/null differ diff --git a/tests/data/shp/farsi-labels.dbf b/tests/data/shp/farsi-labels.dbf deleted file mode 100644 index 6b5d11701..000000000 Binary files a/tests/data/shp/farsi-labels.dbf and /dev/null differ diff --git a/tests/data/shp/farsi-labels.prj b/tests/data/shp/farsi-labels.prj deleted file mode 100644 index a30c00a55..000000000 --- a/tests/data/shp/farsi-labels.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/tests/data/shp/farsi-labels.shp b/tests/data/shp/farsi-labels.shp deleted file mode 100644 index 5c2380eed..000000000 Binary files a/tests/data/shp/farsi-labels.shp and /dev/null differ diff --git a/tests/data/shp/farsi-labels.shx b/tests/data/shp/farsi-labels.shx deleted file mode 100644 index 6fe17c7f9..000000000 Binary files a/tests/data/shp/farsi-labels.shx and /dev/null differ diff --git a/tests/data/shp/long_lat.dbf b/tests/data/shp/long_lat.dbf deleted file mode 100644 index d3716daf8..000000000 Binary files a/tests/data/shp/long_lat.dbf and /dev/null differ diff --git a/tests/data/shp/long_lat.dbt b/tests/data/shp/long_lat.dbt deleted file mode 100644 index 608c35740..000000000 Binary files a/tests/data/shp/long_lat.dbt and /dev/null differ diff --git a/tests/data/shp/long_lat.prj b/tests/data/shp/long_lat.prj deleted file mode 100644 index a30c00a55..000000000 --- a/tests/data/shp/long_lat.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/tests/data/shp/long_lat.shp b/tests/data/shp/long_lat.shp deleted file mode 100644 index 0112cd743..000000000 Binary files a/tests/data/shp/long_lat.shp and /dev/null differ diff --git a/tests/data/shp/long_lat.shx b/tests/data/shp/long_lat.shx deleted file mode 100644 index cc0b42ae7..000000000 Binary files a/tests/data/shp/long_lat.shx and /dev/null differ diff --git a/tests/data/shp/ne_110m_admin_0_countries.dbf b/tests/data/shp/ne_110m_admin_0_countries.dbf deleted file mode 100644 index 5fc769dd7..000000000 Binary files a/tests/data/shp/ne_110m_admin_0_countries.dbf and /dev/null differ diff --git a/tests/data/shp/ne_110m_admin_0_countries.prj b/tests/data/shp/ne_110m_admin_0_countries.prj deleted file mode 100644 index f45cbadf0..000000000 --- a/tests/data/shp/ne_110m_admin_0_countries.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] \ No newline at end of file diff --git a/tests/data/shp/ne_110m_admin_0_countries.shp b/tests/data/shp/ne_110m_admin_0_countries.shp deleted file mode 100644 index f3a3c4eac..000000000 Binary files a/tests/data/shp/ne_110m_admin_0_countries.shp and /dev/null differ diff --git a/tests/data/shp/ne_110m_admin_0_countries.shx b/tests/data/shp/ne_110m_admin_0_countries.shx deleted file mode 100644 index eacce7b01..000000000 Binary files a/tests/data/shp/ne_110m_admin_0_countries.shx and /dev/null differ diff --git a/tests/data/shp/new_zealand/ne_50m_land.dbf b/tests/data/shp/new_zealand/ne_50m_land.dbf deleted file mode 100644 index 8804b2209..000000000 Binary files a/tests/data/shp/new_zealand/ne_50m_land.dbf and /dev/null differ diff --git a/tests/data/shp/new_zealand/ne_50m_land.prj b/tests/data/shp/new_zealand/ne_50m_land.prj deleted file mode 100644 index b13a71791..000000000 --- a/tests/data/shp/new_zealand/ne_50m_land.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/tests/data/shp/new_zealand/ne_50m_land.shp b/tests/data/shp/new_zealand/ne_50m_land.shp deleted file mode 100644 index 0820b2023..000000000 Binary files a/tests/data/shp/new_zealand/ne_50m_land.shp and /dev/null differ diff --git a/tests/data/shp/new_zealand/ne_50m_land.shx b/tests/data/shp/new_zealand/ne_50m_land.shx deleted file mode 100644 index 669690545..000000000 Binary files a/tests/data/shp/new_zealand/ne_50m_land.shx and /dev/null differ diff --git a/tests/data/shp/new_zealand/ne_50m_populated_places_simple.dbf b/tests/data/shp/new_zealand/ne_50m_populated_places_simple.dbf deleted file mode 100644 index 49314124a..000000000 Binary files a/tests/data/shp/new_zealand/ne_50m_populated_places_simple.dbf and /dev/null differ diff --git a/tests/data/shp/new_zealand/ne_50m_populated_places_simple.prj b/tests/data/shp/new_zealand/ne_50m_populated_places_simple.prj deleted file mode 100644 index b13a71791..000000000 --- a/tests/data/shp/new_zealand/ne_50m_populated_places_simple.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/tests/data/shp/new_zealand/ne_50m_populated_places_simple.shp b/tests/data/shp/new_zealand/ne_50m_populated_places_simple.shp deleted file mode 100644 index 1df45a697..000000000 Binary files a/tests/data/shp/new_zealand/ne_50m_populated_places_simple.shp and /dev/null differ diff --git a/tests/data/shp/new_zealand/ne_50m_populated_places_simple.shx b/tests/data/shp/new_zealand/ne_50m_populated_places_simple.shx deleted file mode 100644 index 71979b387..000000000 Binary files a/tests/data/shp/new_zealand/ne_50m_populated_places_simple.shx and /dev/null differ diff --git a/tests/data/shp/overlap.dbf b/tests/data/shp/overlap.dbf deleted file mode 100644 index 566f81b5c..000000000 Binary files a/tests/data/shp/overlap.dbf and /dev/null differ diff --git a/tests/data/shp/overlap.shp b/tests/data/shp/overlap.shp deleted file mode 100644 index 7462a5bbc..000000000 Binary files a/tests/data/shp/overlap.shp and /dev/null differ diff --git a/tests/data/shp/overlap.shx b/tests/data/shp/overlap.shx deleted file mode 100644 index c6308ec85..000000000 Binary files a/tests/data/shp/overlap.shx and /dev/null differ diff --git a/tests/data/shp/points/ogr_zfield.dbf b/tests/data/shp/points/ogr_zfield.dbf deleted file mode 100644 index b1d47b23a..000000000 Binary files a/tests/data/shp/points/ogr_zfield.dbf and /dev/null differ diff --git a/tests/data/shp/points/ogr_zfield.prj b/tests/data/shp/points/ogr_zfield.prj deleted file mode 100644 index a30c00a55..000000000 --- a/tests/data/shp/points/ogr_zfield.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/tests/data/shp/points/ogr_zfield.shp b/tests/data/shp/points/ogr_zfield.shp deleted file mode 100644 index 6735df41b..000000000 Binary files a/tests/data/shp/points/ogr_zfield.shp and /dev/null differ diff --git a/tests/data/shp/points/ogr_zfield.shx b/tests/data/shp/points/ogr_zfield.shx deleted file mode 100644 index e3b45769c..000000000 Binary files a/tests/data/shp/points/ogr_zfield.shx and /dev/null differ diff --git a/tests/data/shp/points/poi.dbf b/tests/data/shp/points/poi.dbf deleted file mode 100644 index 797d92d5e..000000000 Binary files a/tests/data/shp/points/poi.dbf and /dev/null differ diff --git a/tests/data/shp/points/poi.prj b/tests/data/shp/points/poi.prj deleted file mode 100644 index 91f1f56b1..000000000 --- a/tests/data/shp/points/poi.prj +++ /dev/null @@ -1 +0,0 @@ -PROJCS["NAD_1983_HARN_StatePlane_North_Carolina_FIPS_3200_Feet",GEOGCS["GCS_North_American_1983_HARN",DATUM["D_North_American_1983_HARN",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",2000000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-79.0],PARAMETER["Standard_Parallel_1",34.33333333333334],PARAMETER["Standard_Parallel_2",36.16666666666666],PARAMETER["Latitude_Of_Origin",33.75],UNIT["Foot_US",0.3048006096012192]] \ No newline at end of file diff --git a/tests/data/shp/points/poi.shp b/tests/data/shp/points/poi.shp deleted file mode 100644 index de2ad3431..000000000 Binary files a/tests/data/shp/points/poi.shp and /dev/null differ diff --git a/tests/data/shp/points/poi.shx b/tests/data/shp/points/poi.shx deleted file mode 100644 index 092e61907..000000000 Binary files a/tests/data/shp/points/poi.shx and /dev/null differ diff --git a/tests/data/shp/points/poi.zip b/tests/data/shp/points/poi.zip deleted file mode 100644 index 66f40bc46..000000000 Binary files a/tests/data/shp/points/poi.zip and /dev/null differ diff --git a/tests/data/shp/points/poi_ogr.dbf b/tests/data/shp/points/poi_ogr.dbf deleted file mode 100644 index 47066180b..000000000 Binary files a/tests/data/shp/points/poi_ogr.dbf and /dev/null differ diff --git a/tests/data/shp/points/poi_ogr.prj b/tests/data/shp/points/poi_ogr.prj deleted file mode 100644 index 1bca7ccec..000000000 --- a/tests/data/shp/points/poi_ogr.prj +++ /dev/null @@ -1 +0,0 @@ -PROJCS["NAD_1983_HARN_StatePlane_North_Carolina_FIPS_3200_Feet",GEOGCS["GCS_North_American_1983_HARN",DATUM["D_North_American_1983_HARN",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",2000000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-79.0],PARAMETER["Standard_Parallel_1",34.33333333333334],PARAMETER["Standard_Parallel_2",36.16666666666666],PARAMETER["Latitude_Of_Origin",33.75],UNIT["Foot_US",0.30480060960121924]] \ No newline at end of file diff --git a/tests/data/shp/points/poi_ogr.shp b/tests/data/shp/points/poi_ogr.shp deleted file mode 100644 index a50e78f87..000000000 Binary files a/tests/data/shp/points/poi_ogr.shp and /dev/null differ diff --git a/tests/data/shp/points/poi_ogr.shx b/tests/data/shp/points/poi_ogr.shx deleted file mode 100644 index d05f21dbb..000000000 Binary files a/tests/data/shp/points/poi_ogr.shx and /dev/null differ diff --git a/tests/data/shp/points/qgis.dbf b/tests/data/shp/points/qgis.dbf deleted file mode 100644 index be97f7eb9..000000000 Binary files a/tests/data/shp/points/qgis.dbf and /dev/null differ diff --git a/tests/data/shp/points/qgis.prj b/tests/data/shp/points/qgis.prj deleted file mode 100644 index a30c00a55..000000000 --- a/tests/data/shp/points/qgis.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/tests/data/shp/points/qgis.qpj b/tests/data/shp/points/qgis.qpj deleted file mode 100644 index 5fbc831e7..000000000 --- a/tests/data/shp/points/qgis.qpj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]] diff --git a/tests/data/shp/points/qgis.shp b/tests/data/shp/points/qgis.shp deleted file mode 100644 index c3c635164..000000000 Binary files a/tests/data/shp/points/qgis.shp and /dev/null differ diff --git a/tests/data/shp/points/qgis.shx b/tests/data/shp/points/qgis.shx deleted file mode 100644 index d7e283456..000000000 Binary files a/tests/data/shp/points/qgis.shx and /dev/null differ diff --git a/tests/data/shp/points/qgis_multi.dbf b/tests/data/shp/points/qgis_multi.dbf deleted file mode 100644 index 839e3b4fe..000000000 Binary files a/tests/data/shp/points/qgis_multi.dbf and /dev/null differ diff --git a/tests/data/shp/points/qgis_multi.prj b/tests/data/shp/points/qgis_multi.prj deleted file mode 100644 index a30c00a55..000000000 --- a/tests/data/shp/points/qgis_multi.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/tests/data/shp/points/qgis_multi.qpj b/tests/data/shp/points/qgis_multi.qpj deleted file mode 100644 index 5fbc831e7..000000000 --- a/tests/data/shp/points/qgis_multi.qpj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]] diff --git a/tests/data/shp/points/qgis_multi.shp b/tests/data/shp/points/qgis_multi.shp deleted file mode 100644 index 53af804d4..000000000 Binary files a/tests/data/shp/points/qgis_multi.shp and /dev/null differ diff --git a/tests/data/shp/points/qgis_multi.shx b/tests/data/shp/points/qgis_multi.shx deleted file mode 100644 index 6c761fd4d..000000000 Binary files a/tests/data/shp/points/qgis_multi.shx and /dev/null differ diff --git a/tests/data/shp/poly.dbf b/tests/data/shp/poly.dbf deleted file mode 100644 index 277f8ff73..000000000 Binary files a/tests/data/shp/poly.dbf and /dev/null differ diff --git a/tests/data/shp/poly.prj b/tests/data/shp/poly.prj deleted file mode 100644 index 1dc12b346..000000000 --- a/tests/data/shp/poly.prj +++ /dev/null @@ -1 +0,0 @@ -PROJCS["OSGB 1936 / British National Grid",GEOGCS["OSGB 1936",DATUM["D_OSGB_1936",SPHEROID["Airy_1830",6377563.396,299.3249646]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",49],PARAMETER["central_meridian",-2],PARAMETER["scale_factor",0.9996012717],PARAMETER["false_easting",400000],PARAMETER["false_northing",-100000],UNIT["Meter",1]] \ No newline at end of file diff --git a/tests/data/shp/poly.shp b/tests/data/shp/poly.shp deleted file mode 100644 index 98951531b..000000000 Binary files a/tests/data/shp/poly.shp and /dev/null differ diff --git a/tests/data/shp/poly.shx b/tests/data/shp/poly.shx deleted file mode 100644 index 134898b38..000000000 Binary files a/tests/data/shp/poly.shx and /dev/null differ diff --git a/tests/data/shp/polylines.dbf b/tests/data/shp/polylines.dbf deleted file mode 100755 index ecd2415b0..000000000 Binary files a/tests/data/shp/polylines.dbf and /dev/null differ diff --git a/tests/data/shp/polylines.prj b/tests/data/shp/polylines.prj deleted file mode 100755 index c49d9edec..000000000 --- a/tests/data/shp/polylines.prj +++ /dev/null @@ -1 +0,0 @@ -PROJCS["Spherical Mercator",GEOGCS["Unknown",DATUM["D_Unknown",SPHEROID["GRS80_Sphere_No_Flattening",6378137,0]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] \ No newline at end of file diff --git a/tests/data/shp/polylines.shp b/tests/data/shp/polylines.shp deleted file mode 100755 index aa1cf9c09..000000000 Binary files a/tests/data/shp/polylines.shp and /dev/null differ diff --git a/tests/data/shp/polylines.shx b/tests/data/shp/polylines.shx deleted file mode 100755 index 5aecc013f..000000000 Binary files a/tests/data/shp/polylines.shx and /dev/null differ diff --git a/tests/data/shp/textspacing.dbf b/tests/data/shp/textspacing.dbf deleted file mode 100644 index bd1b1276c..000000000 Binary files a/tests/data/shp/textspacing.dbf and /dev/null differ diff --git a/tests/data/shp/textspacing.shp b/tests/data/shp/textspacing.shp deleted file mode 100644 index 60dc7c081..000000000 Binary files a/tests/data/shp/textspacing.shp and /dev/null differ diff --git a/tests/data/shp/textspacing.shx b/tests/data/shp/textspacing.shx deleted file mode 100644 index 9c4767dd8..000000000 Binary files a/tests/data/shp/textspacing.shx and /dev/null differ diff --git a/tests/data/shp/wkt_poly.dbf b/tests/data/shp/wkt_poly.dbf deleted file mode 100644 index 09587db43..000000000 Binary files a/tests/data/shp/wkt_poly.dbf and /dev/null differ diff --git a/tests/data/shp/wkt_poly.shp b/tests/data/shp/wkt_poly.shp deleted file mode 100644 index 207eb46af..000000000 Binary files a/tests/data/shp/wkt_poly.shp and /dev/null differ diff --git a/tests/data/shp/wkt_poly.shx b/tests/data/shp/wkt_poly.shx deleted file mode 100644 index fc4b733e2..000000000 Binary files a/tests/data/shp/wkt_poly.shx and /dev/null differ diff --git a/tests/data/shp/world_merc.dbf b/tests/data/shp/world_merc.dbf deleted file mode 100644 index 2de17d74e..000000000 Binary files a/tests/data/shp/world_merc.dbf and /dev/null differ diff --git a/tests/data/shp/world_merc.prj b/tests/data/shp/world_merc.prj deleted file mode 100644 index 16b8e1eef..000000000 --- a/tests/data/shp/world_merc.prj +++ /dev/null @@ -1 +0,0 @@ -PROJCS["Google Maps Global Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator_2SP"],PARAMETER["standard_parallel_1",0],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] \ No newline at end of file diff --git a/tests/data/shp/world_merc.shp b/tests/data/shp/world_merc.shp deleted file mode 100644 index eaf627d86..000000000 Binary files a/tests/data/shp/world_merc.shp and /dev/null differ diff --git a/tests/data/shp/world_merc.shx b/tests/data/shp/world_merc.shx deleted file mode 100644 index c2eeb54b0..000000000 Binary files a/tests/data/shp/world_merc.shx and /dev/null differ diff --git a/tests/data/shp/world_merc2.dbf b/tests/data/shp/world_merc2.dbf deleted file mode 100644 index d9a91420a..000000000 Binary files a/tests/data/shp/world_merc2.dbf and /dev/null differ diff --git a/tests/data/shp/world_merc2.prj b/tests/data/shp/world_merc2.prj deleted file mode 100644 index a04443eaa..000000000 --- a/tests/data/shp/world_merc2.prj +++ /dev/null @@ -1 +0,0 @@ -PROJCS["WGS_84_World_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1],PARAMETER["standard_parallel_1",0.0]] \ No newline at end of file diff --git a/tests/data/shp/world_merc2.shp b/tests/data/shp/world_merc2.shp deleted file mode 100644 index bbdb453ed..000000000 Binary files a/tests/data/shp/world_merc2.shp and /dev/null differ diff --git a/tests/data/shp/world_merc2.shx b/tests/data/shp/world_merc2.shx deleted file mode 100644 index 4b20df3f0..000000000 Binary files a/tests/data/shp/world_merc2.shx and /dev/null differ diff --git a/tests/data/shp/world_merc_license.txt b/tests/data/shp/world_merc_license.txt deleted file mode 100644 index b32fcc9aa..000000000 --- a/tests/data/shp/world_merc_license.txt +++ /dev/null @@ -1,85 +0,0 @@ -world_merc -========== - -'world_merc.shp' is a version of TM_WORLD_BORDERS_SIMPL-0.3.shp -downloaded from http://thematicmapping.org/downloads/world_borders.php. - -Coodinates near 180 degress longitude were clipped to faciliate reprojection -to Google mercator (EPSG:900913). - -Details from original readme are below: - -------------- - -TM_WORLD_BORDERS-0.1.ZIP - -Provided by Bjorn Sandvik, thematicmapping.org - -Use this dataset with care, as several of the borders are disputed. - -The original shapefile (world_borders.zip, 3.2 MB) was downloaded from the Mapping Hacks website: -http://www.mappinghacks.com/data/ - -The dataset was derived by Schuyler Erle from public domain sources. -Sean Gilles did some clean up and made some enhancements. - - -COLUMN TYPE DESCRIPTION - -Shape Polygon Country/area border as polygon(s) -FIPS String(2) FIPS 10-4 Country Code -ISO2 String(2) ISO 3166-1 Alpha-2 Country Code -ISO3 String(3) ISO 3166-1 Alpha-3 Country Code -UN Short Integer(3) ISO 3166-1 Numeric-3 Country Code -NAME String(50) Name of country/area -AREA Long Integer(7) Land area, FAO Statistics (2002) -POP2005 Double(10,0) Population, World Polulation Prospects (2005) -REGION Short Integer(3) Macro geographical (continental region), UN Statistics -SUBREGION Short Integer(3) Geogrpahical sub-region, UN Statistics -LON FLOAT (7,3) Longitude -LAT FLOAT (6,3) Latitude - - -CHANGELOG VERSION 0.3 - 30 July 2008 - -- Corrected spelling mistake (United Arab Emirates) -- Corrected population number for Japan -- Adjusted long/lat values for India, Italy and United Kingdom - - -CHANGELOG VERSION 0.2 - 1 April 2008 - -- Made new ZIP archieves. No change in dataset. - - -CHANGELOG VERSION 0.1 - 13 March 2008 - -- Polygons representing each country were merged into one feature -- ≈land Islands was extracted from Finland -- Hong Kong was extracted from China -- Holy See (Vatican City) was added -- Gaza Strip and West Bank was merged into "Occupied Palestinean Territory" -- Saint-Barthelemy was extracted from Netherlands Antilles -- Saint-Martin (Frensh part) was extracted from Guadeloupe -- Svalbard and Jan Mayen was merged into "Svalbard and Jan Mayen Islands" -- Timor-Leste was extracted from Indonesia -- Juan De Nova Island was merged with "French Southern & Antarctic Land" -- Baker Island, Howland Island, Jarvis Island, Johnston Atoll, Midway Islands - and Wake Island was merged into "United States Minor Outlying Islands" -- Glorioso Islands, Parcel Islands, Spartly Islands was removed - (almost uninhabited and missing ISO-3611-1 code) - -- Added ISO-3166-1 codes (alpha-2, alpha-3, numeric-3). Source: - https://www.cia.gov/library/publications/the-world-factbook/appendix/appendix-d.html - http://unstats.un.org/unsd/methods/m49/m49alpha.htm - http://www.fysh.org/~katie/development/geography.txt -- AREA column has been replaced with data from UNdata: - Land area, 1000 hectares, 2002, FAO Statistics -- POPULATION column (POP2005) has been replaced with data from UNdata: - Population, 2005, Medium variant, World Population Prospects: The 2006 Revision -- Added region and sub-region codes from UN Statistics Division. Source: - http://unstats.un.org/unsd/methods/m49/m49regin.htm -- Added LAT, LONG values for each country - - - diff --git a/tests/data/sqlite/64bit_int.sqlite b/tests/data/sqlite/64bit_int.sqlite deleted file mode 100644 index 2918ddee4..000000000 Binary files a/tests/data/sqlite/64bit_int.sqlite and /dev/null differ diff --git a/tests/data/sqlite/business.sqlite b/tests/data/sqlite/business.sqlite deleted file mode 100755 index fd8a2463c..000000000 Binary files a/tests/data/sqlite/business.sqlite and /dev/null differ diff --git a/tests/data/sqlite/empty.db b/tests/data/sqlite/empty.db deleted file mode 100644 index 98816e6c2..000000000 Binary files a/tests/data/sqlite/empty.db and /dev/null differ diff --git a/tests/data/sqlite/qgis_spatiallite.sqlite b/tests/data/sqlite/qgis_spatiallite.sqlite deleted file mode 100644 index ff9639b80..000000000 Binary files a/tests/data/sqlite/qgis_spatiallite.sqlite and /dev/null differ diff --git a/tests/data/sqlite/world.sqlite b/tests/data/sqlite/world.sqlite deleted file mode 100644 index 802f2dfa7..000000000 Binary files a/tests/data/sqlite/world.sqlite and /dev/null differ diff --git a/tests/data/svg/README.md b/tests/data/svg/README.md deleted file mode 100644 index 328d72ae9..000000000 --- a/tests/data/svg/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Other good sources of svg for tests include: - - * http://intertwingly.net/svg/ - * http://www.w3.org/Graphics/SVG/Test/20110816/ - * http://croczilla.com/bits_and_pieces/svg/samples/ - * http://www.w3schools.com/svg/svg_examples.asp \ No newline at end of file diff --git a/tests/data/svg/airfield-12-nobox.svg b/tests/data/svg/airfield-12-nobox.svg deleted file mode 100644 index bdb567083..000000000 --- a/tests/data/svg/airfield-12-nobox.svg +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff --git a/tests/data/svg/airfield-12.svg b/tests/data/svg/airfield-12.svg deleted file mode 100644 index 74c726a0e..000000000 --- a/tests/data/svg/airfield-12.svg +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/tests/data/svg/box.svg b/tests/data/svg/box.svg deleted file mode 100644 index a6ddb179a..000000000 --- a/tests/data/svg/box.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/tests/data/svg/crosshair16x16.svg b/tests/data/svg/crosshair16x16.svg deleted file mode 100644 index 9a3ba9ab3..000000000 --- a/tests/data/svg/crosshair16x16.svg +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - diff --git a/tests/data/svg/ellipses.svg b/tests/data/svg/ellipses.svg deleted file mode 100644 index 114cf9e06..000000000 --- a/tests/data/svg/ellipses.svg +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/data/svg/linepattern.svg b/tests/data/svg/linepattern.svg deleted file mode 100644 index 147cdf5bc..000000000 --- a/tests/data/svg/linepattern.svg +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/tests/data/svg/octocat.svg b/tests/data/svg/octocat.svg deleted file mode 100644 index 1f883261b..000000000 --- a/tests/data/svg/octocat.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/data/svg/place-of-worship-24.svg b/tests/data/svg/place-of-worship-24.svg deleted file mode 100644 index ac31795a1..000000000 --- a/tests/data/svg/place-of-worship-24.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - diff --git a/tests/data/svg/point.svg b/tests/data/svg/point.svg deleted file mode 100644 index bb71f432b..000000000 --- a/tests/data/svg/point.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tests/data/svg/point_sm.svg b/tests/data/svg/point_sm.svg deleted file mode 100644 index 2a47ccfa9..000000000 --- a/tests/data/svg/point_sm.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tests/data/svg/radial.svg b/tests/data/svg/radial.svg deleted file mode 100644 index 1dc3dccc5..000000000 --- a/tests/data/svg/radial.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/tests/data/svg/radial_combo.svg b/tests/data/svg/radial_combo.svg deleted file mode 100644 index 27a454da4..000000000 --- a/tests/data/svg/radial_combo.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/data/svg/rect-no-fill.svg b/tests/data/svg/rect-no-fill.svg deleted file mode 100644 index d4b32c644..000000000 --- a/tests/data/svg/rect-no-fill.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/tests/data/svg/rect-no-stroke.svg b/tests/data/svg/rect-no-stroke.svg deleted file mode 100644 index 06d034275..000000000 --- a/tests/data/svg/rect-no-stroke.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/tests/data/svg/rect.svg b/tests/data/svg/rect.svg deleted file mode 100644 index e05c3baa3..000000000 --- a/tests/data/svg/rect.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/tests/data/svg/rect2.svg b/tests/data/svg/rect2.svg deleted file mode 100644 index 37907075f..000000000 --- a/tests/data/svg/rect2.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - - \ No newline at end of file diff --git a/tests/data/svg/transparent_circle.svg b/tests/data/svg/transparent_circle.svg deleted file mode 100644 index ac5ec6c50..000000000 --- a/tests/data/svg/transparent_circle.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/tests/data/tiff/README.md b/tests/data/tiff/README.md deleted file mode 100644 index 3be591138..000000000 --- a/tests/data/tiff/README.md +++ /dev/null @@ -1,4 +0,0 @@ -striped images created with rio -tiled images created with: - - tiffcp -t -w256 -l256 -c lzw input.tiff output.tif \ No newline at end of file diff --git a/tests/data/tiff/ndvi_256x256_gray16_striped.tif b/tests/data/tiff/ndvi_256x256_gray16_striped.tif deleted file mode 100644 index 3036698be..000000000 Binary files a/tests/data/tiff/ndvi_256x256_gray16_striped.tif and /dev/null differ diff --git a/tests/data/tiff/ndvi_256x256_gray16_tiled.tif b/tests/data/tiff/ndvi_256x256_gray16_tiled.tif deleted file mode 100644 index 65705f531..000000000 Binary files a/tests/data/tiff/ndvi_256x256_gray16_tiled.tif and /dev/null differ diff --git a/tests/data/tiff/ndvi_256x256_gray32f_striped.tif b/tests/data/tiff/ndvi_256x256_gray32f_striped.tif deleted file mode 100644 index daf2f70b7..000000000 Binary files a/tests/data/tiff/ndvi_256x256_gray32f_striped.tif and /dev/null differ diff --git a/tests/data/tiff/ndvi_256x256_gray32f_tiled.tif b/tests/data/tiff/ndvi_256x256_gray32f_tiled.tif deleted file mode 100644 index 5ad67417d..000000000 Binary files a/tests/data/tiff/ndvi_256x256_gray32f_tiled.tif and /dev/null differ diff --git a/tests/data/tiff/ndvi_256x256_gray8_striped.tif b/tests/data/tiff/ndvi_256x256_gray8_striped.tif deleted file mode 100644 index c6a90d6ba..000000000 Binary files a/tests/data/tiff/ndvi_256x256_gray8_striped.tif and /dev/null differ diff --git a/tests/data/tiff/ndvi_256x256_gray8_tiled.tif b/tests/data/tiff/ndvi_256x256_gray8_tiled.tif deleted file mode 100644 index e01a743fb..000000000 Binary files a/tests/data/tiff/ndvi_256x256_gray8_tiled.tif and /dev/null differ diff --git a/tests/data/tiff/ndvi_256x256_rgb.tiff b/tests/data/tiff/ndvi_256x256_rgb.tiff deleted file mode 100644 index d755b181e..000000000 Binary files a/tests/data/tiff/ndvi_256x256_rgb.tiff and /dev/null differ diff --git a/tests/data/tiff/ndvi_256x256_rgb8_striped.tif b/tests/data/tiff/ndvi_256x256_rgb8_striped.tif deleted file mode 100644 index 5ed7f06d3..000000000 Binary files a/tests/data/tiff/ndvi_256x256_rgb8_striped.tif and /dev/null differ diff --git a/tests/data/tiff/ndvi_256x256_rgb8_tiled.tif b/tests/data/tiff/ndvi_256x256_rgb8_tiled.tif deleted file mode 100644 index 5e0cb6348..000000000 Binary files a/tests/data/tiff/ndvi_256x256_rgb8_tiled.tif and /dev/null differ diff --git a/tests/data/tiff/ndvi_256x256_rgba8_striped.tif b/tests/data/tiff/ndvi_256x256_rgba8_striped.tif deleted file mode 100644 index bed2b30e9..000000000 Binary files a/tests/data/tiff/ndvi_256x256_rgba8_striped.tif and /dev/null differ diff --git a/tests/data/tiff/ndvi_256x256_rgba8_tiled.tif b/tests/data/tiff/ndvi_256x256_rgba8_tiled.tif deleted file mode 100644 index c3c5e2e61..000000000 Binary files a/tests/data/tiff/ndvi_256x256_rgba8_tiled.tif and /dev/null differ diff --git a/tests/data/tiff/scan_512x512_rgb8_striped.tif b/tests/data/tiff/scan_512x512_rgb8_striped.tif deleted file mode 100644 index ac94c81f3..000000000 Binary files a/tests/data/tiff/scan_512x512_rgb8_striped.tif and /dev/null differ diff --git a/tests/data/tiff/scan_512x512_rgb8_tiled.tif b/tests/data/tiff/scan_512x512_rgb8_tiled.tif deleted file mode 100644 index f5cbf1004..000000000 Binary files a/tests/data/tiff/scan_512x512_rgb8_tiled.tif and /dev/null differ diff --git a/tests/data/vrt/points.vrt b/tests/data/vrt/points.vrt deleted file mode 100644 index e40d87086..000000000 --- a/tests/data/vrt/points.vrt +++ /dev/null @@ -1,8 +0,0 @@ - - - ../csv/points.csv - wkbPoint - WGS84 - - - \ No newline at end of file diff --git a/tests/data/warning_maps/line_pattern_symbolizer_broken.xml b/tests/data/warning_maps/line_pattern_symbolizer_broken.xml deleted file mode 100644 index 2f2763f48..000000000 --- a/tests/data/warning_maps/line_pattern_symbolizer_broken.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/warning_maps/missing_icon.xml b/tests/data/warning_maps/missing_icon.xml deleted file mode 100644 index fa1f0919a..000000000 --- a/tests/data/warning_maps/missing_icon.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/data/warning_maps/point_symbolizer_broken.xml b/tests/data/warning_maps/point_symbolizer_broken.xml deleted file mode 100644 index 98c22a8ea..000000000 --- a/tests/data/warning_maps/point_symbolizer_broken.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/python_tests/__init__.py b/tests/python_tests/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/python_tests/agg_rasterizer_integer_overflow_test.py b/tests/python_tests/agg_rasterizer_integer_overflow_test.py deleted file mode 100644 index 3635e1424..000000000 --- a/tests/python_tests/agg_rasterizer_integer_overflow_test.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.tools import eq_ -from utilities import run_all -import mapnik -import json - -# geojson box of the world -geojson = { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -17963313.143242701888084, -6300857.11560364998877 ], [ -17963313.143242701888084, 13071343.332991421222687 ], [ 7396658.353099936619401, 13071343.332991421222687 ], [ 7396658.353099936619401, -6300857.11560364998877 ], [ -17963313.143242701888084, -6300857.11560364998877 ] ] ] } } - -def test_that_coordinates_do_not_overflow_and_polygon_is_rendered(): - expected_color = mapnik.Color('white') - ds = mapnik.MemoryDatasource() - context = mapnik.Context() - ds.add_feature(mapnik.Feature.from_geojson(json.dumps(geojson),context)) - s = mapnik.Style() - r = mapnik.Rule() - sym = mapnik.PolygonSymbolizer() - sym.fill = expected_color - sym.clip = False - r.symbols.append(sym) - s.rules.append(r) - lyr = mapnik.Layer('Layer') - lyr.datasource = ds - lyr.styles.append('style') - m = mapnik.Map(256,256) - m.background_color = mapnik.Color('black') - m.append_style('style',s) - m.layers.append(lyr) - # 17/20864/45265.png - m.zoom_to_box(mapnik.Box2d(-13658379.710221574,6197514.253362091,-13657768.213995293,6198125.749588372)) - # works 15/5216/11316.png - #m.zoom_to_box(mapnik.Box2d(-13658379.710221574,6195679.764683247,-13655933.72531645,6198125.749588372)) - im = mapnik.Image(256,256) - mapnik.render(m,im) - eq_(im.get_pixel(128,128),expected_color.packed()) - -if __name__ == "__main__": - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/box2d_test.py b/tests/python_tests/box2d_test.py deleted file mode 100644 index c44100287..000000000 --- a/tests/python_tests/box2d_test.py +++ /dev/null @@ -1,176 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.tools import eq_,assert_true,assert_almost_equal,assert_false -from utilities import run_all -import mapnik - -def test_coord_init(): - c = mapnik.Coord(100, 100) - - eq_(c.x, 100) - eq_(c.y, 100) - -def test_coord_multiplication(): - c = mapnik.Coord(100, 100) - c *= 2 - - eq_(c.x, 200) - eq_(c.y, 200) - -def test_envelope_init(): - e = mapnik.Box2d(100, 100, 200, 200) - - assert_true(e.contains(100, 100)) - assert_true(e.contains(100, 200)) - assert_true(e.contains(200, 200)) - assert_true(e.contains(200, 100)) - - assert_true(e.contains(e.center())) - - assert_false(e.contains(99.9, 99.9)) - assert_false(e.contains(99.9, 200.1)) - assert_false(e.contains(200.1, 200.1)) - assert_false(e.contains(200.1, 99.9)) - - eq_(e.width(), 100) - eq_(e.height(), 100) - - eq_(e.minx, 100) - eq_(e.miny, 100) - - eq_(e.maxx, 200) - eq_(e.maxy, 200) - - eq_(e[0],100) - eq_(e[1],100) - eq_(e[2],200) - eq_(e[3],200) - eq_(e[0],e[-4]) - eq_(e[1],e[-3]) - eq_(e[2],e[-2]) - eq_(e[3],e[-1]) - - c = e.center() - - eq_(c.x, 150) - eq_(c.y, 150) - -def test_envelope_static_init(): - e = mapnik.Box2d.from_string('100 100 200 200') - e2 = mapnik.Box2d.from_string('100,100,200,200') - e3 = mapnik.Box2d.from_string('100 , 100 , 200 , 200') - eq_(e,e2) - eq_(e,e3) - - assert_true(e.contains(100, 100)) - assert_true(e.contains(100, 200)) - assert_true(e.contains(200, 200)) - assert_true(e.contains(200, 100)) - - assert_true(e.contains(e.center())) - - assert_false(e.contains(99.9, 99.9)) - assert_false(e.contains(99.9, 200.1)) - assert_false(e.contains(200.1, 200.1)) - assert_false(e.contains(200.1, 99.9)) - - eq_(e.width(), 100) - eq_(e.height(), 100) - - eq_(e.minx, 100) - eq_(e.miny, 100) - - eq_(e.maxx, 200) - eq_(e.maxy, 200) - - eq_(e[0],100) - eq_(e[1],100) - eq_(e[2],200) - eq_(e[3],200) - eq_(e[0],e[-4]) - eq_(e[1],e[-3]) - eq_(e[2],e[-2]) - eq_(e[3],e[-1]) - - c = e.center() - - eq_(c.x, 150) - eq_(c.y, 150) - -def test_envelope_multiplication(): - # no width then no impact of multiplication - a = mapnik.Box2d(100, 100, 100, 100) - a *= 5 - eq_(a.minx,100) - eq_(a.miny,100) - eq_(a.maxx,100) - eq_(a.maxy,100) - - a = mapnik.Box2d(100.0, 100.0, 100.0, 100.0) - a *= 5 - eq_(a.minx,100) - eq_(a.miny,100) - eq_(a.maxx,100) - eq_(a.maxy,100) - - a = mapnik.Box2d(100.0, 100.0, 100.001, 100.001) - a *= 5 - assert_almost_equal(a.minx, 99.9979, places=3) - assert_almost_equal(a.miny, 99.9979, places=3) - assert_almost_equal(a.maxx, 100.0030, places=3) - assert_almost_equal(a.maxy, 100.0030, places=3) - - e = mapnik.Box2d(100, 100, 200, 200) - e *= 2 - eq_(e.minx,50) - eq_(e.miny,50) - eq_(e.maxx,250) - eq_(e.maxy,250) - - assert_true(e.contains(50, 50)) - assert_true(e.contains(50, 250)) - assert_true(e.contains(250, 250)) - assert_true(e.contains(250, 50)) - - assert_false(e.contains(49.9, 49.9)) - assert_false(e.contains(49.9, 250.1)) - assert_false(e.contains(250.1, 250.1)) - assert_false(e.contains(250.1, 49.9)) - - assert_true(e.contains(e.center())) - - eq_(e.width(), 200) - eq_(e.height(), 200) - - eq_(e.minx, 50) - eq_(e.miny, 50) - - eq_(e.maxx, 250) - eq_(e.maxy, 250) - - c = e.center() - - eq_(c.x, 150) - eq_(c.y, 150) - -def test_envelope_clipping(): - e1 = mapnik.Box2d(-180,-90,180,90) - e2 = mapnik.Box2d(-120,40,-110,48) - e1.clip(e2) - eq_(e1,e2) - - # madagascar in merc - e1 = mapnik.Box2d(4772116.5490, -2744395.0631, 5765186.4203, -1609458.0673) - e2 = mapnik.Box2d(5124338.3753, -2240522.1727, 5207501.8621, -2130452.8520) - e1.clip(e2) - eq_(e1,e2) - - # nz in lon/lat - e1 = mapnik.Box2d(163.8062, -47.1897, 179.3628, -33.9069) - e2 = mapnik.Box2d(173.7378, -39.6395, 174.4849, -38.9252) - e1.clip(e2) - eq_(e1,e2) - -if __name__ == "__main__": - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/buffer_clear_test.py b/tests/python_tests/buffer_clear_test.py deleted file mode 100644 index c89c1599a..000000000 --- a/tests/python_tests/buffer_clear_test.py +++ /dev/null @@ -1,61 +0,0 @@ -import os, mapnik -from nose.tools import eq_ -from utilities import execution_path, run_all - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def test_clearing_image_data(): - im = mapnik.Image(256,256) - # make sure it equals itself - bytes = im.tostring() - eq_(im.tostring(),bytes) - # set background, then clear - im.background = mapnik.Color('green') - eq_(im.tostring()!=bytes,True) - # clear image, should now equal original - im.clear() - eq_(im.tostring(),bytes) - -def make_map(): - ds = mapnik.MemoryDatasource() - context = mapnik.Context() - context.push('Name') - pixel_key = 1 - f = mapnik.Feature(context,pixel_key) - f['Name'] = str(pixel_key) - f.add_geometries_from_wkt('POLYGON ((0 0, 0 256, 256 256, 256 0, 0 0))') - ds.add_feature(f) - s = mapnik.Style() - r = mapnik.Rule() - symb = mapnik.PolygonSymbolizer() - r.symbols.append(symb) - s.rules.append(r) - lyr = mapnik.Layer('Places') - lyr.datasource = ds - lyr.styles.append('places_labels') - width,height = 256,256 - m = mapnik.Map(width,height) - m.append_style('places_labels',s) - m.layers.append(lyr) - m.zoom_all() - return m - -if mapnik.has_grid_renderer(): - def test_clearing_grid_data(): - g = mapnik.Grid(256,256) - utf = g.encode() - # make sure it equals itself - eq_(g.encode(),utf) - m = make_map() - mapnik.render_layer(m,g,layer=0,fields=['__id__','Name']) - eq_(g.encode()!=utf,True) - # clear grid, should now match original - g.clear() - eq_(g.encode(),utf) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/cairo_test.py b/tests/python_tests/cairo_test.py deleted file mode 100644 index 30b718efb..000000000 --- a/tests/python_tests/cairo_test.py +++ /dev/null @@ -1,196 +0,0 @@ -#!/usr/bin/env python - -import os -import shutil -import mapnik -from nose.tools import eq_ -from utilities import execution_path, run_all - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def make_tmp_map(): - m = mapnik.Map(512,512) - m.background_color = mapnik.Color('steelblue') - ds = mapnik.MemoryDatasource() - context = mapnik.Context() - context.push('Name') - f = mapnik.Feature(context,1) - f['Name'] = 'Hello' - f.add_geometries_from_wkt('POINT (0 0)') - ds.add_feature(f) - s = mapnik.Style() - r = mapnik.Rule() - sym = mapnik.MarkersSymbolizer() - sym.allow_overlap = True - r.symbols.append(sym) - s.rules.append(r) - lyr = mapnik.Layer('Layer') - lyr.datasource = ds - lyr.styles.append('style') - m.append_style('style',s) - m.layers.append(lyr) - return m - -def draw_title(m,ctx,text,size=10,color=mapnik.Color('black')): - """ Draw a Map Title near the top of a page.""" - middle = m.width/2.0 - ctx.set_source_rgba(*cairo_color(color)) - ctx.select_font_face("DejaVu Sans Book", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL) - ctx.set_font_size(size) - x_bearing, y_bearing, width, height = ctx.text_extents(text)[:4] - ctx.move_to(middle - width / 2 - x_bearing, 20.0 - height / 2 - y_bearing) - ctx.show_text(text) - -def draw_neatline(m,ctx): - w,h = m.width, m.height - ctx.set_source_rgba(*cairo_color(mapnik.Color('black'))) - outline = [ - [0,0],[w,0],[w,h],[0,h] - ] - ctx.set_line_width(1) - for idx,pt in enumerate(outline): - if (idx == 0): - ctx.move_to(*pt) - else: - ctx.line_to(*pt) - ctx.close_path() - inset = 6 - inline = [ - [inset,inset],[w-inset,inset],[w-inset,h-inset],[inset,h-inset] - ] - ctx.set_line_width(inset/2) - for idx,pt in enumerate(inline): - if (idx == 0): - ctx.move_to(*pt) - else: - ctx.line_to(*pt) - ctx.close_path() - ctx.stroke() - -def cairo_color(c): - """ Return a Cairo color tuple from a Mapnik Color.""" - ctx_c = (c.r/255.0,c.g/255.0,c.b/255.0,c.a/255.0) - return ctx_c - -if mapnik.has_pycairo(): - import cairo - - def test_passing_pycairo_context_svg(): - m = make_tmp_map() - m.zoom_to_box(mapnik.Box2d(-180,-90,180,90)) - test_cairo_file = '/tmp/mapnik-cairo-context-test.svg' - surface = cairo.SVGSurface(test_cairo_file, m.width, m.height) - expected_cairo_file = './images/pycairo/cairo-cairo-expected.svg' - context = cairo.Context(surface) - mapnik.render(m,context) - draw_title(m,context,"Hello Map",size=20) - draw_neatline(m,context) - surface.finish() - if not os.path.exists(expected_cairo_file) or os.environ.get('UPDATE'): - print 'generated expected cairo surface file %s' % expected_cairo_file - shutil.copy(test_cairo_file,expected_cairo_file) - diff = abs(os.stat(expected_cairo_file).st_size-os.stat(test_cairo_file).st_size) - msg = 'diff in size (%s) between actual (%s) and expected(%s)' % (diff,test_cairo_file,'tests/python_tests/'+ expected_cairo_file) - eq_( diff < 1500, True, msg) - os.remove(test_cairo_file) - - def test_passing_pycairo_context_pdf(): - m = make_tmp_map() - m.zoom_to_box(mapnik.Box2d(-180,-90,180,90)) - test_cairo_file = '/tmp/mapnik-cairo-context-test.pdf' - surface = cairo.PDFSurface(test_cairo_file, m.width, m.height) - expected_cairo_file = './images/pycairo/cairo-cairo-expected.pdf' - context = cairo.Context(surface) - mapnik.render(m,context) - draw_title(m,context,"Hello Map",size=20) - draw_neatline(m,context) - surface.finish() - if not os.path.exists(expected_cairo_file) or os.environ.get('UPDATE'): - print 'generated expected cairo surface file %s' % expected_cairo_file - shutil.copy(test_cairo_file,expected_cairo_file) - diff = abs(os.stat(expected_cairo_file).st_size-os.stat(test_cairo_file).st_size) - msg = 'diff in size (%s) between actual (%s) and expected(%s)' % (diff,test_cairo_file,'tests/python_tests/'+ expected_cairo_file) - eq_( diff < 1500, True, msg) - os.remove(test_cairo_file) - - def test_passing_pycairo_context_png(): - m = make_tmp_map() - m.zoom_to_box(mapnik.Box2d(-180,-90,180,90)) - test_cairo_file = '/tmp/mapnik-cairo-context-test.png' - surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, m.width, m.height) - expected_cairo_file = './images/pycairo/cairo-cairo-expected.png' - expected_cairo_file2 = './images/pycairo/cairo-cairo-expected-reduced.png' - context = cairo.Context(surface) - mapnik.render(m,context) - draw_title(m,context,"Hello Map",size=20) - draw_neatline(m,context) - surface.write_to_png(test_cairo_file) - reduced_color_image = test_cairo_file.replace('png','-mapnik.png') - im = mapnik.Image.from_cairo(surface) - im.save(reduced_color_image,'png8') - surface.finish() - if not os.path.exists(expected_cairo_file) or os.environ.get('UPDATE'): - print 'generated expected cairo surface file %s' % expected_cairo_file - shutil.copy(test_cairo_file,expected_cairo_file) - diff = abs(os.stat(expected_cairo_file).st_size-os.stat(test_cairo_file).st_size) - msg = 'diff in size (%s) between actual (%s) and expected(%s)' % (diff,test_cairo_file,'tests/python_tests/'+ expected_cairo_file) - eq_( diff < 500, True, msg) - os.remove(test_cairo_file) - if not os.path.exists(expected_cairo_file2) or os.environ.get('UPDATE'): - print 'generated expected cairo surface file %s' % expected_cairo_file2 - shutil.copy(reduced_color_image,expected_cairo_file2) - diff = abs(os.stat(expected_cairo_file2).st_size-os.stat(reduced_color_image).st_size) - msg = 'diff in size (%s) between actual (%s) and expected(%s)' % (diff,reduced_color_image,'tests/python_tests/'+ expected_cairo_file2) - eq_( diff < 500, True, msg) - os.remove(reduced_color_image) - - if 'sqlite' in mapnik.DatasourceCache.plugin_names(): - def _pycairo_surface(type,sym): - test_cairo_file = '/tmp/mapnik-cairo-surface-test.%s.%s' % (sym,type) - expected_cairo_file = './images/pycairo/cairo-surface-expected.%s.%s' % (sym,type) - m = mapnik.Map(256,256) - mapnik.load_map(m,'../data/good_maps/%s_symbolizer.xml' % sym) - m.zoom_all() - if hasattr(cairo,'%sSurface' % type.upper()): - surface = getattr(cairo,'%sSurface' % type.upper())(test_cairo_file, m.width,m.height) - mapnik.render(m, surface) - surface.finish() - if not os.path.exists(expected_cairo_file) or os.environ.get('UPDATE'): - print 'generated expected cairo surface file %s' % expected_cairo_file - shutil.copy(test_cairo_file,expected_cairo_file) - diff = abs(os.stat(expected_cairo_file).st_size-os.stat(test_cairo_file).st_size) - msg = 'diff in size (%s) between actual (%s) and expected(%s)' % (diff,test_cairo_file,'tests/python_tests/'+ expected_cairo_file) - if os.uname()[0] == 'Darwin': - eq_( diff < 2100, True, msg) - else: - eq_( diff < 23000, True, msg) - os.remove(test_cairo_file) - return True - else: - print 'skipping cairo.%s test since surface is not available' % type.upper() - return True - - def test_pycairo_svg_surface1(): - eq_(_pycairo_surface('svg','point'),True) - - def test_pycairo_svg_surface2(): - eq_(_pycairo_surface('svg','building'),True) - - def test_pycairo_svg_surface3(): - eq_(_pycairo_surface('svg','polygon'),True) - - def test_pycairo_pdf_surface1(): - eq_(_pycairo_surface('pdf','point'),True) - - def test_pycairo_pdf_surface2(): - eq_(_pycairo_surface('pdf','building'),True) - - def test_pycairo_pdf_surface3(): - eq_(_pycairo_surface('pdf','polygon'),True) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/compositing_test.py b/tests/python_tests/compositing_test.py deleted file mode 100644 index f4d4f24f9..000000000 --- a/tests/python_tests/compositing_test.py +++ /dev/null @@ -1,258 +0,0 @@ -#encoding: utf8 - -from nose.tools import eq_ -import os -from utilities import execution_path, run_all -from utilities import get_unique_colors, pixel2channels, side_by_side_image -import mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def is_pre(color,alpha): - return (color*255.0/alpha) <= 255 - -def debug_image(image,step=2): - for x in range(0,image.width(),step): - for y in range(0,image.height(),step): - pixel = image.get_pixel(x,y) - red,green,blue,alpha = pixel2channels(pixel) - print "rgba(%s,%s,%s,%s) at %s,%s" % (red,green,blue,alpha,x,y) - -def replace_style(m, name, style): - m.remove_style(name) - m.append_style(name, style) - -# note: it is impossible to know for all pixel colors -# we can only detect likely cases of non premultiplied colors -def validate_pixels_are_not_premultiplied(image): - over_alpha = False - transparent = True - fully_opaque = True - for x in range(0,image.width(),2): - for y in range(0,image.height(),2): - pixel = image.get_pixel(x,y) - red,green,blue,alpha = pixel2channels(pixel) - if alpha > 0: - transparent = False - if alpha < 255: - fully_opaque = False - color_max = max(red,green,blue) - if color_max > alpha: - over_alpha = True - return over_alpha or transparent or fully_opaque - -def validate_pixels_are_not_premultiplied2(image): - looks_not_multiplied = False - for x in range(0,image.width(),2): - for y in range(0,image.height(),2): - pixel = image.get_pixel(x,y) - red,green,blue,alpha = pixel2channels(pixel) - #each value of the color channels will never be bigger than that of the alpha channel. - if alpha > 0: - if red > 0 and red > alpha: - print 'red: %s, a: %s' % (red,alpha) - looks_not_multiplied = True - return looks_not_multiplied - -def validate_pixels_are_premultiplied(image): - bad_pixels = [] - for x in range(0,image.width(),2): - for y in range(0,image.height(),2): - pixel = image.get_pixel(x,y) - red,green,blue,alpha = pixel2channels(pixel) - if alpha > 0: - pixel = image.get_pixel(x,y) - is_valid = ((0 <= red <= alpha) and is_pre(red,alpha)) \ - and ((0 <= green <= alpha) and is_pre(green,alpha)) \ - and ((0 <= blue <= alpha) and is_pre(blue,alpha)) \ - and (alpha >= 0 and alpha <= 255) - if not is_valid: - bad_pixels.append("rgba(%s,%s,%s,%s) at %s,%s" % (red,green,blue,alpha,x,y)) - num_bad = len(bad_pixels) - return (num_bad == 0,bad_pixels) - -def test_compare_images(): - b = mapnik.Image.open('./images/support/b.png') - b.premultiply() - num_ops = len(mapnik.CompositeOp.names) - successes = [] - fails = [] - for name in mapnik.CompositeOp.names: - a = mapnik.Image.open('./images/support/a.png') - a.premultiply() - a.composite(b,getattr(mapnik.CompositeOp,name)) - actual = '/tmp/mapnik-comp-op-test-' + name + '.png' - expected = 'images/composited/' + name + '.png' - valid = validate_pixels_are_premultiplied(a) - if not valid[0]: - fails.append('%s not validly premultiplied!:\n\t %s pixels (%s)' % (name,len(valid[1]),valid[1][0])) - a.demultiply() - if not validate_pixels_are_not_premultiplied(a): - fails.append('%s not validly demultiplied' % (name)) - a.save(actual,'png32') - if not os.path.exists(expected) or os.environ.get('UPDATE'): - print 'generating expected test image: %s' % expected - a.save(expected,'png32') - expected_im = mapnik.Image.open(expected) - # compare them - if a.tostring('png32') == expected_im.tostring('png32'): - successes.append(name) - else: - fails.append('failed comparing actual (%s) and expected(%s)' % (actual,'tests/python_tests/'+ expected)) - fail_im = side_by_side_image(expected_im, a) - fail_im.save('/tmp/mapnik-comp-op-test-' + name + '.fail.png','png32') - eq_(len(successes),num_ops,'\n'+'\n'.join(fails)) - b.demultiply() - # b will be slightly modified by pre and then de multiplication rounding errors - # TODO - write test to ensure the image is 99% the same. - #expected_b = mapnik.Image.open('./images/support/b.png') - #b.save('/tmp/mapnik-comp-op-test-original-mask.png') - #eq_(b.tostring('png32'),expected_b.tostring('png32'), '/tmp/mapnik-comp-op-test-original-mask.png is no longer equivalent to original mask: ./images/support/b.png') - -def test_pre_multiply_status(): - b = mapnik.Image.open('./images/support/b.png') - # not premultiplied yet, should appear that way - result = validate_pixels_are_not_premultiplied(b) - eq_(result,True) - # not yet premultiplied therefore should return false - result = validate_pixels_are_premultiplied(b) - eq_(result[0],False) - # now actually premultiply the pixels - b.premultiply() - # now checking if premultiplied should succeed - result = validate_pixels_are_premultiplied(b) - eq_(result[0],True) - # should now not appear to look not premultiplied - result = validate_pixels_are_not_premultiplied(b) - eq_(result,False) - # now actually demultiply the pixels - b.demultiply() - # should now appear demultiplied - result = validate_pixels_are_not_premultiplied(b) - eq_(result,True) - -def test_pre_multiply_status_of_map1(): - m = mapnik.Map(256,256) - im = mapnik.Image(m.width,m.height) - eq_(validate_pixels_are_not_premultiplied(im),True) - mapnik.render(m,im) - eq_(validate_pixels_are_not_premultiplied(im),True) - -def test_pre_multiply_status_of_map2(): - m = mapnik.Map(256,256) - m.background = mapnik.Color(1,1,1,255) - im = mapnik.Image(m.width,m.height) - eq_(validate_pixels_are_not_premultiplied(im),True) - mapnik.render(m,im) - eq_(validate_pixels_are_not_premultiplied(im),True) - -if 'shape' in mapnik.DatasourceCache.plugin_names(): - def test_style_level_comp_op(): - m = mapnik.Map(256, 256) - mapnik.load_map(m, '../data/good_maps/style_level_comp_op.xml') - m.zoom_all() - successes = [] - fails = [] - for name in mapnik.CompositeOp.names: - # find_style returns a copy of the style object - style_markers = m.find_style("markers") - style_markers.comp_op = getattr(mapnik.CompositeOp, name) - # replace the original style with the modified one - replace_style(m, "markers", style_markers) - im = mapnik.Image(m.width, m.height) - mapnik.render(m, im) - actual = '/tmp/mapnik-style-comp-op-' + name + '.png' - expected = 'images/style-comp-op/' + name + '.png' - im.save(actual,'png32') - if not os.path.exists(expected) or os.environ.get('UPDATE'): - print 'generating expected test image: %s' % expected - im.save(expected,'png32') - expected_im = mapnik.Image.open(expected) - # compare them - if im.tostring('png32') == expected_im.tostring('png32'): - successes.append(name) - else: - fails.append('failed comparing actual (%s) and expected(%s)' % (actual,'tests/python_tests/'+ expected)) - fail_im = side_by_side_image(expected_im, im) - fail_im.save('/tmp/mapnik-style-comp-op-' + name + '.fail.png','png32') - eq_(len(fails), 0, '\n'+'\n'.join(fails)) - - def test_style_level_opacity(): - m = mapnik.Map(512,512) - mapnik.load_map(m,'../data/good_maps/style_level_opacity_and_blur.xml') - m.zoom_all() - im = mapnik.Image(512,512) - mapnik.render(m,im) - actual = '/tmp/mapnik-style-level-opacity.png' - expected = 'images/support/mapnik-style-level-opacity.png' - im.save(actual,'png32') - expected_im = mapnik.Image.open(expected) - eq_(im.tostring('png32'),expected_im.tostring('png32'), 'failed comparing actual (%s) and expected (%s)' % (actual,'tests/python_tests/'+ expected)) - -def test_rounding_and_color_expectations(): - m = mapnik.Map(1,1) - m.background = mapnik.Color('rgba(255,255,255,.4999999)') - im = mapnik.Image(m.width,m.height) - mapnik.render(m,im) - eq_(get_unique_colors(im),['rgba(255,255,255,127)']) - m = mapnik.Map(1,1) - m.background = mapnik.Color('rgba(255,255,255,.5)') - im = mapnik.Image(m.width,m.height) - mapnik.render(m,im) - eq_(get_unique_colors(im),['rgba(255,255,255,128)']) - im_file = mapnik.Image.open('../data/images/stripes_pattern.png') - eq_(get_unique_colors(im_file),['rgba(0,0,0,0)', 'rgba(74,74,74,255)']) - # should have no effect - im_file.premultiply() - eq_(get_unique_colors(im_file),['rgba(0,0,0,0)', 'rgba(74,74,74,255)']) - im_file.set_alpha(.5) - # should have effect now that image has transparency - im_file.premultiply() - eq_(get_unique_colors(im_file),['rgba(0,0,0,0)', 'rgba(37,37,37,127)']) - # should restore to original nonpremultiplied colors - im_file.demultiply() - eq_(get_unique_colors(im_file),['rgba(0,0,0,0)', 'rgba(74,74,74,127)']) - - -def test_background_image_and_background_color(): - m = mapnik.Map(8,8) - m.background = mapnik.Color('rgba(255,255,255,.5)') - m.background_image = '../data/images/stripes_pattern.png' - im = mapnik.Image(m.width,m.height) - mapnik.render(m,im) - eq_(get_unique_colors(im),['rgba(255,255,255,128)', 'rgba(74,74,74,255)']) - -def test_background_image_with_alpha_and_background_color(): - m = mapnik.Map(10,10) - m.background = mapnik.Color('rgba(255,255,255,.5)') - m.background_image = '../data/images/yellow_half_trans.png' - im = mapnik.Image(m.width,m.height) - mapnik.render(m,im) - eq_(get_unique_colors(im),['rgba(255,255,85,191)']) - -def test_background_image_with_alpha_and_background_color_against_composited_control(): - m = mapnik.Map(10,10) - m.background = mapnik.Color('rgba(255,255,255,.5)') - m.background_image = '../data/images/yellow_half_trans.png' - im = mapnik.Image(m.width,m.height) - mapnik.render(m,im) - # create and composite the expected result - im1 = mapnik.Image(10,10) - im1.background = mapnik.Color('rgba(255,255,255,.5)') - im1.premultiply() - im2 = mapnik.Image(10,10) - im2.background = mapnik.Color('rgba(255,255,0,.5)') - im2.premultiply() - im1.composite(im2) - im1.demultiply() - # compare image rendered (compositing in `agg_renderer::setup`) - # vs image composited via python bindings - #raise Todo("looks like we need to investigate PNG color rounding when saving") - #eq_(get_unique_colors(im),get_unique_colors(im1)) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/csv_test.py b/tests/python_tests/csv_test.py deleted file mode 100644 index dfff462c3..000000000 --- a/tests/python_tests/csv_test.py +++ /dev/null @@ -1,605 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import glob -from nose.tools import eq_,raises -from utilities import execution_path - -import os, mapnik - -default_logging_severity = mapnik.logger.get_severity() - -def setup(): - # make the tests silent since we intentially test error conditions that are noisy - mapnik.logger.set_severity(mapnik.severity_type.None) - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def teardown(): - mapnik.logger.set_severity(default_logging_severity) - -if 'csv' in mapnik.DatasourceCache.plugin_names(): - - def get_csv_ds(filename): - return mapnik.Datasource(type='csv',file=os.path.join('../data/csv/',filename)) - - def test_broken_files(visual=False): - broken = glob.glob("../data/csv/fails/*.*") - broken.extend(glob.glob("../data/csv/warns/*.*")) - - # Add a filename that doesn't exist - broken.append("../data/csv/fails/does_not_exist.csv") - - for csv in broken: - if visual: - try: - mapnik.Datasource(type='csv',file=csv,strict=True) - print '\x1b[33mfailed: should have thrown\x1b[0m',csv - except Exception: - print '\x1b[1;32m✓ \x1b[0m', csv - - def test_good_files(visual=False): - good_files = glob.glob("../data/csv/*.*") - good_files.extend(glob.glob("../data/csv/warns/*.*")) - ignorable = os.path.join('..','data','csv','long_lat.vrt') - good_files.remove(ignorable) - - for csv in good_files: - if visual: - try: - mapnik.Datasource(type='csv',file=csv) - print '\x1b[1;32m✓ \x1b[0m', csv - except Exception, e: - print '\x1b[33mfailed: should not have thrown\x1b[0m',csv,str(e) - - def test_lon_lat_detection(**kwargs): - ds = get_csv_ds('lon_lat.csv') - eq_(len(ds.fields()),2) - eq_(ds.fields(),['lon','lat']) - eq_(ds.field_types(),['int','int']) - query = mapnik.Query(ds.envelope()) - for fld in ds.fields(): - query.add_property_name(fld) - fs = ds.features(query) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - feat = fs.next() - attr = {'lon': 0, 'lat': 0} - eq_(feat.attributes,attr) - - def test_lng_lat_detection(**kwargs): - ds = get_csv_ds('lng_lat.csv') - eq_(len(ds.fields()),2) - eq_(ds.fields(),['lng','lat']) - eq_(ds.field_types(),['int','int']) - query = mapnik.Query(ds.envelope()) - for fld in ds.fields(): - query.add_property_name(fld) - fs = ds.features(query) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - feat = fs.next() - attr = {'lng': 0, 'lat': 0} - eq_(feat.attributes,attr) - - def test_type_detection(**kwargs): - ds = get_csv_ds('nypd.csv') - eq_(ds.fields(),['Precinct','Phone','Address','City','geo_longitude','geo_latitude','geo_accuracy']) - eq_(ds.field_types(),['str','str','str','str','float','float','str']) - feat = ds.featureset().next() - attr = {'City': u'New York, NY', 'geo_accuracy': u'house', 'Phone': u'(212) 334-0711', 'Address': u'19 Elizabeth Street', 'Precinct': u'5th Precinct', 'geo_longitude': -70, 'geo_latitude': 40} - eq_(feat.attributes,attr) - eq_(len(ds.all_features()),2) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(desc['name'],'csv') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - - def test_skipping_blank_rows(**kwargs): - ds = get_csv_ds('blank_rows.csv') - eq_(ds.fields(),['x','y','name']) - eq_(ds.field_types(),['int','int','str']) - eq_(len(ds.all_features()),2) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(desc['name'],'csv') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - - def test_empty_rows(**kwargs): - ds = get_csv_ds('empty_rows.csv') - eq_(len(ds.fields()),10) - eq_(len(ds.field_types()),10) - eq_(ds.fields(),['x', 'y', 'text', 'date', 'integer', 'boolean', 'float', 'time', 'datetime', 'empty_column']) - eq_(ds.field_types(),['int', 'int', 'str', 'str', 'int', 'bool', 'float', 'str', 'str', 'str']) - fs = ds.featureset() - attr = {'x': 0, 'empty_column': u'', 'text': u'a b', 'float': 1.0, 'datetime': u'1971-01-01T04:14:00', 'y': 0, 'boolean': True, 'time': u'04:14:00', 'date': u'1971-01-01', 'integer': 40} - first = True - for feat in fs: - if first: - first=False - eq_(feat.attributes,attr) - eq_(len(feat),10) - eq_(feat['empty_column'],u'') - - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(desc['name'],'csv') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - - def test_slashes(**kwargs): - ds = get_csv_ds('has_attributes_with_slashes.csv') - eq_(len(ds.fields()),3) - fs = ds.all_features() - eq_(fs[0].attributes,{'x':0,'y':0,'name':u'a/a'}) - eq_(fs[1].attributes,{'x':1,'y':4,'name':u'b/b'}) - eq_(fs[2].attributes,{'x':10,'y':2.5,'name':u'c/c'}) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(desc['name'],'csv') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - - def test_wkt_field(**kwargs): - ds = get_csv_ds('wkt.csv') - eq_(len(ds.fields()),1) - eq_(ds.fields(),['type']) - eq_(ds.field_types(),['str']) - fs = ds.all_features() - eq_(len(fs[0].geometries()),1) - eq_(fs[0].geometries()[0].type(),mapnik.DataGeometryType.Point) - eq_(len(fs[1].geometries()),1) - eq_(fs[1].geometries()[0].type(),mapnik.DataGeometryType.LineString) - eq_(len(fs[2].geometries()),1) - eq_(fs[2].geometries()[0].type(),mapnik.DataGeometryType.Polygon) - eq_(len(fs[3].geometries()),1) # one geometry, two parts - eq_(fs[3].geometries()[0].type(),mapnik.DataGeometryType.Polygon) - eq_(len(fs[4].geometries()),4) - eq_(fs[4].geometries()[0].type(),mapnik.DataGeometryType.Point) - eq_(len(fs[5].geometries()),2) - eq_(fs[5].geometries()[0].type(),mapnik.DataGeometryType.LineString) - eq_(len(fs[6].geometries()),2) - eq_(fs[6].geometries()[0].type(),mapnik.DataGeometryType.Polygon) - eq_(len(fs[7].geometries()),2) - eq_(fs[7].geometries()[0].type(),mapnik.DataGeometryType.Polygon) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Collection) - eq_(desc['name'],'csv') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - - def test_handling_of_missing_header(**kwargs): - ds = get_csv_ds('missing_header.csv') - eq_(len(ds.fields()),6) - eq_(ds.fields(),['one','two','x','y','_4','aftermissing']) - fs = ds.featureset() - feat = fs.next() - eq_(feat['_4'],'missing') - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(desc['name'],'csv') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - - def test_handling_of_headers_that_are_numbers(**kwargs): - ds = get_csv_ds('numbers_for_headers.csv') - eq_(len(ds.fields()),5) - eq_(ds.fields(),['x','y','1990','1991','1992']) - fs = ds.featureset() - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['1990'],1) - eq_(feat['1991'],2) - eq_(feat['1992'],3) - - eq_(mapnik.Expression("[1991]=2").evaluate(feat),True) - - def test_quoted_numbers(**kwargs): - ds = get_csv_ds('points.csv') - eq_(len(ds.fields()),3) - eq_(ds.fields(),['x','y','label']) - fs = ds.all_features() - eq_(fs[0]['label'],"0,0") - eq_(fs[1]['label'],"5,5") - eq_(fs[2]['label'],"0,5") - eq_(fs[3]['label'],"5,0") - eq_(fs[4]['label'],"2.5,2.5") - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(desc['name'],'csv') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - - def test_reading_windows_newlines(**kwargs): - ds = get_csv_ds('windows_newlines.csv') - eq_(len(ds.fields()),3) - feats = ds.all_features() - eq_(len(feats),1) - fs = ds.featureset() - feat = fs.next() - eq_(feat['x'],1) - eq_(feat['y'],10) - eq_(feat['z'],9999.9999) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(desc['name'],'csv') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - - def test_reading_mac_newlines(**kwargs): - ds = get_csv_ds('mac_newlines.csv') - eq_(len(ds.fields()),3) - feats = ds.all_features() - eq_(len(feats),1) - fs = ds.featureset() - feat = fs.next() - eq_(feat['x'],1) - eq_(feat['y'],10) - eq_(feat['z'],9999.9999) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(desc['name'],'csv') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - - def check_newlines(filename): - ds = get_csv_ds(filename) - eq_(len(ds.fields()),3) - feats = ds.all_features() - eq_(len(feats),1) - fs = ds.featureset() - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['line'],'many\n lines\n of text\n with unix newlines') - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(desc['name'],'csv') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - - def test_mixed_mac_unix_newlines(**kwargs): - check_newlines('mac_newlines_with_unix_inline.csv') - - def test_mixed_mac_unix_newlines_escaped(**kwargs): - check_newlines('mac_newlines_with_unix_inline_escaped.csv') - - # To hard to support this case - #def test_mixed_unix_windows_newlines(**kwargs): - # check_newlines('unix_newlines_with_windows_inline.csv') - - # To hard to support this case - #def test_mixed_unix_windows_newlines_escaped(**kwargs): - # check_newlines('unix_newlines_with_windows_inline_escaped.csv') - - def test_mixed_windows_unix_newlines(**kwargs): - check_newlines('windows_newlines_with_unix_inline.csv') - - def test_mixed_windows_unix_newlines_escaped(**kwargs): - check_newlines('windows_newlines_with_unix_inline_escaped.csv') - - def test_tabs(**kwargs): - ds = get_csv_ds('tabs_in_csv.csv') - eq_(len(ds.fields()),3) - eq_(ds.fields(),['x','y','z']) - fs = ds.featureset() - feat = fs.next() - eq_(feat['x'],-122) - eq_(feat['y'],48) - eq_(feat['z'],0) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(desc['name'],'csv') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - - def test_separator_pipes(**kwargs): - ds = get_csv_ds('pipe_delimiters.csv') - eq_(len(ds.fields()),3) - eq_(ds.fields(),['x','y','z']) - fs = ds.featureset() - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['z'],'hello') - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(desc['name'],'csv') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - - def test_separator_semicolon(**kwargs): - ds = get_csv_ds('semicolon_delimiters.csv') - eq_(len(ds.fields()),3) - eq_(ds.fields(),['x','y','z']) - fs = ds.featureset() - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['z'],'hello') - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(desc['name'],'csv') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - - def test_that_null_and_bool_keywords_are_empty_strings(**kwargs): - ds = get_csv_ds('nulls_and_booleans_as_strings.csv') - eq_(len(ds.fields()),4) - eq_(ds.fields(),['x','y','null','boolean']) - eq_(ds.field_types(),['int', 'int', 'str', 'bool']) - fs = ds.featureset() - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['null'],'null') - eq_(feat['boolean'],True) - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['null'],'') - eq_(feat['boolean'],False) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - - @raises(RuntimeError) - def test_that_nonexistant_query_field_throws(**kwargs): - ds = get_csv_ds('lon_lat.csv') - eq_(len(ds.fields()),2) - eq_(ds.fields(),['lon','lat']) - eq_(ds.field_types(),['int','int']) - query = mapnik.Query(ds.envelope()) - for fld in ds.fields(): - query.add_property_name(fld) - # also add an invalid one, triggering throw - query.add_property_name('bogus') - ds.features(query) - - def test_that_leading_zeros_mean_strings(**kwargs): - ds = get_csv_ds('leading_zeros.csv') - eq_(len(ds.fields()),3) - eq_(ds.fields(),['x','y','fips']) - eq_(ds.field_types(),['int','int','str']) - fs = ds.featureset() - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['fips'],'001') - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['fips'],'003') - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['fips'],'005') - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - - def test_advanced_geometry_detection(**kwargs): - ds = get_csv_ds('point_wkt.csv') - eq_(ds.describe()['geometry_type'],mapnik.DataGeometryType.Point) - ds = get_csv_ds('poly_wkt.csv') - eq_(ds.describe()['geometry_type'],mapnik.DataGeometryType.Polygon) - ds = get_csv_ds('multi_poly_wkt.csv') - eq_(ds.describe()['geometry_type'],mapnik.DataGeometryType.Polygon) - ds = get_csv_ds('line_wkt.csv') - eq_(ds.describe()['geometry_type'],mapnik.DataGeometryType.LineString) - - def test_creation_of_csv_from_in_memory_string(**kwargs): - csv_string = ''' - wkt,Name - "POINT (120.15 48.47)","Winthrop, WA" - ''' # csv plugin will test lines <= 10 chars for being fully blank - ds = mapnik.Datasource(**{"type":"csv","inline":csv_string}) - eq_(ds.describe()['geometry_type'],mapnik.DataGeometryType.Point) - fs = ds.featureset() - feat = fs.next() - eq_(feat['Name'],u"Winthrop, WA") - - def test_creation_of_csv_from_in_memory_string_with_uft8(**kwargs): - csv_string = ''' - wkt,Name - "POINT (120.15 48.47)","Québec" - ''' # csv plugin will test lines <= 10 chars for being fully blank - ds = mapnik.Datasource(**{"type":"csv","inline":csv_string}) - eq_(ds.describe()['geometry_type'],mapnik.DataGeometryType.Point) - fs = ds.featureset() - feat = fs.next() - eq_(feat['Name'],u"Québec") - - def validate_geojson_datasource(ds): - eq_(len(ds.fields()),1) - eq_(ds.fields(),['type']) - eq_(ds.field_types(),['str']) - fs = ds.all_features() - eq_(len(fs[0].geometries()),1) - eq_(fs[0].geometries()[0].type(),mapnik.DataGeometryType.Point) - eq_(len(fs[1].geometries()),1) - eq_(fs[1].geometries()[0].type(),mapnik.DataGeometryType.LineString) - eq_(len(fs[2].geometries()),1) - eq_(fs[2].geometries()[0].type(),mapnik.DataGeometryType.Polygon) - eq_(len(fs[3].geometries()),1) # one geometry, two parts - eq_(fs[3].geometries()[0].type(),mapnik.DataGeometryType.Polygon) - eq_(len(fs[4].geometries()),4) - eq_(fs[4].geometries()[0].type(),mapnik.DataGeometryType.Point) - eq_(len(fs[5].geometries()),2) - eq_(fs[5].geometries()[0].type(),mapnik.DataGeometryType.LineString) - eq_(len(fs[6].geometries()),2) - eq_(fs[6].geometries()[0].type(),mapnik.DataGeometryType.Polygon) - eq_(len(fs[7].geometries()),2) - eq_(fs[7].geometries()[0].type(),mapnik.DataGeometryType.Polygon) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Collection) - eq_(desc['name'],'csv') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - - def test_json_field1(**kwargs): - ds = get_csv_ds('geojson_double_quote_escape.csv') - validate_geojson_datasource(ds) - - def test_json_field2(**kwargs): - ds = get_csv_ds('geojson_single_quote.csv') - validate_geojson_datasource(ds) - - def test_json_field3(**kwargs): - ds = get_csv_ds('geojson_2x_double_quote_filebakery_style.csv') - validate_geojson_datasource(ds) - - def test_that_blank_undelimited_rows_are_still_parsed(**kwargs): - ds = get_csv_ds('more_headers_than_column_values.csv') - eq_(len(ds.fields()),5) - eq_(ds.fields(),['x','y','one', 'two','three']) - eq_(ds.field_types(),['int','int','str','str','str']) - fs = ds.featureset() - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['one'],'') - eq_(feat['two'],'') - eq_(feat['three'],'') - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - - @raises(RuntimeError) - def test_that_fewer_headers_than_rows_throws(**kwargs): - # this has invalid header # so throw - get_csv_ds('more_column_values_than_headers.csv') - - def test_that_feature_id_only_incremented_for_valid_rows(**kwargs): - ds = mapnik.Datasource(type='csv', - file=os.path.join('../data/csv/warns','feature_id_counting.csv')) - eq_(len(ds.fields()),3) - eq_(ds.fields(),['x','y','id']) - eq_(ds.field_types(),['int','int','int']) - fs = ds.featureset() - # first - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['id'],1) - # second, should have skipped bogus one - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['id'],2) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(len(ds.all_features()),2) - - def test_dynamically_defining_headers1(**kwargs): - ds = mapnik.Datasource(type='csv', - file=os.path.join('../data/csv/fails','needs_headers_two_lines.csv'), - headers='x,y,name') - eq_(len(ds.fields()),3) - eq_(ds.fields(),['x','y','name']) - eq_(ds.field_types(),['int','int','str']) - fs = ds.featureset() - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['name'],'data_name') - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(len(ds.all_features()),2) - - def test_dynamically_defining_headers2(**kwargs): - ds = mapnik.Datasource(type='csv', - file=os.path.join('../data/csv/fails','needs_headers_one_line.csv'), - headers='x,y,name') - eq_(len(ds.fields()),3) - eq_(ds.fields(),['x','y','name']) - eq_(ds.field_types(),['int','int','str']) - fs = ds.featureset() - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['name'],'data_name') - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(len(ds.all_features()),1) - - def test_dynamically_defining_headers3(**kwargs): - ds = mapnik.Datasource(type='csv', - file=os.path.join('../data/csv/fails','needs_headers_one_line_no_newline.csv'), - headers='x,y,name') - eq_(len(ds.fields()),3) - eq_(ds.fields(),['x','y','name']) - eq_(ds.field_types(),['int','int','str']) - fs = ds.featureset() - feat = fs.next() - eq_(feat['x'],0) - eq_(feat['y'],0) - eq_(feat['name'],'data_name') - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(len(ds.all_features()),1) - - def test_that_64bit_int_fields_work(**kwargs): - ds = get_csv_ds('64bit_int.csv') - eq_(len(ds.fields()),3) - eq_(ds.fields(),['x','y','bigint']) - eq_(ds.field_types(),['int','int','int']) - fs = ds.featureset() - feat = fs.next() - eq_(feat['bigint'],2147483648) - feat = fs.next() - eq_(feat['bigint'],9223372036854775807) - eq_(feat['bigint'],0x7FFFFFFFFFFFFFFF) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(len(ds.all_features()),2) - - def test_various_number_types(**kwargs): - ds = get_csv_ds('number_types.csv') - eq_(len(ds.fields()),3) - eq_(ds.fields(),['x','y','floats']) - eq_(ds.field_types(),['int','int','float']) - fs = ds.featureset() - feat = fs.next() - eq_(feat['floats'],.0) - feat = fs.next() - eq_(feat['floats'],+.0) - feat = fs.next() - eq_(feat['floats'],1e-06) - feat = fs.next() - eq_(feat['floats'],-1e-06) - feat = fs.next() - eq_(feat['floats'],0.000001) - feat = fs.next() - eq_(feat['floats'],1.234e+16) - feat = fs.next() - eq_(feat['floats'],1.234e+16) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(len(ds.all_features()),8) - - def test_manually_supplied_extent(**kwargs): - csv_string = ''' - wkt,Name - ''' - ds = mapnik.Datasource(**{"type":"csv","extent":"-180,-90,180,90","inline":csv_string}) - b = ds.envelope() - eq_(b.minx,-180) - eq_(b.miny,-90) - eq_(b.maxx,180) - eq_(b.maxy,90) - - def test_inline_geojson(**kwargs): - csv_string = "geojson\n'{\"coordinates\":[-92.22568,38.59553],\"type\":\"Point\"}'" - ds = mapnik.Datasource(**{"type":"csv","inline":csv_string}) - eq_(len(ds.fields()),0) - eq_(ds.fields(),[]) - # FIXME - re-enable after https://github.com/mapnik/mapnik/issues/2319 is fixed - #fs = ds.featureset() - #feat = fs.next() - #eq_(feat.num_geometries(),1) - -if __name__ == "__main__": - setup() - [eval(run)(visual=True) for run in dir() if 'test_' in run] diff --git a/tests/python_tests/datasource_test.py b/tests/python_tests/datasource_test.py deleted file mode 100644 index e13d0d248..000000000 --- a/tests/python_tests/datasource_test.py +++ /dev/null @@ -1,154 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_ -from utilities import execution_path, run_all -import os, mapnik -from itertools import groupby - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def test_that_datasources_exist(): - if len(mapnik.DatasourceCache.plugin_names()) == 0: - print '***NOTICE*** - no datasource plugins have been loaded' - -# adapted from raster_symboliser_test#test_dataraster_query_point -def test_vrt_referring_to_missing_files(): - srs = '+init=epsg:32630' - if 'gdal' in mapnik.DatasourceCache.plugin_names(): - lyr = mapnik.Layer('dataraster') - lyr.datasource = mapnik.Gdal( - file = '../data/raster/missing_raster.vrt', - band = 1, - ) - lyr.srs = srs - _map = mapnik.Map(256, 256, srs) - _map.layers.append(lyr) - - # center of extent of raster - x, y = 556113.0,4381428.0 # center of extent of raster - - _map.zoom_all() - - # Should RuntimeError here - try: - _map.query_point(0, x, y).features - except RuntimeError, e: - eq_("this_file_should_not_exist.tif' does not exist in the file system" in str(e), True) - else: - assert False - - -def test_field_listing(): - if 'shape' in mapnik.DatasourceCache.plugin_names(): - ds = mapnik.Shapefile(file='../data/shp/poly.shp') - fields = ds.fields() - eq_(fields, ['AREA', 'EAS_ID', 'PRFEDEA']) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Polygon) - eq_(desc['name'],'shape') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - -def test_total_feature_count_shp(): - if 'shape' in mapnik.DatasourceCache.plugin_names(): - ds = mapnik.Shapefile(file='../data/shp/poly.shp') - features = ds.all_features() - num_feats = len(features) - eq_(num_feats, 10) - -def test_total_feature_count_json(): - if 'ogr' in mapnik.DatasourceCache.plugin_names(): - ds = mapnik.Ogr(file='../data/json/points.geojson',layer_by_index=0) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(desc['name'],'ogr') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - features = ds.all_features() - num_feats = len(features) - eq_(num_feats, 5) - -def test_sqlite_reading(): - if 'sqlite' in mapnik.DatasourceCache.plugin_names(): - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite',table_by_index=0) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Polygon) - eq_(desc['name'],'sqlite') - eq_(desc['type'],mapnik.DataType.Vector) - eq_(desc['encoding'],'utf-8') - features = ds.all_features() - num_feats = len(features) - eq_(num_feats, 245) - -def test_reading_json_from_string(): - json = open('../data/json/points.geojson','r').read() - if 'ogr' in mapnik.DatasourceCache.plugin_names(): - ds = mapnik.Ogr(file=json,layer_by_index=0) - features = ds.all_features() - num_feats = len(features) - eq_(num_feats, 5) - -def test_feature_envelope(): - if 'shape' in mapnik.DatasourceCache.plugin_names(): - ds = mapnik.Shapefile(file='../data/shp/poly.shp') - features = ds.all_features() - for feat in features: - env = feat.envelope() - contains = ds.envelope().contains(env) - eq_(contains, True) - intersects = ds.envelope().contains(env) - eq_(intersects, True) - -def test_feature_attributes(): - if 'shape' in mapnik.DatasourceCache.plugin_names(): - ds = mapnik.Shapefile(file='../data/shp/poly.shp') - features = ds.all_features() - feat = features[0] - attrs = {'PRFEDEA': u'35043411', 'EAS_ID': 168, 'AREA': 215229.266} - eq_(feat.attributes, attrs) - eq_(ds.fields(),['AREA', 'EAS_ID', 'PRFEDEA']) - eq_(ds.field_types(),['float','int','str']) - -def test_ogr_layer_by_sql(): - if 'ogr' in mapnik.DatasourceCache.plugin_names(): - ds = mapnik.Ogr(file='../data/shp/poly.shp', layer_by_sql='SELECT * FROM poly WHERE EAS_ID = 168') - features = ds.all_features() - num_feats = len(features) - eq_(num_feats, 1) - -def test_hit_grid(): - - def rle_encode(l): - """ encode a list of strings with run-length compression """ - return ["%d:%s" % (len(list(group)), name) for name, group in groupby(l)] - - m = mapnik.Map(256,256); - try: - mapnik.load_map(m,'../data/good_maps/agg_poly_gamma_map.xml'); - m.zoom_all() - join_field = 'NAME' - fg = [] # feature grid - for y in range(0, 256, 4): - for x in range(0, 256, 4): - featureset = m.query_map_point(0,x,y) - added = False - for feature in featureset.features: - fg.append(feature[join_field]) - added = True - if not added: - fg.append('') - hit_list = '|'.join(rle_encode(fg)) - eq_(hit_list[:16],'730:|2:Greenland') - eq_(hit_list[-12:],'1:Chile|812:') - except RuntimeError, e: - # only test datasources that we have installed - if not 'Could not create datasource' in str(e): - raise RuntimeError(str(e)) - - -if __name__ == '__main__': - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/datasource_xml_template_test.py b/tests/python_tests/datasource_xml_template_test.py deleted file mode 100644 index 38a73a3e2..000000000 --- a/tests/python_tests/datasource_xml_template_test.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -from utilities import execution_path, run_all -import mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def test_datasource_template_is_working(): - m = mapnik.Map(256,256) - try: - mapnik.load_map(m,'../data/good_maps/datasource.xml') - except RuntimeError, e: - if "Required parameter 'type'" in str(e): - raise RuntimeError(e) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/extra_map_props_test.py b/tests/python_tests/extra_map_props_test.py deleted file mode 100644 index 045cddbdb..000000000 --- a/tests/python_tests/extra_map_props_test.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.tools import eq_ -from utilities import execution_path, run_all -import os, mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def test_arbitrary_parameters_attached_to_map(): - m = mapnik.Map(256,256) - mapnik.load_map(m,'../data/good_maps/extra_arbitary_map_parameters.xml') - eq_(len(m.parameters),5) - eq_(m.parameters['key'],'value2') - eq_(m.parameters['key3'],'value3') - eq_(m.parameters['unicode'],u'iván') - eq_(m.parameters['integer'],10) - eq_(m.parameters['decimal'],.999) - m2 = mapnik.Map(256,256) - for k,v in m.parameters: - m2.parameters.append(mapnik.Parameter(k,v)) - eq_(len(m2.parameters),5) - eq_(m2.parameters['key'],'value2') - eq_(m2.parameters['key3'],'value3') - eq_(m2.parameters['unicode'],u'iván') - eq_(m2.parameters['integer'],10) - eq_(m2.parameters['decimal'],.999) - map_string = mapnik.save_map_to_string(m) - m3 = mapnik.Map(256,256) - mapnik.load_map_from_string(m3,map_string) - eq_(len(m3.parameters),5) - eq_(m3.parameters['key'],'value2') - eq_(m3.parameters['key3'],'value3') - eq_(m3.parameters['unicode'],u'iván') - eq_(m3.parameters['integer'],10) - eq_(m3.parameters['decimal'],.999) - - -def test_serializing_arbitrary_parameters(): - m = mapnik.Map(256,256) - m.parameters.append(mapnik.Parameter('width',m.width)) - m.parameters.append(mapnik.Parameter('height',m.height)) - - m2 = mapnik.Map(1,1) - mapnik.load_map_from_string(m2,mapnik.save_map_to_string(m)) - eq_(m2.parameters['width'],m.width) - eq_(m2.parameters['height'],m.height) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/feature_id_test.py b/tests/python_tests/feature_id_test.py deleted file mode 100644 index 66c20ccf4..000000000 --- a/tests/python_tests/feature_id_test.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_ -from utilities import execution_path, run_all -import os, mapnik -import itertools - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def compare_shape_between_mapnik_and_ogr(shapefile,query=None): - plugins = mapnik.DatasourceCache.plugin_names() - if 'shape' in plugins and 'ogr' in plugins: - ds1 = mapnik.Ogr(file=shapefile,layer_by_index=0) - ds2 = mapnik.Shapefile(file=shapefile) - if query: - fs1 = ds1.features(query) - fs2 = ds2.features(query) - else: - fs1 = ds1.featureset() - fs2 = ds2.featureset() - count = 0; - for feat1,feat2 in itertools.izip(fs1,fs2): - count += 1 - eq_(feat1.id(),feat2.id(), - '%s : ogr feature id %s "%s" does not equal shapefile feature id %s "%s"' - % (count,feat1.id(),str(feat1.attributes), feat2.id(),str(feat2.attributes))) - return True - - -def test_shapefile_line_featureset_id(): - compare_shape_between_mapnik_and_ogr('../data/shp/polylines.shp') - -def test_shapefile_polygon_featureset_id(): - compare_shape_between_mapnik_and_ogr('../data/shp/poly.shp') - -def test_shapefile_polygon_feature_query_id(): - bbox = (15523428.2632, 4110477.6323, -11218494.8310, 7495720.7404) - query = mapnik.Query(mapnik.Box2d(*bbox)) - if 'ogr' in mapnik.DatasourceCache.plugin_names(): - ds = mapnik.Ogr(file='../data/shp/world_merc.shp',layer_by_index=0) - for fld in ds.fields(): - query.add_property_name(fld) - compare_shape_between_mapnik_and_ogr('../data/shp/world_merc.shp',query) - -def test_feature_hit_count(): - pass - #raise Todo("need to optimize multigeom bbox handling in shapeindex: https://github.com/mapnik/mapnik/issues/783") - # results in different results between shp and ogr! - #bbox = (-14284551.8434, 2074195.1992, -7474929.8687, 8140237.7628) - #bbox = (1113194.91,4512803.085,2226389.82,6739192.905) - #query = mapnik.Query(mapnik.Box2d(*bbox)) - #if 'ogr' in mapnik.DatasourceCache.plugin_names(): - # ds1 = mapnik.Ogr(file='../data/shp/world_merc.shp',layer_by_index=0) - # for fld in ds1.fields(): - # query.add_property_name(fld) - # ds2 = mapnik.Shapefile(file='../data/shp/world_merc.shp') - # count1 = len(ds1.features(query).features) - # count2 = len(ds2.features(query).features) - # eq_(count1,count2,"Feature count differs between OGR driver (%s features) and Shapefile Driver (%s features) when querying the same bbox" % (count1,count2)) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/feature_test.py b/tests/python_tests/feature_test.py deleted file mode 100644 index 42f024509..000000000 --- a/tests/python_tests/feature_test.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.tools import eq_,raises -from utilities import run_all - -import mapnik -from binascii import unhexlify - -def test_default_constructor(): - f = mapnik.Feature(mapnik.Context(),1) - eq_(f is not None,True) - -def test_feature_geo_interface(): - ctx = mapnik.Context() - feat = mapnik.Feature(ctx,1) - feat.add_geometries_from_wkt('Point (0 0)') - eq_(feat.__geo_interface__['geometry'],{u'type': u'Point', u'coordinates': [0, 0]}) - -def test_python_extended_constructor(): - context = mapnik.Context() - context.push('foo') - context.push('foo') - f = mapnik.Feature(context,1) - wkt = 'POLYGON ((35 10, 10 20, 15 40, 45 45, 35 10),(20 30, 35 35, 30 20, 20 30))' - f.add_geometries_from_wkt(wkt) - f['foo'] = 'bar' - eq_(f['foo'], 'bar') - eq_(f.envelope(),mapnik.Box2d(10.0,10.0,45.0,45.0)) - # reset - f['foo'] = u"avión" - eq_(f['foo'], u"avión") - f['foo'] = 1.4 - eq_(f['foo'], 1.4) - f['foo'] = True - eq_(f['foo'], True) - -def test_add_geom_wkb(): -# POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10)) - wkb = '010300000001000000050000000000000000003e4000000000000024400000000000002440000000000000344000000000000034400000000000004440000000000000444000000000000044400000000000003e400000000000002440' - context = mapnik.Context() - f = mapnik.Feature(context,1) - eq_(len(f.geometries()), 0) - f.add_geometries_from_wkb(unhexlify(wkb)) - eq_(len(f.geometries()), 1) - e = mapnik.Box2d() - eq_(e.valid(), False) - for g in f.geometries(): - if not e.valid(): - e = g.envelope() - else: - e +=g.envelope() - - eq_(e, f.envelope()) - -def test_feature_expression_evaluation(): - context = mapnik.Context() - context.push('name') - f = mapnik.Feature(context,1) - f['name'] = 'a' - eq_(f['name'],u'a') - expr = mapnik.Expression("[name]='a'") - evaluated = expr.evaluate(f) - eq_(evaluated,True) - num_attributes = len(f) - eq_(num_attributes,1) - eq_(f.id(),1) - -# https://github.com/mapnik/mapnik/issues/933 -def test_feature_expression_evaluation_missing_attr(): - context = mapnik.Context() - context.push('name') - f = mapnik.Feature(context,1) - f['name'] = u'a' - eq_(f['name'],u'a') - expr = mapnik.Expression("[fielddoesnotexist]='a'") - eq_(f.has_key('fielddoesnotexist'),False) - try: - expr.evaluate(f) - except Exception, e: - eq_("Key does not exist" in str(e),True) - num_attributes = len(f) - eq_(num_attributes,1) - eq_(f.id(),1) - -# https://github.com/mapnik/mapnik/issues/934 -def test_feature_expression_evaluation_attr_with_spaces(): - context = mapnik.Context() - context.push('name with space') - f = mapnik.Feature(context,1) - f['name with space'] = u'a' - eq_(f['name with space'],u'a') - expr = mapnik.Expression("[name with space]='a'") - eq_(str(expr),"([name with space]='a')") - eq_(expr.evaluate(f),True) - -# https://github.com/mapnik/mapnik/issues/2390 -@raises(RuntimeError) -def test_feature_from_geojson(): - ctx = mapnik.Context() - inline_string = """ - { - "geometry" : { - "coordinates" : [ 0,0 ] - "type" : "Point" - }, - "type" : "Feature", - "properties" : { - "this":"that" - "known":"nope because missing comma" - } - } - """ - mapnik.Feature.from_geojson(inline_string,ctx) - -if __name__ == "__main__": - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/filter_test.py b/tests/python_tests/filter_test.py deleted file mode 100644 index f90641063..000000000 --- a/tests/python_tests/filter_test.py +++ /dev/null @@ -1,450 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.tools import eq_,raises -from utilities import run_all -import mapnik - -if hasattr(mapnik,'Expression'): - mapnik.Filter = mapnik.Expression - -map_ = ''' - - -''' - -def test_filter_init(): - m = mapnik.Map(1,1) - mapnik.load_map_from_string(m,map_) - filters = [] - filters.append(mapnik.Filter("([region]>=0) and ([region]<=50)")) - filters.append(mapnik.Filter("(([region]>=0) and ([region]<=50))")) - filters.append(mapnik.Filter("((([region]>=0) and ([region]<=50)))")) - filters.append(mapnik.Filter('((([region]>=0) and ([region]<=50)))')) - filters.append(mapnik.Filter('''((([region]>=0) and ([region]<=50)))''')) - filters.append(mapnik.Filter(''' - ((([region]>=0) - and - ([region]<=50))) - ''')) - filters.append(mapnik.Filter(''' - ([region]>=0) - and - ([region]<=50) - ''')) - filters.append(mapnik.Filter(''' - ([region] - >= - 0) - and - ([region] - <= - 50) - ''')) - - s = m.find_style('s') - - for r in s.rules: - filters.append(r.filter) - - first = filters[0] - for f in filters: - eq_(str(first),str(f)) - - s = m.find_style('s2') - - eq_(s.filter_mode,mapnik.filter_mode.FIRST) - - -def test_geometry_type_eval(): - # clashing field called 'mapnik::geometry' - context2 = mapnik.Context() - context2.push('mapnik::geometry_type') - f = mapnik.Feature(context2,0) - f["mapnik::geometry_type"] = 'sneaky' - expr = mapnik.Expression("[mapnik::geometry_type]") - eq_(expr.evaluate(f),0) - - expr = mapnik.Expression("[mapnik::geometry_type]") - context = mapnik.Context() - - # no geometry - f = mapnik.Feature(context,0) - eq_(expr.evaluate(f),0) - eq_(mapnik.Expression("[mapnik::geometry_type]=0").evaluate(f),True) - - # POINT = 1 - f = mapnik.Feature(context,0) - f.add_geometries_from_wkt('POINT(10 40)') - eq_(expr.evaluate(f),1) - eq_(mapnik.Expression("[mapnik::geometry_type]=point").evaluate(f),True) - - # LINESTRING = 2 - f = mapnik.Feature(context,0) - f.add_geometries_from_wkt('LINESTRING (30 10, 10 30, 40 40)') - eq_(expr.evaluate(f),2) - eq_(mapnik.Expression("[mapnik::geometry_type]=linestring").evaluate(f),True) - - # POLYGON = 3 - f = mapnik.Feature(context,0) - f.add_geometries_from_wkt('POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))') - eq_(expr.evaluate(f),3) - eq_(mapnik.Expression("[mapnik::geometry_type]=polygon").evaluate(f),True) - - # COLLECTION = 4 - f = mapnik.Feature(context,0) - f.add_geometries_from_wkt('GEOMETRYCOLLECTION(POLYGON((1 1,2 1,2 2,1 2,1 1)),POINT(2 3),LINESTRING(2 3,3 4))') - eq_(expr.evaluate(f),4) - eq_(mapnik.Expression("[mapnik::geometry_type]=collection").evaluate(f),True) - -def test_regex_match(): - context = mapnik.Context() - context.push('name') - f = mapnik.Feature(context,0) - f["name"] = 'test' - expr = mapnik.Expression("[name].match('test')") - eq_(expr.evaluate(f),True) # 1 == True - -def test_unicode_regex_match(): - context = mapnik.Context() - context.push('name') - f = mapnik.Feature(context,0) - f["name"] = 'Québec' - expr = mapnik.Expression("[name].match('Québec')") - eq_(expr.evaluate(f),True) # 1 == True - -def test_regex_replace(): - context = mapnik.Context() - context.push('name') - f = mapnik.Feature(context,0) - f["name"] = 'test' - expr = mapnik.Expression("[name].replace('(\B)|( )','$1 ')") - eq_(expr.evaluate(f),'t e s t') - -def test_unicode_regex_replace_to_str(): - expr = mapnik.Expression("[name].replace('(\B)|( )','$1 ')") - eq_(str(expr),"[name].replace('(\B)|( )','$1 ')") - -def test_unicode_regex_replace(): - context = mapnik.Context() - context.push('name') - f = mapnik.Feature(context,0) - f["name"] = 'Québec' - expr = mapnik.Expression("[name].replace('(\B)|( )','$1 ')") - # will fail if -DBOOST_REGEX_HAS_ICU is not defined - eq_(expr.evaluate(f), u'Q u é b e c') - -def test_float_precision(): - context = mapnik.Context() - context.push('num') - f = mapnik.Feature(context,0) - f["num1"] = 1.0000 - f["num2"] = 1.0001 - eq_(f["num1"],1.0000) - eq_(f["num2"],1.0001) - expr = mapnik.Expression("[num1] = 1.0000") - eq_(expr.evaluate(f),True) - expr = mapnik.Expression("[num1].match('1')") - eq_(expr.evaluate(f),True) - expr = mapnik.Expression("[num2] = 1.0001") - eq_(expr.evaluate(f),True) - expr = mapnik.Expression("[num2].match('1.0001')") - eq_(expr.evaluate(f),True) - -def test_string_matching_on_precision(): - context = mapnik.Context() - context.push('num') - f = mapnik.Feature(context,0) - f["num"] = "1.0000" - eq_(f["num"],"1.0000") - expr = mapnik.Expression("[num].match('.*(^0|00)$')") - eq_(expr.evaluate(f),True) - -def test_creation_of_null_value(): - context = mapnik.Context() - context.push('nv') - f = mapnik.Feature(context,0) - f["nv"] = None - eq_(f["nv"],None) - eq_(f["nv"] is None,True) - # test boolean - f["nv"] = 0 - eq_(f["nv"],0) - eq_(f["nv"] is not None,True) - -def test_creation_of_bool(): - context = mapnik.Context() - context.push('bool') - f = mapnik.Feature(context,0) - f["bool"] = True - eq_(f["bool"],True) - # TODO - will become int of 1 do to built in boost python conversion - # https://github.com/mapnik/mapnik/issues/1873 - eq_(isinstance(f["bool"],bool) or isinstance(f["bool"],long),True) - f["bool"] = False - eq_(f["bool"],False) - eq_(isinstance(f["bool"],bool) or isinstance(f["bool"],long),True) - # test NoneType - f["bool"] = None - eq_(f["bool"],None) - eq_(isinstance(f["bool"],bool) or isinstance(f["bool"],long),False) - # test integer - f["bool"] = 0 - eq_(f["bool"],0) - # https://github.com/mapnik/mapnik/issues/1873 - # ugh, boost_python's built into converter does not work right - #eq_(isinstance(f["bool"],bool),False) - -null_equality = [ - ['hello',False,unicode], - [u'',False,unicode], - [0,False,long], - [123,False,long], - [0.0,False,float], - [123.123,False,float], - [.1,False,float], - [False,False,long], # TODO - should become bool: https://github.com/mapnik/mapnik/issues/1873 - [True,False,long], # TODO - should become bool: https://github.com/mapnik/mapnik/issues/1873 - [None,True,None], - [2147483648,False,long], - [922337203685477580,False,long] -] - -def test_expressions_with_null_equality(): - for eq in null_equality: - context = mapnik.Context() - f = mapnik.Feature(context,0) - f["prop"] = eq[0] - eq_(f["prop"],eq[0]) - if eq[0] is None: - eq_(f["prop"] is None, True) - else: - eq_(isinstance(f['prop'],eq[2]),True,'%s is not an instance of %s' % (f['prop'],eq[2])) - expr = mapnik.Expression("[prop] = null") - eq_(expr.evaluate(f),eq[1]) - expr = mapnik.Expression("[prop] is null") - eq_(expr.evaluate(f),eq[1]) - -def test_expressions_with_null_equality2(): - for eq in null_equality: - context = mapnik.Context() - f = mapnik.Feature(context,0) - f["prop"] = eq[0] - eq_(f["prop"],eq[0]) - if eq[0] is None: - eq_(f["prop"] is None, True) - else: - eq_(isinstance(f['prop'],eq[2]),True,'%s is not an instance of %s' % (f['prop'],eq[2])) - # TODO - support `is not` syntax: - # https://github.com/mapnik/mapnik/issues/796 - expr = mapnik.Expression("not [prop] is null") - eq_(expr.evaluate(f),not eq[1]) - # https://github.com/mapnik/mapnik/issues/1642 - expr = mapnik.Expression("[prop] != null") - eq_(expr.evaluate(f),not eq[1]) - -truthyness = [ - [u'hello',True,unicode], - [u'',False,unicode], - [0,False,long], - [123,True,long], - [0.0,False,float], - [123.123,True,float], - [.1,True,float], - [False,False,long], # TODO - should become bool: https://github.com/mapnik/mapnik/issues/1873 - [True,True,long], # TODO - should become bool: https://github.com/mapnik/mapnik/issues/1873 - [None,False,None], - [2147483648,True,long], - [922337203685477580,True,long] -] - -def test_expressions_for_thruthyness(): - context = mapnik.Context() - for eq in truthyness: - f = mapnik.Feature(context,0) - f["prop"] = eq[0] - eq_(f["prop"],eq[0]) - if eq[0] is None: - eq_(f["prop"] is None, True) - else: - eq_(isinstance(f['prop'],eq[2]),True,'%s is not an instance of %s' % (f['prop'],eq[2])) - expr = mapnik.Expression("[prop]") - eq_(expr.to_bool(f),eq[1]) - expr = mapnik.Expression("not [prop]") - eq_(expr.to_bool(f),not eq[1]) - expr = mapnik.Expression("! [prop]") - eq_(expr.to_bool(f),not eq[1]) - # also test if feature does not have property at all - f2 = mapnik.Feature(context,1) - # no property existing will return value_null since - # https://github.com/mapnik/mapnik/commit/562fada9d0f680f59b2d9f396c95320a0d753479#include/mapnik/feature.hpp - eq_(f2["prop"] is None,True) - expr = mapnik.Expression("[prop]") - eq_(expr.evaluate(f2),None) - eq_(expr.to_bool(f2),False) - -# https://github.com/mapnik/mapnik/issues/1859 -def test_if_null_and_empty_string_are_equal(): - context = mapnik.Context() - f = mapnik.Feature(context,0) - f["empty"] = u"" - f["null"] = None - # ensure base assumptions are good - eq_(mapnik.Expression("[empty] = ''").to_bool(f),True) - eq_(mapnik.Expression("[null] = null").to_bool(f),True) - eq_(mapnik.Expression("[empty] != ''").to_bool(f),False) - eq_(mapnik.Expression("[null] != null").to_bool(f),False) - # now test expected behavior - eq_(mapnik.Expression("[null] = ''").to_bool(f),False) - eq_(mapnik.Expression("[empty] = null").to_bool(f),False) - eq_(mapnik.Expression("[empty] != null").to_bool(f),True) - # this one is the back compatibility shim - eq_(mapnik.Expression("[null] != ''").to_bool(f),False) - -def test_filtering_nulls_and_empty_strings(): - context = mapnik.Context() - f = mapnik.Feature(context,0) - f["prop"] = u"hello" - eq_(f["prop"],u"hello") - eq_(mapnik.Expression("[prop]").to_bool(f),True) - eq_(mapnik.Expression("! [prop]").to_bool(f),False) - eq_(mapnik.Expression("[prop] != null").to_bool(f),True) - eq_(mapnik.Expression("[prop] != ''").to_bool(f),True) - eq_(mapnik.Expression("[prop] != null and [prop] != ''").to_bool(f),True) - eq_(mapnik.Expression("[prop] != null or [prop] != ''").to_bool(f),True) - f["prop2"] = u"" - eq_(f["prop2"],u"") - eq_(mapnik.Expression("[prop2]").to_bool(f),False) - eq_(mapnik.Expression("! [prop2]").to_bool(f),True) - eq_(mapnik.Expression("[prop2] != null").to_bool(f),True) - eq_(mapnik.Expression("[prop2] != ''").to_bool(f),False) - eq_(mapnik.Expression("[prop2] = ''").to_bool(f),True) - eq_(mapnik.Expression("[prop2] != null or [prop2] != ''").to_bool(f),True) - eq_(mapnik.Expression("[prop2] != null and [prop2] != ''").to_bool(f),False) - f["prop3"] = None - eq_(f["prop3"],None) - eq_(mapnik.Expression("[prop3]").to_bool(f),False) - eq_(mapnik.Expression("! [prop3]").to_bool(f),True) - eq_(mapnik.Expression("[prop3] != null").to_bool(f),False) - eq_(mapnik.Expression("[prop3] = null").to_bool(f),True) - - # https://github.com/mapnik/mapnik/issues/1859 - #eq_(mapnik.Expression("[prop3] != ''").to_bool(f),True) - eq_(mapnik.Expression("[prop3] != ''").to_bool(f),False) - - eq_(mapnik.Expression("[prop3] = ''").to_bool(f),False) - - # https://github.com/mapnik/mapnik/issues/1859 - #eq_(mapnik.Expression("[prop3] != null or [prop3] != ''").to_bool(f),True) - eq_(mapnik.Expression("[prop3] != null or [prop3] != ''").to_bool(f),False) - - eq_(mapnik.Expression("[prop3] != null and [prop3] != ''").to_bool(f),False) - # attr not existing should behave the same as prop3 - eq_(mapnik.Expression("[prop4]").to_bool(f),False) - eq_(mapnik.Expression("! [prop4]").to_bool(f),True) - eq_(mapnik.Expression("[prop4] != null").to_bool(f),False) - eq_(mapnik.Expression("[prop4] = null").to_bool(f),True) - - # https://github.com/mapnik/mapnik/issues/1859 - ##eq_(mapnik.Expression("[prop4] != ''").to_bool(f),True) - eq_(mapnik.Expression("[prop4] != ''").to_bool(f),False) - - eq_(mapnik.Expression("[prop4] = ''").to_bool(f),False) - - # https://github.com/mapnik/mapnik/issues/1859 - ##eq_(mapnik.Expression("[prop4] != null or [prop4] != ''").to_bool(f),True) - eq_(mapnik.Expression("[prop4] != null or [prop4] != ''").to_bool(f),False) - - eq_(mapnik.Expression("[prop4] != null and [prop4] != ''").to_bool(f),False) - f["prop5"] = False - eq_(f["prop5"],False) - eq_(mapnik.Expression("[prop5]").to_bool(f),False) - eq_(mapnik.Expression("! [prop5]").to_bool(f),True) - eq_(mapnik.Expression("[prop5] != null").to_bool(f),True) - eq_(mapnik.Expression("[prop5] = null").to_bool(f),False) - eq_(mapnik.Expression("[prop5] != ''").to_bool(f),True) - eq_(mapnik.Expression("[prop5] = ''").to_bool(f),False) - eq_(mapnik.Expression("[prop5] != null or [prop5] != ''").to_bool(f),True) - eq_(mapnik.Expression("[prop5] != null and [prop5] != ''").to_bool(f),True) - # note, we need to do [prop5] != 0 here instead of false due to this bug: - # https://github.com/mapnik/mapnik/issues/1873 - eq_(mapnik.Expression("[prop5] != null and [prop5] != '' and [prop5] != 0").to_bool(f),False) - -# https://github.com/mapnik/mapnik/issues/1872 -def test_falseyness_comparision(): - context = mapnik.Context() - f = mapnik.Feature(context,0) - f["prop"] = 0 - eq_(mapnik.Expression("[prop]").to_bool(f),False) - eq_(mapnik.Expression("[prop] = false").to_bool(f),True) - eq_(mapnik.Expression("not [prop] != false").to_bool(f),True) - eq_(mapnik.Expression("not [prop] = true").to_bool(f),True) - eq_(mapnik.Expression("[prop] = true").to_bool(f),False) - eq_(mapnik.Expression("[prop] != true").to_bool(f),True) - -# https://github.com/mapnik/mapnik/issues/1806, fixed by https://github.com/mapnik/mapnik/issues/1872 -def test_truthyness_comparision(): - context = mapnik.Context() - f = mapnik.Feature(context,0) - f["prop"] = 1 - eq_(mapnik.Expression("[prop]").to_bool(f),True) - eq_(mapnik.Expression("[prop] = false").to_bool(f),False) - eq_(mapnik.Expression("not [prop] != false").to_bool(f),False) - eq_(mapnik.Expression("not [prop] = true").to_bool(f),False) - eq_(mapnik.Expression("[prop] = true").to_bool(f),True) - eq_(mapnik.Expression("[prop] != true").to_bool(f),False) - -def test_division_by_zero(): - expr = mapnik.Expression('[a]/[b]') - c = mapnik.Context() - c.push('a') - c.push('b') - f = mapnik.Feature(c,0); - f['a'] = 1 - f['b'] = 0 - eq_(expr.evaluate(f),None) - -@raises(RuntimeError) -def test_invalid_syntax1(): - mapnik.Expression('abs()') - - -if __name__ == "__main__": - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/fontset_test.py b/tests/python_tests/fontset_test.py deleted file mode 100644 index ee8fd7d77..000000000 --- a/tests/python_tests/fontset_test.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_ -from utilities import execution_path, run_all -import os, mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def test_loading_fontset_from_map(): - m = mapnik.Map(256,256) - mapnik.load_map(m,'../data/good_maps/fontset.xml',True) - fs = m.find_fontset('book-fonts') - eq_(len(fs.names),2) - eq_(list(fs.names),['DejaVu Sans Book','DejaVu Sans Oblique']) - -# def test_loading_fontset_from_python(): -# m = mapnik.Map(256,256) -# fset = mapnik.FontSet('foo') -# fset.add_face_name('Comic Sans') -# fset.add_face_name('Papyrus') -# eq_(fset.name,'foo') -# fset.name = 'my-set' -# eq_(fset.name,'my-set') -# m.append_fontset('my-set', fset) -# sty = mapnik.Style() -# rule = mapnik.Rule() -# tsym = mapnik.TextSymbolizer() -# eq_(tsym.fontset,None) -# tsym.fontset = fset -# rule.symbols.append(tsym) -# sty.rules.append(rule) -# m.append_style('Style',sty) -# serialized_map = mapnik.save_map_to_string(m) -# eq_('fontset-name="my-set"' in serialized_map,True) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/geojson_plugin_test.py b/tests/python_tests/geojson_plugin_test.py deleted file mode 100644 index 6609f082d..000000000 --- a/tests/python_tests/geojson_plugin_test.py +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.tools import eq_,assert_almost_equal -from utilities import execution_path, run_all -import os, mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -if 'geojson' in mapnik.DatasourceCache.plugin_names(): - - def test_geojson_init(): - ds = mapnik.Datasource(type='geojson',file='../data/json/escaped.geojson') - e = ds.envelope() - assert_almost_equal(e.minx, -81.705583, places=7) - assert_almost_equal(e.miny, 41.480573, places=6) - assert_almost_equal(e.maxx, -81.705583, places=5) - assert_almost_equal(e.maxy, 41.480573, places=3) - - def test_geojson_properties(): - ds = mapnik.Datasource(type='geojson',file='../data/json/escaped.geojson') - f = ds.features_at_point(ds.envelope().center()).features[0] - eq_(len(ds.fields()),9) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - - eq_(f['name'], u'Test') - eq_(f['int'], 1) - eq_(f['description'], u'Test: \u005C') - eq_(f['spaces'], u'this has spaces') - eq_(f['double'], 1.1) - eq_(f['boolean'], True) - eq_(f['NOM_FR'], u'Qu\xe9bec') - eq_(f['NOM_FR'], u'Québec') - - ds = mapnik.Datasource(type='geojson',file='../data/json/escaped.geojson') - f = ds.all_features()[0] - eq_(len(ds.fields()),9) - - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - - eq_(f['name'], u'Test') - eq_(f['int'], 1) - eq_(f['description'], u'Test: \u005C') - eq_(f['spaces'], u'this has spaces') - eq_(f['double'], 1.1) - eq_(f['boolean'], True) - eq_(f['NOM_FR'], u'Qu\xe9bec') - eq_(f['NOM_FR'], u'Québec') - - def test_geojson_from_in_memory_string(): - # will silently fail since it is a geometry and needs to be a featurecollection. - #ds = mapnik.Datasource(type='geojson',inline='{"type":"LineString","coordinates":[[0,0],[10,10]]}') - # works since it is a featurecollection - ds = mapnik.Datasource(type='geojson',inline='{ "type":"FeatureCollection", "features": [ { "type":"Feature", "properties":{"name":"test"}, "geometry": { "type":"LineString","coordinates":[[0,0],[10,10]] } } ]}') - eq_(len(ds.fields()),1) - f = ds.all_features()[0] - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.LineString) - eq_(f['name'], u'test') - -# @raises(RuntimeError) - def test_that_nonexistant_query_field_throws(**kwargs): - ds = mapnik.Datasource(type='geojson',file='../data/json/escaped.geojson') - eq_(len(ds.fields()),9) - # TODO - this sorting is messed up - #eq_(ds.fields(),['name', 'int', 'double', 'description', 'boolean', 'NOM_FR']) - #eq_(ds.field_types(),['str', 'int', 'float', 'str', 'bool', 'str']) -# TODO - should geojson plugin throw like others? -# query = mapnik.Query(ds.envelope()) -# for fld in ds.fields(): -# query.add_property_name(fld) -# # also add an invalid one, triggering throw -# query.add_property_name('bogus') -# fs = ds.features(query) - - def test_parsing_feature_collection_with_top_level_properties(): - ds = mapnik.Datasource(type='geojson',file='../data/json/feature_collection_level_properties.json') - f = ds.all_features()[0] - - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - eq_(f['feat_name'], u'feat_value') - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/geometry_io_test.py b/tests/python_tests/geometry_io_test.py deleted file mode 100644 index c7ad3cf3d..000000000 --- a/tests/python_tests/geometry_io_test.py +++ /dev/null @@ -1,347 +0,0 @@ -#encoding: utf8 - -from nose.tools import eq_,raises -import os -from utilities import execution_path, run_all -import mapnik -from binascii import unhexlify - -try: - import json -except ImportError: - import simplejson as json - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -wkts = [ - [1,"POINT(30 10)"], - [1,"POINT(30 10)"], - [1,"POINT(30.1 10.1)"], - [1,"LINESTRING(30 10,10 30,40 40)"], - [1,"POLYGON((30 10,10 20,20 40,40 40,30 10))"], - [1,"POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30,35 35,30 20,20 30))"], - [4,"MULTIPOINT((10 40),(40 30),(20 20),(30 10))"], - [2,"MULTILINESTRING((10 10,20 20,10 40),(40 40,30 30,40 20,30 10))"], - [2,"MULTIPOLYGON(((30 20,10 40,45 40,30 20)),((15 5,40 10,10 20,5 10,15 5)))"], - [2,"MULTIPOLYGON(((40 40,20 45,45 30,40 40)),((20 35,45 20,30 5,10 10,10 30,20 35),(30 20,20 25,20 15,30 20)))"], - [3,"GEOMETRYCOLLECTION(POLYGON((1 1,2 1,2 2,1 2,1 1)),POINT(2 3),LINESTRING(2 3,3 4))"], - [1,"POLYGON((-178.32319 71.518365,-178.321586 71.518439,-178.259635 71.510688,-178.304862 71.513129,-178.32319 71.518365),(-178.32319 71.518365,-178.341544 71.517524,-178.32244 71.505439,-178.215323 71.478034,-178.193473 71.47663,-178.147757 71.485175,-178.124442 71.481879,-178.005729 71.448615,-178.017203 71.441413,-178.054191 71.428778,-178.047049 71.425727,-178.033439 71.417792,-178.026236 71.415107,-178.030082 71.413459,-178.039908 71.40766,-177.970878 71.39643,-177.779837 71.333197,-177.718375 71.305243,-177.706412 71.3039,-177.68212 71.304877,-177.670279 71.301825,-177.655387 71.293158,-177.587577 71.285956,-177.548575 71.294867,-177.531119 71.296332,-177.51409 71.293402,-177.498649 71.284735,-177.506217 71.268622,-177.486991 71.258734,-177.459708 71.249884,-177.443412 71.237006,-177.445914 71.222663,-177.457755 71.209357,-177.507804 71.173774,-177.581168 71.147589,-177.637626 71.117011,-177.684134 71.110968,-177.751883 71.092963,-177.819266 71.084662,-177.877677 71.052558,-177.930472 71.041449,-178.206595 71.038398,-178.310111 71.013617,-178.875907 70.981024,-178.980277 70.95069,-179.342093 70.908026,-179.336234 70.911078,-179.322257 70.921698,-179.364493 70.930243,-179.457511 70.915534,-179.501212 70.919684,-179.666007 70.965461,-179.853385 70.979438,-179.888785 70.993598,-179.907523 70.996772,-179.999989 70.992011,-179.999989 71.024848,-179.999989 71.058661,-179.999989 71.126166,-179.999989 71.187018,-179.999989 71.224189,-179.999989 71.27497,-179.999989 71.312079,-179.999989 71.356024,-179.999989 71.410041,-179.999989 71.487799,-179.999989 71.536689,-179.862845 71.538642,-179.912223 71.555854,-179.900748 71.558478,-179.798819 71.569098,-179.757438 71.583197,-179.735953 71.586432,-179.715445 71.583258,-179.697501 71.577338,-179.678702 71.573676,-179.610831 71.585211,-179.372062 71.569098,-179.326774 71.555487,-179.306815 71.557563,-179.287162 71.562934,-179.24285 71.569098,-179.204642 71.583197,-179.074576 71.600043,-178.395438 71.539008,-178.32319 71.518365))"], - [2,"MULTIPOLYGON(((-178.32319 71.518365,-178.321586 71.518439,-178.259635 71.510688,-178.304862 71.513129,-178.32319 71.518365)),((-178.32319 71.518365,-178.341544 71.517524,-178.32244 71.505439,-178.215323 71.478034,-178.193473 71.47663,-178.147757 71.485175,-178.124442 71.481879,-178.005729 71.448615,-178.017203 71.441413,-178.054191 71.428778,-178.047049 71.425727,-178.033439 71.417792,-178.026236 71.415107,-178.030082 71.413459,-178.039908 71.40766,-177.970878 71.39643,-177.779837 71.333197,-177.718375 71.305243,-177.706412 71.3039,-177.68212 71.304877,-177.670279 71.301825,-177.655387 71.293158,-177.587577 71.285956,-177.548575 71.294867,-177.531119 71.296332,-177.51409 71.293402,-177.498649 71.284735,-177.506217 71.268622,-177.486991 71.258734,-177.459708 71.249884,-177.443412 71.237006,-177.445914 71.222663,-177.457755 71.209357,-177.507804 71.173774,-177.581168 71.147589,-177.637626 71.117011,-177.684134 71.110968,-177.751883 71.092963,-177.819266 71.084662,-177.877677 71.052558,-177.930472 71.041449,-178.206595 71.038398,-178.310111 71.013617,-178.875907 70.981024,-178.980277 70.95069,-179.342093 70.908026,-179.336234 70.911078,-179.322257 70.921698,-179.364493 70.930243,-179.457511 70.915534,-179.501212 70.919684,-179.666007 70.965461,-179.853385 70.979438,-179.888785 70.993598,-179.907523 70.996772,-179.999989 70.992011,-179.999989 71.024848,-179.999989 71.058661,-179.999989 71.126166,-179.999989 71.187018,-179.999989 71.224189,-179.999989 71.27497,-179.999989 71.312079,-179.999989 71.356024,-179.999989 71.410041,-179.999989 71.487799,-179.999989 71.536689,-179.862845 71.538642,-179.912223 71.555854,-179.900748 71.558478,-179.798819 71.569098,-179.757438 71.583197,-179.735953 71.586432,-179.715445 71.583258,-179.697501 71.577338,-179.678702 71.573676,-179.610831 71.585211,-179.372062 71.569098,-179.326774 71.555487,-179.306815 71.557563,-179.287162 71.562934,-179.24285 71.569098,-179.204642 71.583197,-179.074576 71.600043,-178.395438 71.539008,-178.32319 71.518365)))"] -] - -geojson = [ - [1,'{"type":"Point","coordinates":[30,10]}'], - [1,'{"type":"Point","coordinates":[30.0,10.0]}'], - [1,'{"type":"Point","coordinates":[30.1,10.1]}'], - [1,'{"type":"LineString","coordinates":[[30.0,10.0],[10.0,30.0],[40.0,40.0]]}'], - [1,'{"type":"Polygon","coordinates":[[[30.0,10.0],[10.0,20.0],[20.0,40.0],[40.0,40.0],[30.0,10.0]]]}'], - [1,'{"type":"Polygon","coordinates":[[[35.0,10.0],[10.0,20.0],[15.0,40.0],[45.0,45.0],[35.0,10.0]],[[20.0,30.0],[35.0,35.0],[30.0,20.0],[20.0,30.0]]]}'], - [4,'{"type":"MultiPoint","coordinates":[[10.0,40.0],[40.0,30.0],[20.0,20.0],[30.0,10.0]]}'], - [2,'{"type":"MultiLineString","coordinates":[[[10.0,10.0],[20.0,20.0],[10.0,40.0]],[[40.0,40.0],[30.0,30.0],[40.0,20.0],[30.0,10.0]]]}'], - [2,'{"type":"MultiPolygon","coordinates":[[[[30.0,20.0],[10.0,40.0],[45.0,40.0],[30.0,20.0]]],[[[15.0,5.0],[40.0,10.0],[10.0,20.0],[5.0,10.0],[15.0,5.0]]]]}'], - [2,'{"type":"MultiPolygon","coordinates":[[[[40.0,40.0],[20.0,45.0],[45.0,30.0],[40.0,40.0]]],[[[20.0,35.0],[45.0,20.0],[30.0,5.0],[10.0,10.0],[10.0,30.0],[20.0,35.0]],[[30.0,20.0],[20.0,25.0],[20.0,15.0],[30.0,20.0]]]]}'], - [3,'{"type":"GeometryCollection","geometries":[{"type":"Polygon","coordinates":[[[1.0,1.0],[2.0,1.0],[2.0,2.0],[1.0,2.0],[1.0,1.0]]]},{"type":"Point","coordinates":[2.0,3.0]},{"type":"LineString","coordinates":[[2.0,3.0],[3.0,4.0]]}]}'], - [1,'{"type":"Polygon","coordinates":[[[-178.32319,71.518365],[-178.321586,71.518439],[-178.259635,71.510688],[-178.304862,71.513129],[-178.32319,71.518365]],[[-178.32319,71.518365],[-178.341544,71.517524],[-178.32244,71.505439],[-178.215323,71.478034],[-178.193473,71.47663],[-178.147757,71.485175],[-178.124442,71.481879],[-178.005729,71.448615],[-178.017203,71.441413],[-178.054191,71.428778],[-178.047049,71.425727],[-178.033439,71.417792],[-178.026236,71.415107],[-178.030082,71.413459],[-178.039908,71.40766],[-177.970878,71.39643],[-177.779837,71.333197],[-177.718375,71.305243],[-177.706412,71.3039],[-177.68212,71.304877],[-177.670279,71.301825],[-177.655387,71.293158],[-177.587577,71.285956],[-177.548575,71.294867],[-177.531119,71.296332],[-177.51409,71.293402],[-177.498649,71.284735],[-177.506217,71.268622],[-177.486991,71.258734],[-177.459708,71.249884],[-177.443412,71.237006],[-177.445914,71.222663],[-177.457755,71.209357],[-177.507804,71.173774],[-177.581168,71.147589],[-177.637626,71.117011],[-177.684134,71.110968],[-177.751883,71.092963],[-177.819266,71.084662],[-177.877677,71.052558],[-177.930472,71.041449],[-178.206595,71.038398],[-178.310111,71.013617],[-178.875907,70.981024],[-178.980277,70.95069],[-179.342093,70.908026],[-179.336234,70.911078],[-179.322257,70.921698],[-179.364493,70.930243],[-179.457511,70.915534],[-179.501212,70.919684],[-179.666007,70.965461],[-179.853385,70.979438],[-179.888785,70.993598],[-179.907523,70.996772],[-179.999989,70.992011],[-179.999989,71.024848],[-179.999989,71.058661],[-179.999989,71.126166],[-179.999989,71.187018],[-179.999989,71.224189],[-179.999989,71.27497],[-179.999989,71.312079],[-179.999989,71.356024],[-179.999989,71.410041],[-179.999989,71.487799],[-179.999989,71.536689],[-179.862845,71.538642],[-179.912223,71.555854],[-179.900748,71.558478],[-179.798819,71.569098],[-179.757438,71.583197],[-179.735953,71.586432],[-179.715445,71.583258],[-179.697501,71.577338],[-179.678702,71.573676],[-179.610831,71.585211],[-179.372062,71.569098],[-179.326774,71.555487],[-179.306815,71.557563],[-179.287162,71.562934],[-179.24285,71.569098],[-179.204642,71.583197],[-179.074576,71.600043],[-178.395438,71.539008],[-178.32319,71.518365]]]}'], - [2,'{"type":"MultiPolygon","coordinates":[[[[-178.32319,71.518365],[-178.321586,71.518439],[-178.259635,71.510688],[-178.304862,71.513129],[-178.32319,71.518365]]],[[[-178.32319,71.518365],[-178.341544,71.517524],[-178.32244,71.505439],[-178.215323,71.478034],[-178.193473,71.47663],[-178.147757,71.485175],[-178.124442,71.481879],[-178.005729,71.448615],[-178.017203,71.441413],[-178.054191,71.428778],[-178.047049,71.425727],[-178.033439,71.417792],[-178.026236,71.415107],[-178.030082,71.413459],[-178.039908,71.40766],[-177.970878,71.39643],[-177.779837,71.333197],[-177.718375,71.305243],[-177.706412,71.3039],[-177.68212,71.304877],[-177.670279,71.301825],[-177.655387,71.293158],[-177.587577,71.285956],[-177.548575,71.294867],[-177.531119,71.296332],[-177.51409,71.293402],[-177.498649,71.284735],[-177.506217,71.268622],[-177.486991,71.258734],[-177.459708,71.249884],[-177.443412,71.237006],[-177.445914,71.222663],[-177.457755,71.209357],[-177.507804,71.173774],[-177.581168,71.147589],[-177.637626,71.117011],[-177.684134,71.110968],[-177.751883,71.092963],[-177.819266,71.084662],[-177.877677,71.052558],[-177.930472,71.041449],[-178.206595,71.038398],[-178.310111,71.013617],[-178.875907,70.981024],[-178.980277,70.95069],[-179.342093,70.908026],[-179.336234,70.911078],[-179.322257,70.921698],[-179.364493,70.930243],[-179.457511,70.915534],[-179.501212,70.919684],[-179.666007,70.965461],[-179.853385,70.979438],[-179.888785,70.993598],[-179.907523,70.996772],[-179.999989,70.992011],[-179.999989,71.024848],[-179.999989,71.058661],[-179.999989,71.126166],[-179.999989,71.187018],[-179.999989,71.224189],[-179.999989,71.27497],[-179.999989,71.312079],[-179.999989,71.356024],[-179.999989,71.410041],[-179.999989,71.487799],[-179.999989,71.536689],[-179.862845,71.538642],[-179.912223,71.555854],[-179.900748,71.558478],[-179.798819,71.569098],[-179.757438,71.583197],[-179.735953,71.586432],[-179.715445,71.583258],[-179.697501,71.577338],[-179.678702,71.573676],[-179.610831,71.585211],[-179.372062,71.569098],[-179.326774,71.555487],[-179.306815,71.557563],[-179.287162,71.562934],[-179.24285,71.569098],[-179.204642,71.583197],[-179.074576,71.600043],[-178.395438,71.539008],[-178.32319,71.518365]]]]}'] -] - -geojson_reversed = [ - [1,'{"coordinates":[30,10],"type":"Point"}'], - [1,'{"coordinates":[30.0,10.0],"type":"Point"}'], - [1,'{"coordinates":[30.1,10.1],"type":"Point"}'], - [1,'{"coordinates":[[30.0,10.0],[10.0,30.0],[40.0,40.0]],"type":"LineString"}'], - [1,'{"coordinates":[[[30.0,10.0],[10.0,20.0],[20.0,40.0],[40.0,40.0],[30.0,10.0]]],"type":"Polygon"}'], - [1,'{"coordinates":[[[35.0,10.0],[10.0,20.0],[15.0,40.0],[45.0,45.0],[35.0,10.0]],[[20.0,30.0],[35.0,35.0],[30.0,20.0],[20.0,30.0]]],"type":"Polygon"}'], - [4,'{"coordinates":[[10.0,40.0],[40.0,30.0],[20.0,20.0],[30.0,10.0]],"type":"MultiPoint"}'], - [2,'{"coordinates":[[[10.0,10.0],[20.0,20.0],[10.0,40.0]],[[40.0,40.0],[30.0,30.0],[40.0,20.0],[30.0,10.0]]],"type":"MultiLineString"}'], - [2,'{"coordinates":[[[[30.0,20.0],[10.0,40.0],[45.0,40.0],[30.0,20.0]]],[[[15.0,5.0],[40.0,10.0],[10.0,20.0],[5.0,10.0],[15.0,5.0]]]],"type":"MultiPolygon"}'], - [2,'{"coordinates":[[[[40.0,40.0],[20.0,45.0],[45.0,30.0],[40.0,40.0]]],[[[20.0,35.0],[45.0,20.0],[30.0,5.0],[10.0,10.0],[10.0,30.0],[20.0,35.0]],[[30.0,20.0],[20.0,25.0],[20.0,15.0],[30.0,20.0]]]],"type":"MultiPolygon"}'], - [3,'{"geometries":[{"coordinates":[[[1.0,1.0],[2.0,1.0],[2.0,2.0],[1.0,2.0],[1.0,1.0]]],"type":"Polygon"},{"coordinates":[2.0,3.0],"type":"Point"},{"coordinates":[[2.0,3.0],[3.0,4.0]],"type":"LineString"}],"type":"GeometryCollection"}'], - [1,'{"coordinates":[[[-178.32319,71.518365],[-178.321586,71.518439],[-178.259635,71.510688],[-178.304862,71.513129],[-178.32319,71.518365]],[[-178.32319,71.518365],[-178.341544,71.517524],[-178.32244,71.505439],[-178.215323,71.478034],[-178.193473,71.47663],[-178.147757,71.485175],[-178.124442,71.481879],[-178.005729,71.448615],[-178.017203,71.441413],[-178.054191,71.428778],[-178.047049,71.425727],[-178.033439,71.417792],[-178.026236,71.415107],[-178.030082,71.413459],[-178.039908,71.40766],[-177.970878,71.39643],[-177.779837,71.333197],[-177.718375,71.305243],[-177.706412,71.3039],[-177.68212,71.304877],[-177.670279,71.301825],[-177.655387,71.293158],[-177.587577,71.285956],[-177.548575,71.294867],[-177.531119,71.296332],[-177.51409,71.293402],[-177.498649,71.284735],[-177.506217,71.268622],[-177.486991,71.258734],[-177.459708,71.249884],[-177.443412,71.237006],[-177.445914,71.222663],[-177.457755,71.209357],[-177.507804,71.173774],[-177.581168,71.147589],[-177.637626,71.117011],[-177.684134,71.110968],[-177.751883,71.092963],[-177.819266,71.084662],[-177.877677,71.052558],[-177.930472,71.041449],[-178.206595,71.038398],[-178.310111,71.013617],[-178.875907,70.981024],[-178.980277,70.95069],[-179.342093,70.908026],[-179.336234,70.911078],[-179.322257,70.921698],[-179.364493,70.930243],[-179.457511,70.915534],[-179.501212,70.919684],[-179.666007,70.965461],[-179.853385,70.979438],[-179.888785,70.993598],[-179.907523,70.996772],[-179.999989,70.992011],[-179.999989,71.024848],[-179.999989,71.058661],[-179.999989,71.126166],[-179.999989,71.187018],[-179.999989,71.224189],[-179.999989,71.27497],[-179.999989,71.312079],[-179.999989,71.356024],[-179.999989,71.410041],[-179.999989,71.487799],[-179.999989,71.536689],[-179.862845,71.538642],[-179.912223,71.555854],[-179.900748,71.558478],[-179.798819,71.569098],[-179.757438,71.583197],[-179.735953,71.586432],[-179.715445,71.583258],[-179.697501,71.577338],[-179.678702,71.573676],[-179.610831,71.585211],[-179.372062,71.569098],[-179.326774,71.555487],[-179.306815,71.557563],[-179.287162,71.562934],[-179.24285,71.569098],[-179.204642,71.583197],[-179.074576,71.600043],[-178.395438,71.539008],[-178.32319,71.518365]]],"type":"Polygon"}'], - [2,'{"coordinates":[[[[-178.32319,71.518365],[-178.321586,71.518439],[-178.259635,71.510688],[-178.304862,71.513129],[-178.32319,71.518365]]],[[[-178.32319,71.518365],[-178.341544,71.517524],[-178.32244,71.505439],[-178.215323,71.478034],[-178.193473,71.47663],[-178.147757,71.485175],[-178.124442,71.481879],[-178.005729,71.448615],[-178.017203,71.441413],[-178.054191,71.428778],[-178.047049,71.425727],[-178.033439,71.417792],[-178.026236,71.415107],[-178.030082,71.413459],[-178.039908,71.40766],[-177.970878,71.39643],[-177.779837,71.333197],[-177.718375,71.305243],[-177.706412,71.3039],[-177.68212,71.304877],[-177.670279,71.301825],[-177.655387,71.293158],[-177.587577,71.285956],[-177.548575,71.294867],[-177.531119,71.296332],[-177.51409,71.293402],[-177.498649,71.284735],[-177.506217,71.268622],[-177.486991,71.258734],[-177.459708,71.249884],[-177.443412,71.237006],[-177.445914,71.222663],[-177.457755,71.209357],[-177.507804,71.173774],[-177.581168,71.147589],[-177.637626,71.117011],[-177.684134,71.110968],[-177.751883,71.092963],[-177.819266,71.084662],[-177.877677,71.052558],[-177.930472,71.041449],[-178.206595,71.038398],[-178.310111,71.013617],[-178.875907,70.981024],[-178.980277,70.95069],[-179.342093,70.908026],[-179.336234,70.911078],[-179.322257,70.921698],[-179.364493,70.930243],[-179.457511,70.915534],[-179.501212,70.919684],[-179.666007,70.965461],[-179.853385,70.979438],[-179.888785,70.993598],[-179.907523,70.996772],[-179.999989,70.992011],[-179.999989,71.024848],[-179.999989,71.058661],[-179.999989,71.126166],[-179.999989,71.187018],[-179.999989,71.224189],[-179.999989,71.27497],[-179.999989,71.312079],[-179.999989,71.356024],[-179.999989,71.410041],[-179.999989,71.487799],[-179.999989,71.536689],[-179.862845,71.538642],[-179.912223,71.555854],[-179.900748,71.558478],[-179.798819,71.569098],[-179.757438,71.583197],[-179.735953,71.586432],[-179.715445,71.583258],[-179.697501,71.577338],[-179.678702,71.573676],[-179.610831,71.585211],[-179.372062,71.569098],[-179.326774,71.555487],[-179.306815,71.557563],[-179.287162,71.562934],[-179.24285,71.569098],[-179.204642,71.583197],[-179.074576,71.600043],[-178.395438,71.539008],[-178.32319,71.518365]]]],"type":"MultiPolygon"}'] -] - -geojson_nulls = [ - '{ "type": "Feature", "properties": { }, "geometry": null }', - '{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [] }}', - '{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [] ] }}', - '{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [] ] ] } }', - '{ "type": "Feature", "properties": { }, "geometry": { "coordinates": [], "type": "Point" }}', - '{ "type": "Feature", "properties": { }, "geometry": { "coordinates": [ [] ], "type": "LineString" }}', - '{ "type": "Feature", "properties": { }, "geometry": { "coordinates": [ [ [] ] ], "type": "Polygon" } }', - '{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiPoint", "coordinates": [ [] ] }}', - '{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiPoint", "coordinates": [ [],[] ] }}', - '{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiLineString", "coordinates": [ [] ] }}', - '{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [] ] ] }}', - '{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiPolygon", "coordinates": [ [] ] }}', - '{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [] ] ] }}', - '{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [] ] ] ] }}', -] - -wkbs = [ - [ 0, "Point EMPTY", '010400000000000000'], - [ 0, "MULTIPOINT EMPTY", '010400000000000000'], - [ 0, "LINESTRING EMPTY", '010200000000000000'], - [ 0, "MULTILINESTRING EMPTY", '010500000000000000'], - [ 0, "Polygon EMPTY", '010300000000000000'], - [ 0, "GEOMETRYCOLLECTION EMPTY", '010700000000000000'], - [ 2, "GEOMETRYCOLLECTION(MULTILINESTRING((10 10,20 20,10 40),(40 40,30 30,40 20,30 10)),LINESTRING EMPTY)", '010700000002000000010500000002000000010200000003000000000000000000244000000000000024400000000000003440000000000000344000000000000024400000000000004440010200000004000000000000000000444000000000000044400000000000003e400000000000003e40000000000000444000000000000034400000000000003e400000000000002440010200000000000000' - ], - [ 0, "GEOMETRYCOLLECTION(LINESTRING EMPTY,LINESTRING EMPTY)", '010700000000000000'], - [ 0, "GEOMETRYCOLLECTION(POINT EMPTY,POINT EMPTY)", '010700000000000000'], - [ 1, "GEOMETRYCOLLECTION(POINT EMPTY,POINT(0 0))", '010700000002000000010400000000000000010100000000000000000000000000000000000000'], - [ 1, "GEOMETRYCOLLECTION(POINT EMPTY,MULTIPOINT(0 0))", '010700000002000000010400000000000000010400000001000000010100000000000000000000000000000000000000'], - [ 0, "LINESTRING EMPTY", '010200000000000000' ], - [ 1, "Point(0 0)", '010100000000000000000000000000000000000000' ], - # unsupported types - [ 0, "MULTIPOLYGON EMPTY", '010600000000000000'], - [ 0, "TRIANGLE EMPTY", '011100000000000000'], - [ 0, "CircularString EMPTY", '010800000000000000'], - [ 0, "CurvePolygon EMPTY", '010A00000000000000'], - [ 0, "CompoundCurve EMPTY", '010900000000000000'], - [ 0, "MultiCurve EMPTY", '010B00000000000000'], - [ 0, "MultiSurface EMPTY", '010C00000000000000'], - [ 0, "PolyhedralSurface EMPTY", '010F00000000000000'], - [ 0, "TIN EMPTY", '011000000000000000'], - # TODO - a few bogus inputs - # enable if we start range checking to avoid crashing on invalid input? - # https://github.com/mapnik/mapnik/issues/2236 - #[ 0, "", '' ], - #[ 0, "00", '01' ], - #[ 0, "0000", '0104' ], -] - -def test_path_geo_interface(): - path = mapnik.Path() - path.add_wkt('POINT(0 0)') - eq_(path.__geo_interface__,{u'type': u'Point', u'coordinates': [0, 0]}) - -def test_wkb_parsing(): - path = mapnik.Path() - count = 0 - for wkb in wkbs: - count += wkb[0] - try : - path.add_wkb(unhexlify(wkb[2])) - except RuntimeError, e: - if 'EMPTY' in wkb[1]: - pass - else: - raise e - eq_(count,len(path)) - -def test_geojson_parsing(): - path = mapnik.Path() - count = 0 - for j in geojson: - count += j[0] - path.add_geojson(j[1]) - eq_(count,len(path)) - -def test_geojson_parsing_reversed(): - path = mapnik.Path() - path2 = mapnik.Path() - count = 0 - for idx,j in enumerate(geojson_reversed): - count += j[0] - path.add_geojson(j[1]) - path2.add_geojson(geojson[idx][1]) - eq_(path.to_geojson(),path2.to_geojson()) - eq_(count,len(path)) - - -# http://geojson.org/geojson-spec.html#positions -def test_geojson_point_positions(): - input_json = '{"type":"Point","coordinates":[30,10]}' - - path = mapnik.Path() - path.add_geojson(input_json) - eq_(path.to_geojson(),input_json) - - path = mapnik.Path() - # should ignore all but the first two - path.add_geojson('{"type":"Point","coordinates":[30,10,50,50,50,50]}') - eq_(path.to_geojson(),input_json) - -def test_geojson_point_positions2(): - input_json = '{"type":"LineString","coordinates":[[30,10],[10,30],[40,40]]}' - - path = mapnik.Path() - path.add_geojson(input_json) - eq_(path.to_geojson(),input_json) - - path = mapnik.Path() - # should ignore all but the first two - path.add_geojson('{"type":"LineString","coordinates":[[30.0,10.0,0,0,0],[10.0,30.0,0,0,0],[40.0,40.0,0,0,0]]}') - eq_(path.to_geojson(),input_json) - -def compare_wkb_from_wkt(wkt,num=None): - - paths = mapnik.Path.from_wkt(wkt) - - # add geometry(s) to feature from wkt - f = mapnik.Feature(mapnik.Context(),1) - f.add_geometries_from_wkt(wkt) - - # ensure both have same result - # compare number of geometry parts - if num: - eq_(len(paths),num) - eq_(len(f.geometries()),num) - # compare collection off all geometries - eq_(paths.to_wkb(mapnik.wkbByteOrder.XDR),f.geometries().to_wkb(mapnik.wkbByteOrder.XDR)) - # compare all parts - for idx,path in enumerate(paths): - eq_(f.geometries()[idx].to_wkb(mapnik.wkbByteOrder.XDR),path.to_wkb(mapnik.wkbByteOrder.XDR)) - - # compare round trip - paths2 = mapnik.Path() - for path in paths: - paths2.add_wkb(path.to_wkb(mapnik.wkbByteOrder.XDR)) - - # ensure result - if num: - eq_(len(paths2),num) - eq_(paths2.to_wkb(mapnik.wkbByteOrder.XDR),paths.to_wkb(mapnik.wkbByteOrder.XDR)) - for idx,path in enumerate(paths2): - eq_(f.geometries()[idx].to_wkb(mapnik.wkbByteOrder.XDR),path.to_wkb(mapnik.wkbByteOrder.XDR)) - -def compare_wkt_from_wkt(wkt,num=None): - paths = mapnik.Path.from_wkt(wkt) - - # add geometry(s) to feature from wkt - f = mapnik.Feature(mapnik.Context(),1) - f.add_geometries_from_wkt(wkt) - - # compare to original, which may not have significant digits - if '.' not in wkt: - eq_(f.geometries().to_wkt().upper().replace('.0',''),wkt) - else: - eq_(f.geometries().to_wkt().upper(),wkt) - - # ensure both have same result - if num: - eq_(len(paths),num) - eq_(len(f.geometries()),num) - eq_(paths.to_wkt(),f.geometries().to_wkt()) - for idx,path in enumerate(paths): - eq_(f.geometries()[idx].to_wkt(),path.to_wkt()) - - # compare round trip - paths2 = mapnik.Path() - for path in paths: - paths2.add_wkt(path.to_wkt()) - - # ensure result - if num: - eq_(len(paths2),num) - eq_(paths2.to_wkt(),paths.to_wkt()) - for idx,path in enumerate(paths2): - eq_(f.geometries()[idx].to_wkb(mapnik.wkbByteOrder.XDR),path.to_wkb(mapnik.wkbByteOrder.XDR)) - -def compare_wkt_to_geojson(idx,wkt,num=None): - paths = mapnik.Path.from_wkt(wkt) - # ensure both have same result - if num: - eq_(len(paths),num) - gj = paths.to_geojson() - eq_(len(gj) > 1,True) - a = json.loads(gj) - e = json.loads(geojson[idx][1]) - eq_(a,e) - -def test_wkt_simple(): - for wkt in wkts: - try: - compare_wkt_from_wkt(wkt[1],wkt[0]) - except RuntimeError, e: - raise RuntimeError('%s %s' % (e, wkt)) - -def test_wkb_simple(): - for wkt in wkts: - try: - compare_wkb_from_wkt(wkt[1],wkt[0]) - except RuntimeError, e: - raise RuntimeError('%s %s' % (e, wkt)) - -def test_wkt_to_geojson(): - idx = -1 - for wkt in wkts: - try: - idx += 1 - compare_wkt_to_geojson(idx,wkt[1],wkt[0]) - except RuntimeError, e: - raise RuntimeError('%s %s' % (e, wkt)) - -@raises(IndexError) -def test_geometry_index_error(): - wkt = 'Point (0 0)' - paths = mapnik.Path.from_wkt(wkt) - paths[3] - f = mapnik.Feature(mapnik.Context(),1) - f.add_geometries_from_wkt(wkt) - f.geometries()[3] - -@raises(IndexError) -def test_geometry_index_error2(): - wkt = 'Point (0 0)' - f = mapnik.Feature(mapnik.Context(),1) - f.add_geometries_from_wkt(wkt) - f.geometries()[3] - -def test_wkt_rounding(): - # currently fails because we use output precision of 6 - should we make configurable? https://github.com/mapnik/mapnik/issues/1009 - # if precision is set to 15 still fails due to very subtle rounding issues - wkt = "POLYGON((7.904185 54.180426,7.89918 54.178168,7.897715 54.182318,7.893565 54.183111,7.890391 54.187567,7.885874 54.19068,7.879893 54.193915,7.894541 54.194647,7.900645 54.19068,7.904185 54.180426))" - compare_wkt_from_wkt(wkt,1) - -def test_wkt_collection_flattening(): - wkt = 'GEOMETRYCOLLECTION(POLYGON((1 1,2 1,2 2,1 2,1 1)),POLYGON((40 40,20 45,45 30,40 40)),POLYGON((20 35,45 20,30 5,10 10,10 30,20 35),(30 20,20 25,20 15,30 20)),LINESTRING(2 3,3 4))' - # currently fails as the MULTIPOLYGON inside will be returned as multiple polygons - not a huge deal - should we worry? - #wkt = "GEOMETRYCOLLECTION(POLYGON((1 1,2 1,2 2,1 2,1 1)),MULTIPOLYGON(((40 40,20 45,45 30,40 40)),((20 35,45 20,30 5,10 10,10 30,20 35),(30 20,20 25,20 15,30 20))),LINESTRING(2 3,3 4))" - compare_wkt_from_wkt(wkt,4) - -# skip since this data is not checked into tests -#def test_wkt_natural_earth(): -# ''' -# wget http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/10m-land.zip -# unzip 10m-land.zip -# ogr2ogr -F CSV -lco GEOMETRY=AS_WKT 10m-land.csv 10m_land.shp -# mv 10m-land.csv tests/data/csv/ -# ''' -# lines = open('../data/csv/10m-land.csv').readlines() -# for line in lines: -# wkt = lines[1][lines[1].index('"',0)+1:lines[1].index('"',1)] -# wkt = wkt.replace(' (','(',1) -# try: -# compare_wkb_from_wkt(wkt) -# except RuntimeError, e: -# raise RuntimeError('%s %s' % (e, wkt)) - -def test_creating_feature_from_geojson(): - json_feat = { - "type": "Feature", - "geometry": {"type": "Point", "coordinates": [-122,48]}, - "properties": {"name": "value"} - } - ctx = mapnik.Context() - feat = mapnik.Feature.from_geojson(json.dumps(json_feat),ctx) - eq_(feat.id(),1) - eq_(feat['name'],u'value') - -def test_handling_geojson_null_geoms(): - for j in geojson_nulls: - ctx = mapnik.Context() - out_json = mapnik.Feature.from_geojson(j,ctx).to_geojson() - expected = '{"type":"Feature","id":1,"geometry":null,"properties":{}}' - eq_(out_json,expected) - # ensure it round trips - eq_(mapnik.Feature.from_geojson(out_json,ctx).to_geojson(),expected) - - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/grayscale_test.py b/tests/python_tests/grayscale_test.py deleted file mode 100644 index f347d7256..000000000 --- a/tests/python_tests/grayscale_test.py +++ /dev/null @@ -1,13 +0,0 @@ -import mapnik -from nose.tools import eq_ -from utilities import run_all - -def test_grayscale_conversion(): - im = mapnik.Image(2,2) - im.background = mapnik.Color('white') - im.set_grayscale_to_alpha() - pixel = im.get_pixel(0,0) - eq_((pixel >> 24) & 0xff,255); - -if __name__ == "__main__": - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/image_encoding_speed_test.py b/tests/python_tests/image_encoding_speed_test.py deleted file mode 100644 index 9ba174853..000000000 --- a/tests/python_tests/image_encoding_speed_test.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os, mapnik -from timeit import Timer, time -from utilities import execution_path, run_all - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -combinations = ['png', - 'png8', - 'png8:m=o', - 'png8:m=h', - 'png8:m=o:t=0', - 'png8:m=o:t=1', - 'png8:m=o:t=2', - 'png8:m=h:t=0', - 'png8:m=h:t=1', - 'png8:m=h:t=2', - 'png:z=1', - 'png:z=1:t=0', # forces rbg, no a - 'png8:z=1', - 'png8:z=1:m=o', - 'png8:z=1:m=h', - 'png8:z=1:c=1', - 'png8:z=1:c=24', - 'png8:z=1:c=64', - 'png8:z=1:c=128', - 'png8:z=1:c=200', - 'png8:z=1:c=255', - 'png8:z=9:c=64', - 'png8:z=9:c=128', - 'png8:z=9:c=200', - 'png8:z=1:c=50:m=h', - 'png8:z=1:c=1:m=o', - 'png8:z=1:c=1:m=o:s=filtered', - 'png:z=1:s=filtered', - 'png:z=1:s=huff', - 'png:z=1:s=rle', - 'png8:m=h:g=2.0', - 'png8:m=h:g=1.0', - 'png:e=miniz', - 'png8:e=miniz' - ] - -tiles = [ -'blank', -'solid', -'many_colors', -'aerial_24' -] - -iterations = 10 - -def do_encoding(): - - global image - - results = {} - sortable = {} - - def run(func, im, format, t): - global image - image = im - start = time.time() - set = t.repeat(iterations,1) - elapsed = (time.time() - start) - min_ = min(set)*1000 - avg = (sum(set)/len(set))*1000 - name = func.__name__ + ' ' + format - results[name] = [min_,avg,elapsed*1000,name,len(func())] - sortable[name] = [min_] - - if 'blank' in tiles: - def blank(): - return eval('image.tostring("%s")' % c) - blank_im = mapnik.Image(512,512) - for c in combinations: - t = Timer(blank) - run(blank,blank_im,c,t) - - if 'solid' in tiles: - def solid(): - return eval('image.tostring("%s")' % c) - solid_im = mapnik.Image(512,512) - solid_im.background = mapnik.Color("#f2efe9") - for c in combinations: - t = Timer(solid) - run(solid,solid_im,c,t) - - if 'many_colors' in tiles: - def many_colors(): - return eval('image.tostring("%s")' % c) - # lots of colors: http://tile.osm.org/13/4194/2747.png - many_colors_im = mapnik.Image.open('../data/images/13_4194_2747.png') - for c in combinations: - t = Timer(many_colors) - run(many_colors,many_colors_im,c,t) - - if 'aerial_24' in tiles: - def aerial_24(): - return eval('image.tostring("%s")' % c) - aerial_24_im = mapnik.Image.open('../data/images/12_654_1580.png') - for c in combinations: - t = Timer(aerial_24) - run(aerial_24,aerial_24_im,c,t) - - for key, value in sorted(sortable.iteritems(), key=lambda (k,v): (v,k)): - s = results[key] - min_ = str(s[0])[:6] - avg = str(s[1])[:6] - elapsed = str(s[2])[:6] - name = s[3] - size = s[4] - print 'min: %sms | avg: %sms | total: %sms | len: %s <-- %s' % (min_,avg,elapsed,size,name) - - -if __name__ == "__main__": - setup() - do_encoding() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/image_filters_test.py b/tests/python_tests/image_filters_test.py deleted file mode 100644 index 269d64ca2..000000000 --- a/tests/python_tests/image_filters_test.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_ -from utilities import execution_path, run_all -from utilities import side_by_side_image -import os, mapnik -import re - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def replace_style(m, name, style): - m.remove_style(name) - m.append_style(name, style) - -def test_append(): - s = mapnik.Style() - eq_(s.image_filters,'') - s.image_filters = 'gray' - eq_(s.image_filters,'gray') - s.image_filters = 'sharpen' - eq_(s.image_filters,'sharpen') - -if 'shape' in mapnik.DatasourceCache.plugin_names(): - def test_style_level_image_filter(): - m = mapnik.Map(256, 256) - mapnik.load_map(m, '../data/good_maps/style_level_image_filter.xml') - m.zoom_all() - successes = [] - fails = [] - for name in ("", "agg-stack-blur(2,2)", "blur", - "edge-detect", "emboss", "gray", "invert", - "sharpen", "sobel", "x-gradient", "y-gradient"): - if name == "": - filename = "none" - else: - filename = re.sub(r"[^-_a-z.0-9]", "", name) - # find_style returns a copy of the style object - style_markers = m.find_style("markers") - style_markers.image_filters = name - style_labels = m.find_style("labels") - style_labels.image_filters = name - # replace the original style with the modified one - replace_style(m, "markers", style_markers) - replace_style(m, "labels", style_labels) - im = mapnik.Image(m.width, m.height) - mapnik.render(m, im) - actual = '/tmp/mapnik-style-image-filter-' + filename + '.png' - expected = 'images/style-image-filter/' + filename + '.png' - im.save(actual,"png32") - if not os.path.exists(expected) or os.environ.get('UPDATE'): - print 'generating expected test image: %s' % expected - im.save(expected,'png32') - expected_im = mapnik.Image.open(expected) - # compare them - if im.tostring('png32') == expected_im.tostring('png32'): - successes.append(name) - else: - fails.append('failed comparing actual (%s) and expected(%s)' % (actual,'tests/python_tests/'+ expected)) - fail_im = side_by_side_image(expected_im, im) - fail_im.save('/tmp/mapnik-style-image-filter-' + filename + '.fail.png','png32') - eq_(len(fails), 0, '\n'+'\n'.join(fails)) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/image_test.py b/tests/python_tests/image_test.py deleted file mode 100644 index 9e9e4b90f..000000000 --- a/tests/python_tests/image_test.py +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os, mapnik -from nose.tools import eq_,raises -from utilities import execution_path, run_all - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def test_image_premultiply(): - im = mapnik.Image(256,256) - eq_(im.premultiplied(),False) - im.premultiply() - eq_(im.premultiplied(),True) - im.demultiply() - eq_(im.premultiplied(),False) - -@raises(RuntimeError) -def test_negative_image_dimensions(): - # TODO - this may have regressed in https://github.com/mapnik/mapnik/commit/4f3521ac24b61fc8ae8fd344a16dc3a5fdf15af7 - im = mapnik.Image(-40,40) - # should not get here - eq_(im.width(),0) - eq_(im.height(),0) - -def test_jpeg_round_trip(): - filepath = '/tmp/mapnik-jpeg-io.jpeg' - im = mapnik.Image(255,267) - im.background = mapnik.Color('rgba(1,2,3,.5)') - im.save(filepath,'jpeg') - im2 = mapnik.Image.open(filepath) - im3 = mapnik.Image.fromstring(open(filepath,'r').read()) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(im.width(),im3.width()) - eq_(im.height(),im3.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('jpeg')),len(im2.tostring('jpeg'))) - eq_(len(im.tostring()),len(im3.tostring())) - eq_(len(im.tostring('jpeg')),len(im3.tostring('jpeg'))) - -def test_png_round_trip(): - filepath = '/tmp/mapnik-png-io.png' - im = mapnik.Image(255,267) - im.background = mapnik.Color('rgba(1,2,3,.5)') - im.save(filepath,'png') - im2 = mapnik.Image.open(filepath) - im3 = mapnik.Image.fromstring(open(filepath,'r').read()) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(im.width(),im3.width()) - eq_(im.height(),im3.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('png')),len(im2.tostring('png'))) - eq_(len(im.tostring('png8')),len(im2.tostring('png8'))) - eq_(len(im.tostring()),len(im3.tostring())) - eq_(len(im.tostring('png')),len(im3.tostring('png'))) - eq_(len(im.tostring('png8')),len(im3.tostring('png8'))) - -def test_image_open_from_string(): - filepath = '../data/images/dummy.png' - im1 = mapnik.Image.open(filepath) - im2 = mapnik.Image.fromstring(open(filepath,'rb').read()) - eq_(im1.width(),im2.width()) - length = len(im1.tostring()) - eq_(length,len(im2.tostring())) - eq_(len(mapnik.Image.fromstring(im1.tostring('png')).tostring()),length) - eq_(len(mapnik.Image.fromstring(im1.tostring('jpeg')).tostring()),length) - eq_(len(mapnik.Image.frombuffer(buffer(im1.tostring('png'))).tostring()),length) - eq_(len(mapnik.Image.frombuffer(buffer(im1.tostring('jpeg'))).tostring()),length) - - # TODO - https://github.com/mapnik/mapnik/issues/1831 - eq_(len(mapnik.Image.fromstring(im1.tostring('tiff')).tostring()),length) - eq_(len(mapnik.Image.frombuffer(buffer(im1.tostring('tiff'))).tostring()),length) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/image_tiff_test.py b/tests/python_tests/image_tiff_test.py deleted file mode 100644 index a30668fc5..000000000 --- a/tests/python_tests/image_tiff_test.py +++ /dev/null @@ -1,259 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os, mapnik -from nose.tools import eq_ -from utilities import execution_path, run_all - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def test_tiff_round_trip_scanline(): - filepath = '/tmp/mapnik-tiff-io-scanline.tiff' - im = mapnik.Image(255,267) - im.background = mapnik.Color('rgba(1,2,3,.5)') - org_str = len(im.tostring()) - im.save(filepath,'tiff:method=scanline') - im2 = mapnik.Image.open(filepath) - im3 = mapnik.Image.fromstring(open(filepath,'r').read()) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(im.width(),im3.width()) - eq_(im.height(),im3.height()) - eq_(len(im.tostring()), org_str) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=scanline')),len(im2.tostring('tiff:method=scanline'))) - eq_(len(im.tostring()),len(im3.tostring())) - eq_(len(im.tostring('tiff:method=scanline')),len(im3.tostring('tiff:method=scanline'))) - -def test_tiff_round_trip_stripped(): - filepath = '/tmp/mapnik-tiff-io-stripped.tiff' - im = mapnik.Image(255,267) - im.background = mapnik.Color('rgba(1,2,3,.5)') - org_str = len(im.tostring()) - im.save(filepath,'tiff:method=stripped') - im2 = mapnik.Image.open(filepath) - im3 = mapnik.Image.fromstring(open(filepath,'r').read()) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(im.width(),im3.width()) - eq_(im.height(),im3.height()) - eq_(len(im.tostring()), org_str) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=stripped')),len(im2.tostring('tiff:method=stripped'))) - eq_(len(im.tostring()),len(im3.tostring())) - eq_(len(im.tostring('tiff:method=stripped')),len(im3.tostring('tiff:method=stripped'))) - -def test_tiff_round_trip_rows_stripped(): - filepath = '/tmp/mapnik-tiff-io-stripped.tiff' - im = mapnik.Image(255,267) - im.background = mapnik.Color('rgba(1,2,3,.5)') - org_str = len(im.tostring()) - im.save(filepath,'tiff:method=stripped:rows_per_strip=8') - im2 = mapnik.Image.open(filepath) - im3 = mapnik.Image.fromstring(open(filepath,'r').read()) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(im.width(),im3.width()) - eq_(im.height(),im3.height()) - eq_(len(im.tostring()), org_str) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=stripped:rows_per_strip=8')),len(im2.tostring('tiff:method=stripped:rows_per_strip=8'))) - eq_(len(im.tostring()),len(im3.tostring())) - eq_(len(im.tostring('tiff:method=stripped:rows_per_strip=8')),len(im3.tostring('tiff:method=stripped:rows_per_strip=8'))) - -def test_tiff_round_trip_buffered_tiled(): - filepath = '/tmp/mapnik-tiff-io-buffered-tiled.tiff' - filepath2 = '/tmp/mapnik-tiff-io-buffered-tiled2.tiff' - im = mapnik.Image(255,267) - #im = mapnik.Image(256,256) - im.background = mapnik.Color('rgba(1,2,3,.5)') - im.save(filepath,'tiff:method=tiled:tile_width=32:tile_height=32') - im2 = mapnik.Image.open(filepath) - im3 = mapnik.Image.fromstring(open(filepath,'r').read()) - im2.save(filepath2, 'tiff:method=tiled:tile_width=32:tile_height=32') - im4 = mapnik.Image.open(filepath2) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(im.width(),im3.width()) - eq_(im.height(),im3.height()) - eq_(len(im2.tostring()),len(im4.tostring())) - eq_(len(im2.tostring('tiff:method=tiled:tile_width=32:tile_height=32')),len(im4.tostring('tiff:method=tiled:tile_width=32:tile_height=32'))) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=tiled:tile_width=32:tile_height=32')),len(im2.tostring('tiff:method=tiled:tile_width=32:tile_height=32'))) - eq_(len(im.tostring()),len(im3.tostring())) - eq_(len(im.tostring('tiff:method=tiled:tile_width=32:tile_height=32')),len(im3.tostring('tiff:method=tiled:tile_width=32:tile_height=32'))) - -def test_tiff_round_trip_tiled(): - filepath = '/tmp/mapnik-tiff-io-tiled.tiff' - im = mapnik.Image(256,256) - im.background = mapnik.Color('rgba(1,2,3,.5)') - im.save(filepath,'tiff:method=tiled') - im2 = mapnik.Image.open(filepath) - im3 = mapnik.Image.fromstring(open(filepath,'r').read()) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(im.width(),im3.width()) - eq_(im.height(),im3.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=tiled')),len(im2.tostring('tiff:method=tiled'))) - eq_(len(im.tostring()),len(im3.tostring())) - eq_(len(im.tostring('tiff:method=tiled')),len(im3.tostring('tiff:method=tiled'))) - - -def test_tiff_rgb8_compare(): - filepath1 = '../data/tiff/ndvi_256x256_rgb8_striped.tif' - filepath2 = '/tmp/mapnik-tiff-rgb8.tiff' - im = mapnik.Image.open(filepath1) - im.save(filepath2,'tiff') - im2 = mapnik.Image.open(filepath2) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff')),len(im2.tostring('tiff'))) - # should not be a blank image - eq_(len(im.tostring("png")) != len(mapnik.Image(im.width(),im.height()).tostring("png")),True) - -def test_tiff_rgba8_compare_scanline(): - filepath1 = '../data/tiff/ndvi_256x256_rgba8_striped.tif' - filepath2 = '/tmp/mapnik-tiff-rgba8-scanline.tiff' - im = mapnik.Image.open(filepath1) - im.save(filepath2,'tiff:method=scanline') - im2 = mapnik.Image.open(filepath2) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=scanline')),len(im2.tostring('tiff:method=scanline'))) - # should not be a blank image - eq_(len(im.tostring("png")) != len(mapnik.Image(im.width(),im.height()).tostring("png")),True) - -def test_tiff_rgba8_compare_stripped(): - filepath1 = '../data/tiff/ndvi_256x256_rgba8_striped.tif' - filepath2 = '/tmp/mapnik-tiff-rgba8-stripped.tiff' - im = mapnik.Image.open(filepath1) - im.save(filepath2,'tiff:method=stripped') - im2 = mapnik.Image.open(filepath2) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=stripped')),len(im2.tostring('tiff:method=stripped'))) - # should not be a blank image - eq_(len(im.tostring("png")) != len(mapnik.Image(im.width(),im.height()).tostring("png")),True) - -def test_tiff_rgba8_compare_tiled(): - filepath1 = '../data/tiff/ndvi_256x256_rgba8_striped.tif' - filepath2 = '/tmp/mapnik-tiff-rgba8-stripped.tiff' - im = mapnik.Image.open(filepath1) - im.save(filepath2,'tiff:method=tiled') - im2 = mapnik.Image.open(filepath2) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=tiled')),len(im2.tostring('tiff:method=tiled'))) - # should not be a blank image - eq_(len(im.tostring("png")) != len(mapnik.Image(im.width(),im.height()).tostring("png")),True) - -def test_tiff_gray8_compare_scanline(): - filepath1 = '../data/tiff/ndvi_256x256_gray8_striped.tif' - filepath2 = '/tmp/mapnik-tiff-gray8-scanline.tiff' - im = mapnik.Image.open(filepath1) - im.save(filepath2,'tiff:method=scanline') - im2 = mapnik.Image.open(filepath2) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=scanline')),len(im2.tostring('tiff:method=scanline'))) - -def test_tiff_gray8_compare_stripped(): - filepath1 = '../data/tiff/ndvi_256x256_gray8_striped.tif' - filepath2 = '/tmp/mapnik-tiff-gray8-stripped.tiff' - im = mapnik.Image.open(filepath1) - im.save(filepath2,'tiff:method=stripped') - im2 = mapnik.Image.open(filepath2) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=stripped')),len(im2.tostring('tiff:method=stripped'))) - -def test_tiff_gray8_compare_tiled(): - filepath1 = '../data/tiff/ndvi_256x256_gray8_striped.tif' - filepath2 = '/tmp/mapnik-tiff-gray8-tiled.tiff' - im = mapnik.Image.open(filepath1) - im.save(filepath2,'tiff:method=tiled') - im2 = mapnik.Image.open(filepath2) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=tiled')),len(im2.tostring('tiff:method=tiled'))) - -def test_tiff_gray16_compare_scanline(): - filepath1 = '../data/tiff/ndvi_256x256_gray16_striped.tif' - filepath2 = '/tmp/mapnik-tiff-gray16-scanline.tiff' - im = mapnik.Image.open(filepath1) - im.save(filepath2,'tiff:method=scanline') - im2 = mapnik.Image.open(filepath2) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=scanline')),len(im2.tostring('tiff:method=scanline'))) - -def test_tiff_gray16_compare_stripped(): - filepath1 = '../data/tiff/ndvi_256x256_gray16_striped.tif' - filepath2 = '/tmp/mapnik-tiff-gray16-stripped.tiff' - im = mapnik.Image.open(filepath1) - im.save(filepath2,'tiff:method=stripped') - im2 = mapnik.Image.open(filepath2) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=stripped')),len(im2.tostring('tiff:method=stripped'))) - -def test_tiff_gray16_compare_tiled(): - filepath1 = '../data/tiff/ndvi_256x256_gray16_striped.tif' - filepath2 = '/tmp/mapnik-tiff-gray16-tiled.tiff' - im = mapnik.Image.open(filepath1) - im.save(filepath2,'tiff:method=tiled') - im2 = mapnik.Image.open(filepath2) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=tiled')),len(im2.tostring('tiff:method=tiled'))) - -def test_tiff_gray32f_compare_scanline(): - filepath1 = '../data/tiff/ndvi_256x256_gray32f_striped.tif' - filepath2 = '/tmp/mapnik-tiff-gray32f-scanline.tiff' - im = mapnik.Image.open(filepath1) - im.save(filepath2,'tiff:method=scanline') - im2 = mapnik.Image.open(filepath2) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=scanline')),len(im2.tostring('tiff:method=scanline'))) - -def test_tiff_gray32f_compare_stripped(): - filepath1 = '../data/tiff/ndvi_256x256_gray32f_striped.tif' - filepath2 = '/tmp/mapnik-tiff-gray32f-stripped.tiff' - im = mapnik.Image.open(filepath1) - im.save(filepath2,'tiff:method=stripped') - im2 = mapnik.Image.open(filepath2) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=stripped')),len(im2.tostring('tiff:method=stripped'))) - -def test_tiff_gray32f_compare_tiled(): - filepath1 = '../data/tiff/ndvi_256x256_gray32f_striped.tif' - filepath2 = '/tmp/mapnik-tiff-gray32f-tiled.tiff' - im = mapnik.Image.open(filepath1) - im.save(filepath2,'tiff:method=tiled') - im2 = mapnik.Image.open(filepath2) - eq_(im.width(),im2.width()) - eq_(im.height(),im2.height()) - eq_(len(im.tostring()),len(im2.tostring())) - eq_(len(im.tostring('tiff:method=tiled')),len(im2.tostring('tiff:method=tiled'))) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/images/composited/clear.png b/tests/python_tests/images/composited/clear.png deleted file mode 100644 index 4fe9ab376..000000000 Binary files a/tests/python_tests/images/composited/clear.png and /dev/null differ diff --git a/tests/python_tests/images/composited/color.png b/tests/python_tests/images/composited/color.png deleted file mode 100644 index f9a687904..000000000 Binary files a/tests/python_tests/images/composited/color.png and /dev/null differ diff --git a/tests/python_tests/images/composited/color_burn.png b/tests/python_tests/images/composited/color_burn.png deleted file mode 100644 index af985bd99..000000000 Binary files a/tests/python_tests/images/composited/color_burn.png and /dev/null differ diff --git a/tests/python_tests/images/composited/color_dodge.png b/tests/python_tests/images/composited/color_dodge.png deleted file mode 100644 index 6c45b8589..000000000 Binary files a/tests/python_tests/images/composited/color_dodge.png and /dev/null differ diff --git a/tests/python_tests/images/composited/contrast.png b/tests/python_tests/images/composited/contrast.png deleted file mode 100644 index 54ea219f3..000000000 Binary files a/tests/python_tests/images/composited/contrast.png and /dev/null differ diff --git a/tests/python_tests/images/composited/darken.png b/tests/python_tests/images/composited/darken.png deleted file mode 100644 index 4324c0a3e..000000000 Binary files a/tests/python_tests/images/composited/darken.png and /dev/null differ diff --git a/tests/python_tests/images/composited/difference.png b/tests/python_tests/images/composited/difference.png deleted file mode 100644 index 312bded7f..000000000 Binary files a/tests/python_tests/images/composited/difference.png and /dev/null differ diff --git a/tests/python_tests/images/composited/divide.png b/tests/python_tests/images/composited/divide.png deleted file mode 100644 index 0a4b24f05..000000000 Binary files a/tests/python_tests/images/composited/divide.png and /dev/null differ diff --git a/tests/python_tests/images/composited/dst.png b/tests/python_tests/images/composited/dst.png deleted file mode 100644 index 14be3530a..000000000 Binary files a/tests/python_tests/images/composited/dst.png and /dev/null differ diff --git a/tests/python_tests/images/composited/dst_atop.png b/tests/python_tests/images/composited/dst_atop.png deleted file mode 100644 index 845c370c1..000000000 Binary files a/tests/python_tests/images/composited/dst_atop.png and /dev/null differ diff --git a/tests/python_tests/images/composited/dst_in.png b/tests/python_tests/images/composited/dst_in.png deleted file mode 100644 index 1664be091..000000000 Binary files a/tests/python_tests/images/composited/dst_in.png and /dev/null differ diff --git a/tests/python_tests/images/composited/dst_out.png b/tests/python_tests/images/composited/dst_out.png deleted file mode 100644 index eb943bc33..000000000 Binary files a/tests/python_tests/images/composited/dst_out.png and /dev/null differ diff --git a/tests/python_tests/images/composited/dst_over.png b/tests/python_tests/images/composited/dst_over.png deleted file mode 100644 index 51fe08eca..000000000 Binary files a/tests/python_tests/images/composited/dst_over.png and /dev/null differ diff --git a/tests/python_tests/images/composited/exclusion.png b/tests/python_tests/images/composited/exclusion.png deleted file mode 100644 index 6cf4fa78d..000000000 Binary files a/tests/python_tests/images/composited/exclusion.png and /dev/null differ diff --git a/tests/python_tests/images/composited/grain_extract.png b/tests/python_tests/images/composited/grain_extract.png deleted file mode 100644 index cfa03e113..000000000 Binary files a/tests/python_tests/images/composited/grain_extract.png and /dev/null differ diff --git a/tests/python_tests/images/composited/grain_merge.png b/tests/python_tests/images/composited/grain_merge.png deleted file mode 100644 index 78de8b5dc..000000000 Binary files a/tests/python_tests/images/composited/grain_merge.png and /dev/null differ diff --git a/tests/python_tests/images/composited/hard_light.png b/tests/python_tests/images/composited/hard_light.png deleted file mode 100644 index 9d878deab..000000000 Binary files a/tests/python_tests/images/composited/hard_light.png and /dev/null differ diff --git a/tests/python_tests/images/composited/hue.png b/tests/python_tests/images/composited/hue.png deleted file mode 100644 index 96ed7a6f1..000000000 Binary files a/tests/python_tests/images/composited/hue.png and /dev/null differ diff --git a/tests/python_tests/images/composited/invert.png b/tests/python_tests/images/composited/invert.png deleted file mode 100644 index 03e8e94b3..000000000 Binary files a/tests/python_tests/images/composited/invert.png and /dev/null differ diff --git a/tests/python_tests/images/composited/invert_rgb.png b/tests/python_tests/images/composited/invert_rgb.png deleted file mode 100644 index 5a8904f12..000000000 Binary files a/tests/python_tests/images/composited/invert_rgb.png and /dev/null differ diff --git a/tests/python_tests/images/composited/lighten.png b/tests/python_tests/images/composited/lighten.png deleted file mode 100644 index 3b8a86062..000000000 Binary files a/tests/python_tests/images/composited/lighten.png and /dev/null differ diff --git a/tests/python_tests/images/composited/linear_burn.png b/tests/python_tests/images/composited/linear_burn.png deleted file mode 100644 index 37ec4b768..000000000 Binary files a/tests/python_tests/images/composited/linear_burn.png and /dev/null differ diff --git a/tests/python_tests/images/composited/linear_dodge.png b/tests/python_tests/images/composited/linear_dodge.png deleted file mode 100644 index 848ddca17..000000000 Binary files a/tests/python_tests/images/composited/linear_dodge.png and /dev/null differ diff --git a/tests/python_tests/images/composited/minus.png b/tests/python_tests/images/composited/minus.png deleted file mode 100644 index 46a764719..000000000 Binary files a/tests/python_tests/images/composited/minus.png and /dev/null differ diff --git a/tests/python_tests/images/composited/multiply.png b/tests/python_tests/images/composited/multiply.png deleted file mode 100644 index 0c6880f5a..000000000 Binary files a/tests/python_tests/images/composited/multiply.png and /dev/null differ diff --git a/tests/python_tests/images/composited/overlay.png b/tests/python_tests/images/composited/overlay.png deleted file mode 100644 index 77df0d38a..000000000 Binary files a/tests/python_tests/images/composited/overlay.png and /dev/null differ diff --git a/tests/python_tests/images/composited/plus.png b/tests/python_tests/images/composited/plus.png deleted file mode 100644 index 6656c63c6..000000000 Binary files a/tests/python_tests/images/composited/plus.png and /dev/null differ diff --git a/tests/python_tests/images/composited/saturation.png b/tests/python_tests/images/composited/saturation.png deleted file mode 100644 index 52e9d6c95..000000000 Binary files a/tests/python_tests/images/composited/saturation.png and /dev/null differ diff --git a/tests/python_tests/images/composited/screen.png b/tests/python_tests/images/composited/screen.png deleted file mode 100644 index df6948615..000000000 Binary files a/tests/python_tests/images/composited/screen.png and /dev/null differ diff --git a/tests/python_tests/images/composited/soft_light.png b/tests/python_tests/images/composited/soft_light.png deleted file mode 100644 index 954bef335..000000000 Binary files a/tests/python_tests/images/composited/soft_light.png and /dev/null differ diff --git a/tests/python_tests/images/composited/src.png b/tests/python_tests/images/composited/src.png deleted file mode 100644 index 70aa18f01..000000000 Binary files a/tests/python_tests/images/composited/src.png and /dev/null differ diff --git a/tests/python_tests/images/composited/src_atop.png b/tests/python_tests/images/composited/src_atop.png deleted file mode 100644 index 5621a099e..000000000 Binary files a/tests/python_tests/images/composited/src_atop.png and /dev/null differ diff --git a/tests/python_tests/images/composited/src_in.png b/tests/python_tests/images/composited/src_in.png deleted file mode 100644 index c2dbc510e..000000000 Binary files a/tests/python_tests/images/composited/src_in.png and /dev/null differ diff --git a/tests/python_tests/images/composited/src_out.png b/tests/python_tests/images/composited/src_out.png deleted file mode 100644 index 4df0d0a25..000000000 Binary files a/tests/python_tests/images/composited/src_out.png and /dev/null differ diff --git a/tests/python_tests/images/composited/src_over.png b/tests/python_tests/images/composited/src_over.png deleted file mode 100644 index fcba78aeb..000000000 Binary files a/tests/python_tests/images/composited/src_over.png and /dev/null differ diff --git a/tests/python_tests/images/composited/value.png b/tests/python_tests/images/composited/value.png deleted file mode 100644 index 70bcf4eb3..000000000 Binary files a/tests/python_tests/images/composited/value.png and /dev/null differ diff --git a/tests/python_tests/images/composited/xor.png b/tests/python_tests/images/composited/xor.png deleted file mode 100644 index b6f2f2f3b..000000000 Binary files a/tests/python_tests/images/composited/xor.png and /dev/null differ diff --git a/tests/python_tests/images/pycairo/cairo-cairo-expected-reduced.png b/tests/python_tests/images/pycairo/cairo-cairo-expected-reduced.png deleted file mode 100644 index b99dc9194..000000000 Binary files a/tests/python_tests/images/pycairo/cairo-cairo-expected-reduced.png and /dev/null differ diff --git a/tests/python_tests/images/pycairo/cairo-cairo-expected.pdf b/tests/python_tests/images/pycairo/cairo-cairo-expected.pdf deleted file mode 100644 index 220a9b210..000000000 Binary files a/tests/python_tests/images/pycairo/cairo-cairo-expected.pdf and /dev/null differ diff --git a/tests/python_tests/images/pycairo/cairo-cairo-expected.png b/tests/python_tests/images/pycairo/cairo-cairo-expected.png deleted file mode 100644 index 3a99f5e73..000000000 Binary files a/tests/python_tests/images/pycairo/cairo-cairo-expected.png and /dev/null differ diff --git a/tests/python_tests/images/pycairo/cairo-cairo-expected.svg b/tests/python_tests/images/pycairo/cairo-cairo-expected.svg deleted file mode 100644 index 18d73432d..000000000 --- a/tests/python_tests/images/pycairo/cairo-cairo-expected.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/python_tests/images/pycairo/cairo-surface-expected.building.pdf b/tests/python_tests/images/pycairo/cairo-surface-expected.building.pdf deleted file mode 100644 index 11559bb2b..000000000 Binary files a/tests/python_tests/images/pycairo/cairo-surface-expected.building.pdf and /dev/null differ diff --git a/tests/python_tests/images/pycairo/cairo-surface-expected.building.svg b/tests/python_tests/images/pycairo/cairo-surface-expected.building.svg deleted file mode 100644 index 78bc15e3d..000000000 --- a/tests/python_tests/images/pycairo/cairo-surface-expected.building.svg +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/python_tests/images/pycairo/cairo-surface-expected.point.pdf b/tests/python_tests/images/pycairo/cairo-surface-expected.point.pdf deleted file mode 100644 index eff8ca634..000000000 Binary files a/tests/python_tests/images/pycairo/cairo-surface-expected.point.pdf and /dev/null differ diff --git a/tests/python_tests/images/pycairo/cairo-surface-expected.point.svg b/tests/python_tests/images/pycairo/cairo-surface-expected.point.svg deleted file mode 100644 index 0b73c8c0b..000000000 --- a/tests/python_tests/images/pycairo/cairo-surface-expected.point.svg +++ /dev/null @@ -1,413 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/python_tests/images/pycairo/cairo-surface-expected.polygon.pdf b/tests/python_tests/images/pycairo/cairo-surface-expected.polygon.pdf deleted file mode 100644 index 201bb9b03..000000000 Binary files a/tests/python_tests/images/pycairo/cairo-surface-expected.polygon.pdf and /dev/null differ diff --git a/tests/python_tests/images/pycairo/cairo-surface-expected.polygon.svg b/tests/python_tests/images/pycairo/cairo-surface-expected.polygon.svg deleted file mode 100644 index 4f2a943cd..000000000 --- a/tests/python_tests/images/pycairo/cairo-surface-expected.polygon.svg +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/python_tests/images/style-comp-op/clear.png b/tests/python_tests/images/style-comp-op/clear.png deleted file mode 100644 index 4fe9ab376..000000000 Binary files a/tests/python_tests/images/style-comp-op/clear.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/color.png b/tests/python_tests/images/style-comp-op/color.png deleted file mode 100644 index 899eb1f15..000000000 Binary files a/tests/python_tests/images/style-comp-op/color.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/color_burn.png b/tests/python_tests/images/style-comp-op/color_burn.png deleted file mode 100644 index 498fb23e0..000000000 Binary files a/tests/python_tests/images/style-comp-op/color_burn.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/color_dodge.png b/tests/python_tests/images/style-comp-op/color_dodge.png deleted file mode 100644 index dea8ec3d1..000000000 Binary files a/tests/python_tests/images/style-comp-op/color_dodge.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/contrast.png b/tests/python_tests/images/style-comp-op/contrast.png deleted file mode 100644 index 2298154c1..000000000 Binary files a/tests/python_tests/images/style-comp-op/contrast.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/darken.png b/tests/python_tests/images/style-comp-op/darken.png deleted file mode 100644 index e0f265b3d..000000000 Binary files a/tests/python_tests/images/style-comp-op/darken.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/difference.png b/tests/python_tests/images/style-comp-op/difference.png deleted file mode 100644 index faef22d4c..000000000 Binary files a/tests/python_tests/images/style-comp-op/difference.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/divide.png b/tests/python_tests/images/style-comp-op/divide.png deleted file mode 100644 index caa5111f5..000000000 Binary files a/tests/python_tests/images/style-comp-op/divide.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/dst.png b/tests/python_tests/images/style-comp-op/dst.png deleted file mode 100644 index 6715d5794..000000000 Binary files a/tests/python_tests/images/style-comp-op/dst.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/dst_atop.png b/tests/python_tests/images/style-comp-op/dst_atop.png deleted file mode 100644 index dbb6b437c..000000000 Binary files a/tests/python_tests/images/style-comp-op/dst_atop.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/dst_in.png b/tests/python_tests/images/style-comp-op/dst_in.png deleted file mode 100644 index dbb6b437c..000000000 Binary files a/tests/python_tests/images/style-comp-op/dst_in.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/dst_out.png b/tests/python_tests/images/style-comp-op/dst_out.png deleted file mode 100644 index 59e0ff057..000000000 Binary files a/tests/python_tests/images/style-comp-op/dst_out.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/dst_over.png b/tests/python_tests/images/style-comp-op/dst_over.png deleted file mode 100644 index 6715d5794..000000000 Binary files a/tests/python_tests/images/style-comp-op/dst_over.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/exclusion.png b/tests/python_tests/images/style-comp-op/exclusion.png deleted file mode 100644 index 5a46d4541..000000000 Binary files a/tests/python_tests/images/style-comp-op/exclusion.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/grain_extract.png b/tests/python_tests/images/style-comp-op/grain_extract.png deleted file mode 100644 index a9a432fe7..000000000 Binary files a/tests/python_tests/images/style-comp-op/grain_extract.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/grain_merge.png b/tests/python_tests/images/style-comp-op/grain_merge.png deleted file mode 100644 index 3be208644..000000000 Binary files a/tests/python_tests/images/style-comp-op/grain_merge.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/hard_light.png b/tests/python_tests/images/style-comp-op/hard_light.png deleted file mode 100644 index db2552437..000000000 Binary files a/tests/python_tests/images/style-comp-op/hard_light.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/hue.png b/tests/python_tests/images/style-comp-op/hue.png deleted file mode 100644 index d58e35fbd..000000000 Binary files a/tests/python_tests/images/style-comp-op/hue.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/invert.png b/tests/python_tests/images/style-comp-op/invert.png deleted file mode 100644 index a4e5991bc..000000000 Binary files a/tests/python_tests/images/style-comp-op/invert.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/lighten.png b/tests/python_tests/images/style-comp-op/lighten.png deleted file mode 100644 index a06819161..000000000 Binary files a/tests/python_tests/images/style-comp-op/lighten.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/linear_burn.png b/tests/python_tests/images/style-comp-op/linear_burn.png deleted file mode 100644 index 389f86060..000000000 Binary files a/tests/python_tests/images/style-comp-op/linear_burn.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/linear_dodge.png b/tests/python_tests/images/style-comp-op/linear_dodge.png deleted file mode 100644 index 05bdce8e8..000000000 Binary files a/tests/python_tests/images/style-comp-op/linear_dodge.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/minus.png b/tests/python_tests/images/style-comp-op/minus.png deleted file mode 100644 index 1c6712a25..000000000 Binary files a/tests/python_tests/images/style-comp-op/minus.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/multiply.png b/tests/python_tests/images/style-comp-op/multiply.png deleted file mode 100644 index dccb2713c..000000000 Binary files a/tests/python_tests/images/style-comp-op/multiply.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/overlay.png b/tests/python_tests/images/style-comp-op/overlay.png deleted file mode 100644 index b0be6c6a9..000000000 Binary files a/tests/python_tests/images/style-comp-op/overlay.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/plus.png b/tests/python_tests/images/style-comp-op/plus.png deleted file mode 100644 index 05bdce8e8..000000000 Binary files a/tests/python_tests/images/style-comp-op/plus.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/saturation.png b/tests/python_tests/images/style-comp-op/saturation.png deleted file mode 100644 index 42c9e7682..000000000 Binary files a/tests/python_tests/images/style-comp-op/saturation.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/screen.png b/tests/python_tests/images/style-comp-op/screen.png deleted file mode 100644 index b940f732a..000000000 Binary files a/tests/python_tests/images/style-comp-op/screen.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/soft_light.png b/tests/python_tests/images/style-comp-op/soft_light.png deleted file mode 100644 index 717d77106..000000000 Binary files a/tests/python_tests/images/style-comp-op/soft_light.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/src.png b/tests/python_tests/images/style-comp-op/src.png deleted file mode 100644 index a7a96f57a..000000000 Binary files a/tests/python_tests/images/style-comp-op/src.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/src_atop.png b/tests/python_tests/images/style-comp-op/src_atop.png deleted file mode 100644 index 869552455..000000000 Binary files a/tests/python_tests/images/style-comp-op/src_atop.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/src_in.png b/tests/python_tests/images/style-comp-op/src_in.png deleted file mode 100644 index a7a96f57a..000000000 Binary files a/tests/python_tests/images/style-comp-op/src_in.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/src_out.png b/tests/python_tests/images/style-comp-op/src_out.png deleted file mode 100644 index 4fe9ab376..000000000 Binary files a/tests/python_tests/images/style-comp-op/src_out.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/src_over.png b/tests/python_tests/images/style-comp-op/src_over.png deleted file mode 100644 index f8261e01e..000000000 Binary files a/tests/python_tests/images/style-comp-op/src_over.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/value.png b/tests/python_tests/images/style-comp-op/value.png deleted file mode 100644 index c984d3e5b..000000000 Binary files a/tests/python_tests/images/style-comp-op/value.png and /dev/null differ diff --git a/tests/python_tests/images/style-comp-op/xor.png b/tests/python_tests/images/style-comp-op/xor.png deleted file mode 100644 index 8d276f6f3..000000000 Binary files a/tests/python_tests/images/style-comp-op/xor.png and /dev/null differ diff --git a/tests/python_tests/images/style-image-filter/agg-stack-blur22.png b/tests/python_tests/images/style-image-filter/agg-stack-blur22.png deleted file mode 100644 index bda766fec..000000000 Binary files a/tests/python_tests/images/style-image-filter/agg-stack-blur22.png and /dev/null differ diff --git a/tests/python_tests/images/style-image-filter/blur.png b/tests/python_tests/images/style-image-filter/blur.png deleted file mode 100644 index f687e511f..000000000 Binary files a/tests/python_tests/images/style-image-filter/blur.png and /dev/null differ diff --git a/tests/python_tests/images/style-image-filter/edge-detect.png b/tests/python_tests/images/style-image-filter/edge-detect.png deleted file mode 100644 index cda6f755a..000000000 Binary files a/tests/python_tests/images/style-image-filter/edge-detect.png and /dev/null differ diff --git a/tests/python_tests/images/style-image-filter/emboss.png b/tests/python_tests/images/style-image-filter/emboss.png deleted file mode 100644 index 5e9fea5be..000000000 Binary files a/tests/python_tests/images/style-image-filter/emboss.png and /dev/null differ diff --git a/tests/python_tests/images/style-image-filter/gray.png b/tests/python_tests/images/style-image-filter/gray.png deleted file mode 100644 index 166ceb5e3..000000000 Binary files a/tests/python_tests/images/style-image-filter/gray.png and /dev/null differ diff --git a/tests/python_tests/images/style-image-filter/invert.png b/tests/python_tests/images/style-image-filter/invert.png deleted file mode 100644 index 072a95be4..000000000 Binary files a/tests/python_tests/images/style-image-filter/invert.png and /dev/null differ diff --git a/tests/python_tests/images/style-image-filter/none.png b/tests/python_tests/images/style-image-filter/none.png deleted file mode 100644 index bf8764987..000000000 Binary files a/tests/python_tests/images/style-image-filter/none.png and /dev/null differ diff --git a/tests/python_tests/images/style-image-filter/sharpen.png b/tests/python_tests/images/style-image-filter/sharpen.png deleted file mode 100644 index 21f3f94f6..000000000 Binary files a/tests/python_tests/images/style-image-filter/sharpen.png and /dev/null differ diff --git a/tests/python_tests/images/style-image-filter/sobel.png b/tests/python_tests/images/style-image-filter/sobel.png deleted file mode 100644 index a647a6e0f..000000000 Binary files a/tests/python_tests/images/style-image-filter/sobel.png and /dev/null differ diff --git a/tests/python_tests/images/style-image-filter/x-gradient.png b/tests/python_tests/images/style-image-filter/x-gradient.png deleted file mode 100644 index 1721fc392..000000000 Binary files a/tests/python_tests/images/style-image-filter/x-gradient.png and /dev/null differ diff --git a/tests/python_tests/images/style-image-filter/y-gradient.png b/tests/python_tests/images/style-image-filter/y-gradient.png deleted file mode 100644 index 37abc0e69..000000000 Binary files a/tests/python_tests/images/style-image-filter/y-gradient.png and /dev/null differ diff --git a/tests/python_tests/images/support/a.png b/tests/python_tests/images/support/a.png deleted file mode 100644 index 3d0cc7288..000000000 Binary files a/tests/python_tests/images/support/a.png and /dev/null differ diff --git a/tests/python_tests/images/support/b.png b/tests/python_tests/images/support/b.png deleted file mode 100644 index 6eca9e180..000000000 Binary files a/tests/python_tests/images/support/b.png and /dev/null differ diff --git a/tests/python_tests/images/support/dataraster_coloring.png b/tests/python_tests/images/support/dataraster_coloring.png deleted file mode 100644 index da3cac4b1..000000000 Binary files a/tests/python_tests/images/support/dataraster_coloring.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png+e=miniz.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png+e=miniz.png deleted file mode 100644 index 4cc101b87..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png+e=miniz.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png+t=0.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png+t=0.png deleted file mode 100644 index b2aa9913d..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png.png deleted file mode 100644 index b2aa9913d..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png32+e=miniz.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png32+e=miniz.png deleted file mode 100644 index 046b4fc83..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png32+e=miniz.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png32+t=0.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png32+t=0.png deleted file mode 100644 index 16481a41b..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png32+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png32.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png32.png deleted file mode 100644 index 0f15a353c..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png32.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+e=miniz.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+e=miniz.png deleted file mode 100644 index d7dd17254..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+e=miniz.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+c=1+t=0.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+c=1+t=0.png deleted file mode 100644 index d6e19b7f7..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+c=1+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+c=1.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+c=1.png deleted file mode 100644 index d6e19b7f7..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+c=1.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+t=0.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+t=0.png deleted file mode 100644 index c6c7ab947..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+t=1.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+t=1.png deleted file mode 100644 index c6c7ab947..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+t=1.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+t=2.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+t=2.png deleted file mode 100644 index c6c7ab947..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h+t=2.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h.png deleted file mode 100644 index c6c7ab947..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=h.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+c=1+t=0.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+c=1+t=0.png deleted file mode 100644 index ad0aca75d..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+c=1+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+c=1.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+c=1.png deleted file mode 100644 index ad0aca75d..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+c=1.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+t=0.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+t=0.png deleted file mode 100644 index 4ab31b649..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+t=1.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+t=1.png deleted file mode 100644 index 4ab31b649..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+t=1.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+t=2.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+t=2.png deleted file mode 100644 index 4ab31b649..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o+t=2.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o.png b/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o.png deleted file mode 100644 index 4ab31b649..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-png8+m=o.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+alpha=false.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+alpha=false.webp deleted file mode 100644 index f2a3cfa0d..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+alpha=false.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+alpha_compression=0.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+alpha_compression=0.webp deleted file mode 100644 index f2a3cfa0d..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+alpha_compression=0.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+alpha_filtering=2.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+alpha_filtering=2.webp deleted file mode 100644 index f2a3cfa0d..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+alpha_filtering=2.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+alpha_quality=50.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+alpha_quality=50.webp deleted file mode 100644 index f2a3cfa0d..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+alpha_quality=50.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+autofilter=0.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+autofilter=0.webp deleted file mode 100644 index f2a3cfa0d..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+autofilter=0.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+filter_sharpness=4.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+filter_sharpness=4.webp deleted file mode 100644 index f29a97eba..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+filter_sharpness=4.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+filter_strength=50.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+filter_strength=50.webp deleted file mode 100644 index 87c1fe68a..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+filter_strength=50.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+filter_type=1+autofilter=1.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+filter_type=1+autofilter=1.webp deleted file mode 100644 index 752148dc6..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+filter_type=1+autofilter=1.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+method=0.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+method=0.webp deleted file mode 100644 index f0f3838ca..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+method=0.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+method=6.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+method=6.webp deleted file mode 100644 index be253e265..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+method=6.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+partition_limit=50.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+partition_limit=50.webp deleted file mode 100644 index 837ff3b07..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+partition_limit=50.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+partitions=3.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+partitions=3.webp deleted file mode 100644 index f2a3cfa0d..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+partitions=3.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+pass=10.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+pass=10.webp deleted file mode 100644 index 7d71893e4..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+pass=10.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+preprocessing=1.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+preprocessing=1.webp deleted file mode 100644 index f5e64b7a9..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+preprocessing=1.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+quality=64.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+quality=64.webp deleted file mode 100644 index efd13ada3..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+quality=64.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+segments=3.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+segments=3.webp deleted file mode 100644 index 967cc57bb..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+segments=3.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+sns_strength=50.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+sns_strength=50.webp deleted file mode 100644 index f2a3cfa0d..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+sns_strength=50.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+target_PSNR=.5.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+target_PSNR=.5.webp deleted file mode 100644 index f2a3cfa0d..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+target_PSNR=.5.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+target_size=100.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+target_size=100.webp deleted file mode 100644 index f2a3cfa0d..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp+target_size=100.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp.webp b/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp.webp deleted file mode 100644 index f2a3cfa0d..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/aerial_rgba-webp.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png+e=miniz.png b/tests/python_tests/images/support/encoding-opts/blank-png+e=miniz.png deleted file mode 100644 index 334ffe553..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png+e=miniz.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png+t=0.png b/tests/python_tests/images/support/encoding-opts/blank-png+t=0.png deleted file mode 100644 index 49c789ae0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png.png b/tests/python_tests/images/support/encoding-opts/blank-png.png deleted file mode 100644 index 49c789ae0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png32+e=miniz.png b/tests/python_tests/images/support/encoding-opts/blank-png32+e=miniz.png deleted file mode 100644 index 8708c3273..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png32+e=miniz.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png32+t=0.png b/tests/python_tests/images/support/encoding-opts/blank-png32+t=0.png deleted file mode 100644 index 50e389033..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png32+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png32.png b/tests/python_tests/images/support/encoding-opts/blank-png32.png deleted file mode 100644 index 04469ac58..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png32.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png8+e=miniz.png b/tests/python_tests/images/support/encoding-opts/blank-png8+e=miniz.png deleted file mode 100644 index 334ffe553..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png8+e=miniz.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+c=1+t=0.png b/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+c=1+t=0.png deleted file mode 100644 index 49c789ae0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+c=1+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+c=1.png b/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+c=1.png deleted file mode 100644 index 49c789ae0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+c=1.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+t=0.png b/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+t=0.png deleted file mode 100644 index 49c789ae0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+t=1.png b/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+t=1.png deleted file mode 100644 index 49c789ae0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+t=1.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+t=2.png b/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+t=2.png deleted file mode 100644 index 49c789ae0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png8+m=h+t=2.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png8+m=h.png b/tests/python_tests/images/support/encoding-opts/blank-png8+m=h.png deleted file mode 100644 index 49c789ae0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png8+m=h.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+c=1+t=0.png b/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+c=1+t=0.png deleted file mode 100644 index 49c789ae0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+c=1+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+c=1.png b/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+c=1.png deleted file mode 100644 index 49c789ae0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+c=1.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+t=0.png b/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+t=0.png deleted file mode 100644 index 49c789ae0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+t=1.png b/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+t=1.png deleted file mode 100644 index 49c789ae0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+t=1.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+t=2.png b/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+t=2.png deleted file mode 100644 index 49c789ae0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png8+m=o+t=2.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-png8+m=o.png b/tests/python_tests/images/support/encoding-opts/blank-png8+m=o.png deleted file mode 100644 index 49c789ae0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-png8+m=o.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+alpha=false.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+alpha=false.webp deleted file mode 100644 index da95b42c6..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+alpha=false.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+alpha_compression=0.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+alpha_compression=0.webp deleted file mode 100644 index 2e264d438..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+alpha_compression=0.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+alpha_filtering=2.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+alpha_filtering=2.webp deleted file mode 100644 index a7369dcb9..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+alpha_filtering=2.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+alpha_quality=50.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+alpha_quality=50.webp deleted file mode 100644 index 10cea1cdf..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+alpha_quality=50.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+autofilter=0.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+autofilter=0.webp deleted file mode 100644 index a7369dcb9..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+autofilter=0.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+filter_sharpness=4.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+filter_sharpness=4.webp deleted file mode 100644 index 932a4dec0..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+filter_sharpness=4.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+filter_strength=50.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+filter_strength=50.webp deleted file mode 100644 index 2e65b9b85..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+filter_strength=50.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+filter_type=1+autofilter=1.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+filter_type=1+autofilter=1.webp deleted file mode 100644 index 7e3bd76b5..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+filter_type=1+autofilter=1.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+method=0.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+method=0.webp deleted file mode 100644 index 5c6492427..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+method=0.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+method=6.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+method=6.webp deleted file mode 100644 index ef84f4c33..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+method=6.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+partition_limit=50.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+partition_limit=50.webp deleted file mode 100644 index a7369dcb9..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+partition_limit=50.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+partitions=3.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+partitions=3.webp deleted file mode 100644 index a7369dcb9..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+partitions=3.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+pass=10.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+pass=10.webp deleted file mode 100644 index a7369dcb9..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+pass=10.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+preprocessing=1.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+preprocessing=1.webp deleted file mode 100644 index a7369dcb9..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+preprocessing=1.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+quality=64.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+quality=64.webp deleted file mode 100644 index 0eb26aa1a..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+quality=64.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+segments=3.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+segments=3.webp deleted file mode 100644 index af3082b71..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+segments=3.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+sns_strength=50.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+sns_strength=50.webp deleted file mode 100644 index a7369dcb9..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+sns_strength=50.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+target_PSNR=.5.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+target_PSNR=.5.webp deleted file mode 100644 index a7369dcb9..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+target_PSNR=.5.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp+target_size=100.webp b/tests/python_tests/images/support/encoding-opts/blank-webp+target_size=100.webp deleted file mode 100644 index a7369dcb9..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp+target_size=100.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/blank-webp.webp b/tests/python_tests/images/support/encoding-opts/blank-webp.webp deleted file mode 100644 index a7369dcb9..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/blank-webp.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/png8-17cols.png b/tests/python_tests/images/support/encoding-opts/png8-17cols.png deleted file mode 100644 index 22f4c3542..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/png8-17cols.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/png8-2px.A.png b/tests/python_tests/images/support/encoding-opts/png8-2px.A.png deleted file mode 100644 index f047b0804..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/png8-2px.A.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/png8-2px.png b/tests/python_tests/images/support/encoding-opts/png8-2px.png deleted file mode 100644 index f047b0804..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/png8-2px.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/png8-9cols.png b/tests/python_tests/images/support/encoding-opts/png8-9cols.png deleted file mode 100644 index a781b37a2..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/png8-9cols.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png+e=miniz.png b/tests/python_tests/images/support/encoding-opts/solid-png+e=miniz.png deleted file mode 100644 index c3e5db471..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png+e=miniz.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png+t=0.png b/tests/python_tests/images/support/encoding-opts/solid-png+t=0.png deleted file mode 100644 index 0d7dee0fb..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png.png b/tests/python_tests/images/support/encoding-opts/solid-png.png deleted file mode 100644 index a4c4de304..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png32+e=miniz.png b/tests/python_tests/images/support/encoding-opts/solid-png32+e=miniz.png deleted file mode 100644 index f155fce57..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png32+e=miniz.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png32+t=0.png b/tests/python_tests/images/support/encoding-opts/solid-png32+t=0.png deleted file mode 100644 index 21fffbf00..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png32+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png32.png b/tests/python_tests/images/support/encoding-opts/solid-png32.png deleted file mode 100644 index 4fe9ab376..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png32.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png8+e=miniz.png b/tests/python_tests/images/support/encoding-opts/solid-png8+e=miniz.png deleted file mode 100644 index c3e5db471..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png8+e=miniz.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+c=1+t=0.png b/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+c=1+t=0.png deleted file mode 100644 index 0d7dee0fb..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+c=1+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+c=1.png b/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+c=1.png deleted file mode 100644 index a4c4de304..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+c=1.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+t=0.png b/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+t=0.png deleted file mode 100644 index 0d7dee0fb..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+t=1.png b/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+t=1.png deleted file mode 100644 index a4c4de304..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+t=1.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+t=2.png b/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+t=2.png deleted file mode 100644 index a4c4de304..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png8+m=h+t=2.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png8+m=h.png b/tests/python_tests/images/support/encoding-opts/solid-png8+m=h.png deleted file mode 100644 index a4c4de304..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png8+m=h.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+c=1+t=0.png b/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+c=1+t=0.png deleted file mode 100644 index 0d7dee0fb..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+c=1+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+c=1.png b/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+c=1.png deleted file mode 100644 index a4c4de304..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+c=1.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+t=0.png b/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+t=0.png deleted file mode 100644 index 0d7dee0fb..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+t=0.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+t=1.png b/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+t=1.png deleted file mode 100644 index a4c4de304..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+t=1.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+t=2.png b/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+t=2.png deleted file mode 100644 index a4c4de304..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png8+m=o+t=2.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-png8+m=o.png b/tests/python_tests/images/support/encoding-opts/solid-png8+m=o.png deleted file mode 100644 index a4c4de304..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-png8+m=o.png and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+alpha=false.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+alpha=false.webp deleted file mode 100644 index cbd85abaf..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+alpha=false.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+alpha_compression=0.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+alpha_compression=0.webp deleted file mode 100644 index cbd85abaf..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+alpha_compression=0.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+alpha_filtering=2.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+alpha_filtering=2.webp deleted file mode 100644 index cbd85abaf..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+alpha_filtering=2.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+alpha_quality=50.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+alpha_quality=50.webp deleted file mode 100644 index cbd85abaf..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+alpha_quality=50.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+autofilter=0.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+autofilter=0.webp deleted file mode 100644 index cbd85abaf..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+autofilter=0.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+filter_sharpness=4.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+filter_sharpness=4.webp deleted file mode 100644 index 1eadaa1f1..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+filter_sharpness=4.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+filter_strength=50.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+filter_strength=50.webp deleted file mode 100644 index 621e6cc23..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+filter_strength=50.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+filter_type=1+autofilter=1.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+filter_type=1+autofilter=1.webp deleted file mode 100644 index 1372321c9..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+filter_type=1+autofilter=1.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+method=0.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+method=0.webp deleted file mode 100644 index e7cff6530..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+method=0.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+method=6.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+method=6.webp deleted file mode 100644 index 5a76594f6..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+method=6.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+partition_limit=50.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+partition_limit=50.webp deleted file mode 100644 index cbd85abaf..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+partition_limit=50.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+partitions=3.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+partitions=3.webp deleted file mode 100644 index cbd85abaf..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+partitions=3.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+pass=10.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+pass=10.webp deleted file mode 100644 index cbd85abaf..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+pass=10.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+preprocessing=1.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+preprocessing=1.webp deleted file mode 100644 index cbd85abaf..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+preprocessing=1.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+quality=64.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+quality=64.webp deleted file mode 100644 index fba30ff35..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+quality=64.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+segments=3.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+segments=3.webp deleted file mode 100644 index 84ba1a802..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+segments=3.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+sns_strength=50.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+sns_strength=50.webp deleted file mode 100644 index cbd85abaf..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+sns_strength=50.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+target_PSNR=.5.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+target_PSNR=.5.webp deleted file mode 100644 index cbd85abaf..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+target_PSNR=.5.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp+target_size=100.webp b/tests/python_tests/images/support/encoding-opts/solid-webp+target_size=100.webp deleted file mode 100644 index cbd85abaf..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp+target_size=100.webp and /dev/null differ diff --git a/tests/python_tests/images/support/encoding-opts/solid-webp.webp b/tests/python_tests/images/support/encoding-opts/solid-webp.webp deleted file mode 100644 index cbd85abaf..000000000 Binary files a/tests/python_tests/images/support/encoding-opts/solid-webp.webp and /dev/null differ diff --git a/tests/python_tests/images/support/mapnik-layer-buffer-size.png b/tests/python_tests/images/support/mapnik-layer-buffer-size.png deleted file mode 100644 index f1de74ab7..000000000 Binary files a/tests/python_tests/images/support/mapnik-layer-buffer-size.png and /dev/null differ diff --git a/tests/python_tests/images/support/mapnik-marker-ellipse-render1.png b/tests/python_tests/images/support/mapnik-marker-ellipse-render1.png deleted file mode 100644 index 7854c5621..000000000 Binary files a/tests/python_tests/images/support/mapnik-marker-ellipse-render1.png and /dev/null differ diff --git a/tests/python_tests/images/support/mapnik-marker-ellipse-render2.png b/tests/python_tests/images/support/mapnik-marker-ellipse-render2.png deleted file mode 100644 index c2a4963c3..000000000 Binary files a/tests/python_tests/images/support/mapnik-marker-ellipse-render2.png and /dev/null differ diff --git a/tests/python_tests/images/support/mapnik-merc2merc-reprojection-render1.png b/tests/python_tests/images/support/mapnik-merc2merc-reprojection-render1.png deleted file mode 100644 index 59726ad0d..000000000 Binary files a/tests/python_tests/images/support/mapnik-merc2merc-reprojection-render1.png and /dev/null differ diff --git a/tests/python_tests/images/support/mapnik-merc2merc-reprojection-render2.png b/tests/python_tests/images/support/mapnik-merc2merc-reprojection-render2.png deleted file mode 100644 index 351febff7..000000000 Binary files a/tests/python_tests/images/support/mapnik-merc2merc-reprojection-render2.png and /dev/null differ diff --git a/tests/python_tests/images/support/mapnik-merc2wgs84-reprojection-render.png b/tests/python_tests/images/support/mapnik-merc2wgs84-reprojection-render.png deleted file mode 100644 index 55995d545..000000000 Binary files a/tests/python_tests/images/support/mapnik-merc2wgs84-reprojection-render.png and /dev/null differ diff --git a/tests/python_tests/images/support/mapnik-palette-test.png b/tests/python_tests/images/support/mapnik-palette-test.png deleted file mode 100644 index b7fd90482..000000000 Binary files a/tests/python_tests/images/support/mapnik-palette-test.png and /dev/null differ diff --git a/tests/python_tests/images/support/mapnik-python-circle-render1.png b/tests/python_tests/images/support/mapnik-python-circle-render1.png deleted file mode 100644 index cb5eba43d..000000000 Binary files a/tests/python_tests/images/support/mapnik-python-circle-render1.png and /dev/null differ diff --git a/tests/python_tests/images/support/mapnik-python-point-render1.png b/tests/python_tests/images/support/mapnik-python-point-render1.png deleted file mode 100644 index b131d8644..000000000 Binary files a/tests/python_tests/images/support/mapnik-python-point-render1.png and /dev/null differ diff --git a/tests/python_tests/images/support/mapnik-style-level-opacity.png b/tests/python_tests/images/support/mapnik-style-level-opacity.png deleted file mode 100644 index 988a438aa..000000000 Binary files a/tests/python_tests/images/support/mapnik-style-level-opacity.png and /dev/null differ diff --git a/tests/python_tests/images/support/mapnik-wgs842merc-reprojection-render.png b/tests/python_tests/images/support/mapnik-wgs842merc-reprojection-render.png deleted file mode 100644 index 6fc5f12f6..000000000 Binary files a/tests/python_tests/images/support/mapnik-wgs842merc-reprojection-render.png and /dev/null differ diff --git a/tests/python_tests/images/support/marker-in-center-not-placed.png b/tests/python_tests/images/support/marker-in-center-not-placed.png deleted file mode 100644 index a4c4de304..000000000 Binary files a/tests/python_tests/images/support/marker-in-center-not-placed.png and /dev/null differ diff --git a/tests/python_tests/images/support/marker-in-center.png b/tests/python_tests/images/support/marker-in-center.png deleted file mode 100644 index 7845d4fc9..000000000 Binary files a/tests/python_tests/images/support/marker-in-center.png and /dev/null differ diff --git a/tests/python_tests/images/support/marker-text-line-scale-factor-0.005.png b/tests/python_tests/images/support/marker-text-line-scale-factor-0.005.png deleted file mode 100644 index 5ba0afcba..000000000 Binary files a/tests/python_tests/images/support/marker-text-line-scale-factor-0.005.png and /dev/null differ diff --git a/tests/python_tests/images/support/marker-text-line-scale-factor-0.1.png b/tests/python_tests/images/support/marker-text-line-scale-factor-0.1.png deleted file mode 100644 index 306424dfc..000000000 Binary files a/tests/python_tests/images/support/marker-text-line-scale-factor-0.1.png and /dev/null differ diff --git a/tests/python_tests/images/support/marker-text-line-scale-factor-0.899.png b/tests/python_tests/images/support/marker-text-line-scale-factor-0.899.png deleted file mode 100644 index cb2c651f8..000000000 Binary files a/tests/python_tests/images/support/marker-text-line-scale-factor-0.899.png and /dev/null differ diff --git a/tests/python_tests/images/support/marker-text-line-scale-factor-1.5.png b/tests/python_tests/images/support/marker-text-line-scale-factor-1.5.png deleted file mode 100644 index a1b34a357..000000000 Binary files a/tests/python_tests/images/support/marker-text-line-scale-factor-1.5.png and /dev/null differ diff --git a/tests/python_tests/images/support/marker-text-line-scale-factor-1.png b/tests/python_tests/images/support/marker-text-line-scale-factor-1.png deleted file mode 100644 index c86c5fa4e..000000000 Binary files a/tests/python_tests/images/support/marker-text-line-scale-factor-1.png and /dev/null differ diff --git a/tests/python_tests/images/support/marker-text-line-scale-factor-10.png b/tests/python_tests/images/support/marker-text-line-scale-factor-10.png deleted file mode 100644 index 8a7842f9e..000000000 Binary files a/tests/python_tests/images/support/marker-text-line-scale-factor-10.png and /dev/null differ diff --git a/tests/python_tests/images/support/marker-text-line-scale-factor-100.png b/tests/python_tests/images/support/marker-text-line-scale-factor-100.png deleted file mode 100644 index f1c0b52b8..000000000 Binary files a/tests/python_tests/images/support/marker-text-line-scale-factor-100.png and /dev/null differ diff --git a/tests/python_tests/images/support/marker-text-line-scale-factor-1e-05.png b/tests/python_tests/images/support/marker-text-line-scale-factor-1e-05.png deleted file mode 100644 index 0f368308a..000000000 Binary files a/tests/python_tests/images/support/marker-text-line-scale-factor-1e-05.png and /dev/null differ diff --git a/tests/python_tests/images/support/marker-text-line-scale-factor-2.png b/tests/python_tests/images/support/marker-text-line-scale-factor-2.png deleted file mode 100644 index e3ad67f99..000000000 Binary files a/tests/python_tests/images/support/marker-text-line-scale-factor-2.png and /dev/null differ diff --git a/tests/python_tests/images/support/marker-text-line-scale-factor-5.png b/tests/python_tests/images/support/marker-text-line-scale-factor-5.png deleted file mode 100644 index 2be5f2df3..000000000 Binary files a/tests/python_tests/images/support/marker-text-line-scale-factor-5.png and /dev/null differ diff --git a/tests/python_tests/images/support/raster-alpha.png b/tests/python_tests/images/support/raster-alpha.png deleted file mode 100644 index 3c79bb304..000000000 Binary files a/tests/python_tests/images/support/raster-alpha.png and /dev/null differ diff --git a/tests/python_tests/images/support/raster_warping.png b/tests/python_tests/images/support/raster_warping.png deleted file mode 100644 index 500a51e47..000000000 Binary files a/tests/python_tests/images/support/raster_warping.png and /dev/null differ diff --git a/tests/python_tests/images/support/raster_warping_does_not_overclip_source.png b/tests/python_tests/images/support/raster_warping_does_not_overclip_source.png deleted file mode 100644 index 0d6ccc5ab..000000000 Binary files a/tests/python_tests/images/support/raster_warping_does_not_overclip_source.png and /dev/null differ diff --git a/tests/python_tests/images/support/spacing.png b/tests/python_tests/images/support/spacing.png deleted file mode 100644 index 8d6bb4026..000000000 Binary files a/tests/python_tests/images/support/spacing.png and /dev/null differ diff --git a/tests/python_tests/images/support/transparency/aerial_rgb.png b/tests/python_tests/images/support/transparency/aerial_rgb.png deleted file mode 100644 index 16481a41b..000000000 Binary files a/tests/python_tests/images/support/transparency/aerial_rgb.png and /dev/null differ diff --git a/tests/python_tests/images/support/transparency/aerial_rgba.png b/tests/python_tests/images/support/transparency/aerial_rgba.png deleted file mode 100644 index 0f15a353c..000000000 Binary files a/tests/python_tests/images/support/transparency/aerial_rgba.png and /dev/null differ diff --git a/tests/python_tests/images/support/transparency/white0.png b/tests/python_tests/images/support/transparency/white0.png deleted file mode 100644 index 955861acc..000000000 Binary files a/tests/python_tests/images/support/transparency/white0.png and /dev/null differ diff --git a/tests/python_tests/images/support/transparency/white0.webp b/tests/python_tests/images/support/transparency/white0.webp deleted file mode 100644 index f276b81ee..000000000 Binary files a/tests/python_tests/images/support/transparency/white0.webp and /dev/null differ diff --git a/tests/python_tests/images/support/transparency/white1.png b/tests/python_tests/images/support/transparency/white1.png deleted file mode 100644 index db4e8278b..000000000 Binary files a/tests/python_tests/images/support/transparency/white1.png and /dev/null differ diff --git a/tests/python_tests/images/support/transparency/white2.png b/tests/python_tests/images/support/transparency/white2.png deleted file mode 100644 index 136e0980d..000000000 Binary files a/tests/python_tests/images/support/transparency/white2.png and /dev/null differ diff --git a/tests/python_tests/introspection_test.py b/tests/python_tests/introspection_test.py deleted file mode 100644 index afb1cc2c9..000000000 --- a/tests/python_tests/introspection_test.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python - -import os -from nose.tools import eq_ -from utilities import execution_path, run_all - -import mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def test_introspect_symbolizers(): - # create a symbolizer - p = mapnik.PointSymbolizer() - p.file = "../data/images/dummy.png" - p.allow_overlap = True - p.opacity = 0.5 - - eq_(p.allow_overlap, True) - eq_(p.opacity, 0.5) - eq_(p.filename,'../data/images/dummy.png') - - # make sure the defaults - # are what we think they are - eq_(p.allow_overlap, True) - eq_(p.opacity,0.5) - eq_(p.filename,'../data/images/dummy.png') - - # contruct objects to hold it - r = mapnik.Rule() - r.symbols.append(p) - s = mapnik.Style() - s.rules.append(r) - m = mapnik.Map(0,0) - m.append_style('s',s) - - # try to figure out what is - # in the map and make sure - # style is there and the same - - s2 = m.find_style('s') - rules = s2.rules - eq_(len(rules),1) - r2 = rules[0] - syms = r2.symbols - eq_(len(syms),1) - - ## TODO here, we can do... - sym = syms[0] - p2 = sym.extract() - assert isinstance(p2,mapnik.PointSymbolizer) - - eq_(p2.allow_overlap, True) - eq_(p2.opacity, 0.5) - eq_(p2.filename,'../data/images/dummy.png') - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/json_feature_properties_test.py b/tests/python_tests/json_feature_properties_test.py deleted file mode 100644 index 47f2428d4..000000000 --- a/tests/python_tests/json_feature_properties_test.py +++ /dev/null @@ -1,102 +0,0 @@ -#encoding: utf8 - -from nose.tools import eq_ -import mapnik -from utilities import run_all -try: - import json -except ImportError: - import simplejson as json - -chars = [ - { - "name":"single_quote", - "test": "string with ' quote", - "json": '{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with \' quote"}}' - }, - { - "name":"escaped_single_quote", - "test":"string with \' quote", - "json":'{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with \' quote"}}' - }, - { - "name":"double_quote", - "test":'string with " quote', - "json":'{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with \\" quote"}}' - }, - { - "name":"double_quote2", - "test":"string with \" quote", - "json":'{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with \\" quote"}}' - }, - { - "name":"reverse_solidus", # backslash - "test":"string with \\ quote", - "json":'{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with \\\ quote"}}' - }, - { - "name":"solidus", # forward slash - "test":"string with / quote", - "json":'{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with / quote"}}' - }, - { - "name":"backspace", - "test":"string with \b quote", - "json":'{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with \\b quote"}}' - }, - { - "name":"formfeed", - "test":"string with \f quote", - "json":'{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with \\f quote"}}' - }, - { - "name":"newline", - "test":"string with \n quote", - "json":'{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with \\n quote"}}' - }, - { - "name":"carriage_return", - "test":"string with \r quote", - "json":'{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with \\r quote"}}' - }, - { - "name":"horiztonal_tab", - "test":"string with \t quote", - "json":'{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with \\t quote"}}' - }, - # remainder are c++ reserved, but not json - { - "name":"vert_tab", - "test":"string with \v quote", - "json":'{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with \\u000b quote"}}' - }, - { - "name":"alert", - "test":"string with \a quote", - "json":'{"type":"Feature","id":1,"geometry":null,"properties":{"name":"string with \u0007 quote"}}' - } -] - -ctx = mapnik.Context() -ctx.push('name') - -def test_char_escaping(): - for char in chars: - feat = mapnik.Feature(ctx,1) - expected = char['test'] - feat["name"] = expected - eq_(feat["name"],expected) - # confirm the python json module - # is working as we would expect - pyjson2 = json.loads(char['json']) - eq_(pyjson2['properties']['name'],expected) - # confirm our behavior is the same as python json module - # for the original string - geojson_feat_string = feat.to_geojson() - eq_(geojson_feat_string,char['json'],"Mapnik's json escaping is not to spec: actual(%s) and expected(%s) for %s" % (geojson_feat_string,char['json'],char['name'])) - # and the round tripped string - pyjson = json.loads(geojson_feat_string) - eq_(pyjson['properties']['name'],expected) - -if __name__ == "__main__": - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/layer_buffer_size_test.py b/tests/python_tests/layer_buffer_size_test.py deleted file mode 100644 index 83765a73f..000000000 --- a/tests/python_tests/layer_buffer_size_test.py +++ /dev/null @@ -1,35 +0,0 @@ -#coding=utf8 -import os -import mapnik -from utilities import execution_path, run_all -from nose.tools import eq_ - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -if 'sqlite' in mapnik.DatasourceCache.plugin_names(): - - # the negative buffer on the layer should - # override the postive map buffer leading - # only one point to be rendered in the map - def test_layer_buffer_size_1(): - m = mapnik.Map(512,512) - eq_(m.buffer_size,0) - mapnik.load_map(m,'../data/good_maps/layer_buffer_size_reduction.xml') - eq_(m.buffer_size,256) - eq_(m.layers[0].buffer_size,-150) - m.zoom_all() - im = mapnik.Image(m.width,m.height) - mapnik.render(m,im) - actual = '/tmp/mapnik-layer-buffer-size.png' - expected = 'images/support/mapnik-layer-buffer-size.png' - im.save(actual,"png32") - expected_im = mapnik.Image.open(expected) - eq_(im.tostring('png32'),expected_im.tostring('png32'), 'failed comparing actual (%s) and expected (%s)' % (actual,'tests/python_tests/'+ expected)) - - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/layer_modification_test.py b/tests/python_tests/layer_modification_test.py deleted file mode 100644 index 7517ac2ac..000000000 --- a/tests/python_tests/layer_modification_test.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python - -import os -from nose.tools import eq_ -from utilities import execution_path, run_all -import mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def test_adding_datasource_to_layer(): - map_string = ''' - - - - world_borders_style - point_style - - - - - -''' - m = mapnik.Map(256, 256) - - try: - mapnik.load_map_from_string(m, map_string) - - # validate it loaded fine - eq_(m.layers[0].styles[0],'world_borders_style') - eq_(m.layers[0].styles[1],'point_style') - eq_(len(m.layers),1) - - # also assign a variable reference to that layer - # below we will test that this variable references - # the same object that is attached to the map - lyr = m.layers[0] - - # ensure that there was no datasource for the layer... - eq_(m.layers[0].datasource,None) - eq_(lyr.datasource,None) - - # also note that since the srs was black it defaulted to wgs84 - eq_(m.layers[0].srs,'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs') - eq_(lyr.srs,'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs') - - # now add a datasource one... - ds = mapnik.Shapefile(file='../data/shp/world_merc.shp') - m.layers[0].datasource = ds - - # now ensure it is attached - eq_(m.layers[0].datasource.describe()['name'],"shape") - eq_(lyr.datasource.describe()['name'],"shape") - - # and since we have now added a shapefile in spherical mercator, adjust the projection - lyr.srs = '+proj=merc +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs' - - # test that assignment - eq_(m.layers[0].srs,'+proj=merc +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs') - eq_(lyr.srs,'+proj=merc +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs') - except RuntimeError, e: - # only test datasources that we have installed - if not 'Could not create datasource' in str(e): - raise RuntimeError(e) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/layer_test.py b/tests/python_tests/layer_test.py deleted file mode 100644 index 6ffd0ca40..000000000 --- a/tests/python_tests/layer_test.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.tools import eq_ -from utilities import run_all -import mapnik - -# Map initialization -def test_layer_init(): - l = mapnik.Layer('test') - eq_(l.name,'test') - eq_(l.srs,'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs') - eq_(l.envelope(),mapnik.Box2d()) - eq_(l.clear_label_cache,False) - eq_(l.cache_features,False) - eq_(l.visible(1),True) - eq_(l.active,True) - eq_(l.datasource,None) - eq_(l.queryable,False) - eq_(l.minzoom,0.0) - eq_(l.maxzoom > 1e+6,True) - eq_(l.group_by,"") - eq_(l.maximum_extent,None) - eq_(l.buffer_size,None) - eq_(len(l.styles),0) - -if __name__ == "__main__": - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/load_map_test.py b/tests/python_tests/load_map_test.py deleted file mode 100644 index 88152c937..000000000 --- a/tests/python_tests/load_map_test.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_ -from utilities import execution_path, run_all - -import os, glob, mapnik - -default_logging_severity = mapnik.logger.get_severity() - -def setup(): - # make the tests silent to suppress unsupported params from harfbuzz tests - # TODO: remove this after harfbuzz branch merges - mapnik.logger.set_severity(mapnik.severity_type.None) - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def teardown(): - mapnik.logger.set_severity(default_logging_severity) - -def test_broken_files(): - default_logging_severity = mapnik.logger.get_severity() - mapnik.logger.set_severity(mapnik.severity_type.None) - broken_files = glob.glob("../data/broken_maps/*.xml") - # Add a filename that doesn't exist - broken_files.append("../data/broken/does_not_exist.xml") - - failures = []; - for filename in broken_files: - try: - m = mapnik.Map(512, 512) - strict = True - mapnik.load_map(m, filename, strict) - failures.append('Loading broken map (%s) did not raise RuntimeError!' % filename) - except RuntimeError: - pass - eq_(len(failures),0,'\n'+'\n'.join(failures)) - mapnik.logger.set_severity(default_logging_severity) - -def test_can_parse_xml_with_deprecated_properties(): - default_logging_severity = mapnik.logger.get_severity() - mapnik.logger.set_severity(mapnik.severity_type.None) - files_with_deprecated_props = glob.glob("../data/deprecated_maps/*.xml") - - failures = []; - for filename in files_with_deprecated_props: - try: - m = mapnik.Map(512, 512) - strict = True - mapnik.load_map(m, filename, strict) - base_path = os.path.dirname(filename) - mapnik.load_map_from_string(m,open(filename,'rb').read(),strict,base_path) - except RuntimeError, e: - # only test datasources that we have installed - if not 'Could not create datasource' in str(e) \ - and not 'Bad connection' in str(e): - failures.append('Failed to load valid map %s (%s)' % (filename,e)) - eq_(len(failures),0,'\n'+'\n'.join(failures)) - mapnik.logger.set_severity(default_logging_severity) - -def test_good_files(): - good_files = glob.glob("../data/good_maps/*.xml") - good_files.extend(glob.glob("../visual_tests/styles/*.xml")) - - failures = []; - for filename in good_files: - try: - m = mapnik.Map(512, 512) - strict = True - mapnik.load_map(m, filename, strict) - base_path = os.path.dirname(filename) - mapnik.load_map_from_string(m,open(filename,'rb').read(),strict,base_path) - except RuntimeError, e: - # only test datasources that we have installed - if not 'Could not create datasource' in str(e) \ - and not 'Bad connection' in str(e): - failures.append('Failed to load valid map %s (%s)' % (filename,e)) - eq_(len(failures),0,'\n'+'\n'.join(failures)) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/map_query_test.py b/tests/python_tests/map_query_test.py deleted file mode 100644 index 4035f7ae9..000000000 --- a/tests/python_tests/map_query_test.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_,raises,assert_almost_equal -from utilities import execution_path, run_all -import os, mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -# map has no layers -@raises(IndexError) -def test_map_query_throw1(): - m = mapnik.Map(256,256) - m.zoom_to_box(mapnik.Box2d(-1,-1,0,0)) - m.query_point(0,0,0) - -# only positive indexes -@raises(IndexError) -def test_map_query_throw2(): - m = mapnik.Map(256,256) - m.query_point(-1,0,0) - -# map has never been zoomed (nodata) -@raises(RuntimeError) -def test_map_query_throw3(): - m = mapnik.Map(256,256) - m.query_point(0,0,0) - -if 'shape' in mapnik.DatasourceCache.plugin_names(): - # map has never been zoomed (even with data) - @raises(RuntimeError) - def test_map_query_throw4(): - m = mapnik.Map(256,256) - mapnik.load_map(m,'../data/good_maps/agg_poly_gamma_map.xml') - m.query_point(0,0,0) - - # invalid coords in general (do not intersect) - @raises(RuntimeError) - def test_map_query_throw5(): - m = mapnik.Map(256,256) - mapnik.load_map(m,'../data/good_maps/agg_poly_gamma_map.xml') - m.zoom_all() - m.query_point(0,9999999999999999,9999999999999999) - - def test_map_query_works1(): - m = mapnik.Map(256,256) - mapnik.load_map(m,'../data/good_maps/wgs842merc_reprojection.xml') - merc_bounds = mapnik.Box2d(-20037508.34,-20037508.34,20037508.34,20037508.34) - m.maximum_extent = merc_bounds - m.zoom_all() - fs = m.query_point(0,-11012435.5376, 4599674.6134) # somewhere in kansas - feat = fs.next() - eq_(feat.attributes['NAME_FORMA'],u'United States of America') - - def test_map_query_works2(): - m = mapnik.Map(256,256) - mapnik.load_map(m,'../data/good_maps/merc2wgs84_reprojection.xml') - wgs84_bounds = mapnik.Box2d(-179.999999975,-85.0511287776,179.999999975,85.0511287776) - m.maximum_extent = wgs84_bounds - # caution - will go square due to evil aspect_fix_mode backhandedness - m.zoom_all() - #mapnik.render_to_file(m,'works2.png') - # validate that aspect_fix_mode modified the bbox reasonably - e = m.envelope() - assert_almost_equal(e.minx, -179.999999975, places=7) - assert_almost_equal(e.miny, -167.951396161, places=7) - assert_almost_equal(e.maxx, 179.999999975, places=7) - assert_almost_equal(e.maxy, 192.048603789, places=7) - fs = m.query_point(0,-98.9264, 38.1432) # somewhere in kansas - feat = fs.next() - eq_(feat.attributes['NAME'],u'United States') - - def test_map_query_in_pixels_works1(): - m = mapnik.Map(256,256) - mapnik.load_map(m,'../data/good_maps/wgs842merc_reprojection.xml') - merc_bounds = mapnik.Box2d(-20037508.34,-20037508.34,20037508.34,20037508.34) - m.maximum_extent = merc_bounds - m.zoom_all() - fs = m.query_map_point(0,55,100) # somewhere in middle of us - feat = fs.next() - eq_(feat.attributes['NAME_FORMA'],u'United States of America') - - def test_map_query_in_pixels_works2(): - m = mapnik.Map(256,256) - mapnik.load_map(m,'../data/good_maps/merc2wgs84_reprojection.xml') - wgs84_bounds = mapnik.Box2d(-179.999999975,-85.0511287776,179.999999975,85.0511287776) - m.maximum_extent = wgs84_bounds - # caution - will go square due to evil aspect_fix_mode backhandedness - m.zoom_all() - # validate that aspect_fix_mode modified the bbox reasonably - e = m.envelope() - assert_almost_equal(e.minx, -179.999999975, places=7) - assert_almost_equal(e.miny, -167.951396161, places=7) - assert_almost_equal(e.maxx, 179.999999975, places=7) - assert_almost_equal(e.maxy, 192.048603789, places=7) - fs = m.query_map_point(0,55,100) # somewhere in Canada - feat = fs.next() - eq_(feat.attributes['NAME'],u'Canada') - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/mapnik_config_test.py b/tests/python_tests/mapnik_config_test.py deleted file mode 100644 index 52b28422a..000000000 --- a/tests/python_tests/mapnik_config_test.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_ -from utilities import run_all -from subprocess import Popen, PIPE - -def test_mapnik_config_no_args(): - process = Popen('mapnik-config', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) - result = process.communicate() - eq_('Usage: mapnik-config' in result[0],True) - eq_(result[1],'') - eq_(process.returncode,1) - -def test_mapnik_config_help(): - process = Popen('mapnik-config --help', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) - result = process.communicate() - eq_('Usage: mapnik-config' in result[0],True) - eq_(result[1],'') - eq_(process.returncode,0) - -def test_mapnik_config_help_short(): - process = Popen('mapnik-config -h', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) - result = process.communicate() - eq_('Usage: mapnik-config' in result[0],True) - eq_(result[1],'') - eq_(process.returncode,0) - -def test_mapnik_config_valid_opts(): - valid_args = [ - '-h', - '--help', - '-v', - '--version', - '--version-number', - '--git-revision', - '--git-describe', - '--fonts', - '--input-plugins', - '--defines', - '--prefix', - '--lib-name', - '--libs', - '--dep-libs', - '--ldflags', - '--includes', - '--dep-includes', - '--cxxflags', - '--cflags', - '--all-flags', - '--cxx' - ] - for item in valid_args: - cmd = 'mapnik-config ' + item - process = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) - result = process.communicate() - eq_(process.returncode,0) - eq_(len(result[0]) > 1,True,cmd) - eq_(result[1],'') - -def test_mapnik_config_invalid_option(): - cmd = 'mapnik-config --invalid-does-not-exist' - process = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) - result = process.communicate() - eq_(process.returncode,0) - eq_(result[0].strip(),'') - eq_(result[1].strip(),'unknown option --invalid-does-not-exist') - -def test_mapnik_config_valid_and_invalid_option(): - cmd = 'mapnik-config --libs --invalid-does-not-exist' - process = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) - result = process.communicate() - eq_('mapnik' in result[0],True) - eq_(result[1].strip(),'unknown option --invalid-does-not-exist') - eq_(process.returncode,0) - -if __name__ == "__main__": - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/mapnik_logger_test.py b/tests/python_tests/mapnik_logger_test.py deleted file mode 100644 index c27ff46a0..000000000 --- a/tests/python_tests/mapnik_logger_test.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python -from nose.tools import eq_ -from utilities import run_all -import mapnik - -def test_logger_init(): - eq_(mapnik.severity_type.Debug,0) - eq_(mapnik.severity_type.Warn,1) - eq_(mapnik.severity_type.Error,2) - eq_(mapnik.severity_type.None,3) - default = mapnik.logger.get_severity() - mapnik.logger.set_severity(mapnik.severity_type.Debug) - eq_(mapnik.logger.get_severity(),mapnik.severity_type.Debug) - mapnik.logger.set_severity(default) - eq_(mapnik.logger.get_severity(),default) - -if __name__ == "__main__": - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/mapnik_test_data_test.py b/tests/python_tests/mapnik_test_data_test.py deleted file mode 100644 index b4226e125..000000000 --- a/tests/python_tests/mapnik_test_data_test.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from utilities import execution_path, run_all -import os, mapnik -from glob import glob - -default_logging_severity = mapnik.logger.get_severity() - -def setup(): - mapnik.logger.set_severity(mapnik.severity_type.None) - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def teardown(): - mapnik.logger.set_severity(default_logging_severity) - -plugin_mapping = { - '.csv' : ['csv'], - '.json': ['geojson','ogr'], - '.tif' : ['gdal'], - #'.tif' : ['gdal','raster'], - '.kml' : ['ogr'], - '.gpx' : ['ogr'], - '.vrt' : ['gdal'] -} - -def test_opening_data(): - # https://github.com/mapbox/mapnik-test-data - # cd tests/data - # git clone --depth 1 https://github.com/mapbox/mapnik-test-data - if os.path.exists('../data/mapnik-test-data/'): - files = glob('../data/mapnik-test-data/data/*/*.*') - for filepath in files: - ext = os.path.splitext(filepath)[1] - if plugin_mapping.get(ext): - #print 'testing opening %s' % filepath - if 'topo' in filepath: - kwargs = {'type': 'ogr','file': filepath} - kwargs['layer_by_index'] = 0 - try: - mapnik.Datasource(**kwargs) - except Exception, e: - print 'could not open, %s: %s' % (kwargs,e) - else: - for plugin in plugin_mapping[ext]: - kwargs = {'type': plugin,'file': filepath} - if plugin is 'ogr': - kwargs['layer_by_index'] = 0 - try: - mapnik.Datasource(**kwargs) - except Exception, e: - print 'could not open, %s: %s' % (kwargs,e) - #else: - # print 'skipping opening %s' % filepath - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/markers_complex_rendering_test.py b/tests/python_tests/markers_complex_rendering_test.py deleted file mode 100644 index efce684fa..000000000 --- a/tests/python_tests/markers_complex_rendering_test.py +++ /dev/null @@ -1,43 +0,0 @@ -#coding=utf8 -import os -import mapnik -from utilities import execution_path, run_all -from nose.tools import eq_ - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -if 'csv' in mapnik.DatasourceCache.plugin_names(): - def test_marker_ellipse_render1(): - m = mapnik.Map(256,256) - mapnik.load_map(m,'../data/good_maps/marker_ellipse_transform.xml') - m.zoom_all() - im = mapnik.Image(m.width,m.height) - mapnik.render(m,im) - actual = '/tmp/mapnik-marker-ellipse-render1.png' - expected = 'images/support/mapnik-marker-ellipse-render1.png' - im.save(actual,'png32') - if os.environ.get('UPDATE'): - im.save(expected,'png32') - expected_im = mapnik.Image.open(expected) - eq_(im.tostring('png32'),expected_im.tostring('png32'), 'failed comparing actual (%s) and expected (%s)' % (actual,'tests/python_tests/'+ expected)) - - def test_marker_ellipse_render2(): - m = mapnik.Map(256,256) - mapnik.load_map(m,'../data/good_maps/marker_ellipse_transform2.xml') - m.zoom_all() - im = mapnik.Image(m.width,m.height) - mapnik.render(m,im) - actual = '/tmp/mapnik-marker-ellipse-render2.png' - expected = 'images/support/mapnik-marker-ellipse-render2.png' - im.save(actual,'png32') - if os.environ.get('UPDATE'): - im.save(expected,'png32') - expected_im = mapnik.Image.open(expected) - eq_(im.tostring('png32'),expected_im.tostring('png32'), 'failed comparing actual (%s) and expected (%s)' % (actual,'tests/python_tests/'+ expected)) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/memory_datasource_test.py b/tests/python_tests/memory_datasource_test.py deleted file mode 100644 index b868f44de..000000000 --- a/tests/python_tests/memory_datasource_test.py +++ /dev/null @@ -1,34 +0,0 @@ -#encoding: utf8 -import mapnik -from utilities import run_all -from nose.tools import eq_ - -def test_add_feature(): - md = mapnik.MemoryDatasource() - eq_(md.num_features(), 0) - context = mapnik.Context() - context.push('foo') - feature = mapnik.Feature(context,1) - feature['foo'] = 'bar' - feature.add_geometries_from_wkt('POINT(2 3)') - md.add_feature(feature) - eq_(md.num_features(), 1) - - featureset = md.features_at_point(mapnik.Coord(2,3)) - retrieved = [] - - for feat in featureset: - retrieved.append(feat) - - eq_(len(retrieved), 1) - f = retrieved[0] - eq_(f['foo'], 'bar') - - featureset = md.features_at_point(mapnik.Coord(20,30)) - retrieved = [] - for feat in featureset: - retrieved.append(feat) - eq_(len(retrieved), 0) - -if __name__ == "__main__": - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/multi_tile_raster_test.py b/tests/python_tests/multi_tile_raster_test.py deleted file mode 100644 index 7dda8760f..000000000 --- a/tests/python_tests/multi_tile_raster_test.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_ -from utilities import execution_path, run_all -import os, mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def test_multi_tile_policy(): - srs = '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' - lyr = mapnik.Layer('raster') - if 'raster' in mapnik.DatasourceCache.plugin_names(): - lyr.datasource = mapnik.Raster( - file = '../data/raster_tiles/${x}/${y}.tif', - lox = -180, - loy = -90, - hix = 180, - hiy = 90, - multi = 1, - tile_size = 256, - x_width = 2, - y_width = 2 - ) - lyr.srs = srs - _map = mapnik.Map(256, 256, srs) - style = mapnik.Style() - rule = mapnik.Rule() - sym = mapnik.RasterSymbolizer() - rule.symbols.append(sym) - style.rules.append(rule) - _map.append_style('foo', style) - lyr.styles.append('foo') - _map.layers.append(lyr) - _map.zoom_to_box(lyr.envelope()) - - im = mapnik.Image(_map.width, _map.height) - mapnik.render(_map, im) - - # test green chunk - eq_(im.view(0,64,1,1).tostring(), '\x00\xff\x00\xff') - eq_(im.view(127,64,1,1).tostring(), '\x00\xff\x00\xff') - eq_(im.view(0,127,1,1).tostring(), '\x00\xff\x00\xff') - eq_(im.view(127,127,1,1).tostring(), '\x00\xff\x00\xff') - - # test blue chunk - eq_(im.view(128,64,1,1).tostring(), '\x00\x00\xff\xff') - eq_(im.view(255,64,1,1).tostring(), '\x00\x00\xff\xff') - eq_(im.view(128,127,1,1).tostring(), '\x00\x00\xff\xff') - eq_(im.view(255,127,1,1).tostring(), '\x00\x00\xff\xff') - - # test red chunk - eq_(im.view(0,128,1,1).tostring(), '\xff\x00\x00\xff') - eq_(im.view(127,128,1,1).tostring(), '\xff\x00\x00\xff') - eq_(im.view(0,191,1,1).tostring(), '\xff\x00\x00\xff') - eq_(im.view(127,191,1,1).tostring(), '\xff\x00\x00\xff') - - # test magenta chunk - eq_(im.view(128,128,1,1).tostring(), '\xff\x00\xff\xff') - eq_(im.view(255,128,1,1).tostring(), '\xff\x00\xff\xff') - eq_(im.view(128,191,1,1).tostring(), '\xff\x00\xff\xff') - eq_(im.view(255,191,1,1).tostring(), '\xff\x00\xff\xff') - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/object_test.py b/tests/python_tests/object_test.py deleted file mode 100644 index 0f23e7118..000000000 --- a/tests/python_tests/object_test.py +++ /dev/null @@ -1,569 +0,0 @@ -# #!/usr/bin/env python -# # -*- coding: utf-8 -*- - -# import os -# from nose.tools import * -# from utilities import execution_path, run_all -# import tempfile - -# import mapnik - -# def setup(): -# # All of the paths used are relative, if we run the tests -# # from another directory we need to chdir() -# os.chdir(execution_path('.')) - -# def test_debug_symbolizer(): -# s = mapnik.DebugSymbolizer() -# eq_(s.mode,mapnik.debug_symbolizer_mode.collision) - -# def test_raster_symbolizer(): -# s = mapnik.RasterSymbolizer() -# eq_(s.comp_op,mapnik.CompositeOp.src_over) # note: mode is deprecated -# eq_(s.scaling,mapnik.scaling_method.NEAR) -# eq_(s.opacity,1.0) -# eq_(s.colorizer,None) -# eq_(s.filter_factor,-1) -# eq_(s.mesh_size,16) -# eq_(s.premultiplied,None) -# s.premultiplied = True -# eq_(s.premultiplied,True) - -# def test_line_pattern(): -# s = mapnik.LinePatternSymbolizer(mapnik.PathExpression('../data/images/dummy.png')) -# eq_(s.filename, '../data/images/dummy.png') -# eq_(s.smooth,0.0) -# eq_(s.transform,'') -# eq_(s.offset,0.0) -# eq_(s.comp_op,mapnik.CompositeOp.src_over) -# eq_(s.clip,True) - -# def test_line_symbolizer(): -# s = mapnik.LineSymbolizer() -# eq_(s.rasterizer, mapnik.line_rasterizer.FULL) -# eq_(s.smooth,0.0) -# eq_(s.comp_op,mapnik.CompositeOp.src_over) -# eq_(s.clip,True) -# eq_(s.stroke.width, 1) -# eq_(s.stroke.opacity, 1) -# eq_(s.stroke.color, mapnik.Color('black')) -# eq_(s.stroke.line_cap, mapnik.line_cap.BUTT_CAP) -# eq_(s.stroke.line_join, mapnik.line_join.MITER_JOIN) - -# l = mapnik.LineSymbolizer(mapnik.Color('blue'), 5.0) - -# eq_(l.stroke.width, 5) -# eq_(l.stroke.opacity, 1) -# eq_(l.stroke.color, mapnik.Color('blue')) -# eq_(l.stroke.line_cap, mapnik.line_cap.BUTT_CAP) -# eq_(l.stroke.line_join, mapnik.line_join.MITER_JOIN) - -# s = mapnik.Stroke(mapnik.Color('blue'), 5.0) -# l = mapnik.LineSymbolizer(s) - -# eq_(l.stroke.width, 5) -# eq_(l.stroke.opacity, 1) -# eq_(l.stroke.color, mapnik.Color('blue')) -# eq_(l.stroke.line_cap, mapnik.line_cap.BUTT_CAP) -# eq_(l.stroke.line_join, mapnik.line_join.MITER_JOIN) - -# def test_line_symbolizer_stroke_reference(): -# l = mapnik.LineSymbolizer(mapnik.Color('green'),0.1) -# l.stroke.add_dash(.1,.1) -# l.stroke.add_dash(.1,.1) -# eq_(l.stroke.get_dashes(), [(.1,.1),(.1,.1)]) -# eq_(l.stroke.color,mapnik.Color('green')) -# eq_(l.stroke.opacity,1.0) -# assert_almost_equal(l.stroke.width,0.1) - -# # https://github.com/mapnik/mapnik/issues/1427 -# def test_stroke_dash_api(): -# stroke = mapnik.Stroke() -# dashes = [(1.0,1.0)] -# stroke.dasharray = dashes -# eq_(stroke.dasharray, dashes) -# stroke.add_dash(.1,.1) -# dashes.append((.1,.1)) -# eq_(stroke.dasharray, dashes) - - -# def test_text_symbolizer(): -# s = mapnik.TextSymbolizer() -# eq_(s.comp_op,mapnik.CompositeOp.src_over) -# eq_(s.clip,True) -# eq_(s.halo_rasterizer,mapnik.halo_rasterizer.FULL) - -# # https://github.com/mapnik/mapnik/issues/1420 -# eq_(s.text_transform, mapnik.text_transform.NONE) - -# # old args required method -# ts = mapnik.TextSymbolizer(mapnik.Expression('[Field_Name]'), 'Font Name', 8, mapnik.Color('black')) -# # eq_(str(ts.name), str(mapnik2.Expression('[Field_Name]'))) name field is no longer supported -# eq_(ts.format.face_name, 'Font Name') -# eq_(ts.format.text_size, 8) -# eq_(ts.format.fill, mapnik.Color('black')) -# eq_(ts.properties.label_placement, mapnik.label_placement.POINT_PLACEMENT) -# eq_(ts.properties.horizontal_alignment, mapnik.horizontal_alignment.AUTO) - -# def test_shield_symbolizer_init(): -# s = mapnik.ShieldSymbolizer(mapnik.Expression('[Field Name]'), 'DejaVu Sans Bold', 6, mapnik.Color('#000000'), mapnik.PathExpression('../data/images/dummy.png')) -# eq_(s.comp_op,mapnik.CompositeOp.src_over) -# eq_(s.clip,True) -# eq_(s.displacement, (0.0,0.0)) -# eq_(s.allow_overlap, False) -# eq_(s.avoid_edges, False) -# eq_(s.character_spacing,0) -# #eq_(str(s.name), str(mapnik2.Expression('[Field Name]'))) name field is no longer supported -# eq_(s.face_name, 'DejaVu Sans Bold') -# eq_(s.allow_overlap, False) -# eq_(s.fill, mapnik.Color('#000000')) -# eq_(s.halo_fill, mapnik.Color('rgb(255,255,255)')) -# eq_(s.halo_radius, 0) -# eq_(s.label_placement, mapnik.label_placement.POINT_PLACEMENT) -# eq_(s.minimum_distance, 0.0) -# eq_(s.text_ratio, 0) -# eq_(s.text_size, 6) -# eq_(s.wrap_width, 0) -# eq_(s.vertical_alignment, mapnik.vertical_alignment.AUTO) -# eq_(s.label_spacing, 0) -# eq_(s.label_position_tolerance, 0) -# # 22.5 * M_PI/180.0 initialized by default -# assert_almost_equal(s.max_char_angle_delta, 0.39269908169872414) - -# eq_(s.text_transform, mapnik.text_transform.NONE) -# eq_(s.line_spacing, 0) -# eq_(s.character_spacing, 0) - -# # r1341 -# eq_(s.wrap_before, False) -# eq_(s.horizontal_alignment, mapnik.horizontal_alignment.AUTO) -# eq_(s.justify_alignment, mapnik.justify_alignment.AUTO) -# eq_(s.opacity, 1.0) - -# # r2300 -# eq_(s.minimum_padding, 0.0) - -# # was mixed with s.opacity -# eq_(s.text_opacity, 1.0) - -# eq_(s.shield_displacement, (0.0,0.0)) -# # TODO - the pattern in bindings seems to be to get/set -# # strings for PathExpressions... should we pass objects? -# eq_(s.filename, '../data/images/dummy.png') - -# # 11c34b1: default transform list is empty, not identity matrix -# eq_(s.transform, '') - -# eq_(s.fontset, None) - -# # ShieldSymbolizer missing image file -# # images paths are now PathExpressions are evaluated at runtime -# # so it does not make sense to throw... -# #@raises(RuntimeError) -# #def test_shieldsymbolizer_missing_image(): -# # s = mapnik.ShieldSymbolizer(mapnik.Expression('[Field Name]'), 'DejaVu Sans Bold', 6, mapnik.Color('#000000'), mapnik.PathExpression('../#data/images/broken.png')) - -# def test_shield_symbolizer_modify(): -# s = mapnik.ShieldSymbolizer(mapnik.Expression('[Field Name]'), 'DejaVu Sans Bold', 6, mapnik.Color('#000000'), mapnik.PathExpression('../data/images/dummy.png')) -# # transform expression -# def check_transform(expr, expect_str=None): -# s.transform = expr -# eq_(s.transform, expr if expect_str is None else expect_str) -# check_transform("matrix(1 2 3 4 5 6)", "matrix(1, 2, 3, 4, 5, 6)") -# check_transform("matrix(1, 2, 3, 4, 5, 6 +7)", "matrix(1, 2, 3, 4, 5, (6+7))") -# check_transform("rotate([a])") -# check_transform("rotate([a] -2)", "rotate(([a]-2))") -# check_transform("rotate([a] -2 -3)", "rotate([a], -2, -3)") -# check_transform("rotate([a] -2 -3 -4)", "rotate(((([a]-2)-3)-4))") -# check_transform("rotate([a] -2, 3, 4)", "rotate(([a]-2), 3, 4)") -# check_transform("translate([tx]) rotate([a])") -# check_transform("scale([sx], [sy]/2)") -# # TODO check expected failures - -# def test_point_symbolizer(): -# p = mapnik.PointSymbolizer() -# eq_(p.filename,'') -# eq_(p.transform,'') -# eq_(p.opacity,1.0) -# eq_(p.allow_overlap,False) -# eq_(p.ignore_placement,False) -# eq_(p.comp_op,mapnik.CompositeOp.src_over) -# eq_(p.placement, mapnik.point_placement.CENTROID) - -# p = mapnik.PointSymbolizer(mapnik.PathExpression("../data/images/dummy.png")) -# p.allow_overlap = True -# p.opacity = 0.5 -# p.ignore_placement = True -# p.placement = mapnik.point_placement.INTERIOR -# eq_(p.allow_overlap, True) -# eq_(p.opacity, 0.5) -# eq_(p.filename,'../data/images/dummy.png') -# eq_(p.ignore_placement,True) -# eq_(p.placement, mapnik.point_placement.INTERIOR) - -# def test_markers_symbolizer(): -# p = mapnik.MarkersSymbolizer() -# eq_(p.allow_overlap, False) -# eq_(p.opacity,1.0) -# eq_(p.fill_opacity,None) -# eq_(p.filename,'shape://ellipse') -# eq_(p.placement,mapnik.marker_placement.POINT_PLACEMENT) -# eq_(p.multi_policy,mapnik.marker_multi_policy.EACH) -# eq_(p.fill,None) -# eq_(p.ignore_placement,False) -# eq_(p.spacing,100) -# eq_(p.max_error,0.2) -# eq_(p.width,None) -# eq_(p.height,None) -# eq_(p.transform,'') -# eq_(p.clip,True) -# eq_(p.comp_op,mapnik.CompositeOp.src_over) - - -# p.width = mapnik.Expression('12') -# p.height = mapnik.Expression('12') -# eq_(str(p.width),'12') -# eq_(str(p.height),'12') - -# p.width = mapnik.Expression('[field] + 2') -# p.height = mapnik.Expression('[field] + 2') -# eq_(str(p.width),'([field]+2)') -# eq_(str(p.height),'([field]+2)') - -# stroke = mapnik.Stroke() -# stroke.color = mapnik.Color('black') -# stroke.width = 1.0 - -# p.stroke = stroke -# p.fill = mapnik.Color('white') -# p.allow_overlap = True -# p.opacity = 0.5 -# p.fill_opacity = 0.5 -# p.placement = mapnik.marker_placement.LINE_PLACEMENT -# p.multi_policy = mapnik.marker_multi_policy.WHOLE - -# eq_(p.allow_overlap, True) -# eq_(p.opacity, 0.5) -# eq_(p.fill_opacity, 0.5) -# eq_(p.multi_policy,mapnik.marker_multi_policy.WHOLE) -# eq_(p.placement,mapnik.marker_placement.LINE_PLACEMENT) - -# #https://github.com/mapnik/mapnik/issues/1285 -# #https://github.com/mapnik/mapnik/issues/1427 -# p.marker_type = 'arrow' -# eq_(p.marker_type,'shape://arrow') -# eq_(p.filename,'shape://arrow') - - -# # PointSymbolizer missing image file -# # images paths are now PathExpressions are evaluated at runtime -# # so it does not make sense to throw... -# #@raises(RuntimeError) -# #def test_pointsymbolizer_missing_image(): -# # p = mapnik.PointSymbolizer(mapnik.PathExpression("../data/images/broken.png")) - -# def test_polygon_symbolizer(): -# p = mapnik.PolygonSymbolizer() -# eq_(p.smooth,0.0) -# eq_(p.comp_op,mapnik.CompositeOp.src_over) -# eq_(p.clip,True) -# eq_(p.fill, mapnik.Color('gray')) -# eq_(p.fill_opacity, 1) - -# p = mapnik.PolygonSymbolizer(mapnik.Color('blue')) - -# eq_(p.fill, mapnik.Color('blue')) -# eq_(p.fill_opacity, 1) - -# def test_building_symbolizer_init(): -# p = mapnik.BuildingSymbolizer() - -# eq_(p.fill, mapnik.Color('gray')) -# eq_(p.fill_opacity, 1) -# eq_(p.height,None) - -# def test_group_symbolizer_init(): -# s = mapnik.GroupSymbolizer() - -# p = mapnik.GroupSymbolizerProperties() - -# l = mapnik.PairLayout() -# l.item_margin = 5.0 -# p.set_layout(l) - -# r = mapnik.GroupRule(mapnik.Expression("[name%1]")) -# r.append(mapnik.PointSymbolizer()) -# p.add_rule(r) -# s.symbolizer_properties = p - -# eq_(s.comp_op,mapnik.CompositeOp.src_over) - -# def test_stroke_init(): -# s = mapnik.Stroke() - -# eq_(s.width, 1) -# eq_(s.opacity, 1) -# eq_(s.color, mapnik.Color('black')) -# eq_(s.line_cap, mapnik.line_cap.BUTT_CAP) -# eq_(s.line_join, mapnik.line_join.MITER_JOIN) -# eq_(s.gamma,1.0) - -# s = mapnik.Stroke(mapnik.Color('blue'), 5.0) -# s.gamma = .5 - -# eq_(s.width, 5) -# eq_(s.opacity, 1) -# eq_(s.color, mapnik.Color('blue')) -# eq_(s.gamma, .5) -# eq_(s.line_cap, mapnik.line_cap.BUTT_CAP) -# eq_(s.line_join, mapnik.line_join.MITER_JOIN) - -# def test_stroke_dash_arrays(): -# s = mapnik.Stroke() -# s.add_dash(1,2) -# s.add_dash(3,4) -# s.add_dash(5,6) - -# eq_(s.get_dashes(), [(1,2),(3,4),(5,6)]) - -# def test_map_init(): -# m = mapnik.Map(256, 256) - -# eq_(m.width, 256) -# eq_(m.height, 256) -# eq_(m.srs, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs') -# eq_(m.base, '') -# eq_(m.maximum_extent, None) -# eq_(m.background_image, None) -# eq_(m.background_image_comp_op, mapnik.CompositeOp.src_over) -# eq_(m.background_image_opacity, 1.0) - -# m = mapnik.Map(256, 256, '+proj=latlong') -# eq_(m.srs, '+proj=latlong') - -# def test_map_style_access(): -# m = mapnik.Map(256, 256) -# sty = mapnik.Style() -# m.append_style("style",sty) -# styles = list(m.styles) -# eq_(len(styles),1) -# eq_(styles[0][0],'style') -# # returns a copy so let's just check it is the right instance -# eq_(isinstance(styles[0][1],mapnik.Style),True) - -# def test_map_maximum_extent_modification(): -# m = mapnik.Map(256, 256) -# eq_(m.maximum_extent, None) -# m.maximum_extent = mapnik.Box2d() -# eq_(m.maximum_extent, mapnik.Box2d()) -# m.maximum_extent = None -# eq_(m.maximum_extent, None) - -# # Map initialization from string -# def test_map_init_from_string(): -# map_string = ''' -# -# -# My Style -# -# shape -# ../../demo/data/boundaries -# -# -# ''' - -# m = mapnik.Map(600, 300) -# eq_(m.base, '') -# try: -# mapnik.load_map_from_string(m, map_string) -# eq_(m.base, './') -# mapnik.load_map_from_string(m, map_string, False, "") # this "" will have no effect -# eq_(m.base, './') - -# tmp_dir = tempfile.gettempdir() -# try: -# mapnik.load_map_from_string(m, map_string, False, tmp_dir) -# except RuntimeError: -# pass # runtime error expected because shapefile path should be wrong and datasource will throw -# eq_(m.base, tmp_dir) # tmp_dir will be set despite the exception because load_map mostly worked -# m.base = 'foo' -# mapnik.load_map_from_string(m, map_string, True, ".") -# eq_(m.base, '.') -# except RuntimeError, e: -# # only test datasources that we have installed -# if not 'Could not create datasource' in str(e): -# raise RuntimeError(e) - -# # Color initialization -# @raises(Exception) # Boost.Python.ArgumentError -# def test_color_init_errors(): -# c = mapnik.Color() - -# @raises(RuntimeError) -# def test_color_init_errors(): -# c = mapnik.Color('foo') # mapnik config - -# def test_color_init(): -# c = mapnik.Color('blue') - -# eq_(c.a, 255) -# eq_(c.r, 0) -# eq_(c.g, 0) -# eq_(c.b, 255) - -# eq_(c.to_hex_string(), '#0000ff') - -# c = mapnik.Color('#f2eff9') - -# eq_(c.a, 255) -# eq_(c.r, 242) -# eq_(c.g, 239) -# eq_(c.b, 249) - -# eq_(c.to_hex_string(), '#f2eff9') - -# c = mapnik.Color('rgb(50%,50%,50%)') - -# eq_(c.a, 255) -# eq_(c.r, 128) -# eq_(c.g, 128) -# eq_(c.b, 128) - -# eq_(c.to_hex_string(), '#808080') - -# c = mapnik.Color(0, 64, 128) - -# eq_(c.a, 255) -# eq_(c.r, 0) -# eq_(c.g, 64) -# eq_(c.b, 128) - -# eq_(c.to_hex_string(), '#004080') - -# c = mapnik.Color(0, 64, 128, 192) - -# eq_(c.a, 192) -# eq_(c.r, 0) -# eq_(c.g, 64) -# eq_(c.b, 128) - -# eq_(c.to_hex_string(), '#004080c0') - -# def test_color_equality(): - -# c1 = mapnik.Color('blue') -# c2 = mapnik.Color(0,0,255) -# c3 = mapnik.Color('black') - -# c3.r = 0 -# c3.g = 0 -# c3.b = 255 -# c3.a = 255 - -# eq_(c1, c2) -# eq_(c1, c3) - -# c1 = mapnik.Color(0, 64, 128) -# c2 = mapnik.Color(0, 64, 128) -# c3 = mapnik.Color(0, 0, 0) - -# c3.r = 0 -# c3.g = 64 -# c3.b = 128 - -# eq_(c1, c2) -# eq_(c1, c3) - -# c1 = mapnik.Color(0, 64, 128, 192) -# c2 = mapnik.Color(0, 64, 128, 192) -# c3 = mapnik.Color(0, 0, 0, 255) - -# c3.r = 0 -# c3.g = 64 -# c3.b = 128 -# c3.a = 192 - -# eq_(c1, c2) -# eq_(c1, c3) - -# c1 = mapnik.Color('rgb(50%,50%,50%)') -# c2 = mapnik.Color(128, 128, 128, 255) -# c3 = mapnik.Color('#808080') -# c4 = mapnik.Color('gray') - -# eq_(c1, c2) -# eq_(c1, c3) -# eq_(c1, c4) - -# c1 = mapnik.Color('hsl(0, 100%, 50%)') # red -# c2 = mapnik.Color('hsl(120, 100%, 50%)') # lime -# c3 = mapnik.Color('hsla(240, 100%, 50%, 0.5)') # semi-transparent solid blue - -# eq_(c1, mapnik.Color('red')) -# eq_(c2, mapnik.Color('lime')) -# eq_(c3, mapnik.Color(0,0,255,128)) - -# def test_rule_init(): -# min_scale = 5 -# max_scale = 10 - -# r = mapnik.Rule() - -# eq_(r.name, '') -# eq_(r.min_scale, 0) -# eq_(r.max_scale, float('inf')) -# eq_(r.has_else(), False) -# eq_(r.has_also(), False) - -# r = mapnik.Rule() - -# r.set_else(True) -# eq_(r.has_else(), True) -# eq_(r.has_also(), False) - -# r = mapnik.Rule() - -# r.set_also(True) -# eq_(r.has_else(), False) -# eq_(r.has_also(), True) - -# r = mapnik.Rule("Name") - -# eq_(r.name, 'Name') -# eq_(r.min_scale, 0) -# eq_(r.max_scale, float('inf')) -# eq_(r.has_else(), False) -# eq_(r.has_also(), False) - -# r = mapnik.Rule("Name") - -# eq_(r.name, 'Name') -# eq_(r.min_scale, 0) -# eq_(r.max_scale, float('inf')) -# eq_(r.has_else(), False) -# eq_(r.has_also(), False) - -# r = mapnik.Rule("Name", min_scale) - -# eq_(r.name, 'Name') -# eq_(r.min_scale, min_scale) -# eq_(r.max_scale, float('inf')) -# eq_(r.has_else(), False) -# eq_(r.has_also(), False) - -# r = mapnik.Rule("Name", min_scale, max_scale) - -# eq_(r.name, 'Name') -# eq_(r.min_scale, min_scale) -# eq_(r.max_scale, max_scale) -# eq_(r.has_else(), False) -# eq_(r.has_also(), False) - -# if __name__ == "__main__": -# setup() -# run_all(eval(x) for x in dir() if x.startswith("test_")) diff --git a/tests/python_tests/ogr_and_shape_geometries_test.py b/tests/python_tests/ogr_and_shape_geometries_test.py deleted file mode 100644 index 5c6918e28..000000000 --- a/tests/python_tests/ogr_and_shape_geometries_test.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_ -from utilities import execution_path, run_all -import os, mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -# TODO - fix truncation in shapefile... -polys = ["POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))", - "POLYGON ((35 10, 10 20, 15 40, 45 45, 35 10),(20 30, 35 35, 30 20, 20 30))", - "MULTIPOLYGON (((30 20, 10 40, 45 40, 30 20)),((15 5, 40 10, 10 20, 5 10, 15 5)))" - "MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)),((20 35, 45 20, 30 5, 10 10, 10 30, 20 35),(30 20, 20 25, 20 15, 30 20)))" - ] - -plugins = mapnik.DatasourceCache.plugin_names() -if 'shape' in plugins and 'ogr' in plugins: - - def ensure_geometries_are_interpreted_equivalently(filename): - ds1 = mapnik.Ogr(file=filename,layer_by_index=0) - ds2 = mapnik.Shapefile(file=filename) - fs1 = ds1.featureset() - fs2 = ds2.featureset() - count = 0; - import itertools - for feat1,feat2 in itertools.izip(fs1, fs2): - count += 1 - eq_(feat1.attributes,feat2.attributes) - # TODO - revisit this: https://github.com/mapnik/mapnik/issues/1093 - # eq_(feat1.to_geojson(),feat2.to_geojson()) - #eq_(feat1.geometries().to_wkt(),feat2.geometries().to_wkt()) - #eq_(feat1.geometries().to_wkb(mapnik.wkbByteOrder.NDR),feat2.geometries().to_wkb(mapnik.wkbByteOrder.NDR)) - #eq_(feat1.geometries().to_wkb(mapnik.wkbByteOrder.XDR),feat2.geometries().to_wkb(mapnik.wkbByteOrder.XDR)) - - def test_simple_polys(): - ensure_geometries_are_interpreted_equivalently('../data/shp/wkt_poly.shp') - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/ogr_test.py b/tests/python_tests/ogr_test.py deleted file mode 100644 index f463b22b5..000000000 --- a/tests/python_tests/ogr_test.py +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.tools import eq_,assert_almost_equal,raises -from utilities import execution_path, run_all -import os, mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -if 'ogr' in mapnik.DatasourceCache.plugin_names(): - - # Shapefile initialization - def test_shapefile_init(): - s = mapnik.Ogr(file='../../demo/data/boundaries.shp',layer_by_index=0) - - e = s.envelope() - - assert_almost_equal(e.minx, -11121.6896651, places=7) - assert_almost_equal(e.miny, -724724.216526, places=6) - assert_almost_equal(e.maxx, 2463000.67866, places=5) - assert_almost_equal(e.maxy, 1649661.267, places=3) - - # Shapefile properties - def test_shapefile_properties(): - ds = mapnik.Ogr(file='../../demo/data/boundaries.shp',layer_by_index=0) - f = ds.features_at_point(ds.envelope().center(), 0.001).features[0] - eq_(ds.geometry_type(),mapnik.DataGeometryType.Polygon) - - eq_(f['CGNS_FID'], u'6f733341ba2011d892e2080020a0f4c9') - eq_(f['COUNTRY'], u'CAN') - eq_(f['F_CODE'], u'FA001') - eq_(f['NAME_EN'], u'Quebec') - eq_(f['Shape_Area'], 1512185733150.0) - eq_(f['Shape_Leng'], 19218883.724300001) - # NOTE: encoding is latin1 but gdal >= 1.9 should now expose utf8 encoded features - # See SHAPE_ENCODING for overriding: http://gdal.org/ogr/drv_shapefile.html - # Failure for the NOM_FR field is expected for older gdal - #eq_(f['NOM_FR'], u'Qu\xe9bec') - #eq_(f['NOM_FR'], u'Québec') - - @raises(RuntimeError) - def test_that_nonexistant_query_field_throws(**kwargs): - ds = mapnik.Ogr(file='../data/shp/world_merc.shp',layer_by_index=0) - eq_(len(ds.fields()),11) - eq_(ds.fields(),['FIPS', 'ISO2', 'ISO3', 'UN', 'NAME', 'AREA', 'POP2005', 'REGION', 'SUBREGION', 'LON', 'LAT']) - eq_(ds.field_types(),['str', 'str', 'str', 'int', 'str', 'int', 'int', 'int', 'int', 'float', 'float']) - query = mapnik.Query(ds.envelope()) - for fld in ds.fields(): - query.add_property_name(fld) - # also add an invalid one, triggering throw - query.add_property_name('bogus') - ds.features(query) - - # disabled because OGR prints an annoying error: ERROR 1: Invalid Point object. Missing 'coordinates' member. - #def test_handling_of_null_features(): - # ds = mapnik.Ogr(file='../data/json/null_feature.geojson',layer_by_index=0) - # fs = ds.all_features() - # eq_(len(fs),1) - - # OGR plugin extent parameter - def test_ogr_extent_parameter(): - ds = mapnik.Ogr(file='../data/shp/world_merc.shp',layer_by_index=0,extent='-1,-1,1,1') - e = ds.envelope() - eq_(e.minx,-1) - eq_(e.miny,-1) - eq_(e.maxx,1) - eq_(e.maxy,1) - - def test_ogr_reading_gpx_waypoint(): - ds = mapnik.Ogr(file='../data/gpx/empty.gpx',layer='waypoints') - e = ds.envelope() - eq_(e.minx,-122) - eq_(e.miny,48) - eq_(e.maxx,-122) - eq_(e.maxy,48) - - def test_ogr_empty_data_should_not_throw(): - default_logging_severity = mapnik.logger.get_severity() - mapnik.logger.set_severity(mapnik.severity_type.None) - # use logger to silence expected warnings - for layer in ['routes', 'tracks', 'route_points', 'track_points']: - ds = mapnik.Ogr(file='../data/gpx/empty.gpx',layer=layer) - e = ds.envelope() - eq_(e.minx,0) - eq_(e.miny,0) - eq_(e.maxx,0) - eq_(e.maxy,0) - mapnik.logger.set_severity(default_logging_severity) - - # disabled because OGR prints an annoying error: ERROR 1: Invalid Point object. Missing 'coordinates' member. - #def test_handling_of_null_features(): - # ds = mapnik.Ogr(file='../data/json/null_feature.geojson',layer_by_index=0) - # fs = ds.all_features() - # eq_(len(fs),1) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/osm_test.py b/tests/python_tests/osm_test.py deleted file mode 100644 index 7ff0bfbfb..000000000 --- a/tests/python_tests/osm_test.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.tools import eq_ -from utilities import execution_path, run_all -import os, mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -if 'osm' in mapnik.DatasourceCache.plugin_names(): - - # osm initialization - def test_osm_init(): - ds = mapnik.Osm(file='../data/osm/nodes.osm') - - e = ds.envelope() - - # these are hardcoded in the plugin… ugh - eq_(e.minx >= -180.0,True) - eq_(e.miny >= -90.0,True) - eq_(e.maxx <= 180.0,True) - eq_(e.maxy <= 90,True) - - def test_that_nonexistant_query_field_throws(**kwargs): - ds = mapnik.Osm(file='../data/osm/nodes.osm') - eq_(len(ds.fields()),0) - query = mapnik.Query(ds.envelope()) - for fld in ds.fields(): - query.add_property_name(fld) - # also add an invalid one, triggering throw - query.add_property_name('bogus') - ds.features(query) - - def test_that_64bit_int_fields_work(): - ds = mapnik.Osm(file='../data/osm/64bit.osm') - eq_(len(ds.fields()),4) - eq_(ds.fields(),['bigint', 'highway', 'junction', 'note']) - eq_(ds.field_types(),['str', 'str', 'str', 'str']) - fs = ds.featureset() - feat = fs.next() - eq_(feat.id(),4294968186) - eq_(feat['bigint'], None) - feat = fs.next() - eq_(feat['bigint'],'9223372036854775807') - - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/palette_test.py b/tests/python_tests/palette_test.py deleted file mode 100644 index 9b308953f..000000000 --- a/tests/python_tests/palette_test.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.tools import eq_ -from utilities import execution_path, run_all -import os, mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -expected_64 = '[Palette 64 colors #494746 #c37631 #89827c #d1955c #7397b9 #fc9237 #a09f9c #fbc147 #9bb3ce #b7c9a1 #b5d29c #c4b9aa #cdc4a5 #d5c8a3 #c1d7aa #ccc4b6 #dbd19c #b2c4d5 #eae487 #c9c8c6 #e4db99 #c9dcb5 #dfd3ac #cbd2c2 #d6cdbc #dbd2b6 #c0ceda #ece597 #f7ef86 #d7d3c3 #dfcbc3 #d1d0cd #d1e2bf #d3dec1 #dbd3c4 #e6d8b6 #f4ef91 #d3d3cf #cad5de #ded7c9 #dfdbce #fcf993 #ffff8a #dbd9d7 #dbe7cd #d4dce2 #e4ded3 #ebe3c9 #e0e2e2 #f4edc3 #fdfcae #e9e5dc #f4edda #eeebe4 #fefdc5 #e7edf2 #edf4e5 #f2efe9 #f6ede7 #fefedd #f6f4f0 #f1f5f8 #fbfaf8 #ffffff]' - -expected_256 = '[Palette 256 colors #272727 #3c3c3c #484847 #564b41 #605243 #6a523e #555555 #785941 #5d5d5d #746856 #676767 #956740 #ba712e #787777 #cb752a #c27c3d #b68049 #dc8030 #df9e10 #878685 #e1a214 #928b82 #a88a70 #ea8834 #e7a81d #cb8d55 #909090 #94938c #e18f48 #f68d36 #6f94b7 #e1ab2e #8e959b #c79666 #999897 #ff9238 #ef9447 #a99a88 #f1b32c #919ca6 #a1a09f #f0b04b #8aa4bf #f8bc39 #b3ac8f #d1a67a #e3b857 #a8a8a7 #ffc345 #a2adb9 #afaeab #f9ab69 #afbba4 #c4c48a #b4b2af #dec177 #9ab2cf #a3bebb #d7b491 #b6cd9e #b5d29c #b9c8a2 #f1c969 #c5c79e #bbbab9 #cabdaa #a6bcd1 #cec4a7 #e7cc89 #dad98a #d5c9a3 #fabd8a #c1d7aa #cec5b4 #d1d1a5 #d9cf9f #c5c4c3 #d3c7b5 #ddd59d #b4c6d6 #d1cbb4 #d1c7ba #d7d1aa #e1c6ab #cbc7c2 #dbd0a9 #e8e58a #fee178 #d3cbba #dfd7a3 #d2cfb9 #c9ddb5 #d2cbbe #c3cbce #d7cbba #dcceb2 #dfd3aa #e5dd9a #dbd3b1 #ceccc6 #d7cbbe #d7cfba #dfc3be #dfd3ae #cbcbcb #cbd3c3 #d3cfc0 #e0d8aa #d7cfbe #dbd3b8 #ebe596 #dfd8b0 #c0ceda #f1ee89 #decfbc #d7cfc4 #d7d3c3 #d1d0cd #d2dfc0 #dbd3c3 #e7c7c3 #e7d7b3 #f2ed92 #d1e2bf #dad7c3 #fef383 #d3d3cf #dbd3c7 #e0d3c2 #dfd7c0 #ebe4a8 #dbd7c7 #dfd3c7 #f7f38f #c9d4de #dcdcc5 #dfd7c7 #e7d5c2 #d6d5d4 #faf78e #d7dfca #fbfb8a #fffb86 #dfd7cb #e5ddc0 #dad7d2 #ecd6c1 #cfd7de #e8d0cc #fbfb8e #fffb8a #eae3b8 #e3d7cd #dfdbce #fffb8e #ffff8a #f5efa6 #dae6cc #e3dbcf #edddc3 #dddbd6 #d5dbdf #ffff91 #e3dbd3 #fefc99 #e7dbd2 #eaddcd #e3dfd3 #ebd7d3 #dddddd #d4dee6 #e2dfd7 #fcdcc0 #e7dbd7 #e7dfd3 #ebe4cb #f4eeb8 #e3dfdb #e7dfd7 #ebded5 #e7e3d7 #fefea6 #e1ecd6 #ece5d3 #e7e3db #dee3e5 #ebe3db #efdfdb #efe3d8 #f4efc9 #e6ecdb #ebe3df #ebe7db #f0ecd3 #e5e6e5 #efe7da #ebe7df #efe3df #fefeb8 #dfe7ef #ebe7e3 #edebde #efe7e0 #e8efe0 #e7f3df #ebebe3 #e7ebe8 #f5edd9 #efebe3 #e3ebf1 #e9efe7 #ebebea #efebe7 #f0efe2 #ecf3e5 #fefdc9 #efefe7 #f3efe7 #f5f3e1 #f2efe9 #e9eef4 #ffeddf #efefef #f3efeb #f3f3eb #f0f7eb #fbf7e1 #fefed8 #f3f3ef #f7f3eb #eef3f7 #f7f7ea #f3f3f3 #f3f7ef #f7f3ef #f3f3f7 #f7f3f3 #f7f7ef #fffee3 #f3f7f7 #f7f7f3 #fcf7ee #f7f7f7 #f7fbf4 #f5f7fb #fbf7f6 #fffeef #f7fbfb #fbfbf7 #fbfbfb #fbfbff #fbfffb #fffbfb #fbffff #fffffb #ffffff]' - -expected_rgb = '[Palette 2 colors #ff00ff #ffffff]' - -def test_reading_palettes(): - act = open('../data/palettes/palette64.act','rb') - palette = mapnik.Palette(act.read(),'act') - eq_(palette.to_string(),expected_64); - act = open('../data/palettes/palette256.act','rb') - palette = mapnik.Palette(act.read(),'act') - eq_(palette.to_string(),expected_256); - palette = mapnik.Palette('\xff\x00\xff\xff\xff\xff', 'rgb') - eq_(palette.to_string(),expected_rgb); - -if 'shape' in mapnik.DatasourceCache.plugin_names(): - - def test_render_with_palette(): - m = mapnik.Map(600,400) - mapnik.load_map(m,'../data/good_maps/agg_poly_gamma_map.xml') - m.zoom_all() - im = mapnik.Image(m.width,m.height) - mapnik.render(m,im) - act = open('../data/palettes/palette256.act','rb') - palette = mapnik.Palette(act.read(),'act') - # test saving directly to filesystem - im.save('/tmp/mapnik-palette-test.png','png',palette) - expected = './images/support/mapnik-palette-test.png' - if os.environ.get('UPDATE'): - im.save(expected,"png",palette); - - # test saving to a string - open('/tmp/mapnik-palette-test2.png','wb').write(im.tostring('png',palette)); - # compare the two methods - eq_(mapnik.Image.open('/tmp/mapnik-palette-test.png').tostring('png32'),mapnik.Image.open('/tmp/mapnik-palette-test2.png').tostring('png32'),'%s not eq to %s' % ('/tmp/mapnik-palette-test.png','/tmp/mapnik-palette-test2.png')) - # compare to expected - eq_(mapnik.Image.open('/tmp/mapnik-palette-test.png').tostring('png32'),mapnik.Image.open(expected).tostring('png32'),'%s not eq to %s' % ('/tmp/mapnik-palette-test.png',expected)) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/parameters_test.py b/tests/python_tests/parameters_test.py deleted file mode 100644 index 1587fbdde..000000000 --- a/tests/python_tests/parameters_test.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -import sys -from nose.tools import eq_ -from utilities import execution_path, run_all -import mapnik - -def setup(): - os.chdir(execution_path('.')) - -def test_parameter_null(): - p = mapnik.Parameter('key',None) - eq_(p[0],'key') - eq_(p[1],None) - -def test_parameter_string(): - p = mapnik.Parameter('key','value') - eq_(p[0],'key') - eq_(p[1],'value') - -def test_parameter_unicode(): - p = mapnik.Parameter('key',u'value') - eq_(p[0],'key') - eq_(p[1],u'value') - -def test_parameter_integer(): - p = mapnik.Parameter('int',sys.maxint) - eq_(p[0],'int') - eq_(p[1],sys.maxint) - -def test_parameter_double(): - p = mapnik.Parameter('double',float(sys.maxint)) - eq_(p[0],'double') - eq_(p[1],float(sys.maxint)) - -def test_parameter_boolean(): - p = mapnik.Parameter('boolean',True) - eq_(p[0],'boolean') - eq_(p[1],True) - eq_(bool(p[1]),True) - - -def test_parameters(): - params = mapnik.Parameters() - p = mapnik.Parameter('float',1.0777) - eq_(p[0],'float') - eq_(p[1],1.0777) - - params.append(p) - - eq_(params[0][0],'float') - eq_(params[0][1],1.0777) - - eq_(params.get('float'),1.0777) - - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/pgraster_test.py b/tests/python_tests/pgraster_test.py deleted file mode 100644 index f635f8d5f..000000000 --- a/tests/python_tests/pgraster_test.py +++ /dev/null @@ -1,739 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_,assert_almost_equal -import atexit -import time -from utilities import execution_path, run_all -from subprocess import Popen, PIPE -import os, mapnik -import sys -import re -from binascii import hexlify - - -MAPNIK_TEST_DBNAME = 'mapnik-tmp-pgraster-test-db' -POSTGIS_TEMPLATE_DBNAME = 'template_postgis' -DEBUG_OUTPUT=False - -def log(msg): - if DEBUG_OUTPUT: - print msg - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def call(cmd,silent=False): - stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() - if not stderr: - return stdin.strip() - elif not silent and 'error' in stderr.lower() \ - or 'not found' in stderr.lower() \ - or 'could not connect' in stderr.lower() \ - or 'bad connection' in stderr.lower() \ - or 'not recognized as an internal' in stderr.lower(): - raise RuntimeError(stderr.strip()) - -def psql_can_connect(): - """Test ability to connect to a postgis template db with no options. - - Basically, to run these tests your user must have full read - access over unix sockets without supplying a password. This - keeps these tests simple and focused on postgis not on postgres - auth issues. - """ - try: - call('psql %s -c "select postgis_version()"' % POSTGIS_TEMPLATE_DBNAME) - return True - except RuntimeError: - print 'Notice: skipping pgraster tests (connection)' - return False - -def psql_run(cmd): - cmd = 'psql --set ON_ERROR_STOP=1 %s -c "%s"' % \ - (MAPNIK_TEST_DBNAME, cmd.replace('"', '\\"')) - log('DEBUG: running ' + cmd) - call(cmd) - -def raster2pgsql_on_path(): - """Test for presence of raster2pgsql on the user path. - - We require this program to load test data into a temporarily database. - """ - try: - call('raster2pgsql') - return True - except RuntimeError: - print 'Notice: skipping pgraster tests (raster2pgsql)' - return False - -def createdb_and_dropdb_on_path(): - """Test for presence of dropdb/createdb on user path. - - We require these programs to setup and teardown the testing db. - """ - try: - call('createdb --help') - call('dropdb --help') - return True - except RuntimeError: - print 'Notice: skipping pgraster tests (createdb/dropdb)' - return False - -def postgis_setup(): - call('dropdb %s' % MAPNIK_TEST_DBNAME,silent=True) - call('createdb -T %s %s' % (POSTGIS_TEMPLATE_DBNAME,MAPNIK_TEST_DBNAME),silent=False) - -def postgis_takedown(): - pass - # fails as the db is in use: https://github.com/mapnik/mapnik/issues/960 - #call('dropdb %s' % MAPNIK_TEST_DBNAME) - -def import_raster(filename, tabname, tilesize, constraint, overview): - log('tile: ' + tilesize + ' constraints: ' + str(constraint) \ - + ' overviews: ' + overview) - cmd = 'raster2pgsql -Y -I -q' - if constraint: - cmd += ' -C' - if tilesize: - cmd += ' -t ' + tilesize - if overview: - cmd += ' -l ' + overview - cmd += ' %s %s | psql --set ON_ERROR_STOP=1 -q %s' % (os.path.abspath(os.path.normpath(filename)),tabname,MAPNIK_TEST_DBNAME) - log('Import call: ' + cmd) - call(cmd) - -def drop_imported(tabname, overview): - psql_run('DROP TABLE IF EXISTS "' + tabname + '";') - if overview: - for of in overview.split(','): - psql_run('DROP TABLE IF EXISTS "o_' + of + '_' + tabname + '";') - -if 'pgraster' in mapnik.DatasourceCache.plugin_names() \ - and createdb_and_dropdb_on_path() \ - and psql_can_connect() \ - and raster2pgsql_on_path(): - - # initialize test database - postgis_setup() - - # [old]dataraster.tif, 2283x1913 int16 single-band - # dataraster-small.tif, 457x383 int16 single-band - def _test_dataraster_16bsi_rendering(lbl, overview, rescale, clip): - if rescale: - lbl += ' Sc' - if clip: - lbl += ' Cl' - ds = mapnik.PgRaster(dbname=MAPNIK_TEST_DBNAME,table='"dataRaster"', - band=1,use_overviews=1 if overview else 0, - prescale_rasters=rescale,clip_rasters=clip) - fs = ds.featureset() - feature = fs.next() - eq_(feature['rid'],1) - lyr = mapnik.Layer('dataraster_16bsi') - lyr.datasource = ds - expenv = mapnik.Box2d(-14637, 3903178, 1126863, 4859678) - env = lyr.envelope() - # As the input size is a prime number both horizontally - # and vertically, we expect the extent of the overview - # tables to be a pixel wider than the original, whereas - # the pixel size in geographical units depends on the - # overview factor. So we start with the original pixel size - # as base scale and multiply by the overview factor. - # NOTE: the overview table extent only grows north and east - pixsize = 500 # see gdalinfo dataraster.tif - pixsize = 2497 # see gdalinfo dataraster-small.tif - tol = pixsize * max(overview.split(',')) if overview else 0 - assert_almost_equal(env.minx, expenv.minx) - assert_almost_equal(env.miny, expenv.miny, delta=tol) - assert_almost_equal(env.maxx, expenv.maxx, delta=tol) - assert_almost_equal(env.maxy, expenv.maxy) - mm = mapnik.Map(256, 256) - style = mapnik.Style() - col = mapnik.RasterColorizer(); - col.default_mode = mapnik.COLORIZER_DISCRETE; - col.add_stop(0, mapnik.Color(0x40,0x40,0x40,255)); - col.add_stop(10, mapnik.Color(0x80,0x80,0x80,255)); - col.add_stop(20, mapnik.Color(0xa0,0xa0,0xa0,255)); - sym = mapnik.RasterSymbolizer() - sym.colorizer = col - rule = mapnik.Rule() - rule.symbols.append(sym) - style.rules.append(rule) - mm.append_style('foo', style) - lyr.styles.append('foo') - mm.layers.append(lyr) - mm.zoom_to_box(expenv) - im = mapnik.Image(mm.width, mm.height) - t0 = time.time() # we want wall time to include IO waits - mapnik.render(mm, im) - lap = time.time() - t0 - log('T ' + str(lap) + ' -- ' + lbl + ' E:full') - # no data - eq_(im.view(1,1,1,1).tostring(), '\x00\x00\x00\x00') - eq_(im.view(255,255,1,1).tostring(), '\x00\x00\x00\x00') - eq_(im.view(195,116,1,1).tostring(), '\x00\x00\x00\x00') - # A0A0A0 - eq_(im.view(100,120,1,1).tostring(), '\xa0\xa0\xa0\xff') - eq_(im.view( 75, 80,1,1).tostring(), '\xa0\xa0\xa0\xff') - # 808080 - eq_(im.view( 74,170,1,1).tostring(), '\x80\x80\x80\xff') - eq_(im.view( 30, 50,1,1).tostring(), '\x80\x80\x80\xff') - # 404040 - eq_(im.view(190, 70,1,1).tostring(), '\x40\x40\x40\xff') - eq_(im.view(140,170,1,1).tostring(), '\x40\x40\x40\xff') - - # Now zoom over a portion of the env (1/10) - newenv = mapnik.Box2d(273663,4024478,330738,4072303) - mm.zoom_to_box(newenv) - t0 = time.time() # we want wall time to include IO waits - mapnik.render(mm, im) - lap = time.time() - t0 - log('T ' + str(lap) + ' -- ' + lbl + ' E:1/10') - # nodata - eq_(hexlify(im.view(255,255,1,1).tostring()), '00000000') - eq_(hexlify(im.view(200,254,1,1).tostring()), '00000000') - # A0A0A0 - eq_(hexlify(im.view(90,232,1,1).tostring()), 'a0a0a0ff') - eq_(hexlify(im.view(96,245,1,1).tostring()), 'a0a0a0ff') - # 808080 - eq_(hexlify(im.view(1,1,1,1).tostring()), '808080ff') - eq_(hexlify(im.view(128,128,1,1).tostring()), '808080ff') - # 404040 - eq_(hexlify(im.view(255, 0,1,1).tostring()), '404040ff') - - def _test_dataraster_16bsi(lbl, tilesize, constraint, overview): - import_raster('../data/raster/dataraster-small.tif', 'dataRaster', tilesize, constraint, overview) - if constraint: - lbl += ' C' - if tilesize: - lbl += ' T:' + tilesize - if overview: - lbl += ' O:' + overview - for prescale in [0,1]: - for clip in [0,1]: - _test_dataraster_16bsi_rendering(lbl, overview, prescale, clip) - drop_imported('dataRaster', overview) - - def test_dataraster_16bsi(): - #for tilesize in ['','256x256']: - for tilesize in ['256x256']: - for constraint in [0,1]: - #for overview in ['','4','2,16']: - for overview in ['','2']: - _test_dataraster_16bsi('data_16bsi', tilesize, constraint, overview) - - # river.tiff, RGBA 8BUI - def _test_rgba_8bui_rendering(lbl, overview, rescale, clip): - if rescale: - lbl += ' Sc' - if clip: - lbl += ' Cl' - ds = mapnik.PgRaster(dbname=MAPNIK_TEST_DBNAME,table='(select * from "River") foo', - use_overviews=1 if overview else 0, - prescale_rasters=rescale,clip_rasters=clip) - fs = ds.featureset() - feature = fs.next() - eq_(feature['rid'],1) - lyr = mapnik.Layer('rgba_8bui') - lyr.datasource = ds - expenv = mapnik.Box2d(0, -210, 256, 0) - env = lyr.envelope() - # As the input size is a prime number both horizontally - # and vertically, we expect the extent of the overview - # tables to be a pixel wider than the original, whereas - # the pixel size in geographical units depends on the - # overview factor. So we start with the original pixel size - # as base scale and multiply by the overview factor. - # NOTE: the overview table extent only grows north and east - pixsize = 1 # see gdalinfo river.tif - tol = pixsize * max(overview.split(',')) if overview else 0 - assert_almost_equal(env.minx, expenv.minx) - assert_almost_equal(env.miny, expenv.miny, delta=tol) - assert_almost_equal(env.maxx, expenv.maxx, delta=tol) - assert_almost_equal(env.maxy, expenv.maxy) - mm = mapnik.Map(256, 256) - style = mapnik.Style() - sym = mapnik.RasterSymbolizer() - rule = mapnik.Rule() - rule.symbols.append(sym) - style.rules.append(rule) - mm.append_style('foo', style) - lyr.styles.append('foo') - mm.layers.append(lyr) - mm.zoom_to_box(expenv) - im = mapnik.Image(mm.width, mm.height) - t0 = time.time() # we want wall time to include IO waits - mapnik.render(mm, im) - lap = time.time() - t0 - log('T ' + str(lap) + ' -- ' + lbl + ' E:full') - #im.save('/tmp/xfull.png') # for debugging - # no data - eq_(hexlify(im.view(3,3,1,1).tostring()), '00000000') - eq_(hexlify(im.view(250,250,1,1).tostring()), '00000000') - # full opaque river color - eq_(hexlify(im.view(175,118,1,1).tostring()), 'b9d8f8ff') - # half-transparent pixel - pxstr = hexlify(im.view(122,138,1,1).tostring()) - apat = ".*(..)$" - match = re.match(apat, pxstr) - assert match, 'pixel ' + pxstr + ' does not match pattern ' + apat - alpha = match.group(1) - assert alpha != 'ff' and alpha != '00', \ - 'unexpected full transparent/opaque pixel: ' + alpha - - # Now zoom over a portion of the env (1/10) - newenv = mapnik.Box2d(166,-105,191,-77) - mm.zoom_to_box(newenv) - t0 = time.time() # we want wall time to include IO waits - mapnik.render(mm, im) - lap = time.time() - t0 - log('T ' + str(lap) + ' -- ' + lbl + ' E:1/10') - #im.save('/tmp/xtenth.png') # for debugging - # no data - eq_(hexlify(im.view(255,255,1,1).tostring()), '00000000') - eq_(hexlify(im.view(200,40,1,1).tostring()), '00000000') - # full opaque river color - eq_(hexlify(im.view(100,168,1,1).tostring()), 'b9d8f8ff') - # half-transparent pixel - pxstr = hexlify(im.view(122,138,1,1).tostring()) - apat = ".*(..)$" - match = re.match(apat, pxstr) - assert match, 'pixel ' + pxstr + ' does not match pattern ' + apat - alpha = match.group(1) - assert alpha != 'ff' and alpha != '00', \ - 'unexpected full transparent/opaque pixel: ' + alpha - - def _test_rgba_8bui(lbl, tilesize, constraint, overview): - import_raster('../data/raster/river.tiff', 'River', tilesize, constraint, overview) - if constraint: - lbl += ' C' - if tilesize: - lbl += ' T:' + tilesize - if overview: - lbl += ' O:' + overview - for prescale in [0,1]: - for clip in [0,1]: - _test_rgba_8bui_rendering(lbl, overview, prescale, clip) - drop_imported('River', overview) - - def test_rgba_8bui(): - for tilesize in ['','16x16']: - for constraint in [0,1]: - for overview in ['2']: - _test_rgba_8bui('rgba_8bui', tilesize, constraint, overview) - - # nodata-edge.tif, RGB 8BUI - def _test_rgb_8bui_rendering(lbl, tnam, overview, rescale, clip): - if rescale: - lbl += ' Sc' - if clip: - lbl += ' Cl' - ds = mapnik.PgRaster(dbname=MAPNIK_TEST_DBNAME,table=tnam, - use_overviews=1 if overview else 0, - prescale_rasters=rescale,clip_rasters=clip) - fs = ds.featureset() - feature = fs.next() - eq_(feature['rid'],1) - lyr = mapnik.Layer('rgba_8bui') - lyr.datasource = ds - expenv = mapnik.Box2d(-12329035.7652168,4508650.39854396, \ - -12328653.0279471,4508957.34625536) - env = lyr.envelope() - # As the input size is a prime number both horizontally - # and vertically, we expect the extent of the overview - # tables to be a pixel wider than the original, whereas - # the pixel size in geographical units depends on the - # overview factor. So we start with the original pixel size - # as base scale and multiply by the overview factor. - # NOTE: the overview table extent only grows north and east - pixsize = 2 # see gdalinfo nodata-edge.tif - tol = pixsize * max(overview.split(',')) if overview else 0 - assert_almost_equal(env.minx, expenv.minx, places=0) - assert_almost_equal(env.miny, expenv.miny, delta=tol) - assert_almost_equal(env.maxx, expenv.maxx, delta=tol) - assert_almost_equal(env.maxy, expenv.maxy, places=0) - mm = mapnik.Map(256, 256) - style = mapnik.Style() - sym = mapnik.RasterSymbolizer() - rule = mapnik.Rule() - rule.symbols.append(sym) - style.rules.append(rule) - mm.append_style('foo', style) - lyr.styles.append('foo') - mm.layers.append(lyr) - mm.zoom_to_box(expenv) - im = mapnik.Image(mm.width, mm.height) - t0 = time.time() # we want wall time to include IO waits - mapnik.render(mm, im) - lap = time.time() - t0 - log('T ' + str(lap) + ' -- ' + lbl + ' E:full') - #im.save('/tmp/xfull.png') # for debugging - # no data - eq_(hexlify(im.view(3,16,1,1).tostring()), '00000000') - eq_(hexlify(im.view(128,16,1,1).tostring()), '00000000') - eq_(hexlify(im.view(250,16,1,1).tostring()), '00000000') - eq_(hexlify(im.view(3,240,1,1).tostring()), '00000000') - eq_(hexlify(im.view(128,240,1,1).tostring()), '00000000') - eq_(hexlify(im.view(250,240,1,1).tostring()), '00000000') - # dark brown - eq_(hexlify(im.view(174,39,1,1).tostring()), 'c3a698ff') - # dark gray - eq_(hexlify(im.view(195,132,1,1).tostring()), '575f62ff') - # Now zoom over a portion of the env (1/10) - newenv = mapnik.Box2d(-12329035.7652168, 4508926.651484220, \ - -12328997.49148983,4508957.34625536) - mm.zoom_to_box(newenv) - t0 = time.time() # we want wall time to include IO waits - mapnik.render(mm, im) - lap = time.time() - t0 - log('T ' + str(lap) + ' -- ' + lbl + ' E:1/10') - #im.save('/tmp/xtenth.png') # for debugging - # no data - eq_(hexlify(im.view(3,16,1,1).tostring()), '00000000') - eq_(hexlify(im.view(128,16,1,1).tostring()), '00000000') - eq_(hexlify(im.view(250,16,1,1).tostring()), '00000000') - # black - eq_(hexlify(im.view(3,42,1,1).tostring()), '000000ff') - eq_(hexlify(im.view(3,134,1,1).tostring()), '000000ff') - eq_(hexlify(im.view(3,244,1,1).tostring()), '000000ff') - # gray - eq_(hexlify(im.view(135,157,1,1).tostring()), '4e555bff') - # brown - eq_(hexlify(im.view(195,223,1,1).tostring()), 'f2cdbaff') - - def _test_rgb_8bui(lbl, tilesize, constraint, overview): - tnam = 'nodataedge' - import_raster('../data/raster/nodata-edge.tif', tnam, tilesize, constraint, overview) - if constraint: - lbl += ' C' - if tilesize: - lbl += ' T:' + tilesize - if overview: - lbl += ' O:' + overview - for prescale in [0,1]: - for clip in [0,1]: - _test_rgb_8bui_rendering(lbl, tnam, overview, prescale, clip) - #drop_imported(tnam, overview) - - def test_rgb_8bui(): - for tilesize in ['64x64']: - for constraint in [1]: - for overview in ['']: - _test_rgb_8bui('rgb_8bui', tilesize, constraint, overview) - - def _test_grayscale_subquery(lbl,pixtype,value): - # - # 3 8 13 - # +---+---+---+ - # 3 | v | v | v | NOTE: writes different color - # +---+---+---+ in 13,8 and 8,13 - # 8 | v | v | a | - # +---+---+---+ - # 13 | v | b | v | - # +---+---+---+ - # - val_a = value/3; - val_b = val_a*2; - sql = "(select 3 as i, " \ - " ST_SetValues(" \ - " ST_SetValues(" \ - " ST_AsRaster(" \ - " ST_MakeEnvelope(0,0,14,14), " \ - " 1.0, -1.0, '%s', %s" \ - " ), " \ - " 11, 6, 4, 5, %s::float8" \ - " )," \ - " 6, 11, 5, 4, %s::float8" \ - " ) as \"R\"" \ - ") as foo" % (pixtype,value, val_a, val_b) - rescale = 0 - clip = 0 - if rescale: - lbl += ' Sc' - if clip: - lbl += ' Cl' - ds = mapnik.PgRaster(dbname=MAPNIK_TEST_DBNAME, table=sql, - raster_field='"R"', use_overviews=1, - prescale_rasters=rescale,clip_rasters=clip) - fs = ds.featureset() - feature = fs.next() - eq_(feature['i'],3) - lyr = mapnik.Layer('grayscale_subquery') - lyr.datasource = ds - expenv = mapnik.Box2d(0,0,14,14) - env = lyr.envelope() - assert_almost_equal(env.minx, expenv.minx, places=0) - assert_almost_equal(env.miny, expenv.miny, places=0) - assert_almost_equal(env.maxx, expenv.maxx, places=0) - assert_almost_equal(env.maxy, expenv.maxy, places=0) - mm = mapnik.Map(15, 15) - style = mapnik.Style() - sym = mapnik.RasterSymbolizer() - rule = mapnik.Rule() - rule.symbols.append(sym) - style.rules.append(rule) - mm.append_style('foo', style) - lyr.styles.append('foo') - mm.layers.append(lyr) - mm.zoom_to_box(expenv) - im = mapnik.Image(mm.width, mm.height) - t0 = time.time() # we want wall time to include IO waits - mapnik.render(mm, im) - lap = time.time() - t0 - log('T ' + str(lap) + ' -- ' + lbl + ' E:full') - #im.save('/tmp/xfull.png') # for debugging - h = format(value, '02x') - hex_v = h+h+h+'ff' - h = format(val_a, '02x') - hex_a = h+h+h+'ff' - h = format(val_b, '02x') - hex_b = h+h+h+'ff' - eq_(hexlify(im.view( 3, 3,1,1).tostring()), hex_v); - eq_(hexlify(im.view( 8, 3,1,1).tostring()), hex_v); - eq_(hexlify(im.view(13, 3,1,1).tostring()), hex_v); - eq_(hexlify(im.view( 3, 8,1,1).tostring()), hex_v); - eq_(hexlify(im.view( 8, 8,1,1).tostring()), hex_v); - eq_(hexlify(im.view(13, 8,1,1).tostring()), hex_a); - eq_(hexlify(im.view( 3,13,1,1).tostring()), hex_v); - eq_(hexlify(im.view( 8,13,1,1).tostring()), hex_b); - eq_(hexlify(im.view(13,13,1,1).tostring()), hex_v); - - def test_grayscale_2bui_subquery(): - _test_grayscale_subquery('grayscale_2bui_subquery', '2BUI', 3) - - def test_grayscale_4bui_subquery(): - _test_grayscale_subquery('grayscale_4bui_subquery', '4BUI', 15) - - def test_grayscale_8bui_subquery(): - _test_grayscale_subquery('grayscale_8bui_subquery', '8BUI', 63) - - def test_grayscale_8bsi_subquery(): - # NOTE: we're using a positive integer because Mapnik - # does not support negative data values anyway - _test_grayscale_subquery('grayscale_8bsi_subquery', '8BSI', 69) - - def test_grayscale_16bui_subquery(): - _test_grayscale_subquery('grayscale_16bui_subquery', '16BUI', 126) - - def test_grayscale_16bsi_subquery(): - # NOTE: we're using a positive integer because Mapnik - # does not support negative data values anyway - _test_grayscale_subquery('grayscale_16bsi_subquery', '16BSI', 144) - - def test_grayscale_32bui_subquery(): - _test_grayscale_subquery('grayscale_32bui_subquery', '32BUI', 255) - - def test_grayscale_32bsi_subquery(): - # NOTE: we're using a positive integer because Mapnik - # does not support negative data values anyway - _test_grayscale_subquery('grayscale_32bsi_subquery', '32BSI', 129) - - def _test_data_subquery(lbl, pixtype, value): - # - # 3 8 13 - # +---+---+---+ - # 3 | v | v | v | NOTE: writes different values - # +---+---+---+ in 13,8 and 8,13 - # 8 | v | v | a | - # +---+---+---+ - # 13 | v | b | v | - # +---+---+---+ - # - val_a = value/3; - val_b = val_a*2; - sql = "(select 3 as i, " \ - " ST_SetValues(" \ - " ST_SetValues(" \ - " ST_AsRaster(" \ - " ST_MakeEnvelope(0,0,14,14), " \ - " 1.0, -1.0, '%s', %s" \ - " ), " \ - " 11, 6, 5, 5, %s::float8" \ - " )," \ - " 6, 11, 5, 5, %s::float8" \ - " ) as \"R\"" \ - ") as foo" % (pixtype,value, val_a, val_b) - overview = '' - rescale = 0 - clip = 0 - if rescale: - lbl += ' Sc' - if clip: - lbl += ' Cl' - ds = mapnik.PgRaster(dbname=MAPNIK_TEST_DBNAME, table=sql, - raster_field='R', use_overviews=0 if overview else 0, - band=1, prescale_rasters=rescale, clip_rasters=clip) - fs = ds.featureset() - feature = fs.next() - eq_(feature['i'],3) - lyr = mapnik.Layer('data_subquery') - lyr.datasource = ds - expenv = mapnik.Box2d(0,0,14,14) - env = lyr.envelope() - assert_almost_equal(env.minx, expenv.minx, places=0) - assert_almost_equal(env.miny, expenv.miny, places=0) - assert_almost_equal(env.maxx, expenv.maxx, places=0) - assert_almost_equal(env.maxy, expenv.maxy, places=0) - mm = mapnik.Map(15, 15) - style = mapnik.Style() - col = mapnik.RasterColorizer(); - col.default_mode = mapnik.COLORIZER_DISCRETE; - col.add_stop(val_a, mapnik.Color(0xff,0x00,0x00,255)); - col.add_stop(val_b, mapnik.Color(0x00,0xff,0x00,255)); - col.add_stop(value, mapnik.Color(0x00,0x00,0xff,255)); - sym = mapnik.RasterSymbolizer() - sym.colorizer = col - rule = mapnik.Rule() - rule.symbols.append(sym) - style.rules.append(rule) - mm.append_style('foo', style) - lyr.styles.append('foo') - mm.layers.append(lyr) - mm.zoom_to_box(expenv) - im = mapnik.Image(mm.width, mm.height) - t0 = time.time() # we want wall time to include IO waits - mapnik.render(mm, im) - lap = time.time() - t0 - log('T ' + str(lap) + ' -- ' + lbl + ' E:full') - - def test_data_2bui_subquery(): - _test_data_subquery('data_2bui_subquery', '2BUI', 3) - - def test_data_4bui_subquery(): - _test_data_subquery('data_4bui_subquery', '4BUI', 15) - - def test_data_8bui_subquery(): - _test_data_subquery('data_8bui_subquery', '8BUI', 63) - - def test_data_8bsi_subquery(): - # NOTE: we're using a positive integer because Mapnik - # does not support negative data values anyway - _test_data_subquery('data_8bsi_subquery', '8BSI', 69) - - def test_data_16bui_subquery(): - _test_data_subquery('data_16bui_subquery', '16BUI', 126) - - def test_data_16bsi_subquery(): - # NOTE: we're using a positive integer because Mapnik - # does not support negative data values anyway - _test_data_subquery('data_16bsi_subquery', '16BSI', 135) - - def test_data_32bui_subquery(): - _test_data_subquery('data_32bui_subquery', '32BUI', 255) - - def test_data_32bsi_subquery(): - # NOTE: we're using a positive integer because Mapnik - # does not support negative data values anyway - _test_data_subquery('data_32bsi_subquery', '32BSI', 264) - - def test_data_32bf_subquery(): - _test_data_subquery('data_32bf_subquery', '32BF', 450) - - def test_data_64bf_subquery(): - _test_data_subquery('data_64bf_subquery', '64BF', 3072) - - def _test_rgba_subquery(lbl, pixtype, r, g, b, a, g1, b1): - # - # 3 8 13 - # +---+---+---+ - # 3 | v | v | h | NOTE: writes different alpha - # +---+---+---+ in 13,8 and 8,13 - # 8 | v | v | a | - # +---+---+---+ - # 13 | v | b | v | - # +---+---+---+ - # - sql = "(select 3 as i, " \ - " ST_SetValues(" \ - " ST_SetValues(" \ - " ST_AddBand(" \ - " ST_AddBand(" \ - " ST_AddBand(" \ - " ST_AsRaster(" \ - " ST_MakeEnvelope(0,0,14,14), " \ - " 1.0, -1.0, '%s', %s" \ - " )," \ - " '%s', %d::float" \ - " ), " \ - " '%s', %d::float" \ - " ), " \ - " '%s', %d::float" \ - " ), " \ - " 2, 11, 6, 4, 5, %s::float8" \ - " )," \ - " 3, 6, 11, 5, 4, %s::float8" \ - " ) as r" \ - ") as foo" % (pixtype, r, pixtype, g, pixtype, b, pixtype, a, g1, b1) - overview = '' - rescale = 0 - clip = 0 - if rescale: - lbl += ' Sc' - if clip: - lbl += ' Cl' - ds = mapnik.PgRaster(dbname=MAPNIK_TEST_DBNAME, table=sql, - raster_field='r', use_overviews=0 if overview else 0, - prescale_rasters=rescale, clip_rasters=clip) - fs = ds.featureset() - feature = fs.next() - eq_(feature['i'],3) - lyr = mapnik.Layer('rgba_subquery') - lyr.datasource = ds - expenv = mapnik.Box2d(0,0,14,14) - env = lyr.envelope() - assert_almost_equal(env.minx, expenv.minx, places=0) - assert_almost_equal(env.miny, expenv.miny, places=0) - assert_almost_equal(env.maxx, expenv.maxx, places=0) - assert_almost_equal(env.maxy, expenv.maxy, places=0) - mm = mapnik.Map(15, 15) - style = mapnik.Style() - sym = mapnik.RasterSymbolizer() - rule = mapnik.Rule() - rule.symbols.append(sym) - style.rules.append(rule) - mm.append_style('foo', style) - lyr.styles.append('foo') - mm.layers.append(lyr) - mm.zoom_to_box(expenv) - im = mapnik.Image(mm.width, mm.height) - t0 = time.time() # we want wall time to include IO waits - mapnik.render(mm, im) - lap = time.time() - t0 - log('T ' + str(lap) + ' -- ' + lbl + ' E:full') - im.save('/tmp/xfull.png') # for debugging - hex_v = format(r << 24 | g << 16 | b << 8 | a, '08x') - hex_a = format(r << 24 | g1 << 16 | b << 8 | a, '08x') - hex_b = format(r << 24 | g << 16 | b1 << 8 | a, '08x') - eq_(hexlify(im.view( 3, 3,1,1).tostring()), hex_v); - eq_(hexlify(im.view( 8, 3,1,1).tostring()), hex_v); - eq_(hexlify(im.view(13, 3,1,1).tostring()), hex_v); - eq_(hexlify(im.view( 3, 8,1,1).tostring()), hex_v); - eq_(hexlify(im.view( 8, 8,1,1).tostring()), hex_v); - eq_(hexlify(im.view(13, 8,1,1).tostring()), hex_a); - eq_(hexlify(im.view( 3,13,1,1).tostring()), hex_v); - eq_(hexlify(im.view( 8,13,1,1).tostring()), hex_b); - eq_(hexlify(im.view(13,13,1,1).tostring()), hex_v); - - def test_rgba_8bui_subquery(): - _test_rgba_subquery('rgba_8bui_subquery', '8BUI', 255, 0, 0, 255, 255, 255) - - #def test_rgba_16bui_subquery(): - # _test_rgba_subquery('rgba_16bui_subquery', '16BUI', 65535, 0, 0, 65535, 65535, 65535) - - #def test_rgba_32bui_subquery(): - # _test_rgba_subquery('rgba_32bui_subquery', '32BUI') - - atexit.register(postgis_takedown) - -def enabled(tname): - enabled = len(sys.argv) < 2 or tname in sys.argv - if not enabled: - print "Skipping " + tname + " as not explicitly enabled" - return enabled - -if __name__ == "__main__": - setup() - fail = run_all(eval(x) for x in dir() if x.startswith("test_") and enabled(x)) - exit(fail) diff --git a/tests/python_tests/pickling_test.py b/tests/python_tests/pickling_test.py deleted file mode 100644 index 7a3572d11..000000000 --- a/tests/python_tests/pickling_test.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -from nose.tools import eq_ -from utilities import execution_path, run_all - -import mapnik, pickle - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def test_color_pickle(): - c = mapnik.Color('blue') - - eq_(pickle.loads(pickle.dumps(c)), c) - - c = mapnik.Color(0, 64, 128) - - eq_(pickle.loads(pickle.dumps(c)), c) - - c = mapnik.Color(0, 64, 128, 192) - - eq_(pickle.loads(pickle.dumps(c)), c) - -def test_envelope_pickle(): - e = mapnik.Box2d(100, 100, 200, 200) - - eq_(pickle.loads(pickle.dumps(e)), e) - -def test_parameters_pickle(): - params = mapnik.Parameters() - params.append(mapnik.Parameter('oh',str('yeah'))) - - params2 = pickle.loads(pickle.dumps(params,pickle.HIGHEST_PROTOCOL)) - - eq_(params[0][0],params2[0][0]) - eq_(params[0][1],params2[0][1]) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/png_encoding_test.py b/tests/python_tests/png_encoding_test.py deleted file mode 100644 index 27c7f1f2f..000000000 --- a/tests/python_tests/png_encoding_test.py +++ /dev/null @@ -1,218 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os, mapnik -from nose.tools import eq_ -from utilities import execution_path, run_all - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -if mapnik.has_png(): - tmp_dir = '/tmp/mapnik-png/' - if not os.path.exists(tmp_dir): - os.makedirs(tmp_dir) - - opts = [ - 'png32', - 'png32:t=0', - 'png8:m=o', - 'png8:m=o:c=1', - 'png8:m=o:t=0', - 'png8:m=o:c=1:t=0', - 'png8:m=o:t=1', - 'png8:m=o:t=2', - 'png8:m=h', - 'png8:m=h:c=1', - 'png8:m=h:t=0', - 'png8:m=h:c=1:t=0', - 'png8:m=h:t=1', - 'png8:m=h:t=2', - 'png32:e=miniz', - 'png8:e=miniz' - ] - - # Todo - use itertools.product - #z_opts = range(1,9+1) - #t_opts = range(0,2+1) - - def gen_filepath(name,format): - return os.path.join('images/support/encoding-opts',name+'-'+format.replace(":","+")+'.png') - - generate = os.environ.get('UPDATE') - - def test_expected_encodings(): - # blank image - im = mapnik.Image(256,256) - for opt in opts: - expected = gen_filepath('solid',opt) - actual = os.path.join(tmp_dir,os.path.basename(expected)) - if generate or not os.path.exists(expected): - print 'generating expected image %s' % expected - im.save(expected,opt) - else: - im.save(actual,opt) - eq_(mapnik.Image.open(actual).tostring('png32'), - mapnik.Image.open(expected).tostring('png32'), - '%s (actual) not == to %s (expected)' % (actual,expected)) - - # solid image - im.background = mapnik.Color('green'); - for opt in opts: - expected = gen_filepath('blank',opt) - actual = os.path.join(tmp_dir,os.path.basename(expected)) - if generate or not os.path.exists(expected): - print 'generating expected image %s' % expected - im.save(expected,opt) - else: - im.save(actual,opt) - eq_(mapnik.Image.open(actual).tostring('png32'), - mapnik.Image.open(expected).tostring('png32'), - '%s (actual) not == to %s (expected)' % (actual,expected)) - - # aerial - im = mapnik.Image.open('./images/support/transparency/aerial_rgba.png') - for opt in opts: - expected = gen_filepath('aerial_rgba',opt) - actual = os.path.join(tmp_dir,os.path.basename(expected)) - if generate or not os.path.exists(expected): - print 'generating expected image %s' % expected - im.save(expected,opt) - else: - im.save(actual,opt) - eq_(mapnik.Image.open(actual).tostring('png32'), - mapnik.Image.open(expected).tostring('png32'), - '%s (actual) not == to %s (expected)' % (actual,expected)) - - def test_transparency_levels(): - # create partial transparency image - im = mapnik.Image(256,256) - im.background = mapnik.Color('rgba(255,255,255,.5)') - c2 = mapnik.Color('rgba(255,255,0,.2)') - c3 = mapnik.Color('rgb(0,255,255)') - for y in range(0,im.height()/2): - for x in range(0,im.width()/2): - im.set_pixel(x,y,c2) - for y in range(im.height()/2,im.height()): - for x in range(im.width()/2,im.width()): - im.set_pixel(x,y,c3) - - t0 = tmp_dir + 'white0.png' - t2 = tmp_dir + 'white2.png' - t1 = tmp_dir + 'white1.png' - - # octree - format = 'png8:m=o:t=0' - im.save(t0,format) - im_in = mapnik.Image.open(t0) - t0_len = len(im_in.tostring(format)) - eq_(t0_len,len(mapnik.Image.open('images/support/transparency/white0.png').tostring(format))) - format = 'png8:m=o:t=1' - im.save(t1,format) - im_in = mapnik.Image.open(t1) - t1_len = len(im_in.tostring(format)) - eq_(len(im.tostring(format)),len(mapnik.Image.open('images/support/transparency/white1.png').tostring(format))) - format = 'png8:m=o:t=2' - im.save(t2,format) - im_in = mapnik.Image.open(t2) - t2_len = len(im_in.tostring(format)) - eq_(len(im.tostring(format)),len(mapnik.Image.open('images/support/transparency/white2.png').tostring(format))) - - eq_(t0_len < t1_len < t2_len,True) - - # hextree - format = 'png8:m=h:t=0' - im.save(t0,format) - im_in = mapnik.Image.open(t0) - t0_len = len(im_in.tostring(format)) - eq_(t0_len,len(mapnik.Image.open('images/support/transparency/white0.png').tostring(format))) - format = 'png8:m=h:t=1' - im.save(t1,format) - im_in = mapnik.Image.open(t1) - t1_len = len(im_in.tostring(format)) - eq_(len(im.tostring(format)),len(mapnik.Image.open('images/support/transparency/white1.png').tostring(format))) - format = 'png8:m=h:t=2' - im.save(t2,format) - im_in = mapnik.Image.open(t2) - t2_len = len(im_in.tostring(format)) - eq_(len(im.tostring(format)),len(mapnik.Image.open('images/support/transparency/white2.png').tostring(format))) - - eq_(t0_len < t1_len < t2_len,True) - - def test_transparency_levels_aerial(): - im = mapnik.Image.open('../data/images/12_654_1580.png') - im_in = mapnik.Image.open('./images/support/transparency/aerial_rgba.png') - eq_(len(im.tostring('png8')),len(im_in.tostring('png8'))) - eq_(len(im.tostring('png32')),len(im_in.tostring('png32'))) - - im_in = mapnik.Image.open('./images/support/transparency/aerial_rgb.png') - eq_(len(im.tostring('png32')),len(im_in.tostring('png32'))) - eq_(len(im.tostring('png32:t=0')),len(im_in.tostring('png32:t=0'))) - eq_(len(im.tostring('png32:t=0')) == len(im_in.tostring('png32')), False) - eq_(len(im.tostring('png8')),len(im_in.tostring('png8'))) - eq_(len(im.tostring('png8:t=0')),len(im_in.tostring('png8:t=0'))) - # unlike png32 paletted images without alpha will look the same even if no alpha is forced - eq_(len(im.tostring('png8:t=0')) == len(im_in.tostring('png8')), True) - eq_(len(im.tostring('png8:t=0:m=o')) == len(im_in.tostring('png8:m=o')), True) - - def test_9_colors_hextree(): - expected = './images/support/encoding-opts/png8-9cols.png' - im = mapnik.Image.open(expected) - t0 = tmp_dir + 'png-encoding-9-colors.result-hextree.png' - im.save(t0, 'png8:m=h') - eq_(mapnik.Image.open(t0).tostring(), - mapnik.Image.open(expected).tostring(), - '%s (actual) not == to %s (expected)' % (t0, expected)) - - def test_9_colors_octree(): - expected = './images/support/encoding-opts/png8-9cols.png' - im = mapnik.Image.open(expected) - t0 = tmp_dir + 'png-encoding-9-colors.result-octree.png' - im.save(t0, 'png8:m=o') - eq_(mapnik.Image.open(t0).tostring(), - mapnik.Image.open(expected).tostring(), - '%s (actual) not == to %s (expected)' % (t0, expected)) - - def test_17_colors_hextree(): - expected = './images/support/encoding-opts/png8-17cols.png' - im = mapnik.Image.open(expected) - t0 = tmp_dir + 'png-encoding-17-colors.result-hextree.png' - im.save(t0, 'png8:m=h') - eq_(mapnik.Image.open(t0).tostring(), - mapnik.Image.open(expected).tostring(), - '%s (actual) not == to %s (expected)' % (t0, expected)) - - def test_17_colors_octree(): - expected = './images/support/encoding-opts/png8-17cols.png' - im = mapnik.Image.open(expected) - t0 = tmp_dir + 'png-encoding-17-colors.result-octree.png' - im.save(t0, 'png8:m=o') - eq_(mapnik.Image.open(t0).tostring(), - mapnik.Image.open(expected).tostring(), - '%s (actual) not == to %s (expected)' % (t0, expected)) - - def test_2px_regression_hextree(): - im = mapnik.Image.open('./images/support/encoding-opts/png8-2px.A.png') - expected = './images/support/encoding-opts/png8-2px.png' - - t0 = tmp_dir + 'png-encoding-2px.result-hextree.png' - im.save(t0, 'png8:m=h') - eq_(mapnik.Image.open(t0).tostring(), - mapnik.Image.open(expected).tostring(), - '%s (actual) not == to %s (expected)' % (t0, expected)) - - def test_2px_regression_octree(): - im = mapnik.Image.open('./images/support/encoding-opts/png8-2px.A.png') - expected = './images/support/encoding-opts/png8-2px.png' - t0 = tmp_dir + 'png-encoding-2px.result-octree.png' - im.save(t0, 'png8:m=o') - eq_(mapnik.Image.open(t0).tostring(), - mapnik.Image.open(expected).tostring(), - '%s (actual) not == to %s (expected)' % (t0, expected)) - - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/pngsuite_test.py b/tests/python_tests/pngsuite_test.py deleted file mode 100644 index 4c933eb2d..000000000 --- a/tests/python_tests/pngsuite_test.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python - -import os -import mapnik -from nose.tools import assert_raises -from utilities import execution_path, run_all - -datadir = '../data/pngsuite' - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def assert_broken_file(fname): - assert_raises(RuntimeError, lambda: mapnik.Image.open(fname)) - -def assert_good_file(fname): - assert mapnik.Image.open(fname) - -def get_pngs(good): - files = [ x for x in os.listdir(datadir) if x.endswith('.png') ] - return [ os.path.join(datadir, x) for x in files if good != x.startswith('x') ] - -def test_good_pngs(): - for x in get_pngs(True): - yield assert_good_file, x - -def test_broken_pngs(): - for x in get_pngs(False): - yield assert_broken_file, x - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/postgis_test.py b/tests/python_tests/postgis_test.py deleted file mode 100644 index d3e3ebe3a..000000000 --- a/tests/python_tests/postgis_test.py +++ /dev/null @@ -1,1166 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_,raises -import atexit -from utilities import execution_path, run_all -from subprocess import Popen, PIPE -import os, mapnik -import threading - - -MAPNIK_TEST_DBNAME = 'mapnik-tmp-postgis-test-db' -POSTGIS_TEMPLATE_DBNAME = 'template_postgis' -SHAPEFILE = os.path.join(execution_path('.'),'../data/shp/world_merc.shp') - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def call(cmd,silent=False): - stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() - if not stderr: - return stdin.strip() - elif not silent and 'error' in stderr.lower() \ - or 'not found' in stderr.lower() \ - or 'could not connect' in stderr.lower() \ - or 'bad connection' in stderr.lower() \ - or 'not recognized as an internal' in stderr.lower(): - raise RuntimeError(stderr.strip()) - -def psql_can_connect(): - """Test ability to connect to a postgis template db with no options. - - Basically, to run these tests your user must have full read - access over unix sockets without supplying a password. This - keeps these tests simple and focused on postgis not on postgres - auth issues. - """ - try: - call('psql %s -c "select postgis_version()"' % POSTGIS_TEMPLATE_DBNAME) - return True - except RuntimeError: - print 'Notice: skipping postgis tests (connection)' - return False - -def shp2pgsql_on_path(): - """Test for presence of shp2pgsql on the user path. - - We require this program to load test data into a temporarily database. - """ - try: - call('shp2pgsql') - return True - except RuntimeError: - print 'Notice: skipping postgis tests (shp2pgsql)' - return False - -def createdb_and_dropdb_on_path(): - """Test for presence of dropdb/createdb on user path. - - We require these programs to setup and teardown the testing db. - """ - try: - call('createdb --help') - call('dropdb --help') - return True - except RuntimeError: - print 'Notice: skipping postgis tests (createdb/dropdb)' - return False - -insert_table_1 = """ -CREATE TABLE test(gid serial PRIMARY KEY, geom geometry); -INSERT INTO test(geom) values (GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test(geom) values (GeomFromEWKT('SRID=4326;POINT(-2 2)')); -INSERT INTO test(geom) values (GeomFromEWKT('SRID=4326;MULTIPOINT(2 1,1 2)')); -INSERT INTO test(geom) values (GeomFromEWKT('SRID=4326;LINESTRING(0 0,1 1,1 2)')); -INSERT INTO test(geom) values (GeomFromEWKT('SRID=4326;MULTILINESTRING((1 0,0 1,3 2),(3 2,5 4))')); -INSERT INTO test(geom) values (GeomFromEWKT('SRID=4326;POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1))')); -INSERT INTO test(geom) values (GeomFromEWKT('SRID=4326;MULTIPOLYGON(((1 1,3 1,3 3,1 3,1 1),(1 1,2 1,2 2,1 2,1 1)), ((-1 -1,-1 -2,-2 -2,-2 -1,-1 -1)))')); -INSERT INTO test(geom) values (GeomFromEWKT('SRID=4326;GEOMETRYCOLLECTION(POLYGON((1 1, 2 1, 2 2, 1 2,1 1)),POINT(2 3),LINESTRING(2 3,3 4))')); -""" - -insert_table_2 = """ -CREATE TABLE test2(manual_id int4 PRIMARY KEY, geom geometry); -INSERT INTO test2(manual_id, geom) values (0, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test2(manual_id, geom) values (1, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test2(manual_id, geom) values (1000, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test2(manual_id, geom) values (-1000, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test2(manual_id, geom) values (2147483647, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test2(manual_id, geom) values (-2147483648, GeomFromEWKT('SRID=4326;POINT(0 0)')); -""" - -insert_table_3 = """ -CREATE TABLE test3(non_id bigint, manual_id int4, geom geometry); -INSERT INTO test3(non_id, manual_id, geom) values (9223372036854775807, 0, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test3(non_id, manual_id, geom) values (9223372036854775807, 1, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test3(non_id, manual_id, geom) values (9223372036854775807, 1000, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test3(non_id, manual_id, geom) values (9223372036854775807, -1000, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test3(non_id, manual_id, geom) values (9223372036854775807, 2147483647, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test3(non_id, manual_id, geom) values (9223372036854775807, -2147483648, GeomFromEWKT('SRID=4326;POINT(0 0)')); -""" - -insert_table_4 = """ -CREATE TABLE test4(non_id int4, manual_id int8 PRIMARY KEY, geom geometry); -INSERT INTO test4(non_id, manual_id, geom) values (0, 0, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test4(non_id, manual_id, geom) values (0, 1, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test4(non_id, manual_id, geom) values (0, 1000, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test4(non_id, manual_id, geom) values (0, -1000, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test4(non_id, manual_id, geom) values (0, 2147483647, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test4(non_id, manual_id, geom) values (0, -2147483648, GeomFromEWKT('SRID=4326;POINT(0 0)')); -""" - -insert_table_5 = """ -CREATE TABLE test5(non_id int4, manual_id numeric PRIMARY KEY, geom geometry); -INSERT INTO test5(non_id, manual_id, geom) values (0, -1, GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test5(non_id, manual_id, geom) values (0, 1, GeomFromEWKT('SRID=4326;POINT(0 0)')); -""" - -insert_table_5b = ''' -CREATE TABLE "tableWithMixedCase"(gid serial PRIMARY KEY, geom geometry); -INSERT INTO "tableWithMixedCase"(geom) values (ST_MakePoint(0,0)); -INSERT INTO "tableWithMixedCase"(geom) values (ST_MakePoint(0,1)); -INSERT INTO "tableWithMixedCase"(geom) values (ST_MakePoint(1,0)); -INSERT INTO "tableWithMixedCase"(geom) values (ST_MakePoint(1,1)); -''' - -insert_table_6 = ''' -CREATE TABLE test6(first_id int4, second_id int4,PRIMARY KEY (first_id,second_id), geom geometry); -INSERT INTO test6(first_id, second_id, geom) values (0, 0, GeomFromEWKT('SRID=4326;POINT(0 0)')); -''' - -insert_table_7 = ''' -CREATE TABLE test7(gid serial PRIMARY KEY, geom geometry); -INSERT INTO test7(gid, geom) values (1, GeomFromEWKT('SRID=4326;GEOMETRYCOLLECTION(MULTILINESTRING((10 10,20 20,10 40),(40 40,30 30,40 20,30 10)),LINESTRING EMPTY)')); -''' - -insert_table_8 = ''' -CREATE TABLE test8(gid serial PRIMARY KEY,int_field bigint, geom geometry); -INSERT INTO test8(gid, int_field, geom) values (1, 2147483648, ST_MakePoint(1,1)); -INSERT INTO test8(gid, int_field, geom) values (2, 922337203685477580, ST_MakePoint(1,1)); -''' - -insert_table_9 = ''' -CREATE TABLE test9(gid serial PRIMARY KEY, name varchar, geom geometry); -INSERT INTO test9(gid, name, geom) values (1, 'name', ST_MakePoint(1,1)); -INSERT INTO test9(gid, name, geom) values (2, '', ST_MakePoint(1,1)); -INSERT INTO test9(gid, name, geom) values (3, null, ST_MakePoint(1,1)); -''' - -insert_table_10 = ''' -CREATE TABLE test10(gid serial PRIMARY KEY, bool_field boolean, geom geometry); -INSERT INTO test10(gid, bool_field, geom) values (1, TRUE, ST_MakePoint(1,1)); -INSERT INTO test10(gid, bool_field, geom) values (2, FALSE, ST_MakePoint(1,1)); -INSERT INTO test10(gid, bool_field, geom) values (3, null, ST_MakePoint(1,1)); -''' - -insert_table_11 = """ -CREATE TABLE test11(gid serial PRIMARY KEY, label varchar(40), geom geometry); -INSERT INTO test11(label,geom) values ('label_1',GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test11(label,geom) values ('label_2',GeomFromEWKT('SRID=4326;POINT(-2 2)')); -INSERT INTO test11(label,geom) values ('label_3',GeomFromEWKT('SRID=4326;MULTIPOINT(2 1,1 2)')); -INSERT INTO test11(label,geom) values ('label_4',GeomFromEWKT('SRID=4326;LINESTRING(0 0,1 1,1 2)')); -INSERT INTO test11(label,geom) values ('label_5',GeomFromEWKT('SRID=4326;MULTILINESTRING((1 0,0 1,3 2),(3 2,5 4))')); -INSERT INTO test11(label,geom) values ('label_6',GeomFromEWKT('SRID=4326;POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1))')); -INSERT INTO test11(label,geom) values ('label_7',GeomFromEWKT('SRID=4326;MULTIPOLYGON(((1 1,3 1,3 3,1 3,1 1),(1 1,2 1,2 2,1 2,1 1)), ((-1 -1,-1 -2,-2 -2,-2 -1,-1 -1)))')); -INSERT INTO test11(label,geom) values ('label_8',GeomFromEWKT('SRID=4326;GEOMETRYCOLLECTION(POLYGON((1 1, 2 1, 2 2, 1 2,1 1)),POINT(2 3),LINESTRING(2 3,3 4))')); -""" - -insert_table_12 = """ -CREATE TABLE test12(gid serial PRIMARY KEY, name varchar(40), geom geometry); -INSERT INTO test12(name,geom) values ('Point',GeomFromEWKT('SRID=4326;POINT(0 0)')); -INSERT INTO test12(name,geom) values ('PointZ',GeomFromEWKT('SRID=4326;POINTZ(0 0 0)')); -INSERT INTO test12(name,geom) values ('PointM',GeomFromEWKT('SRID=4326;POINTM(0 0 0)')); -INSERT INTO test12(name,geom) values ('PointZM',GeomFromEWKT('SRID=4326;POINTZM(0 0 0 0)')); -INSERT INTO test12(name,geom) values ('MultiPoint',GeomFromEWKT('SRID=4326;MULTIPOINT(0 0, 1 1)')); -INSERT INTO test12(name,geom) values ('MultiPointZ',GeomFromEWKT('SRID=4326;MULTIPOINTZ(0 0 0, 1 1 1)')); -INSERT INTO test12(name,geom) values ('MultiPointM',GeomFromEWKT('SRID=4326;MULTIPOINTM(0 0 0, 1 1 1)')); -INSERT INTO test12(name,geom) values ('MultiPointZM',GeomFromEWKT('SRID=4326;MULTIPOINTZM(0 0 0 0, 1 1 1 1)')); -INSERT INTO test12(name,geom) values ('LineString',GeomFromEWKT('SRID=4326;LINESTRING(0 0, 1 1)')); -INSERT INTO test12(name,geom) values ('LineStringZ',GeomFromEWKT('SRID=4326;LINESTRINGZ(0 0 0, 1 1 1)')); -INSERT INTO test12(name,geom) values ('LineStringM',GeomFromEWKT('SRID=4326;LINESTRINGM(0 0 0, 1 1 1)')); -INSERT INTO test12(name,geom) values ('LineStringZM',GeomFromEWKT('SRID=4326;LINESTRINGZM(0 0 0 0, 1 1 1 1)')); -INSERT INTO test12(name,geom) values ('Polygon',GeomFromEWKT('SRID=4326;POLYGON((0 0, 1 1, 2 2, 0 0))')); -INSERT INTO test12(name,geom) values ('PolygonZ',GeomFromEWKT('SRID=4326;POLYGONZ((0 0 0, 1 1 1, 2 2 2, 0 0 0))')); -INSERT INTO test12(name,geom) values ('PolygonM',GeomFromEWKT('SRID=4326;POLYGONZ((0 0 0, 1 1 1, 2 2 2, 0 0 0))')); -INSERT INTO test12(name,geom) values ('PolygonZM',GeomFromEWKT('SRID=4326;POLYGONZM((0 0 0 0, 1 1 1 1, 2 2 2 2, 0 0 0 0))')); -INSERT INTO test12(name,geom) values ('MultiLineString',GeomFromEWKT('SRID=4326;MULTILINESTRING((0 0, 1 1),(2 2, 3 3))')); -INSERT INTO test12(name,geom) values ('MultiLineStringZ',GeomFromEWKT('SRID=4326;MULTILINESTRINGZ((0 0 0, 1 1 1),(2 2 2, 3 3 3))')); -INSERT INTO test12(name,geom) values ('MultiLineStringM',GeomFromEWKT('SRID=4326;MULTILINESTRINGM((0 0 0, 1 1 1),(2 2 2, 3 3 3))')); -INSERT INTO test12(name,geom) values ('MultiLineStringZM',GeomFromEWKT('SRID=4326;MULTILINESTRINGZM((0 0 0 0, 1 1 1 1),(2 2 2 2, 3 3 3 3))')); -INSERT INTO test12(name,geom) values ('MultiPolygon',GeomFromEWKT('SRID=4326;MULTIPOLYGON(((0 0, 1 1, 2 2, 0 0)),((0 0, 1 1, 2 2, 0 0)))')); -INSERT INTO test12(name,geom) values ('MultiPolygonZ',GeomFromEWKT('SRID=4326;MULTIPOLYGONZ(((0 0 0, 1 1 1, 2 2 2, 0 0 0)),((0 0 0, 1 1 1, 2 2 2, 0 0 0)))')); -INSERT INTO test12(name,geom) values ('MultiPolygonM',GeomFromEWKT('SRID=4326;MULTIPOLYGONM(((0 0 0, 1 1 1, 2 2 2, 0 0 0)),((0 0 0, 1 1 1, 2 2 2, 0 0 0)))')); -INSERT INTO test12(name,geom) values ('MultiPolygonZM',GeomFromEWKT('SRID=4326;MULTIPOLYGONZM(((0 0 0 0, 1 1 1 1, 2 2 2 2, 0 0 0 0)),((0 0 0 0, 1 1 1 1, 2 2 2 2, 0 0 0 0)))')); -""" - - -def postgis_setup(): - call('dropdb %s' % MAPNIK_TEST_DBNAME,silent=True) - call('createdb -T %s %s' % (POSTGIS_TEMPLATE_DBNAME,MAPNIK_TEST_DBNAME),silent=False) - call('shp2pgsql -s 3857 -g geom -W LATIN1 %s world_merc | psql -q %s' % (SHAPEFILE,MAPNIK_TEST_DBNAME), silent=True) - call('''psql -q %s -c "CREATE TABLE \"empty\" (key serial);SELECT AddGeometryColumn('','empty','geom','-1','GEOMETRY',4);"''' % MAPNIK_TEST_DBNAME,silent=False) - call('''psql -q %s -c "%s"''' % (MAPNIK_TEST_DBNAME,insert_table_1),silent=False) - call('''psql -q %s -c "%s"''' % (MAPNIK_TEST_DBNAME,insert_table_2),silent=False) - call('''psql -q %s -c "%s"''' % (MAPNIK_TEST_DBNAME,insert_table_3),silent=False) - call('''psql -q %s -c "%s"''' % (MAPNIK_TEST_DBNAME,insert_table_4),silent=False) - call('''psql -q %s -c "%s"''' % (MAPNIK_TEST_DBNAME,insert_table_5),silent=False) - call("""psql -q %s -c '%s'""" % (MAPNIK_TEST_DBNAME,insert_table_5b),silent=False) - call('''psql -q %s -c "%s"''' % (MAPNIK_TEST_DBNAME,insert_table_6),silent=False) - call('''psql -q %s -c "%s"''' % (MAPNIK_TEST_DBNAME,insert_table_7),silent=False) - call('''psql -q %s -c "%s"''' % (MAPNIK_TEST_DBNAME,insert_table_8),silent=False) - call('''psql -q %s -c "%s"''' % (MAPNIK_TEST_DBNAME,insert_table_9),silent=False) - call('''psql -q %s -c "%s"''' % (MAPNIK_TEST_DBNAME,insert_table_10),silent=False) - call('''psql -q %s -c "%s"''' % (MAPNIK_TEST_DBNAME,insert_table_11),silent=False) - call('''psql -q %s -c "%s"''' % (MAPNIK_TEST_DBNAME,insert_table_12),silent=False) - -def postgis_takedown(): - pass - # fails as the db is in use: https://github.com/mapnik/mapnik/issues/960 - #call('dropdb %s' % MAPNIK_TEST_DBNAME) - -if 'postgis' in mapnik.DatasourceCache.plugin_names() \ - and createdb_and_dropdb_on_path() \ - and psql_can_connect() \ - and shp2pgsql_on_path(): - - # initialize test database - postgis_setup() - - def test_feature(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='world_merc') - fs = ds.featureset() - feature = fs.next() - eq_(feature['gid'],1) - eq_(feature['fips'],u'AC') - eq_(feature['iso2'],u'AG') - eq_(feature['iso3'],u'ATG') - eq_(feature['un'],28) - eq_(feature['name'],u'Antigua and Barbuda') - eq_(feature['area'],44) - eq_(feature['pop2005'],83039) - eq_(feature['region'],19) - eq_(feature['subregion'],29) - eq_(feature['lon'],-61.783) - eq_(feature['lat'],17.078) - meta = ds.describe() - eq_(meta['srid'],3857) - eq_(meta.get('key_field'),None) - eq_(meta['encoding'],u'UTF8') - eq_(meta['geometry_type'],mapnik.DataGeometryType.Polygon) - - def test_subquery(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='(select * from world_merc) as w') - fs = ds.featureset() - feature = fs.next() - eq_(feature['gid'],1) - eq_(feature['fips'],u'AC') - eq_(feature['iso2'],u'AG') - eq_(feature['iso3'],u'ATG') - eq_(feature['un'],28) - eq_(feature['name'],u'Antigua and Barbuda') - eq_(feature['area'],44) - eq_(feature['pop2005'],83039) - eq_(feature['region'],19) - eq_(feature['subregion'],29) - eq_(feature['lon'],-61.783) - eq_(feature['lat'],17.078) - meta = ds.describe() - eq_(meta['srid'],3857) - eq_(meta.get('key_field'),None) - eq_(meta['encoding'],u'UTF8') - eq_(meta['geometry_type'],mapnik.DataGeometryType.Polygon) - - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='(select gid,geom,fips as _fips from world_merc) as w') - fs = ds.featureset() - feature = fs.next() - eq_(feature['gid'],1) - eq_(feature['_fips'],u'AC') - eq_(len(feature),2) - meta = ds.describe() - eq_(meta['srid'],3857) - eq_(meta.get('key_field'),None) - eq_(meta['encoding'],u'UTF8') - eq_(meta['geometry_type'],mapnik.DataGeometryType.Polygon) - - def test_empty_db(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='empty') - fs = ds.featureset() - feature = None - try: - feature = fs.next() - except StopIteration: - pass - eq_(feature,None) - meta = ds.describe() - eq_(meta['srid'],-1) - eq_(meta.get('key_field'),None) - eq_(meta['encoding'],u'UTF8') - eq_(meta['geometry_type'],None) - - def test_manual_srid(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,srid=99, table='empty') - fs = ds.featureset() - feature = None - try: - feature = fs.next() - except StopIteration: - pass - eq_(feature,None) - meta = ds.describe() - eq_(meta['srid'],99) - eq_(meta.get('key_field'),None) - eq_(meta['encoding'],u'UTF8') - eq_(meta['geometry_type'],None) - - def test_geometry_detection(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='test', - geometry_field='geom') - meta = ds.describe() - eq_(meta['srid'],4326) - eq_(meta.get('key_field'),None) - eq_(meta['geometry_type'],mapnik.DataGeometryType.Collection) - - # will fail with postgis 2.0 because it automatically adds a geometry_columns entry - #ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='test', - # geometry_field='geom', - # row_limit=1) - #eq_(ds.describe()['geometry_type'],mapnik.DataGeometryType.Point) - - @raises(RuntimeError) - def test_that_nonexistant_query_field_throws(**kwargs): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='empty') - eq_(len(ds.fields()),1) - eq_(ds.fields(),['key']) - eq_(ds.field_types(),['int']) - query = mapnik.Query(ds.envelope()) - for fld in ds.fields(): - query.add_property_name(fld) - # also add an invalid one, triggering throw - query.add_property_name('bogus') - ds.features(query) - - def test_auto_detection_of_unique_feature_id_32_bit(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='test2', - geometry_field='geom', - autodetect_key_field=True) - fs = ds.featureset() - eq_(fs.next()['manual_id'],0) - eq_(fs.next()['manual_id'],1) - eq_(fs.next()['manual_id'],1000) - eq_(fs.next()['manual_id'],-1000) - eq_(fs.next()['manual_id'],2147483647) - eq_(fs.next()['manual_id'],-2147483648) - - fs = ds.featureset() - eq_(fs.next().id(),0) - eq_(fs.next().id(),1) - eq_(fs.next().id(),1000) - eq_(fs.next().id(),-1000) - eq_(fs.next().id(),2147483647) - eq_(fs.next().id(),-2147483648) - meta = ds.describe() - eq_(meta['srid'],4326) - eq_(meta.get('key_field'),u'manual_id') - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - def test_auto_detection_will_fail_since_no_primary_key(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='test3', - geometry_field='geom', - autodetect_key_field=False) - fs = ds.featureset() - feat = fs.next() - eq_(feat['manual_id'],0) - # will fail: https://github.com/mapnik/mapnik/issues/895 - #eq_(feat['non_id'],9223372036854775807) - eq_(fs.next()['manual_id'],1) - eq_(fs.next()['manual_id'],1000) - eq_(fs.next()['manual_id'],-1000) - eq_(fs.next()['manual_id'],2147483647) - eq_(fs.next()['manual_id'],-2147483648) - - # since no valid primary key will be detected the fallback - # is auto-incrementing counter - fs = ds.featureset() - eq_(fs.next().id(),1) - eq_(fs.next().id(),2) - eq_(fs.next().id(),3) - eq_(fs.next().id(),4) - eq_(fs.next().id(),5) - eq_(fs.next().id(),6) - - meta = ds.describe() - eq_(meta['srid'],4326) - eq_(meta.get('key_field'),None) - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - @raises(RuntimeError) - def test_auto_detection_will_fail_and_should_throw(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='test3', - geometry_field='geom', - autodetect_key_field=True) - ds.featureset() - - def test_auto_detection_of_unique_feature_id_64_bit(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='test4', - geometry_field='geom', - autodetect_key_field=True) - fs = ds.featureset() - eq_(fs.next()['manual_id'],0) - eq_(fs.next()['manual_id'],1) - eq_(fs.next()['manual_id'],1000) - eq_(fs.next()['manual_id'],-1000) - eq_(fs.next()['manual_id'],2147483647) - eq_(fs.next()['manual_id'],-2147483648) - - fs = ds.featureset() - eq_(fs.next().id(),0) - eq_(fs.next().id(),1) - eq_(fs.next().id(),1000) - eq_(fs.next().id(),-1000) - eq_(fs.next().id(),2147483647) - eq_(fs.next().id(),-2147483648) - - meta = ds.describe() - eq_(meta['srid'],4326) - eq_(meta.get('key_field'),u'manual_id') - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - def test_disabled_auto_detection_and_subquery(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='''(select geom, 'a'::varchar as name from test2) as t''', - geometry_field='geom', - autodetect_key_field=False) - fs = ds.featureset() - feat = fs.next() - eq_(feat.id(),1) - eq_(feat['name'],'a') - feat = fs.next() - eq_(feat.id(),2) - eq_(feat['name'],'a') - feat = fs.next() - eq_(feat.id(),3) - eq_(feat['name'],'a') - feat = fs.next() - eq_(feat.id(),4) - eq_(feat['name'],'a') - feat = fs.next() - eq_(feat.id(),5) - eq_(feat['name'],'a') - feat = fs.next() - eq_(feat.id(),6) - eq_(feat['name'],'a') - - meta = ds.describe() - eq_(meta['srid'],4326) - eq_(meta.get('key_field'),None) - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - def test_auto_detection_and_subquery_including_key(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='''(select geom, manual_id from test2) as t''', - geometry_field='geom', - autodetect_key_field=True) - fs = ds.featureset() - eq_(fs.next()['manual_id'],0) - eq_(fs.next()['manual_id'],1) - eq_(fs.next()['manual_id'],1000) - eq_(fs.next()['manual_id'],-1000) - eq_(fs.next()['manual_id'],2147483647) - eq_(fs.next()['manual_id'],-2147483648) - - fs = ds.featureset() - eq_(fs.next().id(),0) - eq_(fs.next().id(),1) - eq_(fs.next().id(),1000) - eq_(fs.next().id(),-1000) - eq_(fs.next().id(),2147483647) - eq_(fs.next().id(),-2147483648) - - meta = ds.describe() - eq_(meta['srid'],4326) - eq_(meta.get('key_field'),u'manual_id') - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - @raises(RuntimeError) - def test_auto_detection_of_invalid_numeric_primary_key(): - mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='''(select geom, manual_id::numeric from test2) as t''', - geometry_field='geom', - autodetect_key_field=True) - - @raises(RuntimeError) - def test_auto_detection_of_invalid_multiple_keys(): - mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='''test6''', - geometry_field='geom', - autodetect_key_field=True) - - @raises(RuntimeError) - def test_auto_detection_of_invalid_multiple_keys_subquery(): - mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='''(select first_id,second_id,geom from test6) as t''', - geometry_field='geom', - autodetect_key_field=True) - - def test_manually_specified_feature_id_field(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='test4', - geometry_field='geom', - key_field='manual_id', - autodetect_key_field=True) - fs = ds.featureset() - eq_(fs.next()['manual_id'],0) - eq_(fs.next()['manual_id'],1) - eq_(fs.next()['manual_id'],1000) - eq_(fs.next()['manual_id'],-1000) - eq_(fs.next()['manual_id'],2147483647) - eq_(fs.next()['manual_id'],-2147483648) - - fs = ds.featureset() - eq_(fs.next().id(),0) - eq_(fs.next().id(),1) - eq_(fs.next().id(),1000) - eq_(fs.next().id(),-1000) - eq_(fs.next().id(),2147483647) - eq_(fs.next().id(),-2147483648) - - meta = ds.describe() - eq_(meta['srid'],4326) - eq_(meta.get('key_field'),u'manual_id') - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - def test_numeric_type_feature_id_field(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='test5', - geometry_field='geom', - autodetect_key_field=False) - fs = ds.featureset() - eq_(fs.next()['manual_id'],-1) - eq_(fs.next()['manual_id'],1) - - fs = ds.featureset() - eq_(fs.next().id(),1) - eq_(fs.next().id(),2) - - meta = ds.describe() - eq_(meta['srid'],4326) - eq_(meta.get('key_field'),None) - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - def test_querying_table_with_mixed_case(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='"tableWithMixedCase"', - geometry_field='geom', - autodetect_key_field=True) - fs = ds.featureset() - for id in range(1,5): - eq_(fs.next().id(),id) - - meta = ds.describe() - eq_(meta['srid'],-1) - eq_(meta.get('key_field'),u'gid') - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - def test_querying_subquery_with_mixed_case(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='(SeLeCt * FrOm "tableWithMixedCase") as MixedCaseQuery', - geometry_field='geom', - autodetect_key_field=True) - fs = ds.featureset() - for id in range(1,5): - eq_(fs.next().id(),id) - - meta = ds.describe() - eq_(meta['srid'],-1) - eq_(meta.get('key_field'),u'gid') - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - def test_bbox_token_in_subquery1(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table=''' - (SeLeCt * FrOm "tableWithMixedCase" where geom && !bbox! ) as MixedCaseQuery''', - geometry_field='geom', - autodetect_key_field=True) - fs = ds.featureset() - for id in range(1,5): - eq_(fs.next().id(),id) - - meta = ds.describe() - eq_(meta['srid'],-1) - eq_(meta.get('key_field'),u'gid') - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - def test_bbox_token_in_subquery2(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table=''' - (SeLeCt * FrOm "tableWithMixedCase" where ST_Intersects(geom,!bbox!) ) as MixedCaseQuery''', - geometry_field='geom', - autodetect_key_field=True) - fs = ds.featureset() - for id in range(1,5): - eq_(fs.next().id(),id) - - meta = ds.describe() - eq_(meta['srid'],-1) - eq_(meta.get('key_field'),u'gid') - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - def test_empty_geom(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='test7', - geometry_field='geom') - fs = ds.featureset() - eq_(fs.next()['gid'],1) - - meta = ds.describe() - eq_(meta['srid'],4326) - eq_(meta.get('key_field'),None) - eq_(meta['geometry_type'],mapnik.DataGeometryType.Collection) - - def create_ds(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME, - table='test', - max_size=20, - geometry_field='geom') - fs = ds.all_features() - eq_(len(fs),8) - - meta = ds.describe() - eq_(meta['srid'],4326) - eq_(meta.get('key_field'),None) - eq_(meta['geometry_type'],mapnik.DataGeometryType.Collection) - - def test_threaded_create(NUM_THREADS=100): - # run one to start before thread loop - # to ensure that a throw stops the test - # from running all threads - create_ds() - runs = 0 - for i in range(NUM_THREADS): - t = threading.Thread(target=create_ds) - t.start() - t.join() - runs +=1 - eq_(runs,NUM_THREADS) - - def create_ds_and_error(): - try: - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME, - table='asdfasdfasdfasdfasdf', - max_size=20) - ds.all_features() - except Exception, e: - eq_('in executeQuery' in str(e),True) - - def test_threaded_create2(NUM_THREADS=10): - for i in range(NUM_THREADS): - t = threading.Thread(target=create_ds_and_error) - t.start() - t.join() - - def test_that_64bit_int_fields_work(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME, - table='test8', - geometry_field='geom') - eq_(len(ds.fields()),2) - eq_(ds.fields(),['gid','int_field']) - eq_(ds.field_types(),['int','int']) - fs = ds.featureset() - feat = fs.next() - eq_(feat.id(),1) - eq_(feat['gid'],1) - eq_(feat['int_field'],2147483648) - feat = fs.next() - eq_(feat.id(),2) - eq_(feat['gid'],2) - eq_(feat['int_field'],922337203685477580) - - meta = ds.describe() - eq_(meta['srid'],-1) - eq_(meta.get('key_field'),None) - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - def test_persist_connection_off(): - # NOTE: max_size should be equal or greater than - # the pool size. There's currently no API to - # check nor set that size, but the current - # default is 20, so we use that value. See - # http://github.com/mapnik/mapnik/issues/863 - max_size = 20 - for i in range(0, max_size+1): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME, - max_size=1, # unused - persist_connection=False, - table='(select ST_MakePoint(0,0) as g, pg_backend_pid() as p, 1 as v) as w', - geometry_field='g') - fs = ds.featureset() - eq_(fs.next()['v'], 1) - - meta = ds.describe() - eq_(meta['srid'],-1) - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - def test_null_comparision(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='test9', - geometry_field='geom') - fs = ds.featureset() - feat = fs.next() - - meta = ds.describe() - eq_(meta['srid'],-1) - eq_(meta.get('key_field'),None) - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - eq_(feat['gid'],1) - eq_(feat['name'],'name') - eq_(mapnik.Expression("[name] = 'name'").evaluate(feat),True) - eq_(mapnik.Expression("[name] = ''").evaluate(feat),False) - eq_(mapnik.Expression("[name] = null").evaluate(feat),False) - eq_(mapnik.Expression("[name] = true").evaluate(feat),False) - eq_(mapnik.Expression("[name] = false").evaluate(feat),False) - eq_(mapnik.Expression("[name] != 'name'").evaluate(feat),False) - eq_(mapnik.Expression("[name] != ''").evaluate(feat),True) - eq_(mapnik.Expression("[name] != null").evaluate(feat),True) - eq_(mapnik.Expression("[name] != true").evaluate(feat),True) - eq_(mapnik.Expression("[name] != false").evaluate(feat),True) - - feat = fs.next() - eq_(feat['gid'],2) - eq_(feat['name'],'') - eq_(mapnik.Expression("[name] = 'name'").evaluate(feat),False) - eq_(mapnik.Expression("[name] = ''").evaluate(feat),True) - eq_(mapnik.Expression("[name] = null").evaluate(feat),False) - eq_(mapnik.Expression("[name] = true").evaluate(feat),False) - eq_(mapnik.Expression("[name] = false").evaluate(feat),False) - eq_(mapnik.Expression("[name] != 'name'").evaluate(feat),True) - eq_(mapnik.Expression("[name] != ''").evaluate(feat),False) - eq_(mapnik.Expression("[name] != null").evaluate(feat),True) - eq_(mapnik.Expression("[name] != true").evaluate(feat),True) - eq_(mapnik.Expression("[name] != false").evaluate(feat),True) - - feat = fs.next() - eq_(feat['gid'],3) - eq_(feat['name'],None) # null - eq_(mapnik.Expression("[name] = 'name'").evaluate(feat),False) - eq_(mapnik.Expression("[name] = ''").evaluate(feat),False) - eq_(mapnik.Expression("[name] = null").evaluate(feat),True) - eq_(mapnik.Expression("[name] = true").evaluate(feat),False) - eq_(mapnik.Expression("[name] = false").evaluate(feat),False) - eq_(mapnik.Expression("[name] != 'name'").evaluate(feat),True) - # https://github.com/mapnik/mapnik/issues/1859 - eq_(mapnik.Expression("[name] != ''").evaluate(feat),False) - eq_(mapnik.Expression("[name] != null").evaluate(feat),False) - eq_(mapnik.Expression("[name] != true").evaluate(feat),True) - eq_(mapnik.Expression("[name] != false").evaluate(feat),True) - - def test_null_comparision2(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='test10', - geometry_field='geom') - fs = ds.featureset() - feat = fs.next() - - meta = ds.describe() - eq_(meta['srid'],-1) - eq_(meta.get('key_field'),None) - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - eq_(feat['gid'],1) - eq_(feat['bool_field'],True) - eq_(mapnik.Expression("[bool_field] = 'name'").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] = ''").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] = null").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] = true").evaluate(feat),True) - eq_(mapnik.Expression("[bool_field] = false").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] != 'name'").evaluate(feat),True) - eq_(mapnik.Expression("[bool_field] != ''").evaluate(feat),True) # in 2.1.x used to be False - eq_(mapnik.Expression("[bool_field] != null").evaluate(feat),True) # in 2.1.x used to be False - eq_(mapnik.Expression("[bool_field] != true").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] != false").evaluate(feat),True) - - feat = fs.next() - eq_(feat['gid'],2) - eq_(feat['bool_field'],False) - eq_(mapnik.Expression("[bool_field] = 'name'").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] = ''").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] = null").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] = true").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] = false").evaluate(feat),True) - eq_(mapnik.Expression("[bool_field] != 'name'").evaluate(feat),True) - eq_(mapnik.Expression("[bool_field] != ''").evaluate(feat),True) - eq_(mapnik.Expression("[bool_field] != null").evaluate(feat),True) # in 2.1.x used to be False - eq_(mapnik.Expression("[bool_field] != true").evaluate(feat),True) - eq_(mapnik.Expression("[bool_field] != false").evaluate(feat),False) - - feat = fs.next() - eq_(feat['gid'],3) - eq_(feat['bool_field'],None) # null - eq_(mapnik.Expression("[bool_field] = 'name'").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] = ''").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] = null").evaluate(feat),True) - eq_(mapnik.Expression("[bool_field] = true").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] = false").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] != 'name'").evaluate(feat),True) # in 2.1.x used to be False - # https://github.com/mapnik/mapnik/issues/1859 - eq_(mapnik.Expression("[bool_field] != ''").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] != null").evaluate(feat),False) - eq_(mapnik.Expression("[bool_field] != true").evaluate(feat),True) # in 2.1.x used to be False - eq_(mapnik.Expression("[bool_field] != false").evaluate(feat),True) # in 2.1.x used to be False - - # https://github.com/mapnik/mapnik/issues/1816 - def test_exception_message_reporting(): - try: - mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='doesnotexist') - except Exception, e: - eq_(e.message != 'unidentifiable C++ exception', True) - - def test_null_id_field(): - opts = {'type':'postgis', - 'dbname':MAPNIK_TEST_DBNAME, - 'geometry_field':'geom', - 'table':"(select null::bigint as osm_id, GeomFromEWKT('SRID=4326;POINT(0 0)') as geom) as tmp"} - ds = mapnik.Datasource(**opts) - fs = ds.featureset() - feat = fs.next() - eq_(feat.id(),1L) - eq_(feat['osm_id'],None) - - meta = ds.describe() - eq_(meta['srid'],4326) - eq_(meta.get('key_field'),None) - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - @raises(StopIteration) - def test_null_key_field(): - opts = {'type':'postgis', - "key_field": 'osm_id', - 'dbname':MAPNIK_TEST_DBNAME, - 'geometry_field':'geom', - 'table':"(select null::bigint as osm_id, GeomFromEWKT('SRID=4326;POINT(0 0)') as geom) as tmp"} - ds = mapnik.Datasource(**opts) - fs = ds.featureset() - fs.next() ## should throw since key_field is null: StopIteration: No more features. - - def test_psql_error_should_not_break_connection_pool(): - # Bad request, will trigger an error when returning result - ds_bad = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table="""(SELECT geom as geom,label::int from test11) as failure_table""", - max_async_connection=5,geometry_field='geom',srid=4326) - - # Good request - ds_good = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table="test", - max_async_connection=5,geometry_field='geom',srid=4326) - - # This will/should trigger a PSQL error - failed = False - try: - fs = ds_bad.featureset() - for feature in fs: - pass - except RuntimeError: - failed = True - - eq_(failed,True) - - # Should be ok - fs = ds_good.featureset() - count = 0 - for feature in fs: - count += 1 - eq_(count,8) - - - def test_psql_error_should_give_back_connections_opened_for_lower_layers_to_the_pool(): - map1 = mapnik.Map(600,300) - s = mapnik.Style() - r = mapnik.Rule() - r.symbols.append(mapnik.PolygonSymbolizer()) - s.rules.append(r) - map1.append_style('style',s) - - # This layer will fail after a while - buggy_s = mapnik.Style() - buggy_r = mapnik.Rule() - buggy_r.symbols.append(mapnik.PolygonSymbolizer()) - buggy_r.filter = mapnik.Filter("[fips] = 'FR'") - buggy_s.rules.append(buggy_r) - map1.append_style('style for buggy layer',buggy_s) - buggy_layer = mapnik.Layer('this layer is buggy at runtime') - # We ensure the query wille be long enough - buggy_layer.datasource = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='(SELECT geom as geom, pg_sleep(0.1), fips::int from world_merc) as failure_tabl', - max_async_connection=2, max_size=2,asynchronous_request = True, geometry_field='geom') - buggy_layer.styles.append('style for buggy layer') - - # The query for this layer will be sent, then the previous layer will raise an exception before results are read - forced_canceled_layer = mapnik.Layer('this layer will be canceled when an exception stops map rendering') - forced_canceled_layer.datasource = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='world_merc', - max_async_connection=2, max_size=2, asynchronous_request = True, geometry_field='geom') - forced_canceled_layer.styles.append('style') - - map1.layers.append(buggy_layer) - map1.layers.append(forced_canceled_layer) - map1.zoom_all() - map2 = mapnik.Map(600,300) - map2.background = mapnik.Color('steelblue') - s = mapnik.Style() - r = mapnik.Rule() - r.symbols.append(mapnik.LineSymbolizer()) - r.symbols.append(mapnik.LineSymbolizer()) - s.rules.append(r) - map2.append_style('style',s) - layer1 = mapnik.Layer('layer1') - layer1.datasource = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table='world_merc', - max_async_connection=2, max_size=2, asynchronous_request = True, geometry_field='geom') - layer1.styles.append('style') - map2.layers.append(layer1) - map2.zoom_all() - - # We expect this to trigger a PSQL error - try: - mapnik.render_to_file(map1,'/tmp/mapnik-postgis-test-map1.png', 'png') - # Test must fail if error was not raised just above - eq_(False,True) - except RuntimeError: - pass - # This used to raise an exception before correction of issue 2042 - mapnik.render_to_file(map2,'/tmp/mapnik-postgis-test-map2.png', 'png') - - def test_handling_of_zm_dimensions(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME, - table='(select gid,ST_CoordDim(geom) as dim,name,geom from test12) as tmp', - geometry_field='geom') - eq_(len(ds.fields()),3) - eq_(ds.fields(),['gid', 'dim', 'name']) - eq_(ds.field_types(),['int', 'int', 'str']) - fs = ds.featureset() - - meta = ds.describe() - eq_(meta['srid'],4326) - eq_(meta.get('key_field'),None) - # Note: this is incorrect because we only check first couple geoms - eq_(meta['geometry_type'],mapnik.DataGeometryType.Point) - - # Point (2d) - feat = fs.next() - eq_(feat.id(),1) - eq_(feat['gid'],1) - eq_(feat['dim'],2) - eq_(feat['name'],'Point') - geoms = feat.geometries() - eq_(len(geoms),1) - eq_(geoms[0].to_wkt(),'Point(0 0)') - # PointZ - feat = fs.next() - eq_(feat.id(),2) - eq_(feat['gid'],2) - eq_(feat['dim'],3) - eq_(feat['name'],'PointZ') - geoms = feat.geometries() - eq_(len(geoms),1) - eq_(geoms[0].to_wkt(),'Point(0 0)') - # PointM - feat = fs.next() - eq_(feat.id(),3) - eq_(feat['gid'],3) - eq_(feat['dim'],3) - eq_(feat['name'],'PointM') - geoms = feat.geometries() - eq_(len(geoms),1) - eq_(geoms[0].to_wkt(),'Point(0 0)') - # PointZM - feat = fs.next() - eq_(feat.id(),4) - eq_(feat['gid'],4) - eq_(feat['dim'],4) - eq_(feat['name'],'PointZM') - geoms = feat.geometries() - eq_(len(geoms),1) - eq_(geoms[0].to_wkt(),'Point(0 0)') - # MultiPoint - feat = fs.next() - eq_(feat.id(),5) - eq_(feat['gid'],5) - eq_(feat['dim'],2) - eq_(feat['name'],'MultiPoint') - geoms = feat.geometries() - eq_(len(geoms),2) - eq_(geoms[0].to_wkt(),'Point(0 0)') - eq_(geoms[1].to_wkt(),'Point(1 1)') - # MultiPointZ - feat = fs.next() - eq_(feat.id(),6) - eq_(feat['gid'],6) - eq_(feat['dim'],3) - eq_(feat['name'],'MultiPointZ') - geoms = feat.geometries() - eq_(len(geoms),2) - eq_(geoms[0].to_wkt(),'Point(0 0)') - eq_(geoms[1].to_wkt(),'Point(1 1)') - # MultiPointM - feat = fs.next() - eq_(feat.id(),7) - eq_(feat['gid'],7) - eq_(feat['dim'],3) - eq_(feat['name'],'MultiPointM') - geoms = feat.geometries() - eq_(len(geoms),2) - eq_(geoms[0].to_wkt(),'Point(0 0)') - eq_(geoms[1].to_wkt(),'Point(1 1)') - # MultiPointZM - feat = fs.next() - eq_(feat.id(),8) - eq_(feat['gid'],8) - eq_(feat['dim'],4) - eq_(feat['name'],'MultiPointZM') - geoms = feat.geometries() - eq_(len(geoms),2) - eq_(geoms[0].to_wkt(),'Point(0 0)') - eq_(geoms[1].to_wkt(),'Point(1 1)') - # LineString - feat = fs.next() - eq_(feat.id(),9) - eq_(feat['gid'],9) - eq_(feat['dim'],2) - eq_(feat['name'],'LineString') - geoms = feat.geometries() - eq_(len(geoms),1) - eq_(geoms[0].to_wkt(),'LineString(0 0,1 1)') - # LineStringZ - feat = fs.next() - eq_(feat.id(),10) - eq_(feat['gid'],10) - eq_(feat['dim'],3) - eq_(feat['name'],'LineStringZ') - geoms = feat.geometries() - eq_(len(geoms),1) - eq_(geoms[0].to_wkt(),'LineString(0 0,1 1)') - # LineStringM - feat = fs.next() - eq_(feat.id(),11) - eq_(feat['gid'],11) - eq_(feat['dim'],3) - eq_(feat['name'],'LineStringM') - geoms = feat.geometries() - eq_(len(geoms),1) - eq_(geoms[0].to_wkt(),'LineString(0 0,1 1)') - # LineStringZM - feat = fs.next() - eq_(feat.id(),12) - eq_(feat['gid'],12) - eq_(feat['dim'],4) - eq_(feat['name'],'LineStringZM') - geoms = feat.geometries() - eq_(len(geoms),1) - eq_(geoms[0].to_wkt(),'LineString(0 0,1 1)') - # Polygon - feat = fs.next() - eq_(feat.id(),13) - eq_(feat['gid'],13) - eq_(feat['name'],'Polygon') - geoms = feat.geometries() - eq_(len(geoms),1) - eq_(geoms[0].to_wkt(),'Polygon((0 0,1 1,2 2,0 0))') - # PolygonZ - feat = fs.next() - eq_(feat.id(),14) - eq_(feat['gid'],14) - eq_(feat['name'],'PolygonZ') - geoms = feat.geometries() - eq_(len(geoms),1) - eq_(geoms[0].to_wkt(),'Polygon((0 0,1 1,2 2,0 0))') - # PolygonM - feat = fs.next() - eq_(feat.id(),15) - eq_(feat['gid'],15) - eq_(feat['name'],'PolygonM') - geoms = feat.geometries() - eq_(len(geoms),1) - eq_(geoms[0].to_wkt(),'Polygon((0 0,1 1,2 2,0 0))') - # PolygonZM - feat = fs.next() - eq_(feat.id(),16) - eq_(feat['gid'],16) - eq_(feat['name'],'PolygonZM') - geoms = feat.geometries() - eq_(len(geoms),1) - eq_(geoms[0].to_wkt(),'Polygon((0 0,1 1,2 2,0 0))') - # MultiLineString - feat = fs.next() - eq_(feat.id(),17) - eq_(feat['gid'],17) - eq_(feat['name'],'MultiLineString') - geoms = feat.geometries() - eq_(len(geoms),2) - eq_(geoms[0].to_wkt(),'LineString(0 0,1 1)') - eq_(geoms[1].to_wkt(),'LineString(2 2,3 3)') - # MultiLineStringZ - feat = fs.next() - eq_(feat.id(),18) - eq_(feat['gid'],18) - eq_(feat['name'],'MultiLineStringZ') - geoms = feat.geometries() - eq_(len(geoms),2) - eq_(geoms[0].to_wkt(),'LineString(0 0,1 1)') - eq_(geoms[1].to_wkt(),'LineString(2 2,3 3)') - # MultiLineStringM - feat = fs.next() - eq_(feat.id(),19) - eq_(feat['gid'],19) - eq_(feat['name'],'MultiLineStringM') - geoms = feat.geometries() - eq_(len(geoms),2) - eq_(geoms[0].to_wkt(),'LineString(0 0,1 1)') - eq_(geoms[1].to_wkt(),'LineString(2 2,3 3)') - # MultiLineStringZM - feat = fs.next() - eq_(feat.id(),20) - eq_(feat['gid'],20) - eq_(feat['name'],'MultiLineStringZM') - geoms = feat.geometries() - eq_(len(geoms),2) - eq_(geoms[0].to_wkt(),'LineString(0 0,1 1)') - eq_(geoms[1].to_wkt(),'LineString(2 2,3 3)') - # MultiPolygon - feat = fs.next() - eq_(feat.id(),21) - eq_(feat['gid'],21) - eq_(feat['name'],'MultiPolygon') - geoms = feat.geometries() - eq_(len(geoms),2) - eq_(geoms[0].to_wkt(),'Polygon((0 0,1 1,2 2,0 0))') - eq_(geoms[1].to_wkt(),'Polygon((0 0,1 1,2 2,0 0))') - # MultiPolygonZ - feat = fs.next() - eq_(feat.id(),22) - eq_(feat['gid'],22) - eq_(feat['name'],'MultiPolygonZ') - geoms = feat.geometries() - eq_(len(geoms),2) - eq_(geoms[0].to_wkt(),'Polygon((0 0,1 1,2 2,0 0))') - eq_(geoms[1].to_wkt(),'Polygon((0 0,1 1,2 2,0 0))') - # MultiPolygonM - feat = fs.next() - eq_(feat.id(),23) - eq_(feat['gid'],23) - eq_(feat['name'],'MultiPolygonM') - geoms = feat.geometries() - eq_(len(geoms),2) - eq_(geoms[0].to_wkt(),'Polygon((0 0,1 1,2 2,0 0))') - eq_(geoms[1].to_wkt(),'Polygon((0 0,1 1,2 2,0 0))') - # MultiPolygonZM - feat = fs.next() - eq_(feat.id(),24) - eq_(feat['gid'],24) - eq_(feat['name'],'MultiPolygonZM') - geoms = feat.geometries() - eq_(len(geoms),2) - eq_(geoms[0].to_wkt(),'Polygon((0 0,1 1,2 2,0 0))') - eq_(geoms[1].to_wkt(),'Polygon((0 0,1 1,2 2,0 0))') - - def test_variable_in_subquery1(): - ds = mapnik.PostGIS(dbname=MAPNIK_TEST_DBNAME,table=''' - (select * from test where @zoom = 30 ) as tmp''', - geometry_field='geom', srid=4326, - autodetect_key_field=True) - fs = ds.featureset(variables={'zoom':30}) - for id in range(1,5): - eq_(fs.next().id(),id) - - meta = ds.describe() - eq_(meta['srid'],4326) - eq_(meta.get('key_field'),"gid") - eq_(meta['geometry_type'],None) - - - atexit.register(postgis_takedown) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/projection_test.py b/tests/python_tests/projection_test.py deleted file mode 100644 index a7bdc1455..000000000 --- a/tests/python_tests/projection_test.py +++ /dev/null @@ -1,151 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_,assert_almost_equal - -import mapnik -import math -from utilities import run_all, assert_box2d_almost_equal - -# Tests that exercise map projections. - -def test_normalizing_definition(): - p = mapnik.Projection('+init=epsg:4326') - expanded = p.expanded() - eq_('+proj=longlat' in expanded,True) - - -# Trac Ticket #128 -def test_wgs84_inverse_forward(): - p = mapnik.Projection('+init=epsg:4326') - - c = mapnik.Coord(3.01331418311, 43.3333092669) - e = mapnik.Box2d(-122.54345245, 45.12312553, 68.2335581353, 48.231231233) - - # It appears that the y component changes very slightly, is this OK? - # so we test for 'almost equal float values' - - assert_almost_equal(p.inverse(c).y, c.y) - assert_almost_equal(p.inverse(c).x, c.x) - - assert_almost_equal(p.forward(c).y, c.y) - assert_almost_equal(p.forward(c).x, c.x) - - assert_almost_equal(p.inverse(e).center().y, e.center().y) - assert_almost_equal(p.inverse(e).center().x, e.center().x) - - assert_almost_equal(p.forward(e).center().y, e.center().y) - assert_almost_equal(p.forward(e).center().x, e.center().x) - - assert_almost_equal(c.inverse(p).y, c.y) - assert_almost_equal(c.inverse(p).x, c.x) - - assert_almost_equal(c.forward(p).y, c.y) - assert_almost_equal(c.forward(p).x, c.x) - - assert_almost_equal(e.inverse(p).center().y, e.center().y) - assert_almost_equal(e.inverse(p).center().x, e.center().x) - - assert_almost_equal(e.forward(p).center().y, e.center().y) - assert_almost_equal(e.forward(p).center().x, e.center().x) - -def wgs2merc(lon,lat): - x = lon * 20037508.34 / 180; - y = math.log(math.tan((90 + lat) * math.pi / 360)) / (math.pi / 180); - y = y * 20037508.34 / 180; - return [x,y]; - -def merc2wgs(x,y): - x = (x / 20037508.34) * 180; - y = (y / 20037508.34) * 180; - y = 180 / math.pi * (2 * math.atan(math.exp(y * math.pi/180)) - math.pi/2); - if x > 180: x = 180; - if x < -180: x = -180; - if y > 85.0511: y = 85.0511; - if y < -85.0511: y = -85.0511; - return [x,y] - -#echo -109 37 | cs2cs -f "%.10f" +init=epsg:4326 +to +init=epsg:3857 -#-12133824.4964668211 4439106.7872505859 0.0000000000 - -## todo -# benchmarks -# better well known detection -# better srs matching with strip/trim -# python copy to avoid crash - -def test_proj_transform_between_init_and_literal(): - one = mapnik.Projection('+init=epsg:4326') - two = mapnik.Projection('+init=epsg:3857') - tr1 = mapnik.ProjTransform(one,two) - tr1b = mapnik.ProjTransform(two,one) - wgs84 = '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' - merc = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over' - src = mapnik.Projection(wgs84) - dest = mapnik.Projection(merc) - tr2 = mapnik.ProjTransform(src,dest) - tr2b = mapnik.ProjTransform(dest,src) - for x in xrange(-180,180,10): - for y in xrange(-60,60,10): - coord = mapnik.Coord(x,y) - merc_coord1 = tr1.forward(coord) - merc_coord2 = tr1b.backward(coord) - merc_coord3 = tr2.forward(coord) - merc_coord4 = tr2b.backward(coord) - eq_(math.fabs(merc_coord1.x - merc_coord1.x) < 1,True) - eq_(math.fabs(merc_coord1.x - merc_coord2.x) < 1,True) - eq_(math.fabs(merc_coord1.x - merc_coord3.x) < 1,True) - eq_(math.fabs(merc_coord1.x - merc_coord4.x) < 1,True) - eq_(math.fabs(merc_coord1.y - merc_coord1.y) < 1,True) - eq_(math.fabs(merc_coord1.y - merc_coord2.y) < 1,True) - eq_(math.fabs(merc_coord1.y - merc_coord3.y) < 1,True) - eq_(math.fabs(merc_coord1.y - merc_coord4.y) < 1,True) - lon_lat_coord1 = tr1.backward(merc_coord1) - lon_lat_coord2 = tr1b.forward(merc_coord2) - lon_lat_coord3 = tr2.backward(merc_coord3) - lon_lat_coord4 = tr2b.forward(merc_coord4) - eq_(math.fabs(coord.x - lon_lat_coord1.x) < 1,True) - eq_(math.fabs(coord.x - lon_lat_coord2.x) < 1,True) - eq_(math.fabs(coord.x - lon_lat_coord3.x) < 1,True) - eq_(math.fabs(coord.x - lon_lat_coord4.x) < 1,True) - eq_(math.fabs(coord.y - lon_lat_coord1.y) < 1,True) - eq_(math.fabs(coord.y - lon_lat_coord2.y) < 1,True) - eq_(math.fabs(coord.y - lon_lat_coord3.y) < 1,True) - eq_(math.fabs(coord.y - lon_lat_coord4.y) < 1,True) - - -# Github Issue #2648 -def test_proj_antimeridian_bbox(): - # this is logic from feature_style_processor::prepare_layer() - PROJ_ENVELOPE_POINTS = 20 # include/mapnik/config.hpp - - prjGeog = mapnik.Projection('+init=epsg:4326') - prjProj = mapnik.Projection('+init=epsg:2193') - prj_trans_fwd = mapnik.ProjTransform(prjProj, prjGeog) - prj_trans_rev = mapnik.ProjTransform(prjGeog, prjProj) - - # bad = mapnik.Box2d(-177.31453250437079, -62.33374815225163, 178.02778363316355, -24.584597490955804) - better = mapnik.Box2d(-180.0, -62.33374815225163, 180.0, -24.584597490955804) - - buffered_query_ext = mapnik.Box2d(274000, 3087000, 3327000, 7173000) - fwd_ext = prj_trans_fwd.forward(buffered_query_ext, PROJ_ENVELOPE_POINTS) - assert_box2d_almost_equal(fwd_ext, better) - - # check the same logic works for .backward() - ext = mapnik.Box2d(274000, 3087000, 3327000, 7173000) - rev_ext = prj_trans_rev.backward(ext, PROJ_ENVELOPE_POINTS) - assert_box2d_almost_equal(rev_ext, better) - - # checks for not being snapped (ie. not antimeridian) - normal = mapnik.Box2d(148.766759749,-60.1222810238,159.95484893,-24.9771195151) - buffered_query_ext = mapnik.Box2d(274000, 3087000, 276000, 7173000) - fwd_ext = prj_trans_fwd.forward(buffered_query_ext, PROJ_ENVELOPE_POINTS) - assert_box2d_almost_equal(fwd_ext, normal) - - # check the same logic works for .backward() - ext = mapnik.Box2d(274000, 3087000, 276000, 7173000) - rev_ext = prj_trans_rev.backward(ext, PROJ_ENVELOPE_POINTS) - assert_box2d_almost_equal(rev_ext, normal) - - -if __name__ == "__main__": - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/python_plugin_test.py b/tests/python_tests/python_plugin_test.py deleted file mode 100644 index a39272f6b..000000000 --- a/tests/python_tests/python_plugin_test.py +++ /dev/null @@ -1,160 +0,0 @@ -# #!/usr/bin/env python -# # -*- coding: utf-8 -*- - -# import os -# import math -# import mapnik -# import sys -# from utilities import execution_path, run_all -# from nose.tools import * - -# def setup(): -# # All of the paths used are relative, if we run the tests -# # from another directory we need to chdir() -# os.chdir(execution_path('.')) - -# class PointDatasource(mapnik.PythonDatasource): -# def __init__(self): -# super(PointDatasource, self).__init__( -# geometry_type = mapnik.DataGeometryType.Point, -# envelope = mapnik.Box2d(0,-10,100,110), -# data_type = mapnik.DataType.Vector -# ) - -# def features(self, query): -# return mapnik.PythonDatasource.wkt_features( -# keys = ('label',), -# features = ( -# ( 'POINT (5 6)', { 'label': 'foo-bar'} ), -# ( 'POINT (60 50)', { 'label': 'buzz-quux'} ), -# ) -# ) - -# class ConcentricCircles(object): -# def __init__(self, centre, bounds, step=1): -# self.centre = centre -# self.bounds = bounds -# self.step = step - -# class Iterator(object): -# def __init__(self, container): -# self.container = container - -# centre = self.container.centre -# bounds = self.container.bounds -# step = self.container.step - -# self.radius = step - -# def next(self): -# points = [] -# for alpha in xrange(0, 361, 5): -# x = math.sin(math.radians(alpha)) * self.radius + self.container.centre[0] -# y = math.cos(math.radians(alpha)) * self.radius + self.container.centre[1] -# points.append('%s %s' % (x,y)) -# circle = 'POLYGON ((' + ','.join(points) + '))' - -# # has the circle grown so large that the boundary is entirely within it? -# tl = (self.container.bounds.maxx, self.container.bounds.maxy) -# tr = (self.container.bounds.maxx, self.container.bounds.maxy) -# bl = (self.container.bounds.minx, self.container.bounds.miny) -# br = (self.container.bounds.minx, self.container.bounds.miny) -# def within_circle(p): -# delta_x = p[0] - self.container.centre[0] -# delta_y = p[0] - self.container.centre[0] -# return delta_x*delta_x + delta_y*delta_y < self.radius*self.radius - -# if all(within_circle(p) for p in (tl,tr,bl,br)): -# raise StopIteration() - -# self.radius += self.container.step -# return ( circle, { } ) - -# def __iter__(self): -# return ConcentricCircles.Iterator(self) - -# class CirclesDatasource(mapnik.PythonDatasource): -# def __init__(self, centre_x=-20, centre_y=0, step=10): -# super(CirclesDatasource, self).__init__( -# geometry_type = mapnik.DataGeometryType.Polygon, -# envelope = mapnik.Box2d(-180, -90, 180, 90), -# data_type = mapnik.DataType.Vector -# ) - -# # note that the plugin loader will set all arguments to strings and will not try to parse them -# centre_x = int(centre_x) -# centre_y = int(centre_y) -# step = int(step) - -# self.centre_x = centre_x -# self.centre_y = centre_y -# self.step = step - -# def features(self, query): -# centre = (self.centre_x, self.centre_y) - -# return mapnik.PythonDatasource.wkt_features( -# keys = (), -# features = ConcentricCircles(centre, query.bbox, self.step) -# ) - -# if 'python' in mapnik.DatasourceCache.plugin_names(): -# # make sure we can load from ourself as a module -# sys.path.append(execution_path('.')) - -# def test_python_point_init(): -# ds = mapnik.Python(factory='python_plugin_test:PointDatasource') -# e = ds.envelope() - -# assert_almost_equal(e.minx, 0, places=7) -# assert_almost_equal(e.miny, -10, places=7) -# assert_almost_equal(e.maxx, 100, places=7) -# assert_almost_equal(e.maxy, 110, places=7) - -# def test_python_circle_init(): -# ds = mapnik.Python(factory='python_plugin_test:CirclesDatasource') -# e = ds.envelope() - -# assert_almost_equal(e.minx, -180, places=7) -# assert_almost_equal(e.miny, -90, places=7) -# assert_almost_equal(e.maxx, 180, places=7) -# assert_almost_equal(e.maxy, 90, places=7) - -# def test_python_circle_init_with_args(): -# ds = mapnik.Python(factory='python_plugin_test:CirclesDatasource', centre_x=40, centre_y=7) -# e = ds.envelope() - -# assert_almost_equal(e.minx, -180, places=7) -# assert_almost_equal(e.miny, -90, places=7) -# assert_almost_equal(e.maxx, 180, places=7) -# assert_almost_equal(e.maxy, 90, places=7) - -# def test_python_point_rendering(): -# m = mapnik.Map(512,512) -# mapnik.load_map(m,'../data/python_plugin/python_point_datasource.xml') -# m.zoom_all() -# im = mapnik.Image(512,512) -# mapnik.render(m,im) -# actual = '/tmp/mapnik-python-point-render1.png' -# expected = 'images/support/mapnik-python-point-render1.png' -# im.save(actual) -# expected_im = mapnik.Image.open(expected) -# eq_(im.tostring('png32'),expected_im.tostring('png32'), -# 'failed comparing actual (%s) and expected (%s)' % (actual,'tests/python_tests/'+ expected)) - -# def test_python_circle_rendering(): -# m = mapnik.Map(512,512) -# mapnik.load_map(m,'../data/python_plugin/python_circle_datasource.xml') -# m.zoom_all() -# im = mapnik.Image(512,512) -# mapnik.render(m,im) -# actual = '/tmp/mapnik-python-circle-render1.png' -# expected = 'images/support/mapnik-python-circle-render1.png' -# im.save(actual) -# expected_im = mapnik.Image.open(expected) -# eq_(im.tostring('png32'),expected_im.tostring('png32'), -# 'failed comparing actual (%s) and expected (%s)' % (actual,'tests/python_tests/'+ expected)) - -# if __name__ == "__main__": -# setup() -# run_all(eval(x) for x in dir() if x.startswith("test_")) diff --git a/tests/python_tests/query_test.py b/tests/python_tests/query_test.py deleted file mode 100644 index 8da353448..000000000 --- a/tests/python_tests/query_test.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os, mapnik - -from nose.tools import eq_,assert_almost_equal,raises -from utilities import execution_path, run_all - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def test_query_init(): - bbox = (-180, -90, 180, 90) - query = mapnik.Query(mapnik.Box2d(*bbox)) - r = query.resolution - assert_almost_equal(r[0], 1.0, places=7) - assert_almost_equal(r[1], 1.0, places=7) - # https://github.com/mapnik/mapnik/issues/1762 - eq_(query.property_names,[]) - query.add_property_name('migurski') - eq_(query.property_names,['migurski']) - -# Converting *from* tuples *to* resolutions is not yet supported -@raises(TypeError) -def test_query_resolution(): - bbox = (-180, -90, 180, 90) - init_res = (4.5, 6.7) - query = mapnik.Query(mapnik.Box2d(*bbox), init_res) - r = query.resolution - assert_almost_equal(r[0], init_res[0], places=7) - assert_almost_equal(r[1], init_res[1], places=7) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/query_tolerance_test.py b/tests/python_tests/query_tolerance_test.py deleted file mode 100644 index 97c1b3e2c..000000000 --- a/tests/python_tests/query_tolerance_test.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_ -from utilities import execution_path, run_all -import os, mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -if 'shape' in mapnik.DatasourceCache.plugin_names(): - def test_query_tolerance(): - srs = '+init=epsg:4326' - lyr = mapnik.Layer('test') - ds = mapnik.Shapefile(file='../data/shp/arrows.shp') - lyr.datasource = ds - lyr.srs = srs - _width = 256 - _map = mapnik.Map(_width,_width, srs) - _map.layers.append(lyr) - # zoom determines tolerance - _map.zoom_all() - _map_env = _map.envelope() - tol = (_map_env.maxx - _map_env.minx) / _width * 3 - # 0.046875 for arrows.shp and zoom_all - eq_(tol,0.046875) - # check point really exists - x, y = 2.0, 4.0 - features = _map.query_point(0,x,y).features - eq_(len(features),1) - # check inside tolerance limit - x = 2.0 + tol * 0.9 - features = _map.query_point(0,x,y).features - eq_(len(features),1) - # check outside tolerance limit - x = 2.0 + tol * 1.1 - features = _map.query_point(0,x,y).features - eq_(len(features),0) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/raster_colorizer_test.py b/tests/python_tests/raster_colorizer_test.py deleted file mode 100644 index 6fb0102e2..000000000 --- a/tests/python_tests/raster_colorizer_test.py +++ /dev/null @@ -1,90 +0,0 @@ -#coding=utf8 -import os -import mapnik -from utilities import execution_path, run_all -from nose.tools import eq_ - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -#test discrete colorizer mode -def test_get_color_discrete(): - #setup - colorizer = mapnik.RasterColorizer(); - colorizer.default_color = mapnik.Color(0,0,0,0); - colorizer.default_mode = mapnik.COLORIZER_DISCRETE; - - colorizer.add_stop(10, mapnik.Color(100,100,100,100)); - colorizer.add_stop(20, mapnik.Color(200,200,200,200)); - - #should be default colour - eq_(colorizer.get_color(-50), mapnik.Color(0,0,0,0)); - eq_(colorizer.get_color(0), mapnik.Color(0,0,0,0)); - - #now in stop 1 - eq_(colorizer.get_color(10), mapnik.Color(100,100,100,100)); - eq_(colorizer.get_color(19), mapnik.Color(100,100,100,100)); - - #now in stop 2 - eq_(colorizer.get_color(20), mapnik.Color(200,200,200,200)); - eq_(colorizer.get_color(1000), mapnik.Color(200,200,200,200)); - -#test exact colorizer mode -def test_get_color_exact(): - #setup - colorizer = mapnik.RasterColorizer(); - colorizer.default_color = mapnik.Color(0,0,0,0); - colorizer.default_mode = mapnik.COLORIZER_EXACT; - - colorizer.add_stop(10, mapnik.Color(100,100,100,100)); - colorizer.add_stop(20, mapnik.Color(200,200,200,200)); - - #should be default colour - eq_(colorizer.get_color(-50), mapnik.Color(0,0,0,0)); - eq_(colorizer.get_color(11), mapnik.Color(0,0,0,0)); - eq_(colorizer.get_color(20.001), mapnik.Color(0,0,0,0)); - - #should be stop 1 - eq_(colorizer.get_color(10), mapnik.Color(100,100,100,100)); - - #should be stop 2 - eq_(colorizer.get_color(20), mapnik.Color(200,200,200,200)); - -#test linear colorizer mode -def test_get_color_linear(): - #setup - colorizer = mapnik.RasterColorizer(); - colorizer.default_color = mapnik.Color(0,0,0,0); - colorizer.default_mode = mapnik.COLORIZER_LINEAR; - - colorizer.add_stop(10, mapnik.Color(100,100,100,100)); - colorizer.add_stop(20, mapnik.Color(200,200,200,200)); - - #should be default colour - eq_(colorizer.get_color(-50), mapnik.Color(0,0,0,0)); - eq_(colorizer.get_color(9.9), mapnik.Color(0,0,0,0)); - - #should be stop 1 - eq_(colorizer.get_color(10), mapnik.Color(100,100,100,100)); - - #should be stop 2 - eq_(colorizer.get_color(20), mapnik.Color(200,200,200,200)); - - #half way between stops 1 and 2 - eq_(colorizer.get_color(15), mapnik.Color(150,150,150,150)); - - #after stop 2 - eq_(colorizer.get_color(100), mapnik.Color(200,200,200,200)); - -def test_stop_label(): - stop = mapnik.ColorizerStop(1, mapnik.COLORIZER_LINEAR, mapnik.Color('red')) - assert not stop.label - label = u"32º C".encode('utf8') - stop.label = label - assert stop.label == label, stop.label - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/raster_symbolizer_test.py b/tests/python_tests/raster_symbolizer_test.py deleted file mode 100644 index e105dac73..000000000 --- a/tests/python_tests/raster_symbolizer_test.py +++ /dev/null @@ -1,217 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_ -from utilities import execution_path, run_all, get_unique_colors - -import os, mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - - -def test_dataraster_coloring(): - srs = '+init=epsg:32630' - lyr = mapnik.Layer('dataraster') - if 'gdal' in mapnik.DatasourceCache.plugin_names(): - lyr.datasource = mapnik.Gdal( - file = '../data/raster/dataraster.tif', - band = 1, - ) - lyr.srs = srs - _map = mapnik.Map(256,256, srs) - style = mapnik.Style() - rule = mapnik.Rule() - sym = mapnik.RasterSymbolizer() - # Assigning a colorizer to the RasterSymbolizer tells the later - # that it should use it to colorize the raw data raster - colorizer = mapnik.RasterColorizer(mapnik.COLORIZER_DISCRETE, mapnik.Color("transparent")) - - for value, color in [ - ( 0, "#0044cc"), - ( 10, "#00cc00"), - ( 20, "#ffff00"), - ( 30, "#ff7f00"), - ( 40, "#ff0000"), - ( 50, "#ff007f"), - ( 60, "#ff00ff"), - ( 70, "#cc00cc"), - ( 80, "#990099"), - ( 90, "#660066"), - ( 200, "transparent"), - ]: - colorizer.add_stop(value, mapnik.Color(color)) - sym.colorizer = colorizer; - rule.symbols.append(sym) - style.rules.append(rule) - _map.append_style('foo', style) - lyr.styles.append('foo') - _map.layers.append(lyr) - _map.zoom_to_box(lyr.envelope()) - - im = mapnik.Image(_map.width,_map.height) - mapnik.render(_map, im) - expected_file = './images/support/dataraster_coloring.png' - actual_file = '/tmp/' + os.path.basename(expected_file) - im.save(actual_file,'png32') - if not os.path.exists(expected_file) or os.environ.get('UPDATE'): - im.save(expected_file,'png32') - actual = mapnik.Image.open(actual_file) - expected = mapnik.Image.open(expected_file) - eq_(actual.tostring('png32'),expected.tostring('png32'), 'failed comparing actual (%s) and expected (%s)' % (actual_file,expected_file)) - -def test_dataraster_query_point(): - srs = '+init=epsg:32630' - lyr = mapnik.Layer('dataraster') - if 'gdal' in mapnik.DatasourceCache.plugin_names(): - lyr.datasource = mapnik.Gdal( - file = '../data/raster/dataraster.tif', - band = 1, - ) - lyr.srs = srs - _map = mapnik.Map(256,256, srs) - _map.layers.append(lyr) - - x, y = 556113.0,4381428.0 # center of extent of raster - _map.zoom_all() - features = _map.query_point(0,x,y).features - assert len(features) == 1 - feat = features[0] - center = feat.envelope().center() - assert center.x==x and center.y==y, center - value = feat['value'] - assert value == 18.0, value - - # point inside map extent but outside raster extent - current_box = _map.envelope() - current_box.expand_to_include(-427417,4477517) - _map.zoom_to_box(current_box) - features = _map.query_point(0,-427417,4477517).features - assert len(features) == 0 - - # point inside raster extent with nodata - features = _map.query_point(0,126850,4596050).features - assert len(features) == 0 - -def test_load_save_map(): - map = mapnik.Map(256,256) - in_map = "../visual_tests/styles/raster_symbolizer.xml" - try: - mapnik.load_map(map, in_map) - - out_map = mapnik.save_map_to_string(map) - assert 'RasterSymbolizer' in out_map - assert 'RasterColorizer' in out_map - assert 'stop' in out_map - except RuntimeError, e: - # only test datasources that we have installed - if not 'Could not create datasource' in str(e): - raise RuntimeError(str(e)) - -def test_raster_with_alpha_blends_correctly_with_background(): - WIDTH = 500 - HEIGHT = 500 - - map = mapnik.Map(WIDTH, HEIGHT) - WHITE = mapnik.Color(255, 255, 255) - map.background = WHITE - - style = mapnik.Style() - rule = mapnik.Rule() - symbolizer = mapnik.RasterSymbolizer() - symbolizer.scaling = mapnik.scaling_method.BILINEAR - - rule.symbols.append(symbolizer) - style.rules.append(rule) - - map.append_style('raster_style', style) - - map_layer = mapnik.Layer('test_layer') - filepath = '../data/raster/white-alpha.png' - if 'gdal' in mapnik.DatasourceCache.plugin_names(): - map_layer.datasource = mapnik.Gdal(file=filepath) - map_layer.styles.append('raster_style') - map.layers.append(map_layer) - - map.zoom_all() - - mim = mapnik.Image(WIDTH, HEIGHT) - - mapnik.render(map, mim) - mim.tostring() - # All white is expected - eq_(get_unique_colors(mim),['rgba(254,254,254,255)']) - -def test_raster_warping(): - lyrSrs = "+init=epsg:32630" - mapSrs = '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' - lyr = mapnik.Layer('dataraster', lyrSrs) - if 'gdal' in mapnik.DatasourceCache.plugin_names(): - lyr.datasource = mapnik.Gdal( - file = '../data/raster/dataraster.tif', - band = 1, - ) - sym = mapnik.RasterSymbolizer() - sym.colorizer = mapnik.RasterColorizer(mapnik.COLORIZER_DISCRETE, mapnik.Color(255,255,0)) - rule = mapnik.Rule() - rule.symbols.append(sym) - style = mapnik.Style() - style.rules.append(rule) - _map = mapnik.Map(256,256, mapSrs) - _map.append_style('foo', style) - lyr.styles.append('foo') - _map.layers.append(lyr) - map_proj = mapnik.Projection(mapSrs) - layer_proj = mapnik.Projection(lyrSrs) - prj_trans = mapnik.ProjTransform(map_proj, - layer_proj) - _map.zoom_to_box(prj_trans.backward(lyr.envelope())) - - im = mapnik.Image(_map.width,_map.height) - mapnik.render(_map, im) - expected_file = './images/support/raster_warping.png' - actual_file = '/tmp/' + os.path.basename(expected_file) - im.save(actual_file,'png32') - if not os.path.exists(expected_file) or os.environ.get('UPDATE'): - im.save(expected_file,'png32') - actual = mapnik.Image.open(actual_file) - expected = mapnik.Image.open(expected_file) - eq_(actual.tostring('png32'),expected.tostring('png32'), 'failed comparing actual (%s) and expected (%s)' % (actual_file,expected_file)) - -def test_raster_warping_does_not_overclip_source(): - lyrSrs = "+init=epsg:32630" - mapSrs = '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' - lyr = mapnik.Layer('dataraster', lyrSrs) - if 'gdal' in mapnik.DatasourceCache.plugin_names(): - lyr.datasource = mapnik.Gdal( - file = '../data/raster/dataraster.tif', - band = 1, - ) - sym = mapnik.RasterSymbolizer() - sym.colorizer = mapnik.RasterColorizer(mapnik.COLORIZER_DISCRETE, mapnik.Color(255,255,0)) - rule = mapnik.Rule() - rule.symbols.append(sym) - style = mapnik.Style() - style.rules.append(rule) - _map = mapnik.Map(256,256, mapSrs) - _map.background=mapnik.Color('white') - _map.append_style('foo', style) - lyr.styles.append('foo') - _map.layers.append(lyr) - _map.zoom_to_box(mapnik.Box2d(3,42,4,43)) - - im = mapnik.Image(_map.width,_map.height) - mapnik.render(_map, im) - expected_file = './images/support/raster_warping_does_not_overclip_source.png' - actual_file = '/tmp/' + os.path.basename(expected_file) - im.save(actual_file,'png32') - if not os.path.exists(expected_file) or os.environ.get('UPDATE'): - im.save(expected_file,'png32') - actual = mapnik.Image.open(actual_file) - expected = mapnik.Image.open(expected_file) - eq_(actual.tostring('png32'),expected.tostring('png32'), 'failed comparing actual (%s) and expected (%s)' % (actual_file,expected_file)) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/rasterlite_test.py b/tests/python_tests/rasterlite_test.py deleted file mode 100644 index b15b1574d..000000000 --- a/tests/python_tests/rasterlite_test.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_,assert_almost_equal -from utilities import execution_path, run_all - -import os, mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - - -if 'rasterlite' in mapnik.DatasourceCache.plugin_names(): - - def test_rasterlite(): - ds = mapnik.Rasterlite( - file = '../data/rasterlite/globe.sqlite', - table = 'globe' - ) - e = ds.envelope() - - assert_almost_equal(e.minx,-180, places=5) - assert_almost_equal(e.miny, -90, places=5) - assert_almost_equal(e.maxx, 180, places=5) - assert_almost_equal(e.maxy, 90, places=5) - eq_(len(ds.fields()),0) - query = mapnik.Query(ds.envelope()) - for fld in ds.fields(): - query.add_property_name(fld) - fs = ds.features(query) - feat = fs.next() - eq_(feat.id(),1) - eq_(feat.attributes,{}) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/render_grid_test.py b/tests/python_tests/render_grid_test.py deleted file mode 100644 index 1d15fd5ee..000000000 --- a/tests/python_tests/render_grid_test.py +++ /dev/null @@ -1,355 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.tools import eq_,raises -from utilities import execution_path, run_all -import os, mapnik - -try: - import json -except ImportError: - import simplejson as json - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -if mapnik.has_grid_renderer(): - def show_grids(name,g1,g2): - g1_file = '/tmp/mapnik-%s-actual.json' % name - open(g1_file,'w').write(json.dumps(g1,sort_keys=True)) - g2_file = '/tmp/mapnik-%s-expected.json' % name - open(g2_file,'w').write(json.dumps(g2,sort_keys=True)) - val = 'JSON does not match ->\n' - if g1['grid'] != g2['grid']: - val += ' X grid does not match\n' - else: - val += ' ✓ grid matches\n' - if g1['data'].keys() != g2['data'].keys(): - val += ' X data does not match\n' - else: - val += ' ✓ data matches\n' - if g1['keys'] != g2['keys']: - val += ' X keys do not\n' - else: - val += ' ✓ keys match\n' - val += '\n\t%s\n\t%s' % (g1_file,g2_file) - return val - - def show_grids2(name,g1,g2): - g2_expected = '../data/grids/mapnik-%s-actual.json' % name - if not os.path.exists(g2_expected): - # create test fixture based on actual results - open(g2_expected,'a+').write(json.dumps(g1,sort_keys=True)) - return - g1_file = '/tmp/mapnik-%s-actual.json' % name - open(g1_file,'w').write(json.dumps(g1,sort_keys=True)) - val = 'JSON does not match ->\n' - if g1['grid'] != g2['grid']: - val += ' X grid does not match\n' - else: - val += ' ✓ grid matches\n' - if g1['data'].keys() != g2['data'].keys(): - val += ' X data does not match\n' - else: - val += ' ✓ data matches\n' - if g1['keys'] != g2['keys']: - val += ' X keys do not\n' - else: - val += ' ✓ keys match\n' - val += '\n\t%s\n\t%s' % (g1_file,g2_expected) - return val - - # previous rendering using agg ellipse directly - grid_correct_new = {"data": {"North East": {"Name": "North East"}, "North West": {"Name": "North West"}, "South East": {"Name": "South East"}, "South West": {"Name": "South West"}}, "grid": [" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " !! ## ", " !!! ### ", " !! ## ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " $$ %% ", " $$$ %% ", " $$ %% ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "], "keys": ["", "North West", "North East", "South West", "South East"]} - - # newer rendering using svg - grid_correct_new2 = {"data": {"North East": {"Name": "North East"}, "North West": {"Name": "North West"}, "South East": {"Name": "South East"}, "South West": {"Name": "South West"}}, "grid": [" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " !! ## ", " !!! ### ", " !! ## ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " $$ %% ", " $$$ %% ", " $$ %% ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "], "keys": ["", "North West", "North East", "South West", "South East"]} - - grid_correct_new3 = {"data": {"North East": {"Name": "North East"}, "North West": {"Name": "North West"}, "South East": {"Name": "South East"}, "South West": {"Name": "South West"}}, "grid": [" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " !! ## ", " !!! ### ", " !! ## ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " $$ %% ", " $$$ %% ", " $ %% ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "], "keys": ["", "North West", "North East", "South West", "South East"]} - - def resolve(grid,row,col): - """ Resolve the attributes for a given pixel in a grid. - """ - row = grid['grid'][row] - utf_val = row[col] - #http://docs.python.org/library/functions.html#ord - codepoint = ord(utf_val) - if (codepoint >= 93): - codepoint-=1 - if (codepoint >= 35): - codepoint-=1 - codepoint -= 32 - key = grid['keys'][codepoint] - return grid['data'].get(key) - - - def create_grid_map(width,height,sym): - ds = mapnik.MemoryDatasource() - context = mapnik.Context() - context.push('Name') - f = mapnik.Feature(context,1) - f['Name'] = 'South East' - f.add_geometries_from_wkt('POINT (143.10 -38.60)') - ds.add_feature(f) - - f = mapnik.Feature(context,2) - f['Name'] = 'South West' - f.add_geometries_from_wkt('POINT (142.48 -38.60)') - ds.add_feature(f) - - f = mapnik.Feature(context,3) - f['Name'] = 'North West' - f.add_geometries_from_wkt('POINT (142.48 -38.38)') - ds.add_feature(f) - - f = mapnik.Feature(context,4) - f['Name'] = 'North East' - f.add_geometries_from_wkt('POINT (143.10 -38.38)') - ds.add_feature(f) - s = mapnik.Style() - r = mapnik.Rule() - sym.allow_overlap = True - r.symbols.append(sym) - s.rules.append(r) - lyr = mapnik.Layer('Places') - lyr.datasource = ds - lyr.styles.append('places_labels') - m = mapnik.Map(width,height) - m.append_style('places_labels',s) - m.layers.append(lyr) - return m - - - def test_render_grid(): - """ test render_grid method""" - width,height = 256,256 - sym = mapnik.MarkersSymbolizer() - sym.width = mapnik.Expression('10') - sym.height = mapnik.Expression('10') - m = create_grid_map(width,height,sym) - ul_lonlat = mapnik.Coord(142.30,-38.20) - lr_lonlat = mapnik.Coord(143.40,-38.80) - m.zoom_to_box(mapnik.Box2d(ul_lonlat,lr_lonlat)) - - # new method - grid = mapnik.Grid(m.width,m.height,key='Name') - mapnik.render_layer(m,grid,layer=0,fields=['Name']) - utf1 = grid.encode('utf',resolution=4) - eq_(utf1,grid_correct_new3,show_grids('new-markers',utf1,grid_correct_new3)) - - # check a full view is the same as a full image - grid_view = grid.view(0,0,width,height) - # for kicks check at full res too - utf3 = grid.encode('utf',resolution=1) - utf4 = grid_view.encode('utf',resolution=1) - eq_(utf3['grid'],utf4['grid']) - eq_(utf3['keys'],utf4['keys']) - eq_(utf3['data'],utf4['data']) - - eq_(resolve(utf4,0,0),None) - - # resolve some center points in the - # resampled view - utf5 = grid_view.encode('utf',resolution=4) - eq_(resolve(utf5,25,10),{"Name": "North West"}) - eq_(resolve(utf5,25,46),{"Name": "North East"}) - eq_(resolve(utf5,38,10),{"Name": "South West"}) - eq_(resolve(utf5,38,46),{"Name": "South East"}) - - - grid_feat_id = {'keys': ['', '3', '4', '2', '1'], 'data': {'1': {'Name': 'South East'}, '3': {'Name': u'North West'}, '2': {'Name': 'South West'}, '4': {'Name': 'North East'}}, 'grid': [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' !! ## ', ' !!! ### ', ' !! ## ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' $$$ %% ', ' $$$ %%% ', ' $$ %% ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']} - - grid_feat_id2 = {"data": {"1": {"Name": "South East"}, "2": {"Name": "South West"}, "3": {"Name": "North West"}, "4": {"Name": "North East"}}, "grid": [" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " !! ## ", " !!! ### ", " !! ## ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " $$ %% ", " $$$ %% ", " $$ %% ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "], "keys": ["", "3", "4", "2", "1"]} - - grid_feat_id3 = {"data": {"1": {"Name": "South East", "__id__": 1}, "2": {"Name": "South West", "__id__": 2}, "3": {"Name": "North West", "__id__": 3}, "4": {"Name": "North East", "__id__": 4}}, "grid": [" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " !! ## ", " !!! ### ", " !! ## ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " $$ %% ", " $$$ %% ", " $ %% ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "], "keys": ["", "3", "4", "2", "1"]} - - def test_render_grid3(): - """ test using feature id""" - width,height = 256,256 - sym = mapnik.MarkersSymbolizer() - sym.width = mapnik.Expression('10') - sym.height = mapnik.Expression('10') - m = create_grid_map(width,height,sym) - ul_lonlat = mapnik.Coord(142.30,-38.20) - lr_lonlat = mapnik.Coord(143.40,-38.80) - m.zoom_to_box(mapnik.Box2d(ul_lonlat,lr_lonlat)) - - grid = mapnik.Grid(m.width,m.height,key='__id__') - mapnik.render_layer(m,grid,layer=0,fields=['__id__','Name']) - utf1 = grid.encode('utf',resolution=4) - eq_(utf1,grid_feat_id3,show_grids('id-markers',utf1,grid_feat_id3)) - # check a full view is the same as a full image - grid_view = grid.view(0,0,width,height) - # for kicks check at full res too - utf3 = grid.encode('utf',resolution=1) - utf4 = grid_view.encode('utf',resolution=1) - eq_(utf3['grid'],utf4['grid']) - eq_(utf3['keys'],utf4['keys']) - eq_(utf3['data'],utf4['data']) - - eq_(resolve(utf4,0,0),None) - - # resolve some center points in the - # resampled view - utf5 = grid_view.encode('utf',resolution=4) - eq_(resolve(utf5,25,10),{"Name": "North West","__id__": 3}) - eq_(resolve(utf5,25,46),{"Name": "North East","__id__": 4}) - eq_(resolve(utf5,38,10),{"Name": "South West","__id__": 2}) - eq_(resolve(utf5,38,46),{"Name": "South East","__id__": 1}) - - - def gen_grid_for_id(pixel_key): - ds = mapnik.MemoryDatasource() - context = mapnik.Context() - context.push('Name') - f = mapnik.Feature(context,pixel_key) - f['Name'] = str(pixel_key) - f.add_geometries_from_wkt('POLYGON ((0 0, 0 256, 256 256, 256 0, 0 0))') - ds.add_feature(f) - s = mapnik.Style() - r = mapnik.Rule() - symb = mapnik.PolygonSymbolizer() - r.symbols.append(symb) - s.rules.append(r) - lyr = mapnik.Layer('Places') - lyr.datasource = ds - lyr.styles.append('places_labels') - width,height = 256,256 - m = mapnik.Map(width,height) - m.append_style('places_labels',s) - m.layers.append(lyr) - m.zoom_all() - grid = mapnik.Grid(m.width,m.height,key='__id__') - mapnik.render_layer(m,grid,layer=0,fields=['__id__','Name']) - return grid - - def test_negative_id(): - grid = gen_grid_for_id(-1) - eq_(grid.get_pixel(128,128),-1) - utf1 = grid.encode('utf',resolution=4) - eq_(utf1['keys'],['-1']) - - def test_32bit_int_id(): - int32 = 2147483647 - grid = gen_grid_for_id(int32) - eq_(grid.get_pixel(128,128),int32) - utf1 = grid.encode('utf',resolution=4) - eq_(utf1['keys'],[str(int32)]) - max_neg = -(int32) - grid = gen_grid_for_id(max_neg) - eq_(grid.get_pixel(128,128),max_neg) - utf1 = grid.encode('utf',resolution=4) - eq_(utf1['keys'],[str(max_neg)]) - - def test_64bit_int_id(): - int64 = 0x7FFFFFFFFFFFFFFF - grid = gen_grid_for_id(int64) - eq_(grid.get_pixel(128,128),int64) - utf1 = grid.encode('utf',resolution=4) - eq_(utf1['keys'],[str(int64)]) - max_neg = -(int64) - grid = gen_grid_for_id(max_neg) - eq_(grid.get_pixel(128,128),max_neg) - utf1 = grid.encode('utf',resolution=4) - eq_(utf1['keys'],[str(max_neg)]) - - def test_id_zero(): - grid = gen_grid_for_id(0) - eq_(grid.get_pixel(128,128),0) - utf1 = grid.encode('utf',resolution=4) - eq_(utf1['keys'],['0']) - - line_expected = {"keys": ["", "1"], "data": {"1": {"Name": "1"}}, "grid": [" !", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", " !! ", "!! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! ", " ! "]} - - def test_line_rendering(): - ds = mapnik.MemoryDatasource() - context = mapnik.Context() - context.push('Name') - pixel_key = 1 - f = mapnik.Feature(context,pixel_key) - f['Name'] = str(pixel_key) - f.add_geometries_from_wkt('LINESTRING (30 10, 10 30, 40 40)') - ds.add_feature(f) - s = mapnik.Style() - r = mapnik.Rule() - symb = mapnik.LineSymbolizer() - r.symbols.append(symb) - s.rules.append(r) - lyr = mapnik.Layer('Places') - lyr.datasource = ds - lyr.styles.append('places_labels') - width,height = 256,256 - m = mapnik.Map(width,height) - m.append_style('places_labels',s) - m.layers.append(lyr) - m.zoom_all() - #mapnik.render_to_file(m,'test.png') - grid = mapnik.Grid(m.width,m.height,key='__id__') - mapnik.render_layer(m,grid,layer=0,fields=['Name']) - utf1 = grid.encode() - eq_(utf1,line_expected,show_grids('line',utf1,line_expected)) - - point_expected = {"data": {"1": {"Name": "South East"}, "2": {"Name": "South West"}, "3": {"Name": "North West"}, "4": {"Name": "North East"}}, "grid": [" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " !!!! #### ", " !!!! #### ", " !!!! #### ", " !!!! #### ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " $$$$ %%%% ", " $$$$ %%%% ", " $$$$ %%%% ", " $$$$ %%%% ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "], "keys": ["", "3", "4", "2", "1"]} - - def test_point_symbolizer_grid(): - width,height = 256,256 - sym = mapnik.PointSymbolizer() - sym.file = '../data/images/dummy.png' - m = create_grid_map(width,height,sym) - ul_lonlat = mapnik.Coord(142.30,-38.20) - lr_lonlat = mapnik.Coord(143.40,-38.80) - m.zoom_to_box(mapnik.Box2d(ul_lonlat,lr_lonlat)) - grid = mapnik.Grid(m.width,m.height) - mapnik.render_layer(m,grid,layer=0,fields=['Name']) - utf1 = grid.encode() - eq_(utf1,point_expected,show_grids('point-sym',utf1,point_expected)) - - - # should throw because this is a mis-usage - # https://github.com/mapnik/mapnik/issues/1325 - @raises(RuntimeError) - def test_render_to_grid_multiple_times(): - # create map with two layers - m = mapnik.Map(256,256) - s = mapnik.Style() - r = mapnik.Rule() - sym = mapnik.MarkersSymbolizer() - sym.allow_overlap = True - r.symbols.append(sym) - s.rules.append(r) - m.append_style('points',s) - - # NOTE: we use a csv datasource here - # because the memorydatasource fails silently for - # queries requesting fields that do not exist in the datasource - ds1 = mapnik.Datasource(**{"type":"csv","inline":''' - wkt,Name - "POINT (143.10 -38.60)",South East'''}) - lyr1 = mapnik.Layer('One') - lyr1.datasource = ds1 - lyr1.styles.append('points') - m.layers.append(lyr1) - - ds2 = mapnik.Datasource(**{"type":"csv","inline":''' - wkt,Value - "POINT (142.48 -38.60)",South West'''}) - lyr2 = mapnik.Layer('Two') - lyr2.datasource = ds2 - lyr2.styles.append('points') - m.layers.append(lyr2) - - ul_lonlat = mapnik.Coord(142.30,-38.20) - lr_lonlat = mapnik.Coord(143.40,-38.80) - m.zoom_to_box(mapnik.Box2d(ul_lonlat,lr_lonlat)) - grid = mapnik.Grid(m.width,m.height) - mapnik.render_layer(m,grid,layer=0,fields=['Name']) - # should throw right here since Name will be a property now on the `grid` object - # and it is not found on the second layer - mapnik.render_layer(m,grid,layer=1,fields=['Value']) - grid.encode() - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/render_test.py b/tests/python_tests/render_test.py deleted file mode 100644 index 393b3896a..000000000 --- a/tests/python_tests/render_test.py +++ /dev/null @@ -1,241 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.tools import eq_,raises -import tempfile -import os, mapnik -from utilities import execution_path, run_all - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -def test_simplest_render(): - m = mapnik.Map(256, 256) - im = mapnik.Image(m.width, m.height) - eq_(im.painted(),False) - eq_(im.is_solid(),True) - mapnik.render(m, im) - eq_(im.painted(),False) - eq_(im.is_solid(),True) - s = im.tostring() - eq_(s, 256 * 256 * '\x00\x00\x00\x00') - -def test_render_image_to_string(): - im = mapnik.Image(256, 256) - im.background = mapnik.Color('black') - eq_(im.painted(),False) - eq_(im.is_solid(),True) - s = im.tostring() - eq_(s, 256 * 256 * '\x00\x00\x00\xff') - -def test_non_solid_image(): - im = mapnik.Image(256, 256) - im.background = mapnik.Color('black') - eq_(im.painted(),False) - eq_(im.is_solid(),True) - # set one pixel to a different color - im.set_pixel(0,0,mapnik.Color('white')) - eq_(im.painted(),False) - eq_(im.is_solid(),False) - -def test_non_solid_image_view(): - im = mapnik.Image(256, 256) - im.background = mapnik.Color('black') - view = im.view(0,0,256,256) - eq_(view.is_solid(),True) - # set one pixel to a different color - im.set_pixel(0,0,mapnik.Color('white')) - eq_(im.is_solid(),False) - # view, since it is the exact dimensions of the image - # should also be non-solid - eq_(view.is_solid(),False) - # but not a view that excludes the single diff pixel - view2 = im.view(1,1,256,256) - eq_(view2.is_solid(),True) - -def test_setting_alpha(): - w,h = 256,256 - im1 = mapnik.Image(w,h) - # white, half transparent - c1 = mapnik.Color('rgba(255,255,255,.5)') - im1.background = c1 - eq_(im1.painted(),False) - eq_(im1.is_solid(),True) - # pure white - im2 = mapnik.Image(w,h) - c2 = mapnik.Color('rgba(255,255,255,1)') - im2.background = c2 - im2.set_alpha(c1.a/255.0) - eq_(im2.painted(),False) - eq_(im2.is_solid(),True) - eq_(len(im1.tostring('png32')), len(im2.tostring('png32'))) - -def test_render_image_to_file(): - im = mapnik.Image(256, 256) - im.background = mapnik.Color('black') - if mapnik.has_jpeg(): - im.save('test.jpg') - im.save('test.png', 'png') - if os.path.exists('test.jpg'): - os.remove('test.jpg') - else: - return False - if os.path.exists('test.png'): - os.remove('test.png') - else: - return False - -def get_paired_images(w,h,mapfile): - tmp_map = 'tmp_map.xml' - m = mapnik.Map(w,h) - mapnik.load_map(m,mapfile) - im = mapnik.Image(w,h) - m.zoom_all() - mapnik.render(m,im) - mapnik.save_map(m,tmp_map) - m2 = mapnik.Map(w,h) - mapnik.load_map(m2,tmp_map) - im2 = mapnik.Image(w,h) - m2.zoom_all() - mapnik.render(m2,im2) - os.remove(tmp_map) - return im,im2 - -def test_render_from_serialization(): - try: - im,im2 = get_paired_images(100,100,'../data/good_maps/building_symbolizer.xml') - eq_(im.tostring('png32'),im2.tostring('png32')) - - im,im2 = get_paired_images(100,100,'../data/good_maps/polygon_symbolizer.xml') - eq_(im.tostring('png32'),im2.tostring('png32')) - except RuntimeError, e: - # only test datasources that we have installed - if not 'Could not create datasource' in str(e): - raise RuntimeError(e) - -def test_render_points(): - if not mapnik.has_cairo(): return - # create and populate point datasource (WGS84 lat-lon coordinates) - ds = mapnik.MemoryDatasource() - context = mapnik.Context() - context.push('Name') - f = mapnik.Feature(context,1) - f['Name'] = 'Westernmost Point' - f.add_geometries_from_wkt('POINT (142.48 -38.38)') - ds.add_feature(f) - - f = mapnik.Feature(context,2) - f['Name'] = 'Southernmost Point' - f.add_geometries_from_wkt('POINT (143.10 -38.60)') - ds.add_feature(f) - - # create layer/rule/style - s = mapnik.Style() - r = mapnik.Rule() - symb = mapnik.PointSymbolizer() - symb.allow_overlap = True - r.symbols.append(symb) - s.rules.append(r) - lyr = mapnik.Layer('Places','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs') - lyr.datasource = ds - lyr.styles.append('places_labels') - # latlon bounding box corners - ul_lonlat = mapnik.Coord(142.30,-38.20) - lr_lonlat = mapnik.Coord(143.40,-38.80) - # render for different projections - projs = { - 'google': '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over', - 'latlon': '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs', - 'merc': '+proj=merc +datum=WGS84 +k=1.0 +units=m +over +no_defs', - 'utm': '+proj=utm +zone=54 +datum=WGS84' - } - for projdescr in projs.iterkeys(): - m = mapnik.Map(1000, 500, projs[projdescr]) - m.append_style('places_labels',s) - m.layers.append(lyr) - dest_proj = mapnik.Projection(projs[projdescr]) - src_proj = mapnik.Projection('+init=epsg:4326') - tr = mapnik.ProjTransform(src_proj,dest_proj) - m.zoom_to_box(tr.forward(mapnik.Box2d(ul_lonlat,lr_lonlat))) - # Render to SVG so that it can be checked how many points are there with string comparison - svg_file = os.path.join(tempfile.gettempdir(), 'mapnik-render-points-%s.svg' % projdescr) - mapnik.render_to_file(m, svg_file) - num_points_present = len(ds.all_features()) - svg = open(svg_file,'r').read() - num_points_rendered = svg.count('=1,True) - del ds - - eq_(os.path.exists(index),True) - os.unlink(index) - - def test_geometry_round_trip(): - test_db = '/tmp/mapnik-sqlite-point.db' - ogr_metadata = True - - # create test db - conn = sqlite3.connect(test_db) - cur = conn.cursor() - cur.execute(''' - CREATE TABLE IF NOT EXISTS point_table - (id INTEGER PRIMARY KEY AUTOINCREMENT, geometry BLOB, name varchar) - ''') - # optional: but nice if we want to read with ogr - if ogr_metadata: - cur.execute('''CREATE TABLE IF NOT EXISTS geometry_columns ( - f_table_name VARCHAR, - f_geometry_column VARCHAR, - geometry_type INTEGER, - coord_dimension INTEGER, - srid INTEGER, - geometry_format VARCHAR )''') - cur.execute('''INSERT INTO geometry_columns - (f_table_name, f_geometry_column, geometry_format, - geometry_type, coord_dimension, srid) VALUES - ('point_table','geometry','WKB', 1, 1, 4326)''') - conn.commit() - cur.close() - - # add a point as wkb (using mapnik) to match how an ogr created db looks - x = -122 # longitude - y = 48 # latitude - wkt = 'POINT(%s %s)' % (x,y) - # little endian wkb (mapnik will auto-detect and ready either little or big endian (XDR)) - wkb = mapnik.Path.from_wkt(wkt).to_wkb(mapnik.wkbByteOrder.NDR) - values = (None,sqlite3.Binary(wkb),"test point") - cur = conn.cursor() - cur.execute('''INSERT into "point_table" (id,geometry,name) values (?,?,?)''',values) - conn.commit() - cur.close() - conn.close() - - def make_wkb_point(x,y): - import struct - byteorder = 1; # little endian - endianess = '' - if byteorder == 1: - endianess = '<' - else: - endianess = '>' - geom_type = 1; # for a point - return struct.pack('%sbldd' % endianess, byteorder, geom_type, x, y) - - # confirm the wkb matches a manually formed wkb - wkb2 = make_wkb_point(x,y) - eq_(wkb,wkb2) - - # ensure we can read this data back out properly with mapnik - ds = mapnik.Datasource(**{'type':'sqlite','file':test_db, 'table':'point_table'}) - fs = ds.featureset() - feat = fs.next() - eq_(feat.id(),1) - eq_(feat['name'],'test point') - geoms = feat.geometries() - eq_(len(geoms),1) - eq_(geoms.to_wkt(),'Point(-122 48)') - del ds - - # ensure it matches data read with just sqlite - conn = sqlite3.connect(test_db) - cur = conn.cursor() - cur.execute('''SELECT * from point_table''') - conn.commit() - result = cur.fetchone() - cur.close() - feat_id = result[0] - eq_(feat_id,1) - name = result[2] - eq_(name,'test point') - geom_wkb_blob = result[1] - eq_(str(geom_wkb_blob),geoms.to_wkb(mapnik.wkbByteOrder.NDR)) - new_geom = mapnik.Path.from_wkb(str(geom_wkb_blob)) - eq_(new_geom.to_wkt(),geoms.to_wkt()) - conn.close() - os.unlink(test_db) - -if __name__ == "__main__": - setup() - returncode = run_all(eval(x) for x in dir() if x.startswith("test_")) - exit(returncode) diff --git a/tests/python_tests/sqlite_test.py b/tests/python_tests/sqlite_test.py deleted file mode 100644 index 93d9bdba7..000000000 --- a/tests/python_tests/sqlite_test.py +++ /dev/null @@ -1,460 +0,0 @@ -#!/usr/bin/env python - -from nose.tools import eq_, raises -from utilities import execution_path, run_all -import os -import mapnik - - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -if 'sqlite' in mapnik.DatasourceCache.plugin_names(): - - def test_attachdb_with_relative_file(): - # The point table and index is in the qgis_spatiallite.sqlite - # database. If either is not found, then this fails - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='point', - attachdb='scratch@qgis_spatiallite.sqlite' - ) - fs = ds.featureset() - feature = fs.next() - eq_(feature['pkuid'],1) - - def test_attachdb_with_multiple_files(): - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='attachedtest', - attachdb='scratch1@:memory:,scratch2@:memory:', - initdb=''' - create table scratch1.attachedtest (the_geom); - create virtual table scratch2.idx_attachedtest_the_geom using rtree(pkid,xmin,xmax,ymin,ymax); - insert into scratch2.idx_attachedtest_the_geom values (1,-7799225.5,-7778571.0,1393264.125,1417719.375); - ''' - ) - fs = ds.featureset() - feature = None - try : - feature = fs.next() - except StopIteration: - pass - # the above should not throw but will result in no features - eq_(feature,None) - - def test_attachdb_with_absolute_file(): - # The point table and index is in the qgis_spatiallite.sqlite - # database. If either is not found, then this fails - ds = mapnik.SQLite(file=os.getcwd() + '/../data/sqlite/world.sqlite', - table='point', - attachdb='scratch@qgis_spatiallite.sqlite' - ) - fs = ds.featureset() - feature = fs.next() - eq_(feature['pkuid'],1) - - def test_attachdb_with_index(): - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='attachedtest', - attachdb='scratch@:memory:', - initdb=''' - create table scratch.attachedtest (the_geom); - create virtual table scratch.idx_attachedtest_the_geom using rtree(pkid,xmin,xmax,ymin,ymax); - insert into scratch.idx_attachedtest_the_geom values (1,-7799225.5,-7778571.0,1393264.125,1417719.375); - ''' - ) - - fs = ds.featureset() - feature = None - try : - feature = fs.next() - except StopIteration: - pass - eq_(feature,None) - - def test_attachdb_with_explicit_index(): - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='attachedtest', - index_table='myindex', - attachdb='scratch@:memory:', - initdb=''' - create table scratch.attachedtest (the_geom); - create virtual table scratch.myindex using rtree(pkid,xmin,xmax,ymin,ymax); - insert into scratch.myindex values (1,-7799225.5,-7778571.0,1393264.125,1417719.375); - ''' - ) - fs = ds.featureset() - feature = None - try: - feature = fs.next() - except StopIteration: - pass - eq_(feature,None) - - def test_attachdb_with_sql_join(): - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='(select * from world_merc INNER JOIN business on world_merc.iso3 = business.ISO3 limit 100)', - attachdb='busines@business.sqlite' - ) - eq_(len(ds.fields()),29) - eq_(ds.fields(),['OGC_FID', 'fips', 'iso2', 'iso3', 'un', 'name', 'area', 'pop2005', 'region', 'subregion', 'lon', 'lat', 'ISO3:1', '1995', '1996', '1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010']) - eq_(ds.field_types(),['int', 'str', 'str', 'str', 'int', 'str', 'int', 'int', 'int', 'int', 'float', 'float', 'str', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int']) - fs = ds.featureset() - feature = fs.next() - eq_(feature.id(),1) - expected = { - 1995:0, - 1996:0, - 1997:0, - 1998:0, - 1999:0, - 2000:0, - 2001:0, - 2002:0, - 2003:0, - 2004:0, - 2005:0, - 2006:0, - 2007:0, - 2008:0, - 2009:0, - 2010:0, - # this appears to be sqlites way of - # automatically handling clashing column names - 'ISO3:1':'ATG', - 'OGC_FID':1, - 'area':44, - 'fips':u'AC', - 'iso2':u'AG', - 'iso3':u'ATG', - 'lat':17.078, - 'lon':-61.783, - 'name':u'Antigua and Barbuda', - 'pop2005':83039, - 'region':19, - 'subregion':29, - 'un':28 - } - for k,v in expected.items(): - try: - eq_(feature[str(k)],v) - except: - #import pdb;pdb.set_trace() - print 'invalid key/v %s/%s for: %s' % (k,v,feature) - - def test_attachdb_with_sql_join_count(): - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='(select * from world_merc INNER JOIN business on world_merc.iso3 = business.ISO3 limit 100)', - attachdb='busines@business.sqlite' - ) - eq_(len(ds.fields()),29) - eq_(ds.fields(),['OGC_FID', 'fips', 'iso2', 'iso3', 'un', 'name', 'area', 'pop2005', 'region', 'subregion', 'lon', 'lat', 'ISO3:1', '1995', '1996', '1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010']) - eq_(ds.field_types(),['int', 'str', 'str', 'str', 'int', 'str', 'int', 'int', 'int', 'int', 'float', 'float', 'str', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int']) - eq_(len(ds.all_features()),100) - - def test_attachdb_with_sql_join_count2(): - ''' - sqlite3 world.sqlite - attach database 'business.sqlite' as business; - select count(*) from world_merc INNER JOIN business on world_merc.iso3 = business.ISO3; - ''' - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='(select * from world_merc INNER JOIN business on world_merc.iso3 = business.ISO3)', - attachdb='busines@business.sqlite' - ) - eq_(len(ds.fields()),29) - eq_(ds.fields(),['OGC_FID', 'fips', 'iso2', 'iso3', 'un', 'name', 'area', 'pop2005', 'region', 'subregion', 'lon', 'lat', 'ISO3:1', '1995', '1996', '1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010']) - eq_(ds.field_types(),['int', 'str', 'str', 'str', 'int', 'str', 'int', 'int', 'int', 'int', 'float', 'float', 'str', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int']) - eq_(len(ds.all_features()),192) - - def test_attachdb_with_sql_join_count3(): - ''' - select count(*) from (select * from world_merc where 1=1) as world_merc INNER JOIN business on world_merc.iso3 = business.ISO3; - ''' - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='(select * from (select * from world_merc where !intersects!) as world_merc INNER JOIN business on world_merc.iso3 = business.ISO3)', - attachdb='busines@business.sqlite' - ) - eq_(len(ds.fields()),29) - eq_(ds.fields(),['OGC_FID', 'fips', 'iso2', 'iso3', 'un', 'name', 'area', 'pop2005', 'region', 'subregion', 'lon', 'lat', 'ISO3:1', '1995', '1996', '1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010']) - eq_(ds.field_types(),['int', 'str', 'str', 'str', 'int', 'str', 'int', 'int', 'int', 'int', 'float', 'float', 'str', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int']) - eq_(len(ds.all_features()),192) - - def test_attachdb_with_sql_join_count4(): - ''' - select count(*) from (select * from world_merc where 1=1) as world_merc INNER JOIN business on world_merc.iso3 = business.ISO3; - ''' - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='(select * from (select * from world_merc where !intersects! limit 1) as world_merc INNER JOIN business on world_merc.iso3 = business.ISO3)', - attachdb='busines@business.sqlite' - ) - eq_(len(ds.fields()),29) - eq_(ds.fields(),['OGC_FID', 'fips', 'iso2', 'iso3', 'un', 'name', 'area', 'pop2005', 'region', 'subregion', 'lon', 'lat', 'ISO3:1', '1995', '1996', '1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010']) - eq_(ds.field_types(),['int', 'str', 'str', 'str', 'int', 'str', 'int', 'int', 'int', 'int', 'float', 'float', 'str', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int', 'int']) - eq_(len(ds.all_features()),1) - - def test_attachdb_with_sql_join_count5(): - ''' - select count(*) from (select * from world_merc where 1=1) as world_merc INNER JOIN business on world_merc.iso3 = business.ISO3; - ''' - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='(select * from (select * from world_merc where !intersects! and 1=2) as world_merc INNER JOIN business on world_merc.iso3 = business.ISO3)', - attachdb='busines@business.sqlite' - ) - # nothing is able to join to business so we don't pick up business schema - eq_(len(ds.fields()),12) - eq_(ds.fields(),['OGC_FID', 'fips', 'iso2', 'iso3', 'un', 'name', 'area', 'pop2005', 'region', 'subregion', 'lon', 'lat']) - eq_(ds.field_types(),['int', 'str', 'str', 'str', 'int', 'str', 'int', 'int', 'int', 'int', 'float', 'float']) - eq_(len(ds.all_features()),0) - - def test_subqueries(): - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='world_merc', - ) - fs = ds.featureset() - feature = fs.next() - eq_(feature['OGC_FID'],1) - eq_(feature['fips'],u'AC') - eq_(feature['iso2'],u'AG') - eq_(feature['iso3'],u'ATG') - eq_(feature['un'],28) - eq_(feature['name'],u'Antigua and Barbuda') - eq_(feature['area'],44) - eq_(feature['pop2005'],83039) - eq_(feature['region'],19) - eq_(feature['subregion'],29) - eq_(feature['lon'],-61.783) - eq_(feature['lat'],17.078) - - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='(select * from world_merc)', - ) - fs = ds.featureset() - feature = fs.next() - eq_(feature['OGC_FID'],1) - eq_(feature['fips'],u'AC') - eq_(feature['iso2'],u'AG') - eq_(feature['iso3'],u'ATG') - eq_(feature['un'],28) - eq_(feature['name'],u'Antigua and Barbuda') - eq_(feature['area'],44) - eq_(feature['pop2005'],83039) - eq_(feature['region'],19) - eq_(feature['subregion'],29) - eq_(feature['lon'],-61.783) - eq_(feature['lat'],17.078) - - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='(select OGC_FID,GEOMETRY from world_merc)', - ) - fs = ds.featureset() - feature = fs.next() - eq_(feature['OGC_FID'],1) - eq_(len(feature),1) - - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='(select GEOMETRY,OGC_FID,fips from world_merc)', - ) - fs = ds.featureset() - feature = fs.next() - eq_(feature['OGC_FID'],1) - eq_(feature['fips'],u'AC') - - # same as above, except with alias like postgres requires - # TODO - should we try to make this work? - #ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - # table='(select GEOMETRY,rowid as aliased_id,fips from world_merc) as table', - # key_field='aliased_id' - # ) - #fs = ds.featureset() - #feature = fs.next() - #eq_(feature['aliased_id'],1) - #eq_(feature['fips'],u'AC') - - ds = mapnik.SQLite(file='../data/sqlite/world.sqlite', - table='(select GEOMETRY,OGC_FID,OGC_FID as rowid,fips from world_merc)', - ) - fs = ds.featureset() - feature = fs.next() - eq_(feature['rowid'],1) - eq_(feature['fips'],u'AC') - - def test_empty_db(): - ds = mapnik.SQLite(file='../data/sqlite/empty.db', - table='empty', - ) - fs = ds.featureset() - feature = None - try: - feature = fs.next() - except StopIteration: - pass - eq_(feature,None) - - @raises(RuntimeError) - def test_that_nonexistant_query_field_throws(**kwargs): - ds = mapnik.SQLite(file='../data/sqlite/empty.db', - table='empty', - ) - eq_(len(ds.fields()),25) - eq_(ds.fields(),['OGC_FID', 'scalerank', 'labelrank', 'featurecla', 'sovereignt', 'sov_a3', 'adm0_dif', 'level', 'type', 'admin', 'adm0_a3', 'geou_dif', 'name', 'abbrev', 'postal', 'name_forma', 'terr_', 'name_sort', 'map_color', 'pop_est', 'gdp_md_est', 'fips_10_', 'iso_a2', 'iso_a3', 'iso_n3']) - eq_(ds.field_types(),['int', 'int', 'int', 'str', 'str', 'str', 'float', 'float', 'str', 'str', 'str', 'float', 'str', 'str', 'str', 'str', 'str', 'str', 'float', 'float', 'float', 'float', 'str', 'str', 'float']) - query = mapnik.Query(ds.envelope()) - for fld in ds.fields(): - query.add_property_name(fld) - # also add an invalid one, triggering throw - query.add_property_name('bogus') - ds.features(query) - - def test_intersects_token1(): - ds = mapnik.SQLite(file='../data/sqlite/empty.db', - table='(select * from empty where !intersects!)', - ) - fs = ds.featureset() - feature = None - try : - feature = fs.next() - except StopIteration: - pass - eq_(feature,None) - - def test_intersects_token2(): - ds = mapnik.SQLite(file='../data/sqlite/empty.db', - table='(select * from empty where "a"!="b" and !intersects!)', - ) - fs = ds.featureset() - feature = None - try : - feature = fs.next() - except StopIteration: - pass - eq_(feature,None) - - def test_intersects_token3(): - ds = mapnik.SQLite(file='../data/sqlite/empty.db', - table='(select * from empty where "a"!="b" and !intersects!)', - ) - fs = ds.featureset() - feature = None - try : - feature = fs.next() - except StopIteration: - pass - eq_(feature,None) - - # https://github.com/mapnik/mapnik/issues/1537 - # this works because key_field is manually set - def test_db_with_one_text_column(): - # form up an in-memory test db - wkb = '010100000000000000000000000000000000000000' - ds = mapnik.SQLite(file=':memory:', - table='test1', - initdb=''' - create table test1 (alias TEXT,geometry BLOB); - insert into test1 values ("test",x'%s'); - ''' % wkb, - extent='-180,-60,180,60', - use_spatial_index=False, - key_field='alias' - ) - eq_(len(ds.fields()),1) - eq_(ds.fields(),['alias']) - eq_(ds.field_types(),['str']) - fs = ds.all_features() - eq_(len(fs),1) - feat = fs[0] - #eq_(feat.id(),1) - eq_(feat['alias'],'test') - eq_(len(feat.geometries()),1) - eq_(feat.geometries()[0].to_wkt(),'Point(0 0)') - - def test_db_with_one_untyped_column(): - # form up an in-memory test db - wkb = '010100000000000000000000000000000000000000' - ds = mapnik.SQLite(file=':memory:', - table='test1', - initdb=''' - create table test1 (geometry BLOB, untyped); - insert into test1 values (x'%s', 'untyped'); - ''' % wkb, - extent='-180,-60,180,60', - use_spatial_index=False, - key_field='rowid' - ) - - # ensure the untyped column is found - eq_(len(ds.fields()),2) - eq_(ds.fields(),['rowid', 'untyped']) - eq_(ds.field_types(),['int', 'str']) - - def test_db_with_one_untyped_column_using_subquery(): - # form up an in-memory test db - wkb = '010100000000000000000000000000000000000000' - ds = mapnik.SQLite(file=':memory:', - table='(SELECT rowid, geometry, untyped FROM test1)', - initdb=''' - create table test1 (geometry BLOB, untyped); - insert into test1 values (x'%s', 'untyped'); - ''' % wkb, - extent='-180,-60,180,60', - use_spatial_index=False, - key_field='rowid' - ) - - # ensure the untyped column is found - eq_(len(ds.fields()),3) - eq_(ds.fields(),['rowid', 'untyped', 'rowid']) - eq_(ds.field_types(),['int', 'str', 'int']) - - - def test_that_64bit_int_fields_work(): - ds = mapnik.SQLite(file='../data/sqlite/64bit_int.sqlite', - table='int_table', - use_spatial_index=False - ) - eq_(len(ds.fields()),3) - eq_(ds.fields(),['OGC_FID','id','bigint']) - eq_(ds.field_types(),['int','int','int']) - fs = ds.featureset() - feat = fs.next() - eq_(feat.id(),1) - eq_(feat['OGC_FID'],1) - eq_(feat['bigint'],2147483648) - feat = fs.next() - eq_(feat.id(),2) - eq_(feat['OGC_FID'],2) - eq_(feat['bigint'],922337203685477580) - - - def test_null_id_field(): - # silence null key warning: https://github.com/mapnik/mapnik/issues/1889 - default_logging_severity = mapnik.logger.get_severity() - mapnik.logger.set_severity(mapnik.severity_type.None) - # form up an in-memory test db - wkb = '010100000000000000000000000000000000000000' - # note: the osm_id should be declared INTEGER PRIMARY KEY - # but in this case we intentionally do not make this a valid pkey - # otherwise sqlite would turn the null into a valid, serial id - ds = mapnik.SQLite(file=':memory:', - table='test1', - initdb=''' - create table test1 (osm_id INTEGER,geometry BLOB); - insert into test1 values (null,x'%s'); - ''' % wkb, - extent='-180,-60,180,60', - use_spatial_index=False, - key_field='osm_id' - ) - fs = ds.featureset() - feature = None - try : - feature = fs.next() - except StopIteration: - pass - eq_(feature,None) - mapnik.logger.set_severity(default_logging_severity) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/style_test.py b/tests/python_tests/style_test.py deleted file mode 100644 index 7bc782a4b..000000000 --- a/tests/python_tests/style_test.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.tools import eq_ -from utilities import run_all -import mapnik - -def test_style_init(): - s = mapnik.Style() - eq_(s.filter_mode,mapnik.filter_mode.ALL) - eq_(len(s.rules),0) - eq_(s.opacity,1) - eq_(s.comp_op,None) - eq_(s.image_filters,"") - eq_(s.image_filters_inflate,False) - -if __name__ == "__main__": - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/topojson_plugin_test.py b/tests/python_tests/topojson_plugin_test.py deleted file mode 100644 index a5f3e573d..000000000 --- a/tests/python_tests/topojson_plugin_test.py +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.tools import eq_,assert_almost_equal -from utilities import execution_path, run_all -import os, mapnik - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -if 'topojson' in mapnik.DatasourceCache.plugin_names(): - - def test_topojson_init(): - # topojson tests/data/json/escaped.geojson -o tests/data/json/escaped.topojson --properties - # topojson version 1.4.2 - ds = mapnik.Datasource(type='topojson',file='../data/json/escaped.topojson') - e = ds.envelope() - assert_almost_equal(e.minx, -81.705583, places=7) - assert_almost_equal(e.miny, 41.480573, places=6) - assert_almost_equal(e.maxx, -81.705583, places=5) - assert_almost_equal(e.maxy, 41.480573, places=3) - - def test_topojson_properties(): - ds = mapnik.Datasource(type='topojson',file='../data/json/escaped.topojson') - f = ds.features_at_point(ds.envelope().center()).features[0] - eq_(len(ds.fields()),7) - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - - eq_(f['name'], u'Test') - eq_(f['int'], 1) - eq_(f['description'], u'Test: \u005C') - eq_(f['spaces'], u'this has spaces') - eq_(f['double'], 1.1) - eq_(f['boolean'], True) - eq_(f['NOM_FR'], u'Qu\xe9bec') - eq_(f['NOM_FR'], u'Québec') - - ds = mapnik.Datasource(type='topojson',file='../data/json/escaped.topojson') - f = ds.all_features()[0] - eq_(len(ds.fields()),7) - - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - - eq_(f['name'], u'Test') - eq_(f['int'], 1) - eq_(f['description'], u'Test: \u005C') - eq_(f['spaces'], u'this has spaces') - eq_(f['double'], 1.1) - eq_(f['boolean'], True) - eq_(f['NOM_FR'], u'Qu\xe9bec') - eq_(f['NOM_FR'], u'Québec') - - def test_geojson_from_in_memory_string(): - ds = mapnik.Datasource(type='topojson',inline=open('../data/json/escaped.topojson','r').read()) - f = ds.all_features()[0] - eq_(len(ds.fields()),7) - - desc = ds.describe() - eq_(desc['geometry_type'],mapnik.DataGeometryType.Point) - - eq_(f['name'], u'Test') - eq_(f['int'], 1) - eq_(f['description'], u'Test: \u005C') - eq_(f['spaces'], u'this has spaces') - eq_(f['double'], 1.1) - eq_(f['boolean'], True) - eq_(f['NOM_FR'], u'Qu\xe9bec') - eq_(f['NOM_FR'], u'Québec') - -# @raises(RuntimeError) - def test_that_nonexistant_query_field_throws(**kwargs): - ds = mapnik.Datasource(type='topojson',file='../data/json/escaped.topojson') - eq_(len(ds.fields()),7) - # TODO - this sorting is messed up - eq_(ds.fields(),['name', 'int', 'description', 'spaces', 'double', 'boolean', 'NOM_FR']) - eq_(ds.field_types(),['str', 'int', 'str', 'str', 'float', 'bool', 'str']) -# TODO - should topojson plugin throw like others? -# query = mapnik.Query(ds.envelope()) -# for fld in ds.fields(): -# query.add_property_name(fld) -# # also add an invalid one, triggering throw -# query.add_property_name('bogus') -# fs = ds.features(query) - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/python_tests/utilities.py b/tests/python_tests/utilities.py deleted file mode 100644 index 9893dc4e6..000000000 --- a/tests/python_tests/utilities.py +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin -from nose.tools import assert_almost_equal - -import os, sys, traceback -import mapnik - -def execution_path(filename): - return os.path.join(os.path.dirname(sys._getframe(1).f_code.co_filename), filename) - -class Todo(Exception): - pass - -class TodoPlugin(ErrorClassPlugin): - name = "todo" - - todo = ErrorClass(Todo, label='TODO', isfailure=False) - -def contains_word(word, bytestring_): - """ - Checks that a bytestring contains a given word. len(bytestring) should be - a multiple of len(word). - - >>> contains_word("abcd", "abcd"*5) - True - - >>> contains_word("ab", "ba"*5) - False - - >>> contains_word("ab", "ab"*5+"a") - Traceback (most recent call last): - ... - AssertionError: len(bytestring_) not multiple of len(word) - """ - n = len(word) - assert len(bytestring_)%n == 0, "len(bytestring_) not multiple of len(word)" - chunks = [bytestring_[i:i+n] for i in xrange(0, len(bytestring_), n)] - return word in chunks - -def pixel2channels(pixel): - alpha = (pixel >> 24) & 0xff - red = pixel & 0xff - green = (pixel >> 8) & 0xff - blue = (pixel >> 16) & 0xff - return red,green,blue,alpha - -def pixel2rgba(pixel): - return 'rgba(%s,%s,%s,%s)' % pixel2channels(pixel) - -def get_unique_colors(im): - pixels = [] - for x in range(im.width()): - for y in range(im.height()): - pixel = im.get_pixel(x,y) - if pixel not in pixels: - pixels.append(pixel) - pixels = sorted(pixels) - return map(pixel2rgba,pixels) - -def run_all(iterable): - failed = 0 - for test in iterable: - try: - test() - sys.stderr.write("\x1b[32m✓ \x1b[m" + test.__name__ + "\x1b[m\n") - except: - exc_type, exc_value, exc_tb = sys.exc_info() - failed += 1 - sys.stderr.write("\x1b[31m✘ \x1b[m" + test.__name__ + "\x1b[m\n") - for mline in traceback.format_exception_only(exc_type, exc_value): - for line in mline.rstrip().split("\n"): - sys.stderr.write(" \x1b[31m" + line + "\x1b[m\n") - sys.stderr.write(" Traceback:\n") - for mline in traceback.format_tb(exc_tb): - for line in mline.rstrip().split("\n"): - if not 'utilities.py' in line and not 'trivial.py' in line and not line.strip() == 'test()': - sys.stderr.write(" " + line + "\n") - sys.stderr.flush() - return failed - -def side_by_side_image(left_im, right_im): - width = left_im.width() + 1 + right_im.width() - height = max(left_im.height(), right_im.height()) - im = mapnik.Image(width, height) - im.blend(0, 0, left_im, 1.0) - im.blend(left_im.width() + 1, 0, right_im, 1.0) - return im - -def assert_box2d_almost_equal(a, b, msg=None): - msg = msg or ("%r != %r" % (a, b)) - assert_almost_equal(a.minx, b.minx, msg=msg) - assert_almost_equal(a.maxx, b.maxx, msg=msg) - assert_almost_equal(a.miny, b.miny, msg=msg) - assert_almost_equal(a.maxy, b.maxy, msg=msg) diff --git a/tests/python_tests/webp_encoding_test.py b/tests/python_tests/webp_encoding_test.py deleted file mode 100644 index 12f75e57d..000000000 --- a/tests/python_tests/webp_encoding_test.py +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os, mapnik -from nose.tools import raises,eq_ -from utilities import execution_path, run_all - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -if mapnik.has_webp(): - tmp_dir = '/tmp/mapnik-webp/' - if not os.path.exists(tmp_dir): - os.makedirs(tmp_dir) - - opts = [ - 'webp', - 'webp:method=0', - 'webp:method=6', - 'webp:quality=64', - 'webp:alpha=false', - 'webp:partitions=3', - 'webp:preprocessing=1', - 'webp:partition_limit=50', - 'webp:pass=10', - 'webp:alpha_quality=50', - 'webp:alpha_filtering=2', - 'webp:alpha_compression=0', - 'webp:autofilter=0', - 'webp:filter_type=1:autofilter=1', - 'webp:filter_sharpness=4', - 'webp:filter_strength=50', - 'webp:sns_strength=50', - 'webp:segments=3', - 'webp:target_PSNR=.5', - 'webp:target_size=100' - ] - - - def gen_filepath(name,format): - return os.path.join('images/support/encoding-opts',name+'-'+format.replace(":","+")+'.webp') - - def test_quality_threshold(): - im = mapnik.Image(256,256) - im.tostring('webp:quality=99.99000') - im.tostring('webp:quality=0') - im.tostring('webp:quality=0.001') - - @raises(RuntimeError) - def test_quality_threshold_invalid(): - im = mapnik.Image(256,256) - im.tostring('webp:quality=101') - - @raises(RuntimeError) - def test_quality_threshold_invalid2(): - im = mapnik.Image(256,256) - im.tostring('webp:quality=-1') - - generate = os.environ.get('UPDATE') - - def test_expected_encodings(): - fails = [] - try: - for opt in opts: - im = mapnik.Image(256,256) - expected = gen_filepath('blank',opt) - actual = os.path.join(tmp_dir,os.path.basename(expected)) - if generate or not os.path.exists(expected): - print 'generating expected image %s' % expected - im.save(expected,opt) - im.save(actual,opt) - try: - expected_bytes = mapnik.Image.open(expected).tostring() - except RuntimeError: - # this will happen if libweb is old, since it cannot open images created by more recent webp - print 'warning, cannot open webp expected image (your libwebp is likely too old)' - continue - if mapnik.Image.open(actual).tostring() != expected_bytes: - fails.append('%s (actual) not == to %s (expected)' % (actual,expected)) - - for opt in opts: - im = mapnik.Image(256,256) - im.background = mapnik.Color('green') - expected = gen_filepath('solid',opt) - actual = os.path.join(tmp_dir,os.path.basename(expected)) - if generate or not os.path.exists(expected): - print 'generating expected image %s' % expected - im.save(expected,opt) - im.save(actual,opt) - try: - expected_bytes = mapnik.Image.open(expected).tostring() - except RuntimeError: - # this will happen if libweb is old, since it cannot open images created by more recent webp - print 'warning, cannot open webp expected image (your libwebp is likely too old)' - continue - if mapnik.Image.open(actual).tostring() != expected_bytes: - fails.append('%s (actual) not == to %s (expected)' % (actual,expected)) - - for opt in opts: - im = mapnik.Image.open('images/support/transparency/aerial_rgba.png') - expected = gen_filepath('aerial_rgba',opt) - actual = os.path.join(tmp_dir,os.path.basename(expected)) - if generate or not os.path.exists(expected): - print 'generating expected image %s' % expected - im.save(expected,opt) - im.save(actual,opt) - try: - expected_bytes = mapnik.Image.open(expected).tostring() - except RuntimeError: - # this will happen if libweb is old, since it cannot open images created by more recent webp - print 'warning, cannot open webp expected image (your libwebp is likely too old)' - continue - if mapnik.Image.open(actual).tostring() != expected_bytes: - fails.append('%s (actual) not == to %s (expected)' % (actual,expected)) - # disabled to avoid failures on ubuntu when using old webp packages - #eq_(fails,[],'\n'+'\n'.join(fails)) - except RuntimeError, e: - print e - - def test_transparency_levels(): - try: - # create partial transparency image - im = mapnik.Image(256,256) - im.background = mapnik.Color('rgba(255,255,255,.5)') - c2 = mapnik.Color('rgba(255,255,0,.2)') - c3 = mapnik.Color('rgb(0,255,255)') - for y in range(0,im.height()/2): - for x in range(0,im.width()/2): - im.set_pixel(x,y,c2) - for y in range(im.height()/2,im.height()): - for x in range(im.width()/2,im.width()): - im.set_pixel(x,y,c3) - - t0 = tmp_dir + 'white0-actual.webp' - - # octree - format = 'webp' - expected = 'images/support/transparency/white0.webp' - if generate or not os.path.exists(expected): - im.save('images/support/transparency/white0.webp') - im.save(t0,format) - im_in = mapnik.Image.open(t0) - t0_len = len(im_in.tostring(format)) - try: - expected_bytes = mapnik.Image.open(expected).tostring(format) - except RuntimeError: - # this will happen if libweb is old, since it cannot open images created by more recent webp - print 'warning, cannot open webp expected image (your libwebp is likely too old)' - return - eq_(t0_len,len(expected_bytes)) - except RuntimeError, e: - print e - - -if __name__ == "__main__": - setup() - exit(run_all(eval(x) for x in dir() if x.startswith("test_"))) diff --git a/tests/run_tests.py b/tests/run_tests.py deleted file mode 100755 index edf797465..000000000 --- a/tests/run_tests.py +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env python - -import sys - -try: - import nose -except ImportError, e: - sys.stderr.write("Unable to run python tests: the third party 'nose' module is required\nTo install 'nose' do:\n\tsudo pip install nose (or on debian systems: apt-get install python-nose): %s\n" % e) - sys.exit(1) - -import mapnik -from python_tests.utilities import TodoPlugin -from nose.plugins.doctests import Doctest - -import nose, sys, os, getopt - -def usage(): - print("test.py -h | --help") - print("test.py [-q | -v] [-p | --prefix ]") - -def main(): - try: - opts, args = getopt.getopt(sys.argv[1:], "hvqp:", ["help", "prefix="]) - except getopt.GetoptError,err: - print(str(err)) - usage() - sys.exit(2) - - prefix = None - verbose = False - quiet = False - - for o, a in opts: - if o == "-q": - quiet = True - elif o == "-v": - verbose = True - elif o in ("-h", "--help"): - usage() - sys.exit() - elif o in ("-p", "--prefix"): - prefix = a - else: - assert False, "Unhandled option" - - if quiet and verbose: - usage() - sys.exit(2) - - if prefix: - # Allow python to find libraries for testing on the buildbot - sys.path.insert(0, os.path.join(prefix, "lib/python%s/site-packages" % sys.version[:3])) - - import mapnik - - if not quiet: - print("- mapnik path: %s" % mapnik.__file__) - if hasattr(mapnik,'_mapnik'): - print("- _mapnik.so path: %s" % mapnik._mapnik.__file__) - if hasattr(mapnik,'inputpluginspath'): - print ("- Input plugins path: %s" % mapnik.inputpluginspath) - if os.environ.has_key('MAPNIK_INPUT_PLUGINS_DIRECTORY'): - print ("- MAPNIK_INPUT_PLUGINS_DIRECTORY env: %s" % os.environ.get('MAPNIK_INPUT_PLUGINS_DIRECTORY')) - if hasattr(mapnik,'fontscollectionpath'): - print("- Font path: %s" % mapnik.fontscollectionpath) - if os.environ.has_key('MAPNIK_FONT_DIRECTORY'): - print ("- MAPNIK_FONT_DIRECTORY env: %s" % os.environ.get('MAPNIK_FONT_DIRECTORY')) - print('') - print("- Running nosetests:") - print('') - - argv = [__file__, '--exe', '--with-todo', '--with-doctest', '--doctest-tests'] - - if not quiet: - argv.append('-v') - - if verbose: - # 3 * '-v' gets us debugging information from nose - argv.append('-v') - argv.append('-v') - - dirname = os.path.dirname(sys.argv[0]) - argv.extend(['-w', os.path.join(dirname,'python_tests')]) - - if not nose.run(argv=argv, plugins=[TodoPlugin(), Doctest()]): - sys.exit(1) - else: - sys.exit(0) - -if __name__ == "__main__": - main() diff --git a/tests/visual_tests/.gitignore b/tests/visual_tests/.gitignore deleted file mode 100644 index a39b72071..000000000 --- a/tests/visual_tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*-out.xml diff --git a/tests/visual_tests/clean.sh b/tests/visual_tests/clean.sh deleted file mode 100755 index d5ae9e4de..000000000 --- a/tests/visual_tests/clean.sh +++ /dev/null @@ -1,2 +0,0 @@ -rm -f xml_output/*-out.xml - diff --git a/tests/visual_tests/compare.py b/tests/visual_tests/compare.py deleted file mode 100644 index e1b72893c..000000000 --- a/tests/visual_tests/compare.py +++ /dev/null @@ -1,77 +0,0 @@ -# -*- coding: utf-8 -*- - -import mapnik - -try: - import json -except ImportError: - import simplejson as json - - -# returns true if pixels are not nearly identical -def compare_pixels(pixel1, pixel2, alpha=True, pixel_threshold=0): - if pixel1 == pixel2: - return False - r_diff = abs((pixel1 & 0xff) - (pixel2 & 0xff)) - g_diff = abs(((pixel1 >> 8) & 0xff) - ((pixel2 >> 8) & 0xff)) - b_diff = abs(((pixel1 >> 16) & 0xff)- ((pixel2 >> 16) & 0xff)) - if alpha: - a_diff = abs(((pixel1 >> 24) & 0xff) - ((pixel2 >> 24) & 0xff)) - if(r_diff > pixel_threshold or - g_diff > pixel_threshold or - b_diff > pixel_threshold or - a_diff > pixel_threshold): - return True - else: - if(r_diff > pixel_threshold or - g_diff > pixel_threshold or - b_diff > pixel_threshold): - return True - return False - -# compare two images and return number of different pixels -def compare(actual, expected, alpha=True): - im1 = mapnik.Image.open(actual) - im2 = mapnik.Image.open(expected) - diff = 0 - pixels = im1.width() * im1.height() - delta_pixels = (im2.width() * im2.height()) - pixels - if delta_pixels != 0: - return delta_pixels - # TODO: convert to C++ to speed this up - for x in range(0,im1.width(),2): - for y in range(0,im1.height(),2): - if compare_pixels(im1.get_pixel(x,y),im2.get_pixel(x,y),alpha=alpha): - diff += 1 - return diff - -def compare_grids(actual, expected, threshold=0, alpha=True): - global errors - global passed - im1 = json.loads(open(actual).read()) - im2 = json.loads(open(expected).read()) - # TODO - real diffing - if not im1['data'] == im2['data']: - return 99999999 - if not im1['keys'] == im2['keys']: - return 99999999 - grid1 = im1['grid'] - grid2 = im2['grid'] - # dimensions must be exact - width1 = len(grid1[0]) - width2 = len(grid2[0]) - if not width1 == width2: - return 99999999 - height1 = len(grid1) - height2 = len(grid2) - if not height1 == height2: - return 99999999 - diff = 0; - for y in range(0,height1-1): - row1 = grid1[y] - row2 = grid2[y] - width = min(len(row1),len(row2)) - for w in range(0,width): - if row1[w] != row2[w]: - diff += 1 - return diff diff --git a/tests/visual_tests/data/Yosemite_L9.tfw b/tests/visual_tests/data/Yosemite_L9.tfw deleted file mode 100644 index 700a71cec..000000000 --- a/tests/visual_tests/data/Yosemite_L9.tfw +++ /dev/null @@ -1,6 +0,0 @@ -191.092170573681 -0.000000000000 -0.000000000000 --191.092170573681 --13383825.126807762310 -4651869.862067188136 diff --git a/tests/visual_tests/data/Yosemite_L9.tif b/tests/visual_tests/data/Yosemite_L9.tif deleted file mode 100644 index a3fcc36b8..000000000 Binary files a/tests/visual_tests/data/Yosemite_L9.tif and /dev/null differ diff --git a/tests/visual_tests/data/aerial_rgba.tiff b/tests/visual_tests/data/aerial_rgba.tiff deleted file mode 100644 index bccfd575d..000000000 Binary files a/tests/visual_tests/data/aerial_rgba.tiff and /dev/null differ diff --git a/tests/visual_tests/data/bug1532.csv b/tests/visual_tests/data/bug1532.csv deleted file mode 100644 index f38b6c9a0..000000000 --- a/tests/visual_tests/data/bug1532.csv +++ /dev/null @@ -1,5 +0,0 @@ -wrap|type|wkt -no|point|POINT(0.28436221472838974 0.2614258628766519) -yes|point|POINT(0.1306627157552161 0.2589062249349994) -no|line|LINESTRING(0.48404558019763577 0.22552097681732494, 0.7876650822675934 0.22426115456321344) -yes|line|LINESTRING(0.48341566421823756 0.32315682259650147, 0.7870351662881953 0.3218970105980799) diff --git a/tests/visual_tests/data/bug1533.csv b/tests/visual_tests/data/bug1533.csv deleted file mode 100644 index 5c38f1799..000000000 --- a/tests/visual_tests/data/bug1533.csv +++ /dev/null @@ -1,5 +0,0 @@ -wkt -"LINESTRING(0.8511083807156015 0.03967486460801543, 0.5994991376749135 0.2096131480715248)" -"LINESTRING(0.27084293293759165 0.26302812355087024, 0.04604697152647152 0.05893796680132844)" -"LINESTRING(0.07145061369178042 0.3118185090592599, 0.3750701157617382 0.3105586956821123)" -"LINESTRING(0.8179010492787097 0.3099287889371784, 0.514281547208752 0.3111886023894954)" diff --git a/tests/visual_tests/data/charplacement.dbf b/tests/visual_tests/data/charplacement.dbf deleted file mode 100644 index c143baa95..000000000 Binary files a/tests/visual_tests/data/charplacement.dbf and /dev/null differ diff --git a/tests/visual_tests/data/charplacement.shp b/tests/visual_tests/data/charplacement.shp deleted file mode 100644 index ccdfcf4bc..000000000 Binary files a/tests/visual_tests/data/charplacement.shp and /dev/null differ diff --git a/tests/visual_tests/data/charplacement.shx b/tests/visual_tests/data/charplacement.shx deleted file mode 100644 index 65b8dab8f..000000000 Binary files a/tests/visual_tests/data/charplacement.shx and /dev/null differ diff --git a/tests/visual_tests/data/crossing-lines.csv b/tests/visual_tests/data/crossing-lines.csv deleted file mode 100644 index 3b51da020..000000000 --- a/tests/visual_tests/data/crossing-lines.csv +++ /dev/null @@ -1,7 +0,0 @@ -i|wkt -1|LINESTRING(10 0, 20 0) -1|LINESTRING(10 10, 20 10) -1|LINESTRING(15 5, 20 5) -1|LINESTRING(15 5, 20 5) -1|LINESTRING(10 5, 15 5) -1|LINESTRING(10 5, 15 5) diff --git a/tests/visual_tests/data/displacement.dbf b/tests/visual_tests/data/displacement.dbf deleted file mode 100644 index 06ec3206c..000000000 Binary files a/tests/visual_tests/data/displacement.dbf and /dev/null differ diff --git a/tests/visual_tests/data/displacement.shp b/tests/visual_tests/data/displacement.shp deleted file mode 100644 index 899b16370..000000000 Binary files a/tests/visual_tests/data/displacement.shp and /dev/null differ diff --git a/tests/visual_tests/data/displacement.shx b/tests/visual_tests/data/displacement.shx deleted file mode 100644 index 359820de4..000000000 Binary files a/tests/visual_tests/data/displacement.shx and /dev/null differ diff --git a/tests/visual_tests/data/grouped-rendering.sqlite b/tests/visual_tests/data/grouped-rendering.sqlite deleted file mode 100644 index 277c0f561..000000000 Binary files a/tests/visual_tests/data/grouped-rendering.sqlite and /dev/null differ diff --git a/tests/visual_tests/data/heat.tif b/tests/visual_tests/data/heat.tif deleted file mode 100644 index 5ea60e3aa..000000000 Binary files a/tests/visual_tests/data/heat.tif and /dev/null differ diff --git a/tests/visual_tests/data/heat_nodata.tif b/tests/visual_tests/data/heat_nodata.tif deleted file mode 100644 index ed6d71ea7..000000000 Binary files a/tests/visual_tests/data/heat_nodata.tif and /dev/null differ diff --git a/tests/visual_tests/data/heat_rgb.tif b/tests/visual_tests/data/heat_rgb.tif deleted file mode 100644 index c9ad3b57b..000000000 Binary files a/tests/visual_tests/data/heat_rgb.tif and /dev/null differ diff --git a/tests/visual_tests/data/hex.dbf b/tests/visual_tests/data/hex.dbf deleted file mode 100644 index 193ea6e87..000000000 Binary files a/tests/visual_tests/data/hex.dbf and /dev/null differ diff --git a/tests/visual_tests/data/hex.prj b/tests/visual_tests/data/hex.prj deleted file mode 100644 index eb0befd98..000000000 --- a/tests/visual_tests/data/hex.prj +++ /dev/null @@ -1 +0,0 @@ -PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"],AXIS["X",EAST],AXIS["Y",NORTH]] \ No newline at end of file diff --git a/tests/visual_tests/data/hex.shp b/tests/visual_tests/data/hex.shp deleted file mode 100644 index 094a86793..000000000 Binary files a/tests/visual_tests/data/hex.shp and /dev/null differ diff --git a/tests/visual_tests/data/hex.shx b/tests/visual_tests/data/hex.shx deleted file mode 100644 index ad2bdf266..000000000 Binary files a/tests/visual_tests/data/hex.shx and /dev/null differ diff --git a/tests/visual_tests/data/kurdish.geojson b/tests/visual_tests/data/kurdish.geojson deleted file mode 100644 index cfe1338bd..000000000 --- a/tests/visual_tests/data/kurdish.geojson +++ /dev/null @@ -1 +0,0 @@ -{"type":"FeatureCollection","features":[{"geometry": {"type": "Polygon", "coordinates": [[[45.99235461770755, 35.16617818635398], [45.99237547481334, 35.165666716102706], [45.9883319556193, 35.16701924991742], [45.98503315932268, 35.16802816771194], [45.98465077664349, 35.16824201497082], [45.984044774393894, 35.168580918688136], [45.982703864274264, 35.16902437556599], [45.982941824198875, 35.16988145146968], [45.98180119214958, 35.1702172614711], [45.98167540989029, 35.171115464425476], [45.98118349000219, 35.17188888811469], [45.98118257351588, 35.17189130120418], [45.98118520294277, 35.17189262520137], [45.98141591839354, 35.172008754469964], [45.9817715310328, 35.17208621350769], [45.98195866241614, 35.172137419232264], [45.982456234288414, 35.17257776515322], [45.98261986736089, 35.17283267173747], [45.98277057407737, 35.17302405638272], [45.9828430371665, 35.1731160783786], [45.98299879846318, 35.173394209566936], [45.983057812786555, 35.17352943153634], [45.9831487132402, 35.173714479900745], [45.9832391909315, 35.173864382594644], [45.98337250743875, 35.174002780114556], [45.98358060951312, 35.1741305255599], [45.983614128418196, 35.17429290527566], [45.984998271926585, 35.17494025771359], [45.985503122177235, 35.17533338838655], [45.98563551268088, 35.1754929891916], [45.9855120048533, 35.17561896784981], [45.98528005787102, 35.17576814496443], [45.985243464015, 35.17588895300947], [45.98523921329984, 35.175987179747615], [45.9854067972843, 35.17641346444306], [45.98546604021096, 35.17638203432208], [45.98566919624024, 35.176204989630754], [45.98588010956655, 35.17609621562221], [45.98614970285299, 35.17606061391415], [45.986241215011326, 35.175980903902754], [45.98643781904411, 35.17572115216145], [45.986716230383735, 35.175497177478626], [45.98684542342492, 35.1754748652814], [45.98714950242998, 35.175232457670376], [45.987415361220286, 35.174851261651696], [45.98763307056997, 35.17453909841], [45.98775755148155, 35.174366871894236], [45.98807690380486, 35.17392502625692], [45.98846346482826, 35.17346934786799], [45.98878718553586, 35.17301721809507], [45.989187907688006, 35.17250979019988], [45.98954772289579, 35.17198447417625], [45.989585422334436, 35.171895118764624], [45.98974187786492, 35.171524287970755], [45.989881809226, 35.171167805980126], [45.99011666870779, 35.17069987563794], [45.99043436059051, 35.1700669033653], [45.99094380841713, 35.169322908439376], [45.990969742353364, 35.16928503338455], [45.9917288510691, 35.16826376024745], [45.99241306812511, 35.16757424989188], [45.99232151994116, 35.16698977062805], [45.99232378055641, 35.16693434427973], [45.99235461770755, 35.16617818635398]]]}, "type": "Feature", "id": 0, "properties": {"SHAPE_Leng": 3482.72819018, "name": "\u0645\u06d5\u0631\u062f\u0627\u0646\u06d5", "OBJECTID": 18, "cod": 304}},{"geometry": {"type": "Polygon", "coordinates": [[[45.98722649037926, 35.183624290617544], [45.987694657098906, 35.18305705675576], [45.98788575418974, 35.183114119382275], [45.988246802424854, 35.182792014516096], [45.98886726351255, 35.182272384087966], [45.99011092666733, 35.181461064564616], [45.990113317285974, 35.18145959423118], [45.989698155982346, 35.180991387216835], [45.989676568168335, 35.180967039962795], [45.98925361550881, 35.180490036088415], [45.989245816636014, 35.1804900997902], [45.988644419931106, 35.179777800934694], [45.98849214631859, 35.17962101142376], [45.987854624445134, 35.17896457692938], [45.986958722900035, 35.178221621157746], [45.986814668681916, 35.17810215662015], [45.98592225090038, 35.17752553482369], [45.985816358488464, 35.17745711316335], [45.985597813207775, 35.17735206705087], [45.98513331321101, 35.177526406450646], [45.98506152654518, 35.17755253020057], [45.98506111324195, 35.17755268053467], [45.983815809900484, 35.178005864496704], [45.983142460616385, 35.178320198354555], [45.98290398141986, 35.178628174253], [45.98241097095343, 35.179504266537506], [45.981445999402155, 35.180736545049434], [45.980665670625335, 35.181612300048], [45.9822171301062, 35.18256811973268], [45.98287836726639, 35.18307021974068], [45.98265949303153, 35.18326450822969], [45.98360245818601, 35.18387019489621], [45.98599593461372, 35.1854075046119], [45.986008957647385, 35.185290260659606], [45.98613648925261, 35.18501077172678], [45.986229324708134, 35.18481461094534], [45.98630473469067, 35.18475146049714], [45.98638248549415, 35.184686350540005], [45.986853335010366, 35.184093858492105], [45.98704359678535, 35.183854437131586], [45.98722649037926, 35.183624290617544]]]}, "type": "Feature", "id": 1, "properties": {"SHAPE_Leng": 2569.64415823, "name": "\u0645\u06d5\u0631\u0632\u06d5\u0628\u06c6\u062a\u06c6", "OBJECTID": 19, "cod": 101}}]} \ No newline at end of file diff --git a/tests/visual_tests/data/line-offset.csv b/tests/visual_tests/data/line-offset.csv deleted file mode 100644 index fe557d89f..000000000 --- a/tests/visual_tests/data/line-offset.csv +++ /dev/null @@ -1,9 +0,0 @@ -wkt,name,nr,ref -"LineString(-5.177724 50.191914,-5.177742 50.191769,-5.17773 50.191624,-5.177689 50.191481,-5.177619 50.191343,-5.177522 50.191212,-5.177398 50.19109,-5.177251 50.190979,-5.177082 50.190882,-5.176895 50.190799,-5.176693 50.190733,-5.176479 50.190685,-5.176257 50.190654,-5.176031 50.190643,-5.175804 50.19065,-5.175581 50.190677,-5.175365 50.190722,-5.17516 50.190784,-5.17497 50.190863,-5.174797 50.190957,-5.174645 50.191065,-5.174516 50.191185,-5.174413 50.191314,-5.174337 50.191451,-5.17429 50.191594,-5.174272 50.191738,-5.174283 50.191884,-5.174324 50.192026,-5.174394 50.192165,-5.174492 50.192296,-5.174615 50.192418,-5.174763 50.192529,-5.174931 50.192626,-5.175118 50.192708,-5.17532 50.192774,-5.175534 50.192823,-5.175756 50.192853,-5.175983 50.192865,-5.176209 50.192857,-5.176433 50.192831,-5.176649 50.192786,-5.176854 50.192724,-5.177044 50.192645,-5.177217 50.19255,-5.177369 50.192442,-5.177498 50.192323,-5.177601 50.192193,-5.177677 50.192056,-5.177724 50.191914)","",,4 -"LineString(-5.182328 50.19193,-5.182346 50.191785,-5.182334 50.19164,-5.182293 50.191497,-5.182223 50.191358,-5.182125 50.191227,-5.182002 50.191105,-5.181854 50.190995,-5.181686 50.190897,-5.181499 50.190815,-5.181297 50.190749,-5.181083 50.1907,-5.180861 50.19067,-5.180634 50.190658,-5.180408 50.190666,-5.180184 50.190692,-5.179968 50.190737,-5.179763 50.190799,-5.179573 50.190878,-5.1794 50.190973,-5.179248 50.191081,-5.179119 50.1912,-5.179016 50.19133,-5.17894 50.191467,-5.178893 50.191609,-5.178875 50.191754,-5.178887 50.191899,-5.178928 50.192042,-5.178998 50.19218,-5.179095 50.192311,-5.179219 50.192433,-5.179366 50.192544,-5.179535 50.192641,-5.179722 50.192724,-5.179924 50.19279,-5.180138 50.192838,-5.18036 50.192869,-5.180586 50.19288,-5.180813 50.192873,-5.181036 50.192846,-5.181252 50.192802,-5.181457 50.192739,-5.181648 50.19266,-5.18182 50.192566,-5.181972 50.192458,-5.182101 50.192338,-5.182204 50.192209,-5.18228 50.192072,-5.182328 50.19193)","",,3 -"LineString(-5.187052 50.191945,-5.187004 50.192087,-5.186928 50.192224,-5.186825 50.192354,-5.186696 50.192473,-5.186544 50.192581,-5.186371 50.192675,-5.186181 50.192755,-5.185976 50.192817,-5.18576 50.192862,-5.185537 50.192888,-5.18531 50.192896,-5.185084 50.192884,-5.184862 50.192854,-5.184648 50.192805,-5.184446 50.192739,-5.184259 50.192657,-5.18409 50.192559,-5.183943 50.192449,-5.183819 50.192327,-5.183722 50.192196,-5.183652 50.192057,-5.183611 50.191914,-5.183599 50.191769,-5.183617 50.191624,-5.183664 50.191482,-5.18374 50.191345,-5.183843 50.191216,-5.183972 50.191096,-5.184124 50.190988,-5.184297 50.190894,-5.184487 50.190815,-5.184692 50.190752,-5.184908 50.190708,-5.185132 50.190681,-5.185358 50.190674,-5.185585 50.190685,-5.185807 50.190716,-5.186021 50.190764,-5.186223 50.19083,-5.18641 50.190913,-5.186578 50.19101,-5.186726 50.191121,-5.186849 50.191243,-5.186947 50.191374,-5.187017 50.191512,-5.187058 50.191655,-5.18707 50.1918,-5.187052 50.191945)","",,2 -"LineString(-5.191775 50.191899,-5.191728 50.192041,-5.191652 50.192178,-5.191549 50.192307,-5.19142 50.192427,-5.191268 50.192535,-5.191095 50.192629,-5.190905 50.192708,-5.1907 50.192771,-5.190484 50.192816,-5.190261 50.192842,-5.190034 50.192849,-5.189808 50.192838,-5.189586 50.192808,-5.189372 50.192759,-5.18917 50.192693,-5.188983 50.19261,-5.188814 50.192513,-5.188667 50.192402,-5.188543 50.192281,-5.188446 50.192149,-5.188376 50.192011,-5.188334 50.191868,-5.188323 50.191723,-5.188341 50.191578,-5.188388 50.191436,-5.188464 50.191299,-5.188567 50.19117,-5.188696 50.19105,-5.188848 50.190942,-5.189021 50.190848,-5.189211 50.190769,-5.189416 50.190706,-5.189632 50.190661,-5.189856 50.190635,-5.190082 50.190627,-5.190309 50.190639,-5.190531 50.190669,-5.190744 50.190718,-5.190947 50.190784,-5.191134 50.190866,-5.191302 50.190964,-5.19145 50.191074,-5.191573 50.191196,-5.191671 50.191328,-5.191741 50.191466,-5.191782 50.191609,-5.191793 50.191754,-5.191775 50.191899)","",,1 -"LineString(-5.177742 50.191769,-5.174272 50.191738)","CCW, dy > 0",, -"LineString(-5.182346 50.191785,-5.178875 50.191754)","CCW, dy < 0",, -"LineString(-5.18707 50.1918,-5.183599 50.191769)","CW, dy > 0",, -"LineString(-5.191793 50.191754,-5.188323 50.191723)","CW, dy < 0",, \ No newline at end of file diff --git a/tests/visual_tests/data/line.dbf b/tests/visual_tests/data/line.dbf deleted file mode 100755 index c27e6d5f6..000000000 Binary files a/tests/visual_tests/data/line.dbf and /dev/null differ diff --git a/tests/visual_tests/data/line.shp b/tests/visual_tests/data/line.shp deleted file mode 100755 index 52976981a..000000000 Binary files a/tests/visual_tests/data/line.shp and /dev/null differ diff --git a/tests/visual_tests/data/line.shx b/tests/visual_tests/data/line.shx deleted file mode 100755 index 60746dfb3..000000000 Binary files a/tests/visual_tests/data/line.shx and /dev/null differ diff --git a/tests/visual_tests/data/lines.csv b/tests/visual_tests/data/lines.csv deleted file mode 100644 index f67763eba..000000000 --- a/tests/visual_tests/data/lines.csv +++ /dev/null @@ -1,10 +0,0 @@ -wkt,name,nr -"LineString(0.194483 -0.117354,0.23691 -0.137246,0.252846 -0.181313,0.232953 -0.223741,0.188886 -0.239676,0.146458 -0.219784,0.130523 -0.175717,0.150415 -0.133289,0.194483 -0.117354)","Circle",6 -"LineString(0.747335 -0.107159,0.789763 -0.127051,0.805698 -0.171118,0.785806 -0.213546,0.741739 -0.229481,0.699311 -0.209589,0.683376 -0.165522,0.703268 -0.123094,0.747335 -0.107159)","Circle with long name",7 -"LineString(0.346487 -0.240215,0.535306 -0.240215)","Short line with long name",5 -"LineString(0.347059 -0.122112,0.535878 -0.122112)","Short line",4 -"LineString(0 0,0.9 0)","Rendered @ integer pos. ABCDEFGHIJKLMNOPQRSTUVWXYZ",3 -"LineString(0.002268 0.073178,0.902268 0.073178)","Long line with long name",2 -"LineString(0.003411 0.172529,0.103411 0.172529,0.203411 0.172529,0.303411 0.172529,0.403411 0.172529,0.503411 0.172529,0.603411 0.172529,0.703411 0.172529,0.803411 0.172529,0.903411 0.172529)","Long line with long name and many points",1 -"LineString(0.002841 0.250458,0.902841 0.250458)","Short name",8 -"LineString(0 -0.051,0.9 -0.051)","Rendered @ non-integer p. ABCDEFGHIJKLMNOPQRSTUVWXYZ",9 diff --git a/tests/visual_tests/data/lines2.csv b/tests/visual_tests/data/lines2.csv deleted file mode 100644 index 4d9b59551..000000000 --- a/tests/visual_tests/data/lines2.csv +++ /dev/null @@ -1,17 +0,0 @@ -WKT -"LINESTRING (0.764185269 -0.313888573,0.751190328 -0.314123131,0.737134133 -0.314376844,0.725222103 -0.314591855,0.702047791 -0.315010149,0.688792951 -0.315249398,0.67553811 -0.315488647,0.661092067 -0.315749397,0.641426389 -0.31610436,0.627370194 -0.316358073,0.597525145 -0.316896774,0.584140356 -0.317138368,0.570885515 -0.317377617,0.549747077 -0.317759164,0.533546717 -0.318051579,0.511866823 -0.318442899)" -"LINESTRING (0.289403766 -0.004374853,0.278998818 -0.012163343,0.267744132 -0.020587892,0.258206263 -0.027727341,0.239650772 -0.041616812,0.229037724 -0.049561069,0.218424677 -0.057505325,0.206857843 -0.066163524,0.191111688 -0.077950096,0.179857002 -0.086374637,0.155960304 -0.104262178,0.145243208 -0.112284308,0.134630161 -0.120228551,0.117704778 -0.132897797,0.104733276 -0.14260742,0.087374354 -0.155601173)" -"LINESTRING (0.374895934 -0.188749064,0.362443535 -0.270566448,0.295784263 -0.319614717,0.213966216 -0.307162504,0.164917295 -0.240503998,0.177369693 -0.158686453,0.244028965 -0.109637668,0.325847013 -0.122090041,0.374895934 -0.188749064)" -"LINESTRING (0.892955147 -0.270397048,0.894000762 0.309916722)" -"LINESTRING (0.055417591 0.248226176,0.059600051 -0.260986614)" -"LINESTRING (0.777676102 0.026948692,0.765128722 0.016492544,0.747353269 0.008127625,0.731669045 0.012310084,0.719121666 0.021720618,0.708665516 0.03740484,0.697163752 0.05099783,0.685661988 0.06040836,0.666840919 0.061453974,0.646974236 0.054134673,0.627107552 0.041587299,0.608286483 0.024857463,0.59260226 0.013878507,0.574826806 0.005513587,0.559142582 0.009696047,0.546595203 0.019106581,0.536139054 0.034790803,0.524637289 0.048383794,0.513135525 0.057794324,0.494314456 0.058839938,0.474447773 0.051520637,0.454581089 0.038973262,0.434191598 0.021459215,0.421644219 0.011003066,0.403868765 0.002638146,0.388184541 0.006820606,0.375637162 0.01623114,0.365181013 0.031915363,0.353679249 0.045508354,0.342177485 0.054918884,0.323356416 0.055964499,0.303489732 0.048645197,0.283623049 0.036097822,0.26480198 0.019367985,0.249117756 0.008389028,0.231342302 0.000024109,0.215658079 0.004206569,0.203110699 0.013617103,0.19265455 0.029301326,0.181152786 0.042894317,0.169651022 0.052304848,0.150829953 0.053350463,0.13096327 0.046031161,0.111096586 0.033483785,0.092275517 0.016753948)" -"LINESTRING (0.093560033 0.138666471,0.112381102 0.155396254,0.132247785 0.167943584,0.152114469 0.175262855,0.170935538 0.174217245,0.182437302 0.164806752,0.193939066 0.15121381,0.204395215 0.135529635,0.216942594 0.126119125,0.232626818 0.121936675,0.250402272 0.130301574,0.266086496 0.1412805,0.284907564 0.158010282,0.304774248 0.170557609,0.324640932 0.17787688,0.343462 0.17683127,0.354963765 0.167420778,0.366465529 0.153827838,0.376921678 0.138143665,0.389469057 0.128733156,0.405153281 0.124550707,0.422928735 0.132915605,0.435476114 0.143371724,0.455865605 0.160885712,0.475732289 0.173433038,0.495598972 0.180752307,0.514420041 0.179706697,0.525921805 0.170296207,0.537423569 0.156703268,0.547879718 0.141019097,0.560427098 0.13160859,0.576111322 0.127426141,0.593886775 0.135791038,0.609570999 0.146769961,0.628392068 0.163499739,0.648258751 0.176047063,0.668125435 0.183366331,0.686946504 0.182320722,0.698448268 0.172910232,0.709950032 0.159317296,0.720406181 0.143633127,0.73295356 0.13422262,0.748637784 0.130040171,0.766413238 0.138405068,0.778960617 0.148861184)" -"LINESTRING (0.848982597 0.288736581,0.754751857 0.220905399,0.657509669 0.293052099,0.548765717 0.208358108,0.429565615 0.301416905,0.295726905 0.205221284,0.170253114 0.303508106,0.083467075 0.248091159)" -"LINESTRING (0.090332128 0.348151688,0.187574317 0.410887204,0.309911263 0.313646971,0.436430669 0.403568084,0.548311466 0.316783769,0.660192263 0.398340138,0.759525681 0.319920565,0.85656627 0.390823271)" -"LINESTRING (0.613502456 -0.015963875,0.790148448 -0.024699116,0.812471843 -0.037316685,0.828971743 -0.062551817,0.830912908 -0.097492748,0.828001161 -0.133404222,0.821207084 -0.172227378,0.807618931 -0.188727197,0.760060395 -0.191638928,0.603796632 -0.185815465)" -"LINESTRING (0.680933124 -0.244990843,0.50407624 -0.24631506,0.481071446 -0.234987473,0.463163199 -0.210731652,0.459238186 -0.175957816,0.460103038 -0.139938937,0.464678354 -0.100792195,0.477306218 -0.0835463,0.52462221 -0.077934757,0.680964265 -0.074862572)" -"LINESTRING (0.345138881 -0.004954418,0.367100653 -0.140842741)" -"LINESTRING (0.41651464 -0.017307915,0.393180257 -0.171040066)" -"LINESTRING (0.45220252 -0.037897074,0.59769926 -0.042014905)" -"LINESTRING (0.72397945 -0.139470135,0.577110099 -0.140842741)" -"LINESTRING (0.820051288 0.095328839,0.850629325 0.095086193,0.850629325 0.072034887,0.735372668 0.072034887)" diff --git a/tests/visual_tests/data/lower_columbia.tif b/tests/visual_tests/data/lower_columbia.tif deleted file mode 100644 index 1a0cfa892..000000000 Binary files a/tests/visual_tests/data/lower_columbia.tif and /dev/null differ diff --git a/tests/visual_tests/data/marker-multi-policy.csv b/tests/visual_tests/data/marker-multi-policy.csv deleted file mode 100644 index 3b55ddf73..000000000 --- a/tests/visual_tests/data/marker-multi-policy.csv +++ /dev/null @@ -1,3 +0,0 @@ -i|wkt -1|MULTIPOLYGON(((90 40,50 0,10 40,50 80,90 40)),((190 40,150 0,110 40,150 80,190 40)),((190 140,150 100,110 140,150 180,190 140))) -2|MULTIPOLYGON(((48 130,40 122,32 130,40 138,48 130)),((40 140,20 120,0 140,20 160,40 140)),((48 150,40 142,32 150,40 158,48 150))) diff --git a/tests/visual_tests/data/marker-on-line.csv b/tests/visual_tests/data/marker-on-line.csv deleted file mode 100644 index 4835d65c5..000000000 --- a/tests/visual_tests/data/marker-on-line.csv +++ /dev/null @@ -1,2 +0,0 @@ -i|wkt -1|LINESTRING(-10 0, 0 20, 10 0, 15 5) diff --git a/tests/visual_tests/data/overlap.dbf b/tests/visual_tests/data/overlap.dbf deleted file mode 100644 index 566f81b5c..000000000 Binary files a/tests/visual_tests/data/overlap.dbf and /dev/null differ diff --git a/tests/visual_tests/data/overlap.shp b/tests/visual_tests/data/overlap.shp deleted file mode 100644 index 7462a5bbc..000000000 Binary files a/tests/visual_tests/data/overlap.shp and /dev/null differ diff --git a/tests/visual_tests/data/overlap.shx b/tests/visual_tests/data/overlap.shx deleted file mode 100644 index c6308ec85..000000000 Binary files a/tests/visual_tests/data/overlap.shx and /dev/null differ diff --git a/tests/visual_tests/data/pattern.png b/tests/visual_tests/data/pattern.png deleted file mode 100644 index b1d977a0e..000000000 Binary files a/tests/visual_tests/data/pattern.png and /dev/null differ diff --git a/tests/visual_tests/data/points.csv b/tests/visual_tests/data/points.csv deleted file mode 100644 index 3cd780b40..000000000 --- a/tests/visual_tests/data/points.csv +++ /dev/null @@ -1,11 +0,0 @@ -lat,long,name,nr,color,placements -0,0,Test one,1,#ff0000,"N,S,E,W,SW,10,5" -0,0.1,Test two,2,red,"N,S,E,W,SW,10,5" -0,0.2,Test three,3,#00ff00,"N,S,E,W,SW,10,5" -0,0.3,Test four,4,green,"N,S,E,W,SW,10,5" -0,0.4,Test five,5,#0000ff,"N,S,E,W,SW,10,5" -0,0.5,Test six,6,blue,"N,S,E,W,SW,10,5" -0,0.6,Test seven,7,#000000,"N,S,E,W,SW,10,5" -0,0.7,Test eight,8,black,"N,S,E,W,SW,10,5" -0,0.8,Test nine,9,#ffffff,"N,S,E,W,SW,10,5" -0,0.9,Test ten,10,white,"N,S,E,W,SW,10,5" \ No newline at end of file diff --git a/tests/visual_tests/data/repeat-labels.csv b/tests/visual_tests/data/repeat-labels.csv deleted file mode 100644 index 206294002..000000000 --- a/tests/visual_tests/data/repeat-labels.csv +++ /dev/null @@ -1,10 +0,0 @@ -wkt,type,name,ref -"POINT(-3 -0.40)",poi,, -"POINT(3 -0.40)",poi,, -"POINT(-3 -3.6)",poi,, -"POINT(3 -3.6)",poi,, -"LINESTRING(-12 2, 12 2)",motorway,First Hwy,1 -"LINESTRING(-12 1, 12 1)",motorway,First Hwy,1 -"LINESTRING(-12 3, 12 3)",motorway,Second Hwy,2 -"LINESTRING(-12 -1, 8 -1, 8 -2, -8 -2, -8 -3, 12 -3)",secondary,Main Street, - diff --git a/tests/visual_tests/data/satellite.png b/tests/visual_tests/data/satellite.png deleted file mode 100644 index 0275f36dc..000000000 Binary files a/tests/visual_tests/data/satellite.png and /dev/null differ diff --git a/tests/visual_tests/data/snow-cover.tif b/tests/visual_tests/data/snow-cover.tif deleted file mode 100644 index 239fad9a1..000000000 Binary files a/tests/visual_tests/data/snow-cover.tif and /dev/null differ diff --git a/tests/visual_tests/data/text-data-binding.sqlite b/tests/visual_tests/data/text-data-binding.sqlite deleted file mode 100644 index 2348be2cc..000000000 Binary files a/tests/visual_tests/data/text-data-binding.sqlite and /dev/null differ diff --git a/tests/visual_tests/data/textspacing.dbf b/tests/visual_tests/data/textspacing.dbf deleted file mode 100644 index bd1b1276c..000000000 Binary files a/tests/visual_tests/data/textspacing.dbf and /dev/null differ diff --git a/tests/visual_tests/data/textspacing.shp b/tests/visual_tests/data/textspacing.shp deleted file mode 100644 index 60dc7c081..000000000 Binary files a/tests/visual_tests/data/textspacing.shp and /dev/null differ diff --git a/tests/visual_tests/data/textspacing.shx b/tests/visual_tests/data/textspacing.shx deleted file mode 100644 index 9c4767dd8..000000000 Binary files a/tests/visual_tests/data/textspacing.shx and /dev/null differ diff --git a/tests/visual_tests/data/whole-centroid.csv b/tests/visual_tests/data/whole-centroid.csv deleted file mode 100644 index f630955df..000000000 --- a/tests/visual_tests/data/whole-centroid.csv +++ /dev/null @@ -1,2 +0,0 @@ -i|wkt -1|MULTIPOLYGON(((1350057.96009438 5942345.52058283,1384876.13646624 5891754.2133652,1527153.68896859 5865144.36766544,1489794.86785838 5828107.21457916,1521644.71000822 5808839.16705438,1500586.73589334 5782129.46376012,1549474.58270654 5722446.94649062,1526963.22131985 5715859.64352432,1468675.11142609 5744853.11521536,1367157.74707515 5695509.5055605,1353768.57268098 5663160.88833932,1395853.46277285 5615400.34143299,1363168.83576153 5576894.81504537,1376836.42020216 5503694.0028362,1516356.92287605 5396662.575031,1560328.12173938 5261876.31080913,1640818.23615492 5173802.74601002,1796912.65253506 5148129.98779792,1773597.67574436 5083111.70893878,2005049.37613903 4960037.26198969,2060770.68121407 4885821.98463312,2042650.53978071 4835753.32622244,1988073.15379307 4907241.27057499,1882814.34135654 4930901.063827,1835287.04135981 4832212.44229475,1909252.60910046 4777690.54700568,1911262.92778469 4716420.6995481,1847346.61575592 4693181.77244718,1788068.875589 4568718.26175616,1740109.09937055 4581073.81722757,1805880.43939388 4708906.48580766,1744005.2815483 4870423.42300908,1235522.56053157 5220039.63151647,1125161.53055404 5466602.89896275,973921.757167397 5532097.82173426,838019.24926376 5432786.3871293,852954.651385017 5491916.6901273,776607.959736312 5509523.04321204,782761.478548388 5595015.13624148,736908.312373676 5638877.1573602,793460.506128018 5662194.42680345,756857.878318762 5745270.82868898,783472.587455564 5769448.93739922,874497.199243332 5767386.72200479,939134.416294499 5854912.10535634,1005956.9462694 5754390.71173147,1033261.27965169 5860165.00562569,1127666.33041638 5816836.29071798,1118791.82929085 5867309.80784728,1164989.30665057 5868344.65660203,1165652.54817671 5921100.82966656,1350057.96009438 5942345.52058283),(1386948.01482887 5449379.17151171,1392606.60718488 5463421.03119553,1382120.31115215 5458937.77184712,1386948.01482887 5449379.17151171),(1385381.11851082 5146477.94829492,1386669.06721543 5146224.9584086,1386111.70929647 5147206.59661607,1385381.11851082 5146477.94829492)),((1382897.20987839 5687974.04417046,1371857.98993491 5675822.90372079,1377393.1289756 5689163.60754804,1382897.20987839 5687974.04417046)),((1095847.54640445 5317215.2838641,1091704.01231816 5313451.44710224,1091394.65545324 5321701.46563701,1094455.94145006 5323479.01597989,1095847.54640445 5317215.2838641)),((1162299.15983606 5288324.53042776,1160289.06379081 5267765.62824438,1124543.26210218 5277407.73480368,1162299.15983606 5288324.53042776)),((1123028.09251298 5247084.38946664,1122316.87228631 5254141.60947014,1124512.20396424 5250317.54284925,1123028.09251298 5247084.38946664)),((1215144.97114443 5209828.83212963,1209640.77892215 5214848.8689761,1210908.5966028 5219286.46510058,1215144.97114443 5209828.83212963)),((1148446.00580429 5208658.24432317,1145817.64130717 5213552.48912728,1149497.41839483 5212548.16532901,1148446.00580429 5208658.24432317)),((1059019.27398736 5033998.10699295,1093806.61486026 4942691.99568292,1065234.68643633 4743259.71214946,1003916.12604469 4759901.51823648,986197.736653606 4704377.88889769,935856.725207561 4715744.68629496,952523.590688621 4846503.91226084,911984.817004403 4999606.76073705,1059019.27398736 5033998.10699295)),((928311.824080081 5021563.59386512,914520.452365687 5011234.44611049,926301.728034833 5030262.29618597,928311.824080081 5021563.59386512)),((1443164.46899898 4995230.22633471,1441618.24127186 5000220.31310592,1445823.55767554 5002226.81825718,1443164.46899898 4995230.22633471)),((1553061.29669992 4968395.29665014,1542207.75766705 4973291.02362767,1552690.38015659 4974433.31609162,1553061.29669992 4968395.29665014)),((1581911.63517033 4947738.11891254, 1587632.34380218 4947004.77788114,1580427.52371907 4944237.33055168,1581911.63517033 4947738.11891254)),((923085.819265294 4735088.56864719,915479.024500905 4745293.69583645,924260.796490606 4748923.38178062,923085.819265294 4735088.56864719)),((1693571.31832746 4688858.4894456,1690973.90064878 4691713.90965507,1696416.19923417 4693935.9965921,1693571.31832746 4688858.4894456)),((1466448.61029075 4677403.01590106,1465211.85074803 4680849.56314581,1469231.59756058 4680414.29421003,1466448.61029075 4677403.01590106)),((1655135.14718535 4654767.34922581,1646940.91946804 4659946.37928978,1655166.09400377 4661409.67928983,1655135.14718535 4654767.34922581)),((1664813.70899286 4642559.56041499,1660020.95963625 4652672.28390196,1665772.39244759 4652790.51476716,1664813.70899286 4642559.56041499)),((1668555.37971741 4630998.75869634,1663236.86840579 4636007.55629286,1665215.68367412 4640507.06235257,1668555.37971741 4630998.75869634)),((1728668.01606527 4598788.94471507,1679439.97688818 4506146.77040914,1705043.45977066 4440345.73224938,1678852.4326158 4390316.66779138,1382835.42756099 4550662.053593,1482404.47818411 4610314.59733156,1532745.60094962 4575266.49172867,1728668.01606527 4598788.94471507)),((1344059.17537453 4572873.96816367,1339173.36292359 4577580.75464391,1342420.21851156 4577895.44505675,1344059.17537453 4572873.96816367)),((1375259.46829558 4566170.07673534,1366044.55216722 4570443.18173048,1373589.78725316 4570168.66006012,1375259.46829558 4566170.07673534)),((1337596.41101701 4402695.43852239,1328134.14298011 4415398.45409661,1341214.18314831 4410841.06668909,1337596.41101701 4402695.43852239))) diff --git a/tests/visual_tests/fonts/Awesome/FontAwesome.otf b/tests/visual_tests/fonts/Awesome/FontAwesome.otf deleted file mode 100644 index 81c9ad949..000000000 Binary files a/tests/visual_tests/fonts/Awesome/FontAwesome.otf and /dev/null differ diff --git a/tests/visual_tests/fonts/Awesome/readme.md b/tests/visual_tests/fonts/Awesome/readme.md deleted file mode 100644 index 6e6139b7a..000000000 --- a/tests/visual_tests/fonts/Awesome/readme.md +++ /dev/null @@ -1 +0,0 @@ -Font Awesome by Dave Gandy - http://fontawesome.io diff --git a/tests/visual_tests/fonts/KhmerOS/KhmerOS.ttf b/tests/visual_tests/fonts/KhmerOS/KhmerOS.ttf deleted file mode 100644 index 7aa5bdcd5..000000000 Binary files a/tests/visual_tests/fonts/KhmerOS/KhmerOS.ttf and /dev/null differ diff --git a/tests/visual_tests/fonts/KhmerOS/copyright b/tests/visual_tests/fonts/KhmerOS/copyright deleted file mode 100644 index 67ffde0d8..000000000 --- a/tests/visual_tests/fonts/KhmerOS/copyright +++ /dev/null @@ -1,28 +0,0 @@ -This package was adopted by Soputtra San on -Mon, 23 Jul 2007 11:04:29 +1000 - -This package was debianized by Paul Wise on -Wed, 14 Sep 2005 15:45:30 +0800. - -It was downloaded from http://www.khmeros.info/drupal/?q=en/download/fonts - -Copyright: - -Copyright 2005, 2006 Danh Hong -Copyright 2005, 2006 Open Forum of Cambodia - -License: - -This font 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. - -On Debian systems, the complete text of the GNU Lesser General Public -License can be found in the file /usr/share/common-licenses/LGPL. - diff --git a/tests/visual_tests/fonts/KhmerOS/readme.md b/tests/visual_tests/fonts/KhmerOS/readme.md deleted file mode 100644 index 315881dda..000000000 --- a/tests/visual_tests/fonts/KhmerOS/readme.md +++ /dev/null @@ -1 +0,0 @@ -KhmerOS.ttf V.5.0 downloaded from http://www.khmeros.info/en/fonts on Dec 2, 2013. diff --git a/tests/visual_tests/fonts/Noto/NotoNaskhArabic-Regular.ttf b/tests/visual_tests/fonts/Noto/NotoNaskhArabic-Regular.ttf deleted file mode 100644 index 6855dd576..000000000 Binary files a/tests/visual_tests/fonts/Noto/NotoNaskhArabic-Regular.ttf and /dev/null differ diff --git a/tests/visual_tests/fonts/Rachana/RachanaMac.ttf b/tests/visual_tests/fonts/Rachana/RachanaMac.ttf deleted file mode 100644 index a25c6d597..000000000 Binary files a/tests/visual_tests/fonts/Rachana/RachanaMac.ttf and /dev/null differ diff --git a/tests/visual_tests/fonts/Rachana/readme.md b/tests/visual_tests/fonts/Rachana/readme.md deleted file mode 100644 index 133046d4f..000000000 --- a/tests/visual_tests/fonts/Rachana/readme.md +++ /dev/null @@ -1 +0,0 @@ -RachanaMac.ttf V.5.0 downloaded from https://sites.google.com/site/macmalayalam/ on Dec 2, 2013. diff --git a/tests/visual_tests/fonts/copyright b/tests/visual_tests/fonts/copyright deleted file mode 100644 index 67ffde0d8..000000000 --- a/tests/visual_tests/fonts/copyright +++ /dev/null @@ -1,28 +0,0 @@ -This package was adopted by Soputtra San on -Mon, 23 Jul 2007 11:04:29 +1000 - -This package was debianized by Paul Wise on -Wed, 14 Sep 2005 15:45:30 +0800. - -It was downloaded from http://www.khmeros.info/drupal/?q=en/download/fonts - -Copyright: - -Copyright 2005, 2006 Danh Hong -Copyright 2005, 2006 Open Forum of Cambodia - -License: - -This font 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. - -On Debian systems, the complete text of the GNU Lesser General Public -License can be found in the file /usr/share/common-licenses/LGPL. - diff --git a/tests/visual_tests/fonts/glukfonts/Foglihten-068.otf b/tests/visual_tests/fonts/glukfonts/Foglihten-068.otf deleted file mode 100644 index 84b640803..000000000 Binary files a/tests/visual_tests/fonts/glukfonts/Foglihten-068.otf and /dev/null differ diff --git a/tests/visual_tests/fonts/glukfonts/OFL_License.txt b/tests/visual_tests/fonts/glukfonts/OFL_License.txt deleted file mode 100644 index dd8001ea1..000000000 --- a/tests/visual_tests/fonts/glukfonts/OFL_License.txt +++ /dev/null @@ -1,94 +0,0 @@ -Copyright (c) 2010-2011, gluk (http://www.glukfonts.pl|gluksza@wp.pl), -with Reserved Font Name Foglihten. - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/66-lohit-bengali.conf b/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/66-lohit-bengali.conf deleted file mode 100644 index fb6bffef1..000000000 --- a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/66-lohit-bengali.conf +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - bn - - - sans-serif - - - Lohit Bengali - - - - - - Lohit Bengali - - - true - - - - - Lohit Bengali - - sans-serif - - - - diff --git a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/AUTHORS b/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/AUTHORS deleted file mode 100644 index ce2775c3a..000000000 --- a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/AUTHORS +++ /dev/null @@ -1,12 +0,0 @@ -Contributors (Alphabetically) :- -- Baishampayan Ghose -- Bernard Massot -- Darshan Santani -- Hiran Venugopalan -- Leon Ho -- Parag Nemade -- Pravin Satpute -- Rahul Bhalerao -- Ramkrishna Reddy -- Sandeep Shedmake -- Shriramana Sharma diff --git a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/COPYRIGHT b/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/COPYRIGHT deleted file mode 100644 index ec59324d1..000000000 --- a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/COPYRIGHT +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 2011-12 Lohit Fonts Project contributors. - - - Licensed under the SIL Open Font License 1.1 (see file - OFL.txt) - - Lohit is a trademark of Red Hat, Inc. diff --git a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/ChangeLog b/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/ChangeLog deleted file mode 100644 index d0f16bd31..000000000 --- a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/ChangeLog +++ /dev/null @@ -1,25 +0,0 @@ - lohit-bengali -Current Version :- 2.5.3 - -* Fri Dec 21 2012 Pravin Satpute - 2.5.3 -- Dropping RFN from OFL.txt - -* Thu Nov 08 2012 Pravin Satpute - 2.5.2 -- resolved rendering error for UTRRS Assamese GPSO sequence 25, 28 44 and 63 for Harfbuzz -- resolved rendering error for UTRRS Bengali GSUB sequnce 86, 88 for harfbuzz -- corrected panose values #803294 - -* Wed Feb 29 2012 Pravin Satpute - 2.5.1 -- added U+09FB character -- added autohint instruction in conf file - -* Wed Sep 21 2011 Pravin Satpute - 2.5.0 -- relicensing to OFL 1.1 - -* Tue Aug 30 2011 Pravin Satpute - 2.4.3.1 -- minor release, added makefile in tarball - -* Fri Aug 28 2009 Pravin Satpute - 2.4.3 -- first release with split tarball -- see Changelog.old for previous changes - diff --git a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/ChangeLog.old b/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/ChangeLog.old deleted file mode 100644 index 019e5cd41..000000000 --- a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/ChangeLog.old +++ /dev/null @@ -1,175 +0,0 @@ - fonts-indic -Current Version :- 2.4.3 -* Wed Sep 09 2009 Pravin Satpute - 2.4.3 -- updated conf file for all language -- added changelog for individual lang -- modified makedist.sh generate.sh for releasing new tarballs - -* Fri Aug 28 2009 Pravin Satpute - 2.4.2 -- added conf file for all fonts -- contributions from Parag Nemade for conf files - -* Wed Aug 12 2009 Pravin Satpute - 2.4.1 -- Update Copyright - -* Tue Aug 04 2009 Pravin Satpute - 2.4.0 -- Added Unicode 5.1 support in All Lohit fonts - -* Thu Mar 05 2009 Rahul Bhalerao - 2.3.8 -- Bug 428427 - [kn_IN][fonts-indic] - 0CB5+0CCA is wrongly rendering -- Bug 450699 - [ta_IN]Errors in "sh" and "shrI" in Lohit Tamil font (fixed in font, needs rendering update) -- Bug 476427 - [te_IN] - Consonant+Virama+Consonant+Virama+space renders the second virama as a separate glyph in lohit-telugu font -- Bug 479100 - [kn_IN] Conjunct combination of U0C9D with U0CCA/U0CCB is rendering wrongly -- Bug 483530 - [bn_IN]Lohit Bengali font cheating about character support -- Added Lohit-Assamese -- Modified README file. - -* Tue Sep 09 2008 Rahul Bhalerao - 2.3.1 -- Bug 216400: [te_IN] - Anaconda GUI - Release Notes button is overlapping -with other texts in a specific page - -* Wed Aug 20 2008 Rahul Bhalerao - 2.3.0 -- Bug 215902: [hi_IN, mr_IN]Incorrect extent of 0x093f when attached to a composite character which has width greater than a single character (hi_IN & maybe others) -- Forked Lohit Hindi into Marathi, Maithili, Kashmiri, Konkani, Sindhi and Nepali. - -* Fri Jun 06 2008 Rahul Bhalerao -- Bug 445176: [ml_IN] Conjuncts combining with 0D30 do not form the pre based glyph - -* Fri Jun 06 2008 Rahul Bhalerao -- Improved Anchoring(blwm Anchor-0) for Hindi font. -- Corrected positioning of U+0953 for Hindi font. - -* Tue Apr 29 2008 Rahul Bhalerao - 2.2.1 -- Resolved bugs (bugzilla.redhat.com): -- Bug 444559 Processed: [ml_IN] Wrong shape for conjuncts formed using 0D30 -(xRa) in a word -- Bug 444561 Processed: [ml_IN] Conjuncts does not get combined with 0D30 to -form the pre based glyph -- Bug 444563: [ml_IN] When 0D2F is combined with a consonant and followed by -0D15, 0D2F joins with 0D15 - -* Tue Apr 08 2008 Rahul Bhalerao - 2.2.0 -- Resolved bugs (bugzilla.redhat.com): -- Bug 202400: [hi_IN] New codepoints/glyphs in Unicode 5.0 -- Bug 205981: [hi_IN]The font file of Devanagari(lohit_hi.ttf) lacks the glyph -of U+0x0904 -- Bug 206426: [hi_IN, mr_IN] Some Glyphs are missing and some GPOS shapes -should be more perfect - Priority - C -- Bug 239630: [hi_IN] the glyph of 0x0953 in lohit_hi.ttf is wrong. -- Bug 428427: [kn_IN][fonts-indic] - 0CB5+0CCA is wrongly rendering - -* Thu Feb 28 2008 Rahul Bhalerao - 2.1.9 -- Resolved bugs(bugzilla.redhat.com): -- Bug 431035: [ml_IN] Glyph to be formed for nine consonants + 0D4D + 0D32 -- Bug 433437: [ml_IN] Rendering combination incorrect with 0D35 -- Bug 433440: [ml_IN] Rendering combination incorrect with 0D2F -- Contributions from Hiran Venugopalan (xRa glyphs and few other) - -* Fri Jan 25 2008 Rahul Bhalerao - 2.1.8 -- Bug 192812: [ml_IN]GPOS issues in new Malayalam font -- Bug 402321: [ml_IN} Wrong combinations used for the conjunct 'ന്പ' -- Bug 402331: [ml_IN] Wrong combinations used for conjunct 'ന്‍റ' -- Bug 424701: [ml_IN] words are shown joined (very low space shown on screen) -- Bug 429526: [ml_IN]: Removal of a glyph from font file -- Bug 247233: Additional special character rendering for assamese [as-IN] and bengali [bn-IN] - -* Tue Jan 15 2008 Rahul Bhalerao - 2.1.7 -- Updated the makedist.sh script - -* Tue Jan 15 2008 Rahul Bhalerao - 2.1.7 -- Bug 233419: [kn_IN] GSUB's combinaing with additional dependent vowel are -not rendering correctly - -* Fri Dec 14 2007 Rahul Bhalerao - 2.1.6 -- Bug 234284: [pa_IN] Enlarge size for asterik(*) - -* Mon Mar 26 2007 Parag Nemade - 2.1.5 -- Resolved Bugs from Parag Nemade -- Bug 231965: [kn_IN] wrong Conjuct combines during the formation kannada letter [yo] -- Bug 233257: [kn_IN] Conjuct combination of U0CAE with U0CCB is rendering wrongly -- Bug 233415: [kn_IN] GSUB's combinaing with additional dependent vowel are not rendering correctly -- Bug 233554: [kn_IN] GSUB's combinaing with additional dependent vowel U0CC0 are not rendering correctly -- Bug 233555: [kn_IN] GSUB's combinaing with additional dependent vowel U0CC7 are not rendering correctly -- Bug 233556: [kn_IN] GSUB's combinaing with additional dependent vowel U0CC6 are not rendering correctly -- Bug 233557: [kn_IN] GSUB's combinaing with additional dependent vowel U0CC8 are not rendering correctly -- Bug 233558: [kn_IN] GSUB's combinaing with additional dependent vowel U0CCBare not rendering correctly -- Bug 233559: [kn_IN] GSUB's combinaing with additional dependent vowel U0CBE are not rendering correctly -- Bug 233560: [kn_IN] GSUB's combinaing with additional dependent vowel U0CBF are not rendering correctly - -* Mon Mar 05 2007 Parag Nemade - 2.1.4 -- Resolved Bugs from Parag Nemade -- Bug 221383: [kn_IN] GSUB combinations has problem with Ra - -* Mon Feb 19 2007 Parag Nemade - 2.1.3 -- Resolved Bugs from Parag Nemade -- Bug 202401: [ta_IN] New codepoints/glyphs in Unicode 5.0 -- Bug 223774: [kn_IN] Some Ligature rules are wrong in the font file -- Bug 223971: [kn_IN] Consonant + Halant + Consonant + Dependent Vowel not appearing properly in some rare cases -- Bug 227971: [kn_IN] Combinations with 2 Halants not rendering properly - -* Tue Jan 16 2007 Parag Nemade - 2.1.2 -- Resolved Bugs from Parag Nemade -- Bug 222407: [or_IN] [fonts-indic] - One GSUB Conjunct is not appearing with its correct shape -- Bug 206434: [ml_IN] Digits are appearing in English instead of malayalam - Priority C -- Bug 215894: Relative height of 0x0901 (and 0x0902) on 0x0915 is different than other devnagari characters (hi_IN, mr_IN) -- Bug 222408: [te_IN] [fonts-indic] - Danda and Double Danda to be implemented with 0964 && 0965 -- Bug 222409: [kn_IN] [fonts-indic] - Danda and Double Danda to be implemented with 0964 && 0965 -- Bug 221384: [kn_IN] - shape of ra (U+0CB0) is not corret in combined character (below base) - -* Tue Jan 16 2007 Parag Nemade - 2.1.1 -- Added makedist.sh, generate.sh and generate.pe script files. - -* Fri Jan 12 2007 Parag Nemade - 2.0.13 -- Resolved Bugs from Parag Nemade -- Bug 220880: [or_IN] Danda need to move from 0B64/0B65 to 0964/0965 -- Bug 222406: [ml_IN] Danda need to move from 0D64/0D65 to 0964/0965 - -* Wed Jan 02 2007 Parag Nemade - 2.0.12 -- Resolved Bugs from Parag Nemade -- Bug 220881: [ta_IN] [fonts-tamil] - Warning showing in the terminal when run apps with ta_IN locale -- Bug 220882: [hi_IN] rendering problem for number "5" in postscript file - -* Wed Dec 13 2006 Parag Nemade - 2.0.11 -- Resolved Bugs from Parag Nemade -- Bug 216639: [kn_IN] OTF rules to be fixed - Priority A -- Bug 217482: [kn_IN] - pango - Composed Char not rendered properly -- Bug 219583: [pa_IN] Punjabi fonts' size is big as compared to English -- Bug 218588: [gu_IN] Qt doesn't display virama properly - -* Tue Dec 06 2006 Parag Nemade - 2.0.10 -- Resolved Bugs from Parag Nemade -- Bug 207269: [ta_IN] - Some conjunct characters not appearing with proper shape - Priority - B -- Bug 217482: [kn_IN] - pango - Composed Char not rendered properly -- Bug 216628: [ml] characters are not shown bold during selecting BOLD font -- Bug 218588: [gu_IN] Qt doesn't display virama properly -- Bug 206599: [te_IN] - Some of the Priority - C GSUB Conjuncts are not appearing with its actual shape -- Resolved Bugs from LingNing Zhang -- Bug 218586: [ml_IN] 0d2f+0d4d combination is invaild when put in word -- Bug 218587: [ml_IN] 0d35+0d4d combination is invaild (should not combine) - -* Tue Nov 21 2006 Parag Nemade - 2.0.9 -- Fixed Bugs from Parag Nemade -- Bug 216060: [pa_IN]Lohit Punjabi: (U+0A03) Gurmukhi Sign Visarga right margin is too wide. - -* Tue Nov 21 2006 Parag Nemade - 2.0.8 -- Fixed Bugs from Parag Nemade -- Bug 216629 : [te_IN] GPOS position should be at middle instead of left hand side - Priority B -- Bug 216631 : [or_IN] one GSUB Rule is wrongly defined - Priority A -- Bug 216628 : [ml] characters are not shown bold during selecting BOLD font -- Bug 216624 : [pa_IN] 0a01/0a03/0964/0965 is missing from font -- Bug 216634 : Glyphs for two combinations are wrong in Gujarati (gu_IN) -- Bug 197216 : [bn_IN]Incorrect glyph for conjunct -- Bug 215894 : Relative height of 0x0901 (and 0x0902) on 0x0915 is different than - other devnagari characters (hi_IN, mr_IN) -- Fixed Bugs from LingNing Zhang -- Bug 216626 : [as_IN] Pango - A particular char when Conjuncts, creates Cursor Nevigation Problem -- Bug 216627 : [ml_IN] The glyph of 0x25CC is not existing in lohit_ml.ttf -- Bug 216639 : [kn_IN] OTF rules to be fixed - Priority A - -* Tue 17 oct 2006 Leon Ho - 2.0.7 -- Bug 206601: [ta_IN] Glyph is missing for Unicode U+0BB6 - Priority - A (Rahul Bhalerao) -- Bug 216639: [kn_IN] OTF rules to be fixed - Priority A (Ramakrishna Reddy) - -* Fri 29 Sep 2006 Leon Ho - 2.0.6 -- Bug 208525: [ml_IN]the glyph of 0d33+0d4d+0d33 is wrong (LingNing Zhang) -- Bug 208540: [ml_IN]the glyph of 0d2f+0d4d and the glyph of 0d2f+0d4d+0d2f are wrong (LingNing Zhang) diff --git a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/Lohit-Bengali.ttf b/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/Lohit-Bengali.ttf deleted file mode 100644 index 2f537a191..000000000 Binary files a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/Lohit-Bengali.ttf and /dev/null differ diff --git a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/OFL.txt b/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/OFL.txt deleted file mode 100644 index 01b830782..000000000 --- a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/OFL.txt +++ /dev/null @@ -1,94 +0,0 @@ -Copyright 2011-12 Lohit Fonts Project contributors - - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/README b/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/README deleted file mode 100644 index e4f820750..000000000 --- a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/README +++ /dev/null @@ -1,21 +0,0 @@ - Lohit Fonts Project - -1) Generating .ttf file from source - Example - $tar -xvf lohit-hindi-2.4.3.tar.gz - $cd lohit-hindi-2.4.3 - $make - -2) Installing font (.ttf) file - You can then install .ttf font files by copying them to ~/.fonts directory. - Then execute fc-cache command and then relogin to use that font. - - -Lohit Project Information :- -See https://fedorahosted.org/lohit/ for more details. - -Mailing list:- -http://www.redhat.com/mailman/listinfo/lohit-devel-list - - - diff --git a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/README.cvs b/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/README.cvs deleted file mode 100644 index 59dafe942..000000000 --- a/tests/visual_tests/fonts/lohit-bengali-ttf-2.5.3/README.cvs +++ /dev/null @@ -1,20 +0,0 @@ -Lohit Fonts Project - -Scripts Usage:- -Lohit CVS is now included with 2 shell scripts -1)generate.sh - Once you checkout the .sfd files from lohit CVS, you just need to execute this script - and you will get all .ttf files in respective language directory. You can then install those font files - by copying them to ~/.fonts directory. Then execute fc-cache command and then relogin to use that font. - -2)makedist.sh - Use this script to generate upstream tarball used by fonts-indic SPEC to build rpms. - e.g. - To generate lohit-lang-$version.tar.gz follow steps as - 1) Anonymous CVS access - $ svn co http://svn.fedorahosted.org/svn/lohit - 1) cd lohit - 2) sh makedist.sh - You will get upstream tarball used to build lohit-fonts-$version-1 rpm. - NOTE:- This script can be used only from 2.1.1 and above version of this package. - diff --git a/tests/visual_tests/grids/antimeridian-bbox-1000-1000-1.0-grid-reference.json b/tests/visual_tests/grids/antimeridian-bbox-1000-1000-1.0-grid-reference.json deleted file mode 100644 index 0f716567a..000000000 --- a/tests/visual_tests/grids/antimeridian-bbox-1000-1000-1.0-grid-reference.json +++ /dev/null @@ -1,306 +0,0 @@ -{ - "keys": [ - "", - "42", - "41", - "40", - "24", - "44", - "26", - "38", - "23", - "46", - "36", - "22", - "28", - "21", - "47", - "34", - "29", - "33", - "30", - "19", - "15", - "14", - "12", - "18", - "16", - "11", - "31", - "49", - "48", - "10", - "50", - "51", - "9", - "52", - "8", - "54", - "6", - "56", - "5", - "58", - "4", - "60", - "3", - "62", - "1", - "63", - "66", - "65", - "64" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !# $ % ", - " & ' ", - " ( ) ", - " * + , ", - " - . ", - " / 0 1 ", - " 2 3 4 56 7 ", - " 8 9 : ", - " ; <= ", - " > ? ", - " @ ", - " A B ", - " C D ", - " ", - " E F ", - " ", - " G H ", - " I J ", - " K L ", - " ", - " M N ", - " OP ", - " Q ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/antimeridian-bbox-1000-1000-2.0-grid-reference.json b/tests/visual_tests/grids/antimeridian-bbox-1000-1000-2.0-grid-reference.json deleted file mode 100644 index 17039986c..000000000 --- a/tests/visual_tests/grids/antimeridian-bbox-1000-1000-2.0-grid-reference.json +++ /dev/null @@ -1,286 +0,0 @@ -{ - "keys": [ - "", - "42", - "40", - "24", - "37", - "46", - "22", - "28", - "35", - "20", - "30", - "15", - "12", - "32", - "17", - "48", - "10", - "50", - "9", - "52", - "54", - "7", - "57", - "5", - "60", - "3", - "1", - "63", - "66" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ! # $ ", - " ", - " % ", - " & ' ", - " ( ", - " ) * ", - " + , - ", - " . / ", - " 0 ", - " 1 2 ", - " ", - " 3 4 ", - " 5 ", - " 6 ", - " ", - " 7 ", - " 8 ", - " 9 ", - " : ", - " ", - " ; < ", - " = ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/building-symbolizer-opacity-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/building-symbolizer-opacity-512-512-1.0-grid-reference.json deleted file mode 100644 index 2e111c9a3..000000000 --- a/tests/visual_tests/grids/building-symbolizer-opacity-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "keys": [ - "", - "1", - "2" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ! ", - " !!! ", - " !!!!! ", - " !!!!!!! ", - " !!!!!!!!! ", - " !!!!!!!!!!! ", - " !!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ## !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " #### # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ###### ### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ######## ##### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########## ####### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ############ ######### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ############## ########### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "############################ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " ########################## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " ########################## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ############## ########### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ############ ######### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########## ####### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ######## ##### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ###### ### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " #### # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ## !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!! ", - " !!!!!!!!!!! ", - " !!!!!!!!! ", - " !!!!!!! ", - " !!!!! ", - " !!! ", - " ! ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !! ! ", - " !!!! !!! ", - " !!!!!! !!!!! ", - " !!!!!!!! !!!!!!! ", - " !!!!!!!!!! !!!!!!!!! ", - " !!!!!!!!!!!! !!!!!!!!!!! ", - " !!!!!!!!!!!!!! !!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!! !!!!!!!!!!!!!! ", - " !!!!!!!!!!!! !!!!!!!!!!!! ", - " !!!!!!!!!! !!!!!!!!!! ", - " !!!!!!!! !!!!!!!! ", - " !!!!!! !!!!!! ", - " !!!! !!!! ", - " !! !! ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/building-symbolizer-opacity-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/building-symbolizer-opacity-512-512-2.0-grid-reference.json deleted file mode 100644 index 2e111c9a3..000000000 --- a/tests/visual_tests/grids/building-symbolizer-opacity-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "keys": [ - "", - "1", - "2" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ! ", - " !!! ", - " !!!!! ", - " !!!!!!! ", - " !!!!!!!!! ", - " !!!!!!!!!!! ", - " !!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ## !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " #### # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ###### ### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ######## ##### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########## ####### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ############ ######### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ############## ########### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "############################ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " ########################## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " ########################## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########################## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ############## ########### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ############ ######### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ########## ####### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ######## ##### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ###### ### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " #### # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ## !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!! ", - " !!!!!!!!!!! ", - " !!!!!!!!! ", - " !!!!!!! ", - " !!!!! ", - " !!! ", - " ! ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !! ! ", - " !!!! !!! ", - " !!!!!! !!!!! ", - " !!!!!!!! !!!!!!! ", - " !!!!!!!!!! !!!!!!!!! ", - " !!!!!!!!!!!! !!!!!!!!!!! ", - " !!!!!!!!!!!!!! !!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!! !!!!!!!!!!!!!! ", - " !!!!!!!!!!!! !!!!!!!!!!!! ", - " !!!!!!!!!! !!!!!!!!!! ", - " !!!!!!!! !!!!!!!! ", - " !!!!!! !!!!!! ", - " !!!! !!!! ", - " !! !! ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/charspacing-200-400-1.0-grid-reference.json b/tests/visual_tests/grids/charspacing-200-400-1.0-grid-reference.json deleted file mode 100644 index 617c072b5..000000000 --- a/tests/visual_tests/grids/charspacing-200-400-1.0-grid-reference.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "keys": [ - "", - "6" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ! ! !! !!!! ! !!! ! ", - " ! !!!! !! ! !! !!! ", - " ! ! ! ! ! ", - " ! ! !! !!!!! !! ", - " !! ! ! !! ! ", - " !!! !! !!!! ! !!! !! ", - " !! !!! !! ! !! ! ", - " ! ! ! ! ", - " !! !!!!! !! ! ", - " ! !! ! ! ! ! ", - " !! ! !! ! !!! ! !! ! ", - " !!! !! ! !! ! ! ", - " !! ! ! ! ", - " ! !!! !!!! ! ! !! ! ", - " ! ! !! ! ! ! ! ", - " ! ! ! ! !! ! !!! ! !! ! ", - " !!!! !!! ! ! !!!! ", - " !!! ! ! ! ! !! ", - " ! ! !! !!! !! !! ", - " ! !! ! ! ", - " !!! !! !! ! !!! ! !! ", - " !! !! !!! !! !!!! ", - " ! ! ! ! ! ! ", - " !! ! !!! !!! ! ", - " ! ! ! ! ! ", - " !!!! !! ! !!! ! ! ", - " !!!! !!! !!!! ! ", - " ! ! ! ! ! ", - " ! ! ! ! !!! ! ! ", - " ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! !! ", - " ! ! ! ! ! ", - " ! ! ! ! ! ", - " ! !!! ! !! ! !!!! ! ", - " ! ! ! !! ! ", - " !! ! !! ! ! ! ! ! !! ! ", - " !! !! ! !! ! ! !! !! ", - " ! ! ! ! ! ", - " !! !! ! ! ! ! ! !! ", - " ! ! ! ! ! ! ! ", - " !! ! !! ! ! ! ! ! ! ! ", - " !! ! ! !! ! !! ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/charspacing-200-400-2.0-grid-reference.json b/tests/visual_tests/grids/charspacing-200-400-2.0-grid-reference.json deleted file mode 100644 index 38fe2f049..000000000 --- a/tests/visual_tests/grids/charspacing-200-400-2.0-grid-reference.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "keys": [ - "", - "6" - ], - "data": {}, - "grid": [ - " ", - " ! ", - " ! ! ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! !! !! !! ! ! ! ! ! ", - " ! ! ! ! !! !! !! !! !! ! ! ! ! ! ", - " ! ! ! !! ! ! ! ! ! ", - " ! ! ! ! ", - " ! !!! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! !! ! ! ! ! ", - " ! !! !! ! ! !! !! ! ! ! ! ! ", - " ! ! ! !! ! ! ! ! ", - " ! ! ! ! ", - " ! !! ! ! ! ! ! ! ! ! ! ", - " ! ! !! ! ! ! !! ! ! ! ! ! ! ", - " ! ! ! !! ! !! !! ! ! ! ! ", - " !! ! !! !! ! ! ! ", - " ! ! ! ", - " ! !! ! ! ! ! ! ! ! ! ! !", - " ! ! ! ! ! !! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! !! ! ! ! ! ! ! !", - " ! ! !! !! ! ! ! ! ! ", - " ! ! ! ! ", - " ! !!! ! ! !! ! ! ! ! ! ! ! !!", - " ! ! ! ! ! ! ! !! ! ! ! ! ! ! !!", - " !! ! ! ! ! ! ! !! ! ! ! ! ! ! !!!", - " ! ! ! ! ! ! ! ! ", - " ! ! ! ", - " ! !! ! ! ! ! ! ! ! ! !! ! ", - " ! ! ! ! ! ! ! ! !! ! !!", - " ! ! ! ! ! ! ! !! ! ! !! ! !! ", - " !! ! ! ! ! ! ! !!", - " ! ", - " ! ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! !!", - " ! ! ! !! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! !", - " ! ! ", - " ! !! ! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ", - " ! ! ", - " ! !! ! ! ! ! ! ! ! ! !", - " ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !", - " ! ! !! ! ! !! ! ! ! ! ! ! ! ! !", - " ! ! ! !! ! ! ! ", - " ! ! ", - " ! ! ! ! ! ! ! ! ! ! ! !", - " ! ! ! ! ! ! ! ! ! ! !", - " ! ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! !! ! ! ! ! ", - " ! ! ! ! ", - " ! !! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! ! ! ! ", - " !! ! !! !! ! ! ! ", - " ! ! ! ", - " ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! !! ! !! ! ", - " ! ! ! ", - "! ! !! ! ! !! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ", - " ! ! ! ", - "! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! ! ! !", - "! ! ! ! ! ! ! ! ! ! ! ! ! !", - " ! ! !! ! ! ", - " ! ! ! ! ", - " !! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! !! ! !! ", - " ! ! !", - " ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! ! ", - " ! ! !! ! ! ", - " ! ! ", - " ! ! ! ! ! ", - "! ! ! ! ! ! ", - "! ! ! ! ! ! ! ! ", - " ! !! ! !! ", - " ! ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/charspacing-lines-300-300-1.0-grid-reference.json b/tests/visual_tests/grids/charspacing-lines-300-300-1.0-grid-reference.json deleted file mode 100644 index a792e966b..000000000 --- a/tests/visual_tests/grids/charspacing-lines-300-300-1.0-grid-reference.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "keys": [ - "", - "6" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ! ! ! !! ! !! ! ! ! ! ", - " ! ! ! !! ! !! ! ! ! ! ", - " !! ! ! ", - " !! !! ! ! ! ! ! !! !! ", - " !! ", - " ! ! ! ! ! !! ! !! !! ! ! ", - " !! ! ! ! !! ! !! !! ! ! ", - " !!! ! ! ", - " !!!! ! ! !!!! ", - " ! ", - " ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! !! ! ", - " ! ! ! ", - " ! ! ! ! ! ", - " ! ", - " ! !! !!!! !!!!!! ", - " ! !!! !!!! !!!!!! ! ! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " !! !!!! !!!!! ! ", - " ! ! ", - " ! ! ! ! !!!! !!!!! ! ", - " !!! ! !!!! !!!!! ! ! ", - " !!! ! ! !! ", - " ! !!! !!!! !!! ", - " ! ! ", - " ! !!! ! !!!! !!! ! ! ! ", - " !!!! !!!! !!!!! !!!! ", - " ! ! ! ! ", - " !!! !!!! !! !! ", - " ! ! ", - " !!!! !!!! !!! ! !! ! ", - " ! !! !!!! !! ! !!! ", - " !! ! ! ! ", - " !! !!!! ! !! ! ", - " ! ! ", - " ! ! !! ! !! !!! ! ! ", - " !! !! ! !! !! !! ! !! ", - " !! ! ! ! ", - " ! !!!! ! ! ! !! ", - " ! ", - " !!!! ! !! !!!!! !! ", - " !!!!! ! !! !! !! !!! ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/charspacing-lines-300-300-2.0-grid-reference.json b/tests/visual_tests/grids/charspacing-lines-300-300-2.0-grid-reference.json deleted file mode 100644 index ec902266d..000000000 --- a/tests/visual_tests/grids/charspacing-lines-300-300-2.0-grid-reference.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "keys": [ - "", - "6" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !! ! ! ", - " !! !! !! !! !! !! !! !! !!! ! ", - " ! ! ! !! ! ! !! ! ! ! ! !! ", - " ! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! ", - " ! ! ", - " !! ! !! !! ", - " ! !! !! !! !! !!! !! !! ! !! !!! ! ", - " ! !! ! !! ! ! !! ! ! ! ! ! ! ", - " ! ! ! !! ! ! ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ! ", - " ! ! !! !! ", - " ! !!! !! !! !! !! !! !! !! !! ! ", - " ! ! !! ! !! !! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! !! !! ! ! ! ! ! ! ! !! ", - " ! ! ", - " !! ! ! ! !! ", - " !! !! ! !! !! !! !! ! !!! !! ! ", - " ! ! !! ! ! ! !! ! ! ! ! ! ", - " ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! ", - " ! ! ", - " !! ! ! ! ! ", - " ! !!! !! !! !! !!! !! !! ! !! !! ! ! ! ", - " ! ! ! !!! !! ! ! !!! ! ! ! ! ! ! ! ", - " ! !! ! ! ! ! !! ! ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ! !! !!! !! !! !! !! !! ! !! !! ! ! ! ", - " ! !! ! !! ! !!! ! ! ! ! ! !! ", - " ! ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! ! ", - " ! ", - " !! ! ! !! ! ", - " ! !! !! !! !! !! !! !! ! !! !!! ! ! ", - " ! ! ! !! ! ! !!! ! ! ! ! !!! ", - " ! ! ! ! ! ! ! !! ! ! ! ! ! ! ! !! ! ! ! ", - " ! ! ", - " !! ! ! !! ", - " !!! !! !! !! !! !! !! !!! !!! ! ! ! ", - " ! ! ! !! ! ! !!!! ! ! ! ! ! ! ! ", - " ! !! ! !! ! ! !! ! ! ! ! ! ! ! ! ", - " ", - " !! ! !! ", - " ! !! !! ! !! !! !! !! !!! !! ! ! ", - " ! ! !!! ! ! !!!! ! ! ! ! ! ! ", - " ! ! ! ! ! ! ! ! ! ! !! ! ! ! !! ", - " ! ", - " !! ! !! !! ", - " ! !! !! !! !! !! !! !! !!! !! ! ! ", - " ! ! ! !! ! ! ! !!!!! ! !! ! ! ! ! ", - " !! ! !! ! ! ! ! ! ! ! ! ! ! ! ! ", - " ! ! ", - " ! ! !! ! ", - " ! !!! !! !! !! !! !! !! !! !! ! !! ", - " ! ! !! ! !! ! ! !!! ! !! ! !! ", - " ! !! ! ! ! ! !! ! ! !! ! !! ! ! ", - " ! ! ", - " !! ! ! !! ", - " ! !! !! !! !! !! !! !!! !! !! ! ! ! ", - " ! !! ! !! ! ! !!! ! ! !! ! ! ! !! ", - " ! ! ! ! !! !! ! ! !! ! ! ! !! ! ", - " ! ! ! ", - " !! ! ! ! !! ", - " ! !! !! ! !! !! !! !!! !! !!! ! ! ! ", - " ! ! ! !! !! ! ! !!! ! ! ! ! ! ! ! ", - " ! !! !! ! ! !! !! !! ! ! ! ! ! !! ! ", - " ! ! ! ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/collision-600-400-1.0-grid-reference.json b/tests/visual_tests/grids/collision-600-400-1.0-grid-reference.json deleted file mode 100644 index e59d9c95c..000000000 --- a/tests/visual_tests/grids/collision-600-400-1.0-grid-reference.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "keys": [ - "", - "1" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!! ", - " !!! ", - " !!!! ", - " !!!!! ", - " !!!!!! ", - " !!!!! ", - " !!!! ", - " !!! !! ", - " !!! ", - " !!!! ", - " !!!!! ", - " !!!!!! ", - " !!!!! ", - " !!!! !! ", - " !! !!! ", - " !!!! ", - " !!!!! ", - " !!!!!!! ", - " !!!! ", - " !! ", - " !! ", - " !!!! ", - " !!!!! ", - " !!!!! ", - " !!!!! ", - " !!!! ", - " !! ", - " ", - " !!!! ", - " !!!! ", - " !!! ", - " !!! ", - " !!! ", - " !!! ", - " !!!! ", - " !!! ", - " ", - " !! ", - " !!! ", - " !!! ", - " !!! ", - " !!! ", - " !!! ", - " !!!! ", - " !!!! ", - " ! ", - " !!! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!! ", - " ! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!! ", - " ", - " !!! ", - " !!! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!!!! ", - " !!!! ", - " !!! !! ", - " !!! ", - " !!!! ", - " !!!!!! ", - " !!!!!! ", - " !!!! ", - " !! !!!! ", - " !!!! ", - " !!!!!!! ", - " !!!!!!! ", - " !!!!!! !! ", - " !! !!!! ", - " !!!!!! ", - " !!!!!!!! ", - " !!!!!! !! ", - " !! !!!! ", - " !!!!!!!! ", - " !!!!!!!! ", - " !!!!! ", - " !! " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/collision-600-400-2.0-grid-reference.json b/tests/visual_tests/grids/collision-600-400-2.0-grid-reference.json deleted file mode 100644 index 60bcfb2b4..000000000 --- a/tests/visual_tests/grids/collision-600-400-2.0-grid-reference.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "keys": [ - "", - "1" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ! ", - " ! !!!! ", - " !!!!! ", - " !!!!!! ", - " !!!!!!!! ", - " !!!!!!!!! ", - " !!!!!!!! ", - " !!!!!!!!! ", - " !!!!!!!!! ", - " !!!!!!!!!!! ", - " !!!!!!!!!! ", - " !!!!!!!!! ", - " !!!!!!!!! ", - " !!!! ! ", - " !!!! !! ", - " !!! !! !!!! ", - " !!!!! ", - " !!!!!! ", - " !!!!!!!! ", - " !!!!!!!! ", - " !!!!!!!!!! ", - " !!!!!!!! ", - " !!!!!!!!!! ", - " !!!!!!!!! ", - " !!!!!!!!!! ", - " !!!!!!!! ", - " !!!!!!!! ", - " !!! !!! ", - " !! ! ", - " ! ", - " ! ", - " ! ", - " ! ", - " !!!!!!! ", - " !!!!!!!! ", - " !!!!!!!! ", - " !!!!!!! ", - " !!!!!! ", - " !!!!!! ", - " !!!!!! ", - " !!!!!! ", - " !!!!!! ", - " !!!!!!! ", - " !!!!!!! ", - " !!!!!!!! ", - " !!!!!!!! ", - " !!!!!! ", - " !!!!!! ", - " !!! ! ", - " ! ", - " ! ", - " ! ", - " !!!!! ", - " !!!!!!! ", - " !!!!!!! ", - " !!!!!!! ", - " !!!!!!! ", - " !!!!!! ", - " !!!!!! ", - " !!!!!!! ", - " !!!!!! ", - " !!!!!!! ", - " !!!!!!! ", - " !!!!!!!! ", - " !!!!!!!! ", - " !!!!!!! ", - " !!! !! ", - " !!! ! ", - " ! ", - " ! !!! ", - " ! !!!! ", - " !!!!! ", - " !!!!!!!! ", - " !!!!!!!!! ", - " !!!!!!!!!!! ", - " !!!!!!!!!! ", - " !!!!!!!!!!!!! ", - " !!!!!!!!!!!! ", - " !!!!!!!!!! ", - " !!!!!!!! ", - " !!!!!! !! !!! ", - " !!! !! !!!! ", - " !!! !!!!!!!! ", - " !!!!!!!!! ", - " !!!!!!!!!!! ", - " !!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!! ", - " !!!!!!!!!!!! ", - " !!!!!! !!! ", - " !!!!! " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/colorize-alpha1-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/colorize-alpha1-512-512-1.0-grid-reference.json deleted file mode 100644 index 10e41a5bb..000000000 --- a/tests/visual_tests/grids/colorize-alpha1-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,283 +0,0 @@ -{ - "keys": [ - "", - "66", - "28", - "119", - "135", - "168", - "78", - "151", - "53", - "58", - "51", - "44", - "97", - "99", - "20", - "75", - "118", - "42", - "128", - "84", - "31", - "56", - "98", - "41", - "166", - "108", - "29", - "80", - "10", - "72", - "134", - "19", - "147", - "169", - "83", - "131", - "50", - "3", - "104", - "65", - "162", - "59", - "158", - "86", - "130", - "76", - "157", - "100", - "46", - "161", - "39", - "153", - "77", - "1", - "123", - "88", - "94", - "74", - "103", - "48", - "138", - "90", - "120", - "110", - "25", - "106", - "18", - "105", - "4", - "122", - "16", - "163", - "38", - "137", - "115", - "154", - "139", - "91", - "171", - "71", - "45", - "174", - "156", - "67", - "69", - "141", - "49", - "126", - "144", - "117", - "15", - "116", - "52", - "87", - "36", - "170", - "160", - "61", - "60", - "155", - "14", - "33", - "140", - "145", - "146", - "124", - "68", - "143", - "32", - "27", - "95", - "148", - "93", - "34", - "73", - "112", - "23", - "64", - "35", - "165", - "85", - "47", - "125", - "57", - "164", - "127", - "2", - "176", - "159", - "142", - "22", - "111", - "109", - "9", - "102", - "172", - "113", - "177", - "54", - "30", - "132", - "26", - "5", - "175", - "167", - "121", - "55", - "7" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!! ", - " ##########!!!!!!!!!!!!!!!!!!!! $$ %%% %%% ", - " # ###########!!!!!!!!!!!!!!!!!!!! $$ $ %% ", - " ##### ######## !!!!!!!!!!!!!!! %%% %%%%%%%%%% %%%%% ", - " ####### ### ###### !!!!!!!!!!!! % % %%%%%%%%%%%%%%%%%% %%%% ", - " &&&&&&&&# ###### ######### ####### !!!!!!!!!!! $$$$%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%", - "%%%% &&&&&&&&###################### ##### !!!!!!!! ' $((())%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - " %& &&&&&&&###################### ### !!!! ''' $$((()))%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - " &&&&&&&&&################# ### !! $$$(( ))%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% ", - " &&& &&############## ###### * $$(( +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% ", - " && &################# ####### ** ,,( -./%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% ", - " ############################ 0 ** 1223333//%%%%%%%%%%%444444%%%%%%%%%%%%%%%55%%%%%% % ", - " ######################## # * 667228839999999%%%444444444444%%%:%::%%%%%%555%%%% % ", - " &&&&&&&&&&&&&&#####&## ## 6666;<=>>???999%%%%44444444444445:::::::::::55555%% % ", - " &&&&&&&&&&&&&&&##&&&&# 666<< @AA?? 9 %%% 44BB444444455555::::::5555555%% C ", - " &&&&&&&&&&&&&&&&&&&& DEEEE <<<>???999%%%%44444444444445:::::::::::55555%% % ", - " &&&&&&&&&&&&&&&##&&&&# 666<< @AA?? 9 %%% 44BB444444455555::::::5555555%% C ", - " &&&&&&&&&&&&&&&&&&&& DEEEE <<<>???999%%%%44444444444445:::::::::::55555%% % ", - " &&&&&&&&&&&&&&&##&&&&# 666<< @AA?? 9 %%% 44BB444444455555::::::5555555%% C ", - " &&&&&&&&&&&&&&&&&&&& DEEEE <<<>???999%%%%44444444444445:::::::::::55555%% % ", - " &&&&&&&&&&&&&&&##&&&&# 666<< @AA?? 9 %%% 44BB444444455555::::::5555555%% C ", - " &&&&&&&&&&&&&&&&&&&& DEEEE <<< ?@ABCCDE444444 FG ", - " HH% I J==KKKLMMCCENNOP444 ", - " % H QR JSTUUVWWMMM NNNPX4 ", - " Y ZTT[[VWW]^ NN X_ ` ", - " aab cd[[eff]g h X i` ", - " jklll mnopq rrrrr ", - " sllllll oott rrr u v ", - " swlll xxyyz{ ||| ", - " w}ll ~\u007f\u0080 { |||||| \u0081 ", - " \u0082\u0083\u0083l \u0084\u0084\u0084 |||||| ", - " \u0082\u0083\u0085 \u0084 | ||| ", - " \u0082\u0083 \u0086 ", - " \u0082 ", - " ", - " \u0087 ", - " \u0087\u0087 \u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087 ", - " \u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087 \u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087 ", - " \u0087\u0087 \u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087 " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/colorize-alpha3-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/colorize-alpha3-512-512-1.0-grid-reference.json deleted file mode 100644 index 10e41a5bb..000000000 --- a/tests/visual_tests/grids/colorize-alpha3-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,283 +0,0 @@ -{ - "keys": [ - "", - "66", - "28", - "119", - "135", - "168", - "78", - "151", - "53", - "58", - "51", - "44", - "97", - "99", - "20", - "75", - "118", - "42", - "128", - "84", - "31", - "56", - "98", - "41", - "166", - "108", - "29", - "80", - "10", - "72", - "134", - "19", - "147", - "169", - "83", - "131", - "50", - "3", - "104", - "65", - "162", - "59", - "158", - "86", - "130", - "76", - "157", - "100", - "46", - "161", - "39", - "153", - "77", - "1", - "123", - "88", - "94", - "74", - "103", - "48", - "138", - "90", - "120", - "110", - "25", - "106", - "18", - "105", - "4", - "122", - "16", - "163", - "38", - "137", - "115", - "154", - "139", - "91", - "171", - "71", - "45", - "174", - "156", - "67", - "69", - "141", - "49", - "126", - "144", - "117", - "15", - "116", - "52", - "87", - "36", - "170", - "160", - "61", - "60", - "155", - "14", - "33", - "140", - "145", - "146", - "124", - "68", - "143", - "32", - "27", - "95", - "148", - "93", - "34", - "73", - "112", - "23", - "64", - "35", - "165", - "85", - "47", - "125", - "57", - "164", - "127", - "2", - "176", - "159", - "142", - "22", - "111", - "109", - "9", - "102", - "172", - "113", - "177", - "54", - "30", - "132", - "26", - "5", - "175", - "167", - "121", - "55", - "7" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!! ", - " ##########!!!!!!!!!!!!!!!!!!!! $$ %%% %%% ", - " # ###########!!!!!!!!!!!!!!!!!!!! $$ $ %% ", - " ##### ######## !!!!!!!!!!!!!!! %%% %%%%%%%%%% %%%%% ", - " ####### ### ###### !!!!!!!!!!!! % % %%%%%%%%%%%%%%%%%% %%%% ", - " &&&&&&&&# ###### ######### ####### !!!!!!!!!!! $$$$%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%", - "%%%% &&&&&&&&###################### ##### !!!!!!!! ' $((())%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - " %& &&&&&&&###################### ### !!!! ''' $$((()))%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - " &&&&&&&&&################# ### !! $$$(( ))%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% ", - " &&& &&############## ###### * $$(( +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% ", - " && &################# ####### ** ,,( -./%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% ", - " ############################ 0 ** 1223333//%%%%%%%%%%%444444%%%%%%%%%%%%%%%55%%%%%% % ", - " ######################## # * 667228839999999%%%444444444444%%%:%::%%%%%%555%%%% % ", - " &&&&&&&&&&&&&&#####&## ## 6666;<=>>???999%%%%44444444444445:::::::::::55555%% % ", - " &&&&&&&&&&&&&&&##&&&&# 666<< @AA?? 9 %%% 44BB444444455555::::::5555555%% C ", - " &&&&&&&&&&&&&&&&&&&& DEEEE <<<>???999%%%%44444444444445:::::::::::55555%% % ", - " &&&&&&&&&&&&&&&##&&&&# 666<< @AA?? 9 %%% 44BB444444455555::::::5555555%% C ", - " &&&&&&&&&&&&&&&&&&&& DEEEE <<<>???999%%%%44444444444445:::::::::::55555%%%% ", - " &&&&&&&&&&&&&&&!!&&&&!! @@6666<<>???999%%%%44444444444445:::::::::::55555%%%% ", - " &&&&&&&&&&&&&&&!!&&&&!! @@6666<??@@@,,,%%%%55555555555556:::::::::::66666%%%%%%%%%%% ", - " !&&&&&&&&&&&&&&&&&!!&&&&!&!!!!! A;;;;;777==BCDD@@,,,%%%E55FF555555566666::::::6666666%%%%G%%G%% ", - " &&&&&&&&&&&&&&&&&&&&&&&&&&!!!! ;;A;AAAAH====IJKEEEE,EL%FMFMFFFFNNN66666666:6666666OO%%%G%%GG ", - " &&&&&&&&&&&&&&&&&&&&&&&&!! ;;P;AAAHH=HH=EK,EEEEEEQQFMMMMFFRR666666666666666O6OO%%%%GGGG ", - " &&&&&&&&&&&&&&&&&&&&&&& ;;;P;SSSHHHHEEEETUEVWWQQQQQMXXXYY666666666666666OOZZ%GGGGG ", - " &&&&&&&&&&&&&&&&&&&&& P[[PPPSSSHHHH]]ETTEVWWWQQQQQXXXYY^^666666666666666OOGGZGGGG ", - " &&&&____&&&&&&&&&&&& P[[[PPSSSSS]]]]]````aaaWbQQQQXXYYY^^c66666666666666ddZZGGGG ", - " &&&& &&______&&&&&&&&&&e P[[PPfSSSSSS]]]]]````aaaaaaQQQQYYY^^^^ccg^hh6666666dddZGGG ", - " &&&&&& ____&____&&&&&&e&ijjjj [[[PffkSSSSS]]]]]````aaaaaalmaaYYY^^^^^^n^h66666666dodGG ", - " &&& &&& ________&&p_qqq&jirjj [s[[ffkkkSStttuu]vvvvvaaaaaammaYY^^^^^^^nhhhwxx66doood ", - " && &&& __________p&&&yryzryj ssffffkkkkttttuuuvvvvv{aaa{mm{aYYY^^^^^h||h|wxx6xddddd ", - " &&&&&& ________}~~p\u007fzzzzzzz\u0080 ssssfffkkktttuuuuvvvvv\u0081{{{{{{{m^^^^^^^^h||h|||xxxxdodoo ", - " &&&& _____p\u0082p\u0082\u0082pzzzzzzzzz sssskkk\u0083tt\u0084\u0084\u0084uuuvvvvv\u0085\u0085\u0081{{{{{{m ^^^^^\u0086\u0086hh||||\u0087xxxxoooooo ", - " ___p\u0082\u007fp\u0082pz\u0088zzzz\u0080zzz\u00897 s\u008a\u008a\u008b\u008bkk\u008c\u008d\u008e\u0084\u0084\u0084\u008fuuv\u0090v\u0090\u0090\u0085\u0085\u0091\u0091\u0091\u0092{{ ^^\u0086^^^\u0086\u0086h|||xxxxxxoooooo ", - " }pppp\u007f\u007f\u0088zzzzz\u0093zz\u0089\u0089 s\u008a\u008a\u008a\u008a\u008b\u0094\u008c\u008d\u0084\u0084\u0084\u0084\u008fu\u0095\u0095\u0090\u0090\u0090\u0090\u0085\u0085\u0085\u0085\u0092{\u0092\u0092 ^\u0086^^\u0086^\u0086\u0096|||xxxxxooooooo ", - " \u0082\u007f\u007f\u007fz\u0088\u0088\u0088zzz\u0093\u00897\u0089\u00897\u0097 \u008a\u008a\u008a\u008a\u0098\u0094\u008c\u008d\u008d\u0084\u0084\u008f\u008f\u0095\u0099\u0099\u0099\u0090\u0090\u0090\u0085\u0085\u0085\u0092\u0092\u0092\u0092\u0092 ^\u0086\u0086\u0086\u0086\u0086\u0086\u0096|\u0096x\u009axxxo\u009a\u009aooooo\u0096\u0096\u0096 ", - " \u007f\u009b\u009b\u0088\u0088\u0088\u0088zz\u0097\u0093\u00897\u0097\u00897\u0097\u0097\u0097 \u008a\u008a\u008a\u008a\u008d\u008d\u008d\u008d\u008d\u0084\u009c\u009d\u009d\u0099\u0099\u0099\u0099\u009e\u009e\u009f\u009f\u0092\u0092\u0092\u0092\u0092 ^\u0086\u0086\u0086\u0086\u0086\u0096\u0096|\u0096\u009a\u009ax\u009a\u009a\u0096ooooo\u0096\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ", - " \u009b\u009b\u00a1\u00a1\u009b\u0088\u0088\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u0098\u0098\u0098\u0098\u0098\u008d\u008d\u0084\u00a2\u00a2\u00a2\u009d\u0099\u0099\u0099\u0099\u009e\u009e\u009f\u009f\u0092\u00a3\u0092\u0092 \u0086\u0086 \u0096\u009a|\u0096\u0096\u009a\u0096\u0096\u0096\u009a\u0096oo\u0096\u0096\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a4\u00a4\u00a4\u00a4 ", - " \u009b\u009b\u009b\u009b\u009b\u009b\u009b\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00a2\u009c\u009c\u00a2\u009d\u0099\u0099\u0099\u0099\u0099\u00a3\u00a3\u00a3\u009f\u00a3\u00a3\u0092 \u0096\u0096\u009a\u0096\u0096\u009a\u009a\u0096\u0096\u009a\u0096\u00a5\u0096\u0096\u0096\u0096\u0096\u00a0\u00a0\u00a0\u00a0\u00a0\u00a4\u00a4\u00a4\u00a4\u00a4 ", - " \u009b\u009b\u009b\u009b\u009b\u009b\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00a2\u00a2\u00a2\u00a6\u0099\u0099\u0099\u0099\u0099\u00a3\u00a3\u00a3\u00a7\u00a3\u00a3\u00a8\u00a8\u00a8 \u0096\u0096\u0096\u0096\u0096\u009a\u009a\u0096\u00a5\u00a5\u00a5\u0096\u00a5\u00a5\u00a0\u0096\u00a0\u00a0\u00a0\u00a0\u00a4\u00a0\u00a4\u00a4\u00a4\u00a4 ", - "\u00a9 \u009b\u009b\u009b\u009b\u009b\u009b\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00a2\u00a2\u00a2\u00a6\u00a6\u00a6\u0099\u0099\u00a7\u00a7\u00a3\u00a3\u00a3\u00a3\u00a3\u00a8\u00a8\u00a8 \u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u00a5\u0096\u00a5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a4\u00a4\u00a4\u00a4\u00aa\u00aa\u00aa \u00a9", - "\u00a9\u00a9\u00a9 \u009b\u009b\u009b\u009b\u009b\u009b\u00ab\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00a6\u00ac\u00ac\u00a6\u00a6\u00a6\u00a6\u00a7\u00a7\u00a7\u00ad\u00a3\u00ae\u00a3\u00a3\u00a8\u00a8\u00a8\u00a8 \u0096\u0096\u0096\u0096\u0096\u0096\u00a5\u00a5\u00a5\u0096\u0096\u00af\u00af\u00a0\u00a0\u00a0\u00a0\u00a0\u00a4\u00a4\u00a4\u00aa\u00aa\u00aa\u00a4\u00aa\u00a9 ", - " \u00a9\u00a9 \u009b\u009b\u009b\u009b\u009b\u009b\u00ab\u00ab\u00ab\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00ac\u00ac\u00ac\u00a6\u00a6\u00a6\u00a7\u00a7\u00a7\u00a7\u00ad\u00ae\u00ae\u00a3\u00a3\u00a8\u00a8\u00a8\u00a8 \u0096\u0096\u0096\u0096\u0096\u00a5\u00a5\u00af\u00af\u00af\u00af\u00a0\u00a0\u00af\u00a0\u00a0\u00a0\u00a4\u00a4\u00aa\u00aa\u00aa\u00b0\u00a9\u00aa ", - " \u00a9 \u009b\u009b\u009b\u009b\u009b\u00ab\u00ab\u00ab\u00ab\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00a7\u00b1\u00b1\u00b1\u00ae\u00ae\u00b1\u00a3\u00a8\u00a8\u00a8\u00a8\u00a8 \u00af\u00af\u00af\u00af\u0096\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00a0\u00a0\u00af\u00b0\u00aa\u00aa \u00aa\u00aa\u00aa\u00a9", - " \u00a9\u00a9 \u009b\u009b\u009b\u00b2\u00ab\u00ab\u00b3\u00b3\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00b4\u00b4\u00b1\u00b1\u00ae\u00b1\u00b1\u00ae\u00a8\u00a8\u00a8\u00a8 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00b0\u00b0\u00aa\u00aa\u00aa\u00aa\u00a9\u00a9", - "\u00a9\u00a9 \u009b\u009b\u00b2\u00b2\u00b5\u00b3\u00b3\u00b3\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00ac\u00b6\u00ac\u00ac\u00ac\u00b4\u00b4\u00b6\u00b6\u00ae\u00b1\u00ae\u00ae\u00a8\u00a8\u00a8\u00a8 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00b0\u00b0 \u00aa\u00aa\u00b0\u00a9\u00a9", - " \u00b2\u00b2\u00b2\u00b5\u00b5\u00b5\u00b5\u00b3\u0097\u0097\u00b3\u0097\u0097\u0097\u0097 \u00ac\u00b6\u00b6\u00ac\u00b6\u00b6\u00b6\u00b6\u00b6\u00b1\u00b1\u00b6\u00ae\u00a8\u00a8\u00a8\u00a8 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00b0 \u00b0\u00b0\u00b0 ", - " \u00b2\u00b2\u00b2\u00b2\u00b5\u00b5\u00b5\u00b5\u0097\u0097\u0097\u00b7\u0097\u0097\u0097 \u00ac\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b1\u00b6\u00b6\u00a8\u00a8\u00a8\u00a8 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00b0\u00b0\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b5\u00b5\u00b5\u00b5\u00b5\u00b7\u0097\u00b7\u00b7\u0097 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00a8\u00a8\u00a8 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b2\u00b5\u00b5\u00b5\u00b5\u00b7\u00b7\u00b7\u00b7\u0097 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b5\u00b5\u00b5\u00b5\u00b5\u00b7\u00b7\u00b7\u00b7 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b2\u00b5\u00b5\u00b5\u00b7\u00b7\u00b7\u00b7\u00b7 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00af\u00af\u00af\u00af\u00af\u00af \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b2\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b9\u00b9\u00b9\u00b9 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b2\u00b5\u00b5\u00ba\u00ba\u00ba\u00ba \u00b9\u00b9 \u00b9\u00b9 \u00af\u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b2\u00b5\u00b5\u00ba\u00b5\u00b5\u00ba\u00ba \u00b9 \u00b9 \u00af\u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b2\u00b5\u00ba\u00ba\u00b2\u00ba\u00ba\u00ba \u00b9\u00b9 \u00b9\u00b9 \u00b8\u00b8\u00b8\u00b8\u00b8 ", - " \u00b2\u00b2\u00b2\u00b2\u00b2\u00b5\u00ba\u00ba\u00b5\u00ba\u00ba \u00b9\u00b9\u00b9\u00b9\u00b9 ", - " \u00b2\u00b2\u00b2\u00b2\u00b2\u00ba\u00ba\u00ba\u00ba\u00ba \u00b9\u00b9 ", - " \u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00bb\u00bb\u00bb \u00bb\u00bb\u00bb\u00bb\u00bb \u00bb\u00bb\u00bb \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb ", - " \u00bb\u00b2\u00b2\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bb \u00bb\u00bb \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb ", - " \u00bb\u00bb\u00bb\u00bb \u00bb \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb ", - " \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - " \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bb\u00bb\u00bb \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - " \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - " \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb ", - "\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - "\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - "\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - "\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - "\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - "\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - "\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/image-filters-multi-blur-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/image-filters-multi-blur-512-512-2.0-grid-reference.json deleted file mode 100644 index c3c52beb7..000000000 --- a/tests/visual_tests/grids/image-filters-multi-blur-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,288 +0,0 @@ -{ - "keys": [ - "", - "66", - "28", - "119", - "135", - "168", - "151", - "78", - "53", - "166", - "58", - "51", - "131", - "44", - "97", - "99", - "20", - "75", - "118", - "42", - "128", - "84", - "31", - "56", - "98", - "41", - "108", - "100", - "29", - "80", - "10", - "72", - "134", - "161", - "19", - "147", - "173", - "169", - "83", - "137", - "50", - "3", - "104", - "65", - "162", - "59", - "158", - "86", - "130", - "150", - "76", - "157", - "163", - "46", - "154", - "39", - "153", - "77", - "1", - "123", - "88", - "94", - "74", - "103", - "129", - "141", - "48", - "138", - "90", - "120", - "110", - "174", - "25", - "106", - "18", - "170", - "105", - "4", - "122", - "16", - "38", - "143", - "115", - "139", - "91", - "171", - "126", - "71", - "45", - "156", - "67", - "69", - "160", - "148", - "49", - "144", - "117", - "15", - "116", - "52", - "146", - "87", - "124", - "36", - "23", - "61", - "60", - "155", - "14", - "33", - "140", - "145", - "127", - "125", - "68", - "32", - "27", - "95", - "93", - "34", - "73", - "112", - "159", - "142", - "64", - "35", - "165", - "85", - "47", - "57", - "164", - "172", - "54", - "176", - "2", - "177", - "102", - "113", - "22", - "111", - "109", - "9", - "114", - "132", - "30", - "175", - "26", - "5", - "167", - "121", - "8", - "55", - "7" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!!! ", - " ###########!!!!!!!!!!!!!!!!!!!!!! $$ %%%% %%%% ", - " ##############!!!!!!!!!!!!!!!!!!!!!!!!!! $$$$$$$$$$$$%%%%%%%%% %%%%%%%%%% ", - " ################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$$$$$$$$$$$$%%%%%%%%%%%%%%% %%%%%%%%%%%%%% %%%%%%%% ", - " #################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$$$$$$$$$$$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ", - "%%%% &&&&&&&&&&&##################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$$$$$$$$$$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "%%&&&&&&&&&&&&&&&&######################!!!!!!!!!!!!!!!!!!!!!!!$$$$$'''$$''%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "%&&&&&&&&&&&&&&&&&####################!!!!!!!!!!!!!!!!!!!!((((!$$$$''$$'$'''%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&&&&&&&&&&&&&&&&&&#################!!!!!!!!!!!!!!!!!!!!!!((((($$$'''''''''''%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&&&&&&&&&&&&&&&&&&###################!!!!!!!!!!!!!!!!!!!(((((($$'''''''''''''%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&&&&&&&&&&&&&#&#########################!!!!!!!!!!!!!!!(((((($$'''''''$$$$%%'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "%%%%&&&&&&&&&&######################!!#####!!!!!!!!!!(((((((($$$'''''$'''))%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&%&&&&&&&&&&&#######################!###!!!!!!!!!!(((((((((($$''''$$''')))%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&&&&&&&&&&&&&#################&&&&#####&&!!!!!!!!!(((((((((($$'''$$$''*))%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&&&&&&&&&&&&&&&&##############&&&&&######&&!!!!!!!(((((((((($+'''$$''***,%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&&&&&&&&&&&&&&&&&#################&#######&!!!!!!!!(((((((---++'''..'**/01%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&&&&&&&&&&&&&&&&############################!!!!!!!!(((((---2-++'344555511%%%%%%%%%%%666666%%%%%%%%%%%%%%%77%%%%%%%%%%%%%%%%%%%", - " &&&&&&&&&&&&&&&&&&########################&#!!!!!!!! ((-----+-88944::5*******%%%666666666666%%%;%;;%%%%%%777%%%%%%%%%%%%%%%%%%", - " &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#####&##&&##!!!!! ---<<--8888=>?@@AAA***%%%%66666666666667;;;;;;;;;;;77777%%%%%%%%%%%%%%% ", - " &&&&&&&&&& #&&&&&&&&&&&&&&&&&&&&&##&&&&#&&&&##### ---<<3-B888>>*CDDAAE*E%%%F66FF666666677777;;;;;;7777777%%%%G%%%%%%%%%% ", - " &&&&&& #&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#### --->>>JKLMMMMEMN%FOFOFFFFPPP77777777;7777777QQ%%%G%%%%%%%%% ", - " &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&##### -HHHH-IIIRR>**>*LEMMMMMMSSFOOOOFFTT777777777777777U7UQ%%%%G%%%%%%%% ", - " &&& &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#### ??@@@,,,%%%%55555555555556:::::::::::66666%%%%%%%%%%% ", - " !&&&&&&&&&&&&&&&&&!!&&&&!&!!!!! A;;;;;777==BCDD@@,,,%%%E55FF555555566666::::::6666666%%%%G%%G%% ", - " &&&&&&&&&&&&&&&&&&&&&&&&&&!!!! ;;A;AAAAH====IJKEEEE,EL%FMFMFFFFNNN66666666:6666666OO%%%G%%GG ", - " &&&&&&&&&&&&&&&&&&&&&&&&!! ;;P;AAAHH=HH=EK,EEEEEEQQFMMMMFFRR666666666666666O6OO%%%%GGGG ", - " &&&&&&&&&&&&&&&&&&&&&&& ;;;P;SSSHHHHEEEETUEVWWQQQQQMXXXYY666666666666666OOZZ%GGGGG ", - " &&&&&&&&&&&&&&&&&&&&& P[[PPPSSSHHHH]]ETTEVWWWQQQQQXXXYY^^666666666666666OOGGZGGGG ", - " &&&&____&&&&&&&&&&&& P[[[PPSSSSS]]]]]````aaaWbQQQQXXYYY^^c66666666666666ddZZGGGG ", - " &&&& &&______&&&&&&&&&&e P[[PPfSSSSSS]]]]]````aaaaaaQQQQYYY^^^^ccg^hh6666666dddZGGG ", - " &&&&&& ____&____&&&&&&e&ijjjj [[[PffkSSSSS]]]]]````aaaaaalmaaYYY^^^^^^n^h66666666dodGG ", - " &&& &&& ________&&p_qqq&jirjj [s[[ffkkkSStttuu]vvvvvaaaaaammaYY^^^^^^^nhhhwxx66doood ", - " && &&& __________p&&&yryzryj ssffffkkkkttttuuuvvvvv{aaa{mm{aYYY^^^^^h||h|wxx6xddddd ", - " &&&&&& ________}~~p\u007fzzzzzzz\u0080 ssssfffkkktttuuuuvvvvv\u0081{{{{{{{m^^^^^^^^h||h|||xxxxdodoo ", - " &&&& _____p\u0082p\u0082\u0082pzzzzzzzzz sssskkk\u0083tt\u0084\u0084\u0084uuuvvvvv\u0085\u0085\u0081{{{{{{m ^^^^^\u0086\u0086hh||||\u0087xxxxoooooo ", - " ___p\u0082\u007fp\u0082pz\u0088zzzz\u0080zzz\u00897 s\u008a\u008a\u008b\u008bkk\u008c\u008d\u008e\u0084\u0084\u0084\u008fuuv\u0090v\u0090\u0090\u0085\u0085\u0091\u0091\u0091\u0092{{ ^^\u0086^^^\u0086\u0086h|||xxxxxxoooooo ", - " }pppp\u007f\u007f\u0088zzzzz\u0093zz\u0089\u0089 s\u008a\u008a\u008a\u008a\u008b\u0094\u008c\u008d\u0084\u0084\u0084\u0084\u008fu\u0095\u0095\u0090\u0090\u0090\u0090\u0085\u0085\u0085\u0085\u0092{\u0092\u0092 ^\u0086^^\u0086^\u0086\u0096|||xxxxxooooooo ", - " \u0082\u007f\u007f\u007fz\u0088\u0088\u0088zzz\u0093\u00897\u0089\u00897\u0097 \u008a\u008a\u008a\u008a\u0098\u0094\u008c\u008d\u008d\u0084\u0084\u008f\u008f\u0095\u0099\u0099\u0099\u0090\u0090\u0090\u0085\u0085\u0085\u0092\u0092\u0092\u0092\u0092 ^\u0086\u0086\u0086\u0086\u0086\u0086\u0096|\u0096x\u009axxxo\u009a\u009aooooo\u0096\u0096\u0096 ", - " \u007f\u009b\u009b\u0088\u0088\u0088\u0088zz\u0097\u0093\u00897\u0097\u00897\u0097\u0097\u0097 \u008a\u008a\u008a\u008a\u008d\u008d\u008d\u008d\u008d\u0084\u009c\u009d\u009d\u0099\u0099\u0099\u0099\u009e\u009e\u009f\u009f\u0092\u0092\u0092\u0092\u0092 ^\u0086\u0086\u0086\u0086\u0086\u0096\u0096|\u0096\u009a\u009ax\u009a\u009a\u0096ooooo\u0096\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ", - " \u009b\u009b\u00a1\u00a1\u009b\u0088\u0088\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u0098\u0098\u0098\u0098\u0098\u008d\u008d\u0084\u00a2\u00a2\u00a2\u009d\u0099\u0099\u0099\u0099\u009e\u009e\u009f\u009f\u0092\u00a3\u0092\u0092 \u0086\u0086 \u0096\u009a|\u0096\u0096\u009a\u0096\u0096\u0096\u009a\u0096oo\u0096\u0096\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a4\u00a4\u00a4\u00a4 ", - " \u009b\u009b\u009b\u009b\u009b\u009b\u009b\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00a2\u009c\u009c\u00a2\u009d\u0099\u0099\u0099\u0099\u0099\u00a3\u00a3\u00a3\u009f\u00a3\u00a3\u0092 \u0096\u0096\u009a\u0096\u0096\u009a\u009a\u0096\u0096\u009a\u0096\u00a5\u0096\u0096\u0096\u0096\u0096\u00a0\u00a0\u00a0\u00a0\u00a0\u00a4\u00a4\u00a4\u00a4\u00a4 ", - " \u009b\u009b\u009b\u009b\u009b\u009b\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00a2\u00a2\u00a2\u00a6\u0099\u0099\u0099\u0099\u0099\u00a3\u00a3\u00a3\u00a7\u00a3\u00a3\u00a8\u00a8\u00a8 \u0096\u0096\u0096\u0096\u0096\u009a\u009a\u0096\u00a5\u00a5\u00a5\u0096\u00a5\u00a5\u00a0\u0096\u00a0\u00a0\u00a0\u00a0\u00a4\u00a0\u00a4\u00a4\u00a4\u00a4 ", - "\u00a9 \u009b\u009b\u009b\u009b\u009b\u009b\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00a2\u00a2\u00a2\u00a6\u00a6\u00a6\u0099\u0099\u00a7\u00a7\u00a3\u00a3\u00a3\u00a3\u00a3\u00a8\u00a8\u00a8 \u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u00a5\u0096\u00a5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a4\u00a4\u00a4\u00a4\u00aa\u00aa\u00aa \u00a9", - "\u00a9\u00a9\u00a9 \u009b\u009b\u009b\u009b\u009b\u009b\u00ab\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00a6\u00ac\u00ac\u00a6\u00a6\u00a6\u00a6\u00a7\u00a7\u00a7\u00ad\u00a3\u00ae\u00a3\u00a3\u00a8\u00a8\u00a8\u00a8 \u0096\u0096\u0096\u0096\u0096\u0096\u00a5\u00a5\u00a5\u0096\u0096\u00af\u00af\u00a0\u00a0\u00a0\u00a0\u00a0\u00a4\u00a4\u00a4\u00aa\u00aa\u00aa\u00a4\u00aa\u00a9 ", - " \u00a9\u00a9 \u009b\u009b\u009b\u009b\u009b\u009b\u00ab\u00ab\u00ab\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00ac\u00ac\u00ac\u00a6\u00a6\u00a6\u00a7\u00a7\u00a7\u00a7\u00ad\u00ae\u00ae\u00a3\u00a3\u00a8\u00a8\u00a8\u00a8 \u0096\u0096\u0096\u0096\u0096\u00a5\u00a5\u00af\u00af\u00af\u00af\u00a0\u00a0\u00af\u00a0\u00a0\u00a0\u00a4\u00a4\u00aa\u00aa\u00aa\u00b0\u00a9\u00aa ", - " \u00a9 \u009b\u009b\u009b\u009b\u009b\u00ab\u00ab\u00ab\u00ab\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00a7\u00b1\u00b1\u00b1\u00ae\u00ae\u00b1\u00a3\u00a8\u00a8\u00a8\u00a8\u00a8 \u00af\u00af\u00af\u00af\u0096\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00a0\u00a0\u00af\u00b0\u00aa\u00aa \u00aa\u00aa\u00aa\u00a9", - " \u00a9\u00a9 \u009b\u009b\u009b\u00b2\u00ab\u00ab\u00b3\u00b3\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00b4\u00b4\u00b1\u00b1\u00ae\u00b1\u00b1\u00ae\u00a8\u00a8\u00a8\u00a8 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00b0\u00b0\u00aa\u00aa\u00aa\u00aa\u00a9\u00a9", - "\u00a9\u00a9 \u009b\u009b\u00b2\u00b2\u00b5\u00b3\u00b3\u00b3\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u00ac\u00b6\u00ac\u00ac\u00ac\u00b4\u00b4\u00b6\u00b6\u00ae\u00b1\u00ae\u00ae\u00a8\u00a8\u00a8\u00a8 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00b0\u00b0 \u00aa\u00aa\u00b0\u00a9\u00a9", - " \u00b2\u00b2\u00b2\u00b5\u00b5\u00b5\u00b5\u00b3\u0097\u0097\u00b3\u0097\u0097\u0097\u0097 \u00ac\u00b6\u00b6\u00ac\u00b6\u00b6\u00b6\u00b6\u00b6\u00b1\u00b1\u00b6\u00ae\u00a8\u00a8\u00a8\u00a8 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00b0 \u00b0\u00b0\u00b0 ", - " \u00b2\u00b2\u00b2\u00b2\u00b5\u00b5\u00b5\u00b5\u0097\u0097\u0097\u00b7\u0097\u0097\u0097 \u00ac\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b1\u00b6\u00b6\u00a8\u00a8\u00a8\u00a8 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00b0\u00b0\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b5\u00b5\u00b5\u00b5\u00b5\u00b7\u0097\u00b7\u00b7\u0097 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00a8\u00a8\u00a8 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b2\u00b5\u00b5\u00b5\u00b5\u00b7\u00b7\u00b7\u00b7\u0097 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b5\u00b5\u00b5\u00b5\u00b5\u00b7\u00b7\u00b7\u00b7 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b2\u00b5\u00b5\u00b5\u00b7\u00b7\u00b7\u00b7\u00b7 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00af\u00af\u00af\u00af\u00af\u00af \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b2\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b9\u00b9\u00b9\u00b9 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b2\u00b5\u00b5\u00ba\u00ba\u00ba\u00ba \u00b9\u00b9 \u00b9\u00b9 \u00af\u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b2\u00b5\u00b5\u00ba\u00b5\u00b5\u00ba\u00ba \u00b9 \u00b9 \u00af\u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8", - " \u00b2\u00b2\u00b2\u00b2\u00b5\u00ba\u00ba\u00b2\u00ba\u00ba\u00ba \u00b9\u00b9 \u00b9\u00b9 \u00b8\u00b8\u00b8\u00b8\u00b8 ", - " \u00b2\u00b2\u00b2\u00b2\u00b2\u00b5\u00ba\u00ba\u00b5\u00ba\u00ba \u00b9\u00b9\u00b9\u00b9\u00b9 ", - " \u00b2\u00b2\u00b2\u00b2\u00b2\u00ba\u00ba\u00ba\u00ba\u00ba \u00b9\u00b9 ", - " \u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00bb\u00bb\u00bb \u00bb\u00bb\u00bb\u00bb\u00bb \u00bb\u00bb\u00bb \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb ", - " \u00bb\u00b2\u00b2\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bb \u00bb\u00bb \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb ", - " \u00bb\u00bb\u00bb\u00bb \u00bb \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb ", - " \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - " \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bb\u00bb\u00bb \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - " \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - " \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb ", - "\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - "\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - "\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - "\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - "\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - "\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - "\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/image-filters-multi-blur-inflate-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/image-filters-multi-blur-inflate-512-512-2.0-grid-reference.json deleted file mode 100644 index c3c52beb7..000000000 --- a/tests/visual_tests/grids/image-filters-multi-blur-inflate-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,288 +0,0 @@ -{ - "keys": [ - "", - "66", - "28", - "119", - "135", - "168", - "151", - "78", - "53", - "166", - "58", - "51", - "131", - "44", - "97", - "99", - "20", - "75", - "118", - "42", - "128", - "84", - "31", - "56", - "98", - "41", - "108", - "100", - "29", - "80", - "10", - "72", - "134", - "161", - "19", - "147", - "173", - "169", - "83", - "137", - "50", - "3", - "104", - "65", - "162", - "59", - "158", - "86", - "130", - "150", - "76", - "157", - "163", - "46", - "154", - "39", - "153", - "77", - "1", - "123", - "88", - "94", - "74", - "103", - "129", - "141", - "48", - "138", - "90", - "120", - "110", - "174", - "25", - "106", - "18", - "170", - "105", - "4", - "122", - "16", - "38", - "143", - "115", - "139", - "91", - "171", - "126", - "71", - "45", - "156", - "67", - "69", - "160", - "148", - "49", - "144", - "117", - "15", - "116", - "52", - "146", - "87", - "124", - "36", - "23", - "61", - "60", - "155", - "14", - "33", - "140", - "145", - "127", - "125", - "68", - "32", - "27", - "95", - "93", - "34", - "73", - "112", - "159", - "142", - "64", - "35", - "165", - "85", - "47", - "57", - "164", - "172", - "54", - "176", - "2", - "177", - "102", - "113", - "22", - "111", - "109", - "9", - "114", - "132", - "30", - "175", - "26", - "5", - "167", - "121", - "8", - "55", - "7" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!!! ", - " ###########!!!!!!!!!!!!!!!!!!!!!! $$ %%%% %%%% ", - " ##############!!!!!!!!!!!!!!!!!!!!!!!!!! $$$$$$$$$$$$%%%%%%%%% %%%%%%%%%% ", - " ################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$$$$$$$$$$$$%%%%%%%%%%%%%%% %%%%%%%%%%%%%% %%%%%%%% ", - " #################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$$$$$$$$$$$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ", - "%%%% &&&&&&&&&&&##################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$$$$$$$$$$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "%%&&&&&&&&&&&&&&&&######################!!!!!!!!!!!!!!!!!!!!!!!$$$$$'''$$''%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "%&&&&&&&&&&&&&&&&&####################!!!!!!!!!!!!!!!!!!!!((((!$$$$''$$'$'''%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&&&&&&&&&&&&&&&&&&#################!!!!!!!!!!!!!!!!!!!!!!((((($$$'''''''''''%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&&&&&&&&&&&&&&&&&&###################!!!!!!!!!!!!!!!!!!!(((((($$'''''''''''''%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&&&&&&&&&&&&&#&#########################!!!!!!!!!!!!!!!(((((($$'''''''$$$$%%'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "%%%%&&&&&&&&&&######################!!#####!!!!!!!!!!(((((((($$$'''''$'''))%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&%&&&&&&&&&&&#######################!###!!!!!!!!!!(((((((((($$''''$$''')))%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&&&&&&&&&&&&&#################&&&&#####&&!!!!!!!!!(((((((((($$'''$$$''*))%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&&&&&&&&&&&&&&&&##############&&&&&######&&!!!!!!!(((((((((($+'''$$''***,%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&&&&&&&&&&&&&&&&&#################&#######&!!!!!!!!(((((((---++'''..'**/01%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", - "&&&&&&&&&&&&&&&&&############################!!!!!!!!(((((---2-++'344555511%%%%%%%%%%%666666%%%%%%%%%%%%%%%77%%%%%%%%%%%%%%%%%%%", - " &&&&&&&&&&&&&&&&&&########################&#!!!!!!!! ((-----+-88944::5*******%%%666666666666%%%;%;;%%%%%%777%%%%%%%%%%%%%%%%%%", - " &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#####&##&&##!!!!! ---<<--8888=>?@@AAA***%%%%66666666666667;;;;;;;;;;;77777%%%%%%%%%%%%%%% ", - " &&&&&&&&&& #&&&&&&&&&&&&&&&&&&&&&##&&&&#&&&&##### ---<<3-B888>>*CDDAAE*E%%%F66FF666666677777;;;;;;7777777%%%%G%%%%%%%%%% ", - " &&&&&& #&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#### --->>>JKLMMMMEMN%FOFOFFFFPPP77777777;7777777QQ%%%G%%%%%%%%% ", - " &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&##### -HHHH-IIIRR>**>*LEMMMMMMSSFOOOOFFTT777777777777777U7UQ%%%%G%%%%%%%% ", - " &&& &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#### ??999999$$$55555555555555$::::::::::6666$$$$$$ $$$$ ", - " '''''''''''''''#####'###;;;# @@7@@<<$$$$$$$$$$$$ ", - " '''''''''''''''''#'''''''555 <<<<< <A$$$$$$$$$$$ ", - " '''''''''''''''''''''''### <<<<<<< < ?? @ ", - " !#A$ BB%%(( C77DEF GH /I9JK:L <> ? @@ ", - " # M$NN OO( PCQQR 8S TU/V9W:XL ?? @ ", - " !#M$NB BOZ[]^^_`8abcd/e99fgL ? tt u ", - " # MM6 vm ZwQxyz{|}~//e9ff\u007fgL <\u0080> \u0081tuuu ", - " \u0082 ! l\u0083\u0084 \u0085\u0085v ))\u0086\u0087 \u0088\u0089~/\u008a9fff\u007f\u008bL <\u0080>\u008c \u0081\u0081 \u008d\u008d\u008d ", - " \u0082\u0082 !# NA$\u008e \u0085v \u008fz \u0089\u0089\u0090\u0091\u0092\u0093ff\u0094\u007f\u0095 LLL\u0096\u0096\u0096\u0081\u0081\u008d\u008d\u0097\u0097\u0098\u0099\u0098 ", - " \u0082\u0082 !# N\u009am $$ \u0085\u0085\u008f\u009b\u009c \u009d\u0089\u009e\u009f\u00a0\u0093\u0093ffK\u007f\u00a1\u007f\u00a2 \u0097\u0098\u0099\u0098\u0099\u0099 \u00a3\u00a4 ", - " \u0082 !#\u009a\u00a5\u00a6\u00a7\u00a8 \u00a9\u00a9 \u008f\u008f\u00aa }\u0089\u009e\u009e\u009f\u009f\u0093\u0093f\u00ab\u0094\u00ac\u00ad\u00a2\u00ae\u00af\u00b0\u00b1\u0098\u0097\u0098\u0099 \u00a3\u00a4\u00a4\u00b2\u00b2 ", - " \u0082\u0082 ! \u00b3\u00a5\u00b4\u00b4\u00a8 A$\u008f\u00b5\u00aa \u0089\u0089\u00b6\u00b7\u009f\u009f\u00b8\u00b8\u00b9\u00ba\u0094K \u007f\u00bb\u00bc\u00bd\u00be\u00bf\u0099\u0099 \u00c0\u00a3\u00a4\u00a4\u00b2\u00b2 ", - " \u0082\u0082 !#\u00a7\u00a5\u00c1 \u00c2\u00a8\u008f\u00c3\u00c4\u00c4\u0089\u0089\u009e\u00c5\u00c6\u00c6\u00c7\u00b8\u00c8\u00b9#\u00c9\u0094\u00b1\u00bc\u00bb\u00bb\u00ca\u00cb\u00cb\u0099\u00a3\u00c0\u00a3\u00a4\u00b2\u00b2 ", - " \u0082 \u00cc#\u00cd\u00ce \u00cf\u00c2\u008f\u00d0\u00c4\u00c4\u0089\u0089\u009e\u00c5\u00d1\u00d2\u00d3\u00c7\u00d4\u00d4\u00d5#\u00d6\u00d7\u00d8\u00be \u00cb\u00cb\u00cb\u00c0\u00d9\u00a3\u00a4 \u00b2\u00b2 ", - " \u0082\u0082 \u00cc#\u00cd\u00da\u00db\u00dc \u00c4\u00c4\u00dd\u0089\u009e\u00de\u00df\u00e0\u00d2\u00d2\u00c7\u00e1\u00e2\u00e3\u00d6\u00d6\u00d7\u00d8\u00cb\u00cb \u00e4\u00e4\u00a3\u00a4\u00e5\u00b2\u00b2 ", - " \u0082\u0082\u00e6 \u00cc!\u00cd\u00e7\u00e8 \u00e9\u00ea\u00eb\u0089\u0089\u00ec\u00de\u00de\u00df\u00ed\u00ee\u00ef\u00e2\u00e2\u00e3\u00d6\u00d6 \u00f0\u00f1\u00c0\u00a3\u00a4\u00f2\u00f3\u00f3\u00e5\u00f4 ", - " \u0082\u00e6\u00e6k#\u00f5\u00f6\u00f7\u00e9\u00f8\u0089\u0089\u00ec\u00ed\u00de\u00de\u00ee\u00ee##\u00f9\u00e2\u00e2\u00fa\u00fb \u00fc\u00fd\u00fd \u00f2\u00e5 \u00f4 ", - " \u0082\u0082\u00e6\u00f5\u00f5\u00fe\u00f6\u00f6\u00f6\u0089\u00ec\u00ed\u00ed\u00ed\u00ff##\u0100\u00be\u00be\u0101\u0102\u0103\u0104\u0105\u0105\u0106\u00fd\u0107 \u00f2\u0108\u0108\u0108\u0108\u0109\u0109 ", - " \u0082\u0082\u00e6k\u00fe!#\u010a\u010a\u00ed\u010b\u010c##\u010d\u00be\u00be \u010e\u010f\u0110\u0110\u0103\u0111\u0112\u0113\u0114\u00f0\u0115\u00f2\u0116 \u00f4 ", - " \u0117 \u0118\u0119\u011a\u011b\u011c\u010a\u010a###\u011d\u00be\u00be\u010e\u010e\u00cc\u011e\u011f\u0120\u0121\u0121\u0122\u0123\u0123\u0124\u0125\u0126\u00f2\u0116\u0116\u00f4\u00f4 \u0127\u0127\u0127 ", - " \u0117\u0117\u0118 \u0082\u0082\u0128\u010a\u010a\u0129\u012a\u012a\u011d\u011d\u011e\u011e\u011b\u011e\u012b\u012c\u012d\u0121\u012e\u012f\u0130\u0131\u0131\u0131\u0123\u0123\u00f0\u00f2\u0116\u0116 \u0127\u0127\u0132\u0132\u0132\u0132\u0132 ", - " \u0117\u0118\u0118\u0133\u0133\u0134\u0135\u0135\u012a\u0136\u011e\u011e\u011e\u011d \u0137\u0138\u011f\u012d\u0139\u013a\u012f\u012f\u0101\u013b\u013b\u013b\u013b\u0131\u00f0\u0107\u00f2\u013c\u013d\u013d\u0132\u0132\u0132\u0132 ", - " \u0117\u0118\u0118\u0133\u0133\u0134\u0135\u0135\u0135\u012a\u013e\u013f \u0140\u0140\u0141\u012d\u0139\u013a\u013a\u0142\u0101\u0101\u0143\u0144 \u0145\u013b\u0131\u0146\u0147\u0147\u013d\u013d\u0148\u0148 ", - " \u0117\u0117\u0118\u0149\u0149 \u0135\u0135\u0135\u014a\u014b\u014c\u014c\u014d\u014e \u0140\u012b\u011f\u012d\u0139\u013a\u014f\u0150 \u0151\u0101\u0101\u0144 \u0145 \u0152\u0147\u0147\u0107 \u0153\u0148\u0148\u0148\u0148\u0148 ", - " \u0117\u0117\u0118 \u0149\u0128\u0135\u0135\u014a\u0154\u014c\u014c \u014e\u014d\u012b\u011f\u012d\u012d\u013a\u013a\u0155\u0156\u0156\u0156\u0156\u0101\u0101\u0144\u0144\u0145\u0157\u0152\u0158 \u0159\u0107 \u0153 \u0148\u0148\u0148 " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/road-casings-grouped-rendering-600-600-1.0-grid-reference.json b/tests/visual_tests/grids/road-casings-grouped-rendering-600-600-1.0-grid-reference.json deleted file mode 100644 index f7317104e..000000000 --- a/tests/visual_tests/grids/road-casings-grouped-rendering-600-600-1.0-grid-reference.json +++ /dev/null @@ -1,888 +0,0 @@ -{ - "keys": [ - "", - "330", - "155", - "74", - "57", - "749", - "788", - "201", - "202", - "181", - "691", - "774", - "228", - "46", - "523", - "73", - "530", - "384", - "286", - "385", - "1", - "156", - "644", - "361", - "531", - "43", - "449", - "93", - "328", - "527", - "605", - "589", - "288", - "215", - "635", - "532", - "588", - "154", - "138", - "287", - "637", - "638", - "529", - "576", - "362", - "348", - "45", - "639", - "497", - "300", - "329", - "237", - "600", - "137", - "534", - "636", - "595", - "103", - "14", - "180", - "232", - "593", - "104", - "353", - "526", - "592", - "594", - "136", - "352", - "327", - "323", - "203", - "490", - "415", - "442", - "342", - "258", - "528", - "596", - "599", - "157", - "343", - "331", - "257", - "598", - "412", - "313", - "335", - "277", - "89", - "597", - "344", - "431", - "276", - "126", - "113", - "108", - "107", - "591", - "590", - "407", - "414", - "147", - "99", - "369", - "413", - "337", - "97", - "124", - "122", - "110", - "174", - "406", - "75", - "82", - "83", - "72", - "278", - "173", - "472", - "481", - "336", - "159", - "153", - "100", - "102", - "96", - "200", - "266", - "265", - "263", - "269", - "231", - "446", - "66", - "409", - "410", - "315", - "179", - "182", - "419", - "392", - "391", - "390", - "525", - "417", - "411", - "183", - "479", - "473", - "146", - "475", - "474", - "401", - "421", - "445", - "356", - "483", - "480", - "551", - "583", - "325", - "324", - "476", - "582", - "364", - "389", - "393", - "839", - "724", - "440", - "227", - "620", - "462", - "477", - "268", - "267", - "225", - "464", - "16", - "271", - "535", - "463", - "299", - "693", - "261", - "270", - "247", - "548", - "467", - "465", - "422", - "241", - "466", - "238", - "239", - "246", - "489", - "634", - "671", - "333", - "326", - "488", - "482", - "633", - "448", - "243", - "248", - "461", - "460", - "332", - "378", - "577", - "484", - "471", - "381", - "25", - "188", - "470", - "565", - "469", - "334", - "379", - "355", - "284", - "279", - "175", - "667", - "562", - "380", - "665", - "550", - "373", - "354", - "632", - "485", - "570", - "363", - "575", - "673", - "585", - "131", - "404", - "285", - "587", - "78", - "145", - "85", - "41", - "739", - "478", - "87", - "121", - "40", - "358", - "226", - "260", - "283", - "687", - "690", - "486", - "133", - "672", - "95", - "322", - "321", - "195", - "264", - "194", - "177", - "396", - "359", - "402", - "55", - "686", - "619", - "15", - "382", - "397", - "319", - "735", - "212", - "236", - "282", - "280", - "618", - "615", - "614", - "403", - "376", - "59", - "204", - "786", - "640", - "641", - "375", - "374", - "400", - "320", - "58", - "773", - "199", - "692", - "584", - "377", - "395", - "405", - "398", - "56", - "579", - "670", - "31", - "357", - "505", - "493", - "784", - "741", - "743", - "50", - "92", - "38", - "213", - "847", - "492", - "841", - "254", - "747", - "827", - "568", - "39", - "53", - "439", - "224", - "607", - "5", - "61", - "158", - "840", - "438", - "214", - "835", - "753", - "223", - "626", - "22", - "13", - "838", - "302", - "54", - "52", - "708", - "769", - "697", - "165", - "118", - "62", - "494", - "491", - "301", - "9", - "222", - "622", - "423", - "296", - "317", - "318", - "252", - "631", - "495", - "304", - "710", - "36", - "123", - "308", - "760", - "762", - "630", - "621", - "674", - "2", - "3", - "253", - "255", - "846", - "77", - "316", - "771", - "628", - "453", - "291", - "383", - "830", - "722", - "564", - "295", - "292", - "365", - "845", - "617", - "624", - "666", - "662", - "581", - "42", - "294", - "726", - "694", - "627", - "654", - "661", - "456", - "48", - "47", - "716", - "732", - "836", - "623", - "507", - "629", - "606", - "651", - "571", - "580", - "574", - "572", - "293", - "837", - "613", - "457", - "65", - "459", - "23", - "764", - "144", - "125", - "758", - "834", - "831", - "719", - "780", - "844", - "184", - "616", - "679", - "681", - "458", - "833", - "825", - "166", - "139", - "682", - "17", - "511", - "509", - "29", - "832", - "770", - "772", - "766", - "768", - "689", - "842", - "220", - "610", - "675", - "518", - "63", - "26", - "27", - "713", - "219", - "221", - "506", - "677", - "120", - "498", - "680", - "35", - "30", - "714", - "730", - "738", - "678", - "676", - "573", - "37", - "443", - "740", - "717", - "502", - "642", - "130", - "444", - "703", - "826", - "501", - "503", - "142", - "117", - "18", - "28", - "742", - "731", - "745", - "767", - "90", - "569", - "70", - "20", - "715", - "808", - "170", - "727", - "515", - "514", - "521", - "755", - "191", - "185", - "684", - "557", - "516", - "513", - "522", - "311", - "234", - "556", - "519", - "517", - "701", - "310", - "545", - "450", - "699", - "696", - "733", - "350", - "211", - "520", - "303", - "725", - "729", - "702", - "822", - "210", - "64", - "820", - "349", - "524", - "140", - "744", - "746", - "815", - "813", - "189", - "192", - "190", - "555", - "135", - "24", - "705", - "698", - "712", - "707", - "193", - "553", - "538", - "546", - "643", - "33", - "34", - "510", - "345", - "721", - "818", - "539", - "750", - "795", - "817", - "351", - "559", - "603", - "601", - "604", - "794", - "793", - "783", - "683", - "206", - "544", - "76", - "734", - "819", - "781", - "789", - "32", - "706", - "805", - "785", - "787", - "297", - "12", - "711", - "235", - "105", - "44", - "542", - "759", - "765", - "807", - "791", - "852", - "290", - "347", - "289", - "536", - "51", - "757", - "728", - "811", - "810", - "425", - "160", - "430", - "169", - "778", - "704", - "504", - "541", - "779", - "709", - "134", - "98", - "4", - "346", - "809", - "339", - "305", - "685", - "148", - "752", - "341", - "167", - "162", - "163", - "149", - "754", - "748", - "340", - "10", - "168", - "67", - "828", - "540", - "824", - "782", - "688", - "109", - "554", - "763", - "756", - "428", - "112", - "68", - "496", - "127", - "229", - "128", - "161", - "761", - "829", - "132", - "249", - "176", - "561", - "306", - "537", - "111", - "171", - "307", - "432", - "309", - "19", - "164", - "250", - "178", - "695", - "129", - "116", - "804", - "775", - "197", - "360", - "21", - "802", - "800", - "806", - "803", - "801", - "799", - "797", - "798", - "217", - "216", - "718", - "69", - "150", - "7", - "790", - "338", - "843", - "720", - "152", - "151", - "86", - "8", - "207", - "796", - "233", - "88", - "218", - "560", - "209", - "6", - "777", - "452", - "208", - "172", - "776", - "558", - "451" - ], - "data": {}, - "grid": [ - " ! ##$ %%&'' ( )) *** ", - " ! ##$ %%+', ( ))) ** - ", - " !! #.$ %%&+' ( ))) ** - ", - " / 0 ! #.$ %%&', ( ))) ** - ", - " / 1 0 ! #.$ 2 %%&+', ( ))3 *** - ", - " / 1 00 !! #.$ 4 2 %%&', ( )) 33 ** -- ", - " / 1 000 ! #.$ 4 222 %%&+',55 ( )) 3 ** -- ", - " / 1 66700 ! 8888 ##.$4 22 %%&',555 ( )) 3 ** -- ", - " / 1 99667000 ! 888 #..$4 222 :%%+',55; ( )) 33*** -- ", - " / 1 99 667700 ! 8 ##.$$4 22 :%%&', 55 ( )) 33** -- ", - " / 1 99 66770<0 ! 8 ##.$=422 :%%+',55; ( )) **3 -- ", - " />>> ? 1 9@@ 667<<000 !! 8 #..$=422 :%%&',,55; ( )) A**3 ------- BBBB ", - " / C>>>> ? D 9 @E EE66F 0000 ! 8 ##.GG=42 ::%%+',555 ( ) H 3--- BB BB ", - " / CI J>>KKK DDDD 9 E EEE ELFFF 000 ! MMMMMMNN #OGG= ::%%&+ ,55; ( ) * 3- B ", - " //PPPPPJ Q DDDDD99 E EE L FFF 000 ! R R N## GGS: :::%&+',555 ( )) **TT BB ", - " / PC IJPPQ DD EE EE UUU FFF 0000 ! R R #VVGS.::::%%&' ,55; () TT - BBBBBBBBB ", - "W/ PXXIJP Q EE E YYUUU FFF 000 ! R R ZZ VSS[:::%%&+', 55 ) TT] - BB ^ ", - "//PPP JP Q E E __YYY UU FFF 000 ! R R ZZ``Saa[[ %%&' ,555 ))TT] - BB ^ ", - "bb C PPPPQ E E c __ YY U dFF ee0 ! R RR Z``fg [[[%%&',,55 hh T ] - B ^^ ", - "/bbbb J Q EE LLLcc ___YY dd FFF e000 ! RRR ZZ``fg [[%&+',555 hhiT ] - B ^^ ", - " bbbbQ j kkk ccc__ d FFFe 000 !!l ZZ`mmmmm [%%&+ ,555 hh iT ] - B nnn ", - " o jj kkkccc d p qFFF 00r lll Z``stttmm[%%+', 55 hh iT ]]- B uun ", - " o jj kkkk d vvppq FFFF rr00llllll wZ` sx tm%%&+',55;y hh iT ]z-- B ^ u {{{{{{{{{{", - " oo jjjjj kkd ||vvvqpp FFFr 0000llll ZZ` s}}}m[%%&'~,55 yyh iT \u007f\u007f\u007f zzzzzz--- B {{{{{{\u0080{{{{{{{{{{{{{\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081", - " o j kk|||qvv pp rrFF 00000l Z`` ssssm[%%&',555 hh iT\u007f\u007f \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0083\u0083{{{{{{{{{{\u0081\u0081\u0081\u0081\u0081\u0080\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081 ", - " o j kkk q| vv\u0084\u0085\u0086\u0087 FFF\u0088\u0088\u008800000Z`\u0089\u008a\u008bx \u008cm%%&+',5\u008d\u008e\u008eh\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u0090\u0090\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0091\u0081\u0081 ", - " o j kq |||\u0084\u0084\u0092\u0087\u0086\u0086 \u0093\u0088\u0088\u0088\u0088\u0088\u0088\u0094\u0095`\u0089\u0089\u0089\u0089\u0089\u0089\u0089\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008e\u008e\u0082\u0082\u0082\u0082\u0082\u0096\u0096\u0096\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u0097 -- \u0098 \u0091 ", - " o jj \u0099\u009a\u0099 kkk| \u009b\u0087\u0092\u0092 \u0086\u0086 \u0093\u0093\u009c\u009c\u0088\u0088\u009d\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009f\u009f\u009f\u009f\u009f\u009f\u009f\u009f\u009f\u0096\u0096\u00a0\u0096\u0096\u0096\u0096 \u00a1\u00a2\u00a3\u00a4\u00a4\u00a5 \u00a6\u00a6\u00a6\u00a6--- \u0098\u0098 \u0091 ", - " o jj \u0099\u0099\u009a \u0099\u0099\u0099 k \u0087\u009b \u0092 k\u00a7\u009c\u009c\u00a8\u009d\u00a9\u00a9\u00aax\u00ab %%%&',55 \u00ac \u00a1\u00a2 \u00ad\u00ad\u00a5\u00a6-- \u0098 \u0091 ", - " o j \u0099 \u009a \u0099 kkkkkkkkkk\u00aekkk \u009c\u009c\u009d\u009d\u00af\u00b0 x\u00b1 %%&&',55 \u00ac \u00a1\u00a2 \u00ad - \u0098\u0098 \u0091 ", - "\u00b2\u00b2\u00b2 o j \u0099 \u009a \u00b3 \u00b4\u00a7\u009c\u009d\u009d\u00af\u00b0x \u00ab\u00b1 %%&+',55 \u00ac \u00a1\u00a2\u00b5\u00ad - \u0098 \u0091 ", - " \u00b2\u00b2\u00b2o j \u0099\u0099 \u009a\u009a \u00b6\u00b7 \u00b3 \u00b4\u00a7\u00b8\u009d \u00af\u00b0x\u00ab \u00b1%%%&+',55 \u00ac \u00a1\u00a2\u00b5\u00ad - \u0098 \u0091 ", - " \u00b2\u00b2\u00b2 jj \u0099\u0099 \u009a \u00b9\u00ba \u00b6\u00b7\u00b7\u00b7 \u00bb\u00bb\u00bb\u00bb\u00bc \u00bd\u00b8\u00b8\u009d\u00af \u00b0x\u00ab\u00b1 %%%&+',5\u00be \u00ac \u00a1 \u00a2\u00b5\u00ad - \u0098 \u0091 ", - "\u00bf \u00b2\u00b2\u00b2 jj \u0099 \u009a \u00b9 \u00ba\u00ba\u00ba \u00c0 \u00b7\u00b7 \u00bb\u00bb\u00bb \u00bc \u00bd\u00b8\u009d\u009d\u00af\u00b0 x\u00ab\u00b1 %% &+'55\u00be \u00ac \u00a1\u00a1\u00a2\u00b5\u00b5\u00ad - \u0098 \u0091 ", - " \u00bf\u00bf \u00b2\u00b2 j \u0099\u00c1 \u009a\u009a\u009a\u00b9 \u00c2\u00c2\u00c0\u00b6 \u00b7 \u00c3 \u00c4 \u00bd\u00bd\u00b8\u009d \u00af\u00b0x\u00ab\u00ab\u00b1 %% &+'55\u00be \u00ac \u00a1\u00a2\u00a2\u00b5\u00b5\u00ad- \u0098 \u0091 ", - " \u00bf\u00bf j \u0099\u0099\u00c1 \u009a\u00c5\u00c5 \u00c6 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b7 \u00c3 \u00c4 \u00bd\u00c7\u00b8\u009d \u00c8\u00c8\u00b0\u00c9\u00b1\u00b1 %% \u00ca\u00cb,55 \u00cc \u00ac \u00a1 \u00a2 \u00b5\u00cd\u00cd- \u0098 \u0091 ", - " \u00bf\u00ce\u00ce\u00ce jj j \u0099\u0099\u00c1\u00c1\u00cf\u00cf\u00cf\u00cf\u00cf\u00b9\u00cf \u00d0\u00c5 \u00c6 \u00b7 \u00c3 \u00c4\u00c4 \u00bd\u00b8\u00b8\u009d \u00b0\u00c9\u00b1 %%%&\u00ca',55 \u00cc \u00ac \u00a1\u00a1\u00d1\u00d1\u00d2\u00d3 -- \u0098 \u0091 ", - " \u00bf\u00bf\u00ce\u00cej jj \u0099\u00cf\u00cf\u00c1 \u00d4\u00cf\u00cf\u00d0 \u00c5\u00c6 \u00b7 \u00c3 \u00c4 \u00bd\u00b8\u009d\u009d x\u00c9\u00ab \u00d5%%&\u00ca',55 \u00cc \u00ac\u00ac \u00a1\u00d6\u00d1 \u00d3\u00d3 - \u0098 \u0091 ", - " \u00bf\u00bf \u00ce\u00ce \u0099\u00cf\u00cf \u00c1\u00c1\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d8 \u00cf\u00cf\u00c6 \u00b7 \u00c3 \u00c4 \u00d9\u00bd\u00b8\u009d x\u00c9\u00ab %%%&\u00da',55\u00cc\u00be \u00ac \u00a1\u00a1\u00db\u00dc \u00d3 - \u00dd\u00dd\u0098\u0098 \u0091 ", - " \u00bf\u00bf \u00ce\u00ce \u0099\u00de\u00cf \u00d7\u00d7 \u00df \u00d7\u00d7\u00d7 \u00e0\u00cf\u00cf \u00b7 \u00c3 \u00e1\u00c4 \u00bd\u00b8\u00b8\u009d x\u00c9\u00ab \u00d5%% &\u00da',55 \u00be \u00ac \u00a1 \u00dc\u00dc \u00d3 - \u00e2\u00dd \u0098 \u0091 ", - " \u00bf \u00ce\u00ce \u0099\u0099\u00cf\u00de\u00de\u00de \u00e3\u00e3\u00df\u00e3 \u00d7\u00e0 \u00cf \u00b7 \u00c3 \u00c4 \u00bd\u00b8\u00b8\u009d x\u00c9\u00ab \u00d5%% &\u00ca',55 \u00be \u00ac \u00a1\u00a1 \u00db\u00db \u00d3 -- \u00e4\u00e5\u00e6 \u0098\u0098 \u0091 ", - " \u00bf \u00e7 \u0099 \u00cf\u00e8\u00e8\u00e8 \u00e3 \u00e3\u00e3 \u00e9\u00d7\u00d7 \u00cf \u00b7 \u00ea\u00ea \u00eb \u00bd\u00b8\u009d\u009d x\u00c9\u00ab \u00d5%% &\u00da',55 \u00be \u00ac \u00a1 \u00db\u00db\u00db -- \u00e4\u00e4\u00e5\u00e6 \u0098 \u0091 ", - " \u00bf\u00bf \u00e7\u00ec \u00ed\u0099 \u00cf\u00ee\u00ee\u00d7 \u00e3\u00e3 \u00e9\u00e3 \u00d7\u00d7 \u00cf\u00cf \u00b7 \u00ef\u00ef\u00ea\u00ea\u00ea \u00eb \u00bd\u00b8\u009d\u009d x\u00c9\u00ab \u00d5%% &\u00ca',55 \u00be \u00ac \u00a1 \u00db\u00db\u00db\u00db- \u00e4\u00f0\u00f1\u00f1\u00f1\u0098 \u0091 ", - " \u00bf \u00ec\u00ec\u00ed\u00ed \u0099\u00cf\u00f2\u00ee\u00d7 \u00e3 \u00e3 \u00d7\u00f3\u00f3\u00cf \u00b7 \u00f4\u00f4\u00ef\u00ef\u00ef\u00ea\u00ea \u00eb \u00f5\u00bd\u00b8\u009d x\u00c9\u00ab \u00d5%% &\u00da' 55 \u00be \u00ac \u00a1\u00a1 \u00d3\u00d3 - \u0098 \u0091 ", - " \u00bf \u00f6\u00ed\u00f7\u00f7\u00f7\u00f7\u0099\u00cf \u00d7 \u00f8\u00e3 \u00e3 \u00d7\u00f3 \u00cf \u00b7 \u00f4\u00f4\u00ef\u00ef\u00ea \u00eb \u00f9\u00f5\u00f5\u00f5\u00f5\u00f5 x\u00c9\u00ab \u00d5\u00d5%% &\u00ca' \u00fa\u00fa \u00be \u00ac\u00ac \u00a1\u00a1 \u00d3 - \u0098 \u00fb ", - " \u00f6\u00f6\u00f6 \u00f7\u0099\u00cf \u00d7\u00f8 \u00e3\u00e3 \u00e3 \u00d7 \u00cf\u00b7\u00b7 \u00f4\u00ef\u00ea\u00eb\u00eb \u00f9\u00bd\u00b8\u009d\u00f5\u00f5 x\u00c9\u00ab \u00d5\u00d5%% &\u00cb'\u00fa\u00fa\u00fa \u00be \u00ac \u00a1\u00a1 \u00d3 - \u0098 \u00fb ", - " \u00f6 \u00ed\u00ed\u00f7\u00f7\u0099 \u00cf \u00d7 \u00e3\u00fc\u00e3\u00e3 \u00e3\u00e3 \u00d7 \u00cf\u00b7 \u00f4\u00f4 \u00bd\u00b8\u009d\u00f5 x\u00c9\u00ab\u00ab \u00d5%% &\u00cb'\u00fa\u00fa\u00fa \u00be\u00be \u00ac \u00a1 \u00d3 - \u0098 \u00fb ", - " \u00f6\u00f6 \u00ed\u00f7\u0099 \u00cf\u00cf \u00fd\u00d7\u00d7\u00fc\u00fc \u00fe \u00d7 \u00b7\u00b7 \u00ff \u00b8\u00b8\u009d\u0100 x\u00c9\u00ab \u00d5%% &\u00cb,\u00fa\u00fa\u0101\u0101 \u00be \u00ac \u00a1 \u0102\u0102\u0103 - \u0098 \u00fb \u0104\u0104\u0104", - " \u00f6\u00f6 \u00ed\u00ed \u00cf\u00cf\u0105 \u00d7\u00d7\u00d7 \u00fe \u00d7\u00d7 \u00cf\u00b7 \u0106 \u00ff \u00b8\u00b8\u009d\u0107xxx\u00c9\u00ab \u00d5%% &\u00cb'\u00fa\u00fa \u0101 \u00be \u00ac \u00a1\u0102\u0102\u0102\u0103\u00d3 -- \u0098 \u00fb \u0104\u0104\u0104\u0104 ", - " \u00f6 \u0099\u0099 \u00cf \u00d7\u0108\u00d7\u00d7\u00d7 \u0109 \u00cf\u00b7\u00b7 \u0106\u010a \u00ff \u00bd\u00b8\u009d\u009d \u00c9\u00ab \u00d5%% &\u00cb\u00fa\u00fa\u00fa\u010b\u010b \u00be \u00ac \u00a1\u00a1 \u0102\u00d3 - \u0098 \u00fb\u00fb \u0104\u0104\u0104\u0104 ", - " \u00f6 \u0099\u0099 \u0108\u010c\u010c \u0109 \u00cf\u010d \u010e\u010a\u010a\u010a\u010a\u010f \u0110 \u0111\u0111\u00b8\u009d\u009d \u00c9\u00c9\u00ab \u00d5\u00d5%% &\u00cb\u00fa\u00fa\u010b \u010b \u00be\u00be \u00ac \u00a1 \u0102\u00d3 - \u0098\u00fb\u00fb \u0104\u0104\u0104\u0104 ", - " \u00f6\u0112 \u0099\u0099 \u010c \u00cf\u0109\u010d \u010e \u010a\u010a\u0110 \u0111\u0113\u0113\u0113\u00b8\u00b8\u009d \u0114\u00ab \u00d5%%% &\u00fa\u00fa\u00fa\u010b \u010b \u00be \u00ac \u00a1 \u0102\u00d3 - \u0115\u00fb\u0104\u0104\u0104\u0104 ", - " \u00f6\u0116\u0116\u0112\u0112 \u0099 \u010c\u00b7\u00b7\u010d\u010d \u010a\u010a \u010a\u010a \u0110 \u0111\u0113\u0113\u0113\u0117\u0118\u0119\u009d\u011a\u011a \u0114 \u00ab\u00ab\u00d5%% &\u00fa\u00fa \u010b \u010b \u00be \u00ac \u00a1 \u0102\u00d3 -- \u0115\u0115\u0104 ", - "\u011b \u00f6 \u0116\u0116\u0112\u0112 \u0099\u0099 \u011c\u00b7\u00b7\u00b7\u00b7 \u010d\u010d \u010a\u010a\u010a \u0110 \u0111\u0113\u0113\u0117\u0117\u0117\u0118\u011d\u011e\u011a\u011a\u011f\u011f\u0114 \u00d5\u00d5%% \u00fa\u00fa\u00fa,\u010b \u010b\u010b \u00be\u0120\u0120\u0120 \u00ac \u00a1 \u0102\u0102\u0121\u00d3\u00d3--\u0122\u0122\u0123 \u0115\u0115 ", - "\u0124\u0125\u0125 \u00f6 \u0116\u0112\u0112 \u0099\u0099 \u011c\u0126\u0126 \u010d \u010a\u010a \u0110\u0111\u0127\u0113\u0117\u0128\u0128\u0128\u0129\u011e\u011e\u012a\u012b\u011f\u011f\u011f\u00d5\u00d5\u00d5\u00d5%% \u00fa\u00fa\u00fa', \u010b \u010b\u010b\u00be\u00be \u00ac\u00ac \u00a1 \u0102\u0121 \u012c\u012d\u012e\u0123 \u0115\u0115 \u012f\u012f", - " \u0124\u0125\u0125 \u00f6 \u0116\u0116\u0112\u0112 \u0099\u011c\u0126 \u0126 \u010d \u0110 \u0127\u0127\u0128 \u0129\u0129\u011e\u011e\u0130\u012b\u012b\u011f\u011f\u00d5\u00d5\u00d5%% \u00fa\u00fa\u00fa', \u010b \u010b \u0131 \u00ac\u00ac\u00ac \u00a1 \u0121 \u012c \u012e\u012e \u0115\u0115 \u012f\u012f\u012f\u012f ", - " \u0124\u0125 \u00f6\u00f6 \u0116\u0116\u0112\u0112 \u011c\u0126\u0126\u0126\u0126\u010d\u010d \u0110\u0111\u0127\u0128 \u0129\u0129\u011e\u011e \u0132\u012b\u012b %% \u00fa\u00fa\u0133\u00da', \u010b \u0131 \u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac \u00a1 \u0121 \u012d \u0123 \u0115\u0115 \u012f\u012f\u012f\u012f\u012f \u0134", - " \u0135 \u0124\u0125\u0125 \u0116\u0112\u0112 \u0099\u0126\u0126\u010d\u010d \u0110\u0111\u0127\u0127\u0136\u0136\u0137\u0137 \u0129\u0129\u011e\u011e \u0138 \u0132\u012b %%% \u00fa\u00fa\u00fa\u0139\u013a\u00cb, \u010b \u013b\u010b \u00ac\u00ac\u00ac\u00ac\u013c\u013c\u013c \u013d \u013e \u0115\u0115 \u012f\u012f\u012f\u012f\u012f \u0134\u0134\u0134\u0134 ", - " \u013f \u0135 \u0124\u0125\u0125 \u0116\u0116\u0112 \u0140\u0141\u0126 \u0110\u0111\u0127\u0127\u0136\u0136\u0136\u0136\u0137\u0137\u0129 \u011e \u0142\u0143\u0132\u0132\u012b\u0144%% \u00fa\u00fa\u00fa\u0133\u0139\u00da', \u010b \u013b \u010b \u013c\u013c\u013c\u013c\u013c\u013c\u013c\u013c\u013c\u013c\u0145\u0145\u0115\u0115 \u012f\u012f\u012f\u012f \u0134\u0134\u0134\u0134 \u0146\u0146\u0146\u0146", - "\u00bf \u013f \u00f6 \u0147\u0124\u0125\u0148 \u0116\u0116\u0112\u0112 \u0140\u0141\u0141 \u0110\u0110\u0127\u0127\u0128\u0149\u0149\u014a\u0136\u0136\u0137\u0129 \u011e\u0143\u0143\u0143\u014b\u0132\u014c\u014d\u014d% \u00fa\u00fa\u0133\u0139 \u013a\u014e' \u010b\u010b \u013b\u013b \u010b\u010b \u014f\u014f \u012f\u012f\u012f\u012f \u0134\u0134\u0134\u0146\u0146\u0146\u0146\u0150\u0150\u0150 ", - "\u00bf \u00f6\u00f6 \u0147\u0124\u0125\u0148 \u0116\u0112\u0112 \u0140\u0140\u0141 \u0151\u0151 \u0110\u0111\u0127\u0128\u0149\u0149\u014a\u014a\u0136\u0136 \u0129\u0152\u0143\u0143\u011e\u011e\u0153\u0154\u0155\u014d\u0156\u0156%\u00fa\u00fa\u0133 \u0139 &\u014e', \u010b \u013b\u013b \u010b\u010b \u012f\u012f\u012f \u0134\u0134\u0134\u0134\u0146\u0146\u0150\u0146\u0150\u0150 ", - " \u00f6\u00f6 \u0124\u0125\u0125 \u0116\u0116\u0112 \u0140\u0141 \u0151\u0157 \u0158\u0111\u0127\u0128\u014a\u0149\u014a\u014a\u0136\u0159\u0159\u0159\u0129\u0152 \u011e\u011e\u0154\u014d\u014d\u0156\u0156\u00fa\u00fa\u00fa\u0133 \u0139 \u00da\u014e', \u010b \u015a\u013b \u010b\u010b \u0134\u0134\u0134\u0134\u0146\u0146\u0146\u0146\u0150\u0150 ", - "\u015b \u00f6 \u0147\u0124\u0125 \u0116\u0116\u0112\u0112 \u0140\u0141\u0141 \u0157\u015c \u0110\u0111\u0127\u0127\u0128 \u014a\u0159\u0159\u0159\u0159\u0159\u0159\u0129 \u014d\u014d\u014d\u0156\u0156\u0156\u00fa\u00fa\u0133 \u0139 &\u014e\u00cb, \u010b\u015a\u015a\u013b\u013b \u013b\u013b\u013b \u0134\u0134\u0134\u0146\u0146\u0146\u0146\u0150\u0150\u0150 \u015d", - "\u015b\u00f6 \u0147\u015e\u015f\u0148 \u0116\u0116\u0112\u0112 \u0140\u0141\u0141 \u015c\u015c \u015c \u0110\u0111\u0127\u0127\u0128\u0160\u0160\u0160\u0159\u0159\u0159\u0159 \u0161\u0161\u0162\u0162\u0162\u014d\u014d\u014d\u014d\u014d\u0156\u0156\u00fa\u00fa\u0133\u014c\u014c & ',, \u010b\u015a \u013b\u013b \u013b\u013b\u0163\u013b\u013b \u0134\u0134\u0134\u0146\u0146\u0146\u0146\u0150\u0150\u0150 \u015d\u0164\u0164", - " \u015b \u0124\u0125\u0125 \u0116\u0116\u0140\u0140\u0141 \u015c\u015c \u015c\u0165 \u0110\u0111\u0127\u0128\u0160\u0160\u0160\u0160\u0162\u0162\u0162\u0162\u0162\u0161\u0161\u0162\u0162\u0162\u014d\u014d\u014d \u0156\u0156\u0156\u00fa\u00fa\u0133 \u014c \u0166 \u014e', \u010b\u010b \u013b\u013b \u013b\u0163\u0163\u0163\u013b\u013b\u013b \u0167\u0167\u0167\u0134\u0134\u0134\u0134\u0146\u0146\u0146\u0146 \u0150\u0150\u0150 \u015d\u0164\u0164\u0168\u0169", - "\u016a \u015b\u015b \u0124\u015f\u0125 \u0116\u0140\u0141 \u015c \u0165\u0165 \u0110\u0111\u0127\u0128\u0160\u0160\u0160\u016b\u016b\u016b\u016b\u016b\u016b\u016b\u0161\u0161\u016b\u0162\u0162 \u016c\u0156\u00fa\u00fa\u0133\u0154\u0155\u014c\u014c \u0166\u00da\u014e',\u016d \u010b\u010b \u013b\u013b \u013b \u0163\u0163\u0167\u0167\u0167\u0167\u0167\u0167\u0167\u0167\u0167\u0134\u0134\u0134\u0146\u0146\u0146\u0146\u016e\u016e \u0150\u0150 \u015d\u0164\u0164\u0168\u0169\u0169 ", - "\u016f\u016a \u015b\u015b \u0147\u015f\u0125\u0148 \u0140\u0141 \u015c \u0110\u0111\u0127\u0127\u0160\u0160\u016b\u016b\u016b\u016b\u016b\u0170\u0170\u0170\u016b\u016b\u0161\u016b\u016b\u016b \u016c\u0171\u0171\u0133\u0172\u0172\u0154\u0155\u014c \u0173\u00da\u014e' ,\u016d \u0174\u0174\u010b\u010b \u013b\u013b\u0175 \u0167 \u0176\u0177\u0134\u0177\u0146\u0146\u0146 \u0178\u016e \u0150\u0150 \u015d\u0164\u0164\u0168\u0169\u0169 ", - "\u016f\u016a\u016a \u0179\u015b \u0147\u0124\u0125\u0125 \u0140\u0141\u0141 \u015c \u0110\u0111\u0127\u0127\u0160\u0160\u016b\u016b\u016b\u0170\u0170\u0170\u0170\u0170\u0170\u0170\u0170\u0161\u016b\u016b\u016b\u016b\u016b \u016c\u016c\u0171\u0171\u017a\u017b\u0172\u0172\u0155\u014c \u0166\u00da \u014e',\u016d\u016d\u0174\u0174 \u0174\u0174\u0174\u010b \u0175\u0175\u0175 \u0167 \u0176\u0176\u0176\u0177\u017c\u0146\u0146 \u0178\u0178\u0178\u016e \u0150 \u015d\u015d\u0164\u0164\u0168\u0169\u0169 ", - "\u016f \u016a\u016a\u0179 \u015b \u0124\u0124\u0125 \u0140\u0140\u0141 \u015c\u015c \u0110\u0110\u0111\u0127\u0160\u0160\u016b\u016b\u0170\u0170 \u017d\u017d \u0161\u0161\u0170\u016b\u016b\u016b\u016b\u017e\u017e\u017f\u017a\u017a\u017b\u017b\u0172\u0154\u014c \u0166\u00da \u014e',,\u016d\u0174 \u010b\u010b \u0167\u0167\u0167\u0176\u0176\u0176\u0180\u0177\u0181\u017c \u0178\u0178\u0178 \u016e \u0150 \u015d\u015d\u0164\u0182\u0168\u0169\u0169 \u0183\u0183", - "\u016f\u016a\u016a\u0179\u0179 \u015b\u015b \u0147\u0125\u0125\u0148 \u0140\u0140\u0141 \u015c\u015c \u0110\u0111\u0127\u0160\u0160\u0160\u016b\u0170\u0170 \u017d \u017d\u017d\u017d\u017d \u0184\u0184\u0170\u0185\u0185\u016b\u016b\u017e\u017e\u017f\u017a\u017a\u017b\u017b\u0172\u0172\u0155\u014c \u0173\u00da \u014e', \u016d \u010b\u010b \u0167\u0167\u0167\u0176\u0176\u0176\u0180\u017c\u017c\u0181 \u0178\u0178\u0178 \u016e\u016e \u0150 \u015d\u0164\u0164\u0168\u0168\u0169\u0169 \u0183\u0183\u0183 ", - " \u016a\u0179\u0179 \u015b\u015b \u0147\u0124\u0125\u0148\u0140\u0141 \u0186\u0187 \u0110\u0111\u0127\u0127\u0160\u0160\u016b\u0170\u0170 \u017d\u017d\u0188 \u017d\u017d\u0189\u0184\u0189\u0185\u0185 \u017e\u017e\u017f\u017f\u017a\u017a \u017b\u017b\u0172\u0155\u014c \u0173\u00da \u014e',, \u016d \u010b\u010b\u0167\u0176\u0176\u0176\u0180\u0180\u017c\u017c\u0181 \u0178\u0178 \u018a\u018a\u016e \u0150 \u015d\u0164\u0164\u0168\u0168\u0169\u0169 \u0183\u0183 ", - "\u016a \u0179\u018b \u015b\u015b \u0124\u0148\u0148\u0141 \u0186 \u0187 \u0111\u0127\u0127\u0160\u0160\u016b\u0170\u0170 \u017d\u017d \u0188\u0188\u0188\u0188\u0188 \u018c\u0184\u0189\u0185\u0185\u0185\u017e\u017e\u017f\u017f\u017a\u017a \u017b\u017b\u0172\u0155\u014c\u018d\u018e\u018e\u018e\u018f\u014e\u00cb', \u016d \u0190\u0190\u0176\u0180\u0177\u017c\u017c\u0181 \u0178\u0178\u0178 \u018a\u018a\u018a\u016e\u016e\u0150 \u015d\u0164\u0164\u0168\u0169\u0169\u0169 \u0183\u0183 ", - " \u0191 \u015b\u015b \u0140\u0147\u0141 \u0192 \u0187 \u0111\u0111\u0127\u0160\u0160\u016b\u016b\u0170 \u017d\u017d \u0193\u0193 \u0188\u0188\u0188\u017d\u0184\u0184\u0189\u0185\u0185\u017e\u017e\u017f\u016b\u017a\u017a\u017a\u017b\u017b\u0172\u018d \u0173\u0194 \u018f\u018f\u014e',, \u016d \u0176\u0176 \u0190\u0190\u0190\u017c\u0181 \u0178\u0178\u0178 \u018a\u018a \u016e\u0150\u0150 \u015d\u0164\u0164\u0168\u0169\u0169\u0169 \u0183\u0183 ", - "\u0179 \u015b\u015b \u0140\u0140\u0141 \u0192\u0192\u0187\u0187 \u0111\u0127\u0160\u0160\u0160\u016b\u0170\u0195\u0195\u0195\u0193\u0193 \u0193\u0193\u0193 \u0188\u017d \u0184\u0189\u0185\u0185\u017e\u017e\u017f\u016b\u016b\u017a\u017a\u017b\u017b\u0196\u0197 \u0173\u0194 \u018f\u014e\u00cb', \u016d\u016d \u0176\u0176 \u0198\u0177\u0199\u017c\u0190\u0190 \u016e\u016e\u016e\u016e\u018a\u018a\u018a \u016e \u0150 \u015d\u0164\u0164\u0168\u0169\u0169 \u0183\u0183 ", - "\u019a \u019b\u019b\u015b \u0140\u0141 \u019c\u019c\u019c\u019c\u019c \u0111\u0127\u0127\u0160\u0160\u016b\u0170\u0195\u0195\u0195 \u0193\u0193\u0193\u0193 \u0184\u0189\u0189\u0185\u019d\u019e\u019e\u016b\u016b\u017a\u017a\u017b\u017b\u0196\u0197 \u0173\u00da \u018f \u014e',, \u016d \u0176\u0176 \u0180\u0177\u017c\u017c\u0181\u0181 \u019f\u019f \u016e\u016e\u016e\u016e\u01a0\u01a0\u016e\u016e\u0150 \u015d\u0164\u0164\u01a1\u0168\u0169\u0169 \u0183\u0183 ", - " \u019b \u015b \u0140\u0141\u0141 \u019c\u019c\u01a2\u01a2\u01a2\u01a2 \u0111\u0127\u0127\u0160\u0160\u016b\u016b\u0195\u0195\u0195 \u0193 \u0184\u0184\u0189\u0185\u019d\u019e\u019e\u016b\u016b\u017a\u017a\u017b\u017b\u0196\u0197 \u0173 \u0194 \u01a3\u014e\u00cb',\u01a4\u0176\u0176 \u0180\u0177\u017c\u017c\u0181\u0181 \u01a0\u01a0 \u0150\u0150 \u015d\u0164\u0164\u01a1\u0168\u0169\u0169 \u0183\u0183 ", - " \u01a5 \u019b \u015b\u015b\u0140\u0141\u0141 \u01a2\u01a2\u01a2\u01a2\u01a2\u01a2\u01a2\u01a2 \u0111\u0127\u0127\u0160\u0160\u016b\u016b\u0195\u0195\u0195 \u01a6\u01a6\u01a7\u01a7\u01a7\u01a7 \u01a8\u01a8\u0184\u0189\u0185\u019d\u019e\u019e\u016b\u016b\u017a\u017a\u017b\u0196\u0196 \u0173 \u0194 \u01a9\u01aa\u01a4\u01a4 \u0180\u0177\u017c\u017c \u0181\u0181 \u01a0\u01a0 \u0150 \u015d\u0164\u0164\u01a1\u0169\u0169\u0169 \u0183\u0183 ", - " \u01a5\u01a5\u01ab\u01ab\u01ab \u015b\u0140\u0141 \u01a2\u01a2\u01a2 \u01a2\u01a2 \u0111\u0127\u0160\u0160\u0160\u016b\u0195\u0195\u0195 \u01a7\u01ac\u01a7 \u01a7\u01a7\u01a7 \u01ad\u01ad\u01ae\u01ae\u0184\u0184\u0185\u019d\u019e\u019e\u016b\u016b\u017a\u017a\u017b\u0196\u0197 \u0173 \u0194\u00da \u01a9\u01a9\u01aa\u01a4\u01a4\u017c\u017c \u0181\u0181 \u01a0\u01a0 \u0150 \u015d\u0164\u0164\u01af\u01af\u0169\u0169 \u0183\u0183\u0183 ", - "\u01b0\u01b1 \u019b\u019b\u01ab \u01ab\u01ab\u01ab \u015b\u015b\u01b2\u01b3 \u019c\u01a2\u01a2\u01b4\u01b4\u01b4\u01b4 \u01a2\u01a2\u0127\u0127\u0160\u0160\u01b5\u0195\u0195 \u01b6\u01a7 \u01ac\u01ac \u01a7\u01ad\u01ad \u01ae\u0184\u0184\u0185\u019d\u019e\u019e\u016b\u016b\u017a\u017a\u017b\u0196 \u0173\u0173 \u0194\u00da \u0176\u0176\u01a9\u01b7\u01aa\u01a4\u01a4 \u0181\u0181 \u01a0\u01a0\u01a0\u01a0\u01a0 \u01b8\u0150\u015d\u015d\u0164\u01af\u0168\u0169\u0169 \u0183\u0183 ", - "\u01b1\u01b0\u01b0 \u01b9\u01b9 \u01ab \u01ba\u01bb\u01b2\u019c\u01a2\u01a2\u01b4\u01b4 \u01b4 \u01bc\u0111\u0127\u0127\u01bd\u0160\u01be\u01b5\u01b5 \u01a7\u01b6\u01b6\u01b6 \u01ac\u01ac \u01a7 \u01ae\u0184\u0185\u019d\u019e\u019e\u016b\u016b\u017a\u017a\u0196\u0196 \u0173 \u01bf\u01c0\u01c1\u0176 \u0180\u0180\u01a9\u01a9\u01aa\u01a4\u01a4\u0181 \u01a0\u01a0\u01a0\u01a0 \u01a0\u01a0\u01a0 \u01b8\u0164\u0164\u01af\u01af\u0169 \u0183\u0183 ", - "\u016a\u016a\u01c2\u01b0 \u01c3 \u01c4\u01ab \u01c5\u01c6\u01c7\u01a2\u01a2 \u01b4 \u01c8 \u01c9\u01ca\u0111\u0127\u0127\u0128\u01bd\u01bd\u01be\u01b5 \u01cb\u01cb \u01b6\u01b6 \u01ac\u01ac\u01ac\u01a7 \u01ae\u0184\u0184\u019d\u019d\u019e\u019e\u016b\u017a\u017b\u0196\u0197 \u0173\u0173 \u01bf\u01c0\u01c0\u01cc\u0180\u017c\u017c\u01a9\u01b7\u01aa\u01a4\u01a4 \u01a0\u01a0 \u01a0\u01a0\u0164\u0164\u0164\u0168\u01af\u0169 \u0183\u0183 ", - " \u016a\u016a \u01cd\u01c3 \u019b\u01c4\u01c4 \u01c5\u01ce\u01a2\u01cf\u01b4 \u01c8 \u01c8\u01c9 \u0111\u0127\u0128\u01bd\u01bd\u01be\u01b5\u01b5 \u01d0\u01a7 \u01cb\u01cb \u01b6\u01b6 \u01ac\u01ac \u01ae \u0184\u0185\u019d\u019e\u01d1\u01d1\u01d1 \u0196 \u0173\u0173 \u01c1\u01c1\u01bf\u01c0\u01c0\u01d2\u017c \u0181\u0181\u01a9\u01b7\u01aa\u01a4 \u01a0\u01a0 \u01a0\u015d\u015d\u0164\u0164\u0182\u0169\u0169 \u0183\u0183 ", - " \u016a \u01cd\u01cd\u019b\u019b\u01ab\u01ab \u01c5\u01ce \u01cf\u01cf\u01cf\u01c8 \u0111\u0127\u0128\u01bd\u01bd\u01be\u01b5\u01b5\u01d3\u01d3\u01a7\u01a7\u01d0\u01d0 \u01cb\u01cb \u01b6\u01b6 \u01a7 \u01ae \u0184\u0184\u019d\u01d1\u01d1\u01d1\u01d1\u0196\u01d4\u0173\u0173\u01c1\u01c1\u01d5\u01d6\u01bf\u01c0\u01c0 \u0181\u0181\u0181 \u01d7\u01d8\u01d9\u01d9\u01a0\u01a0\u01a0\u01a0\u01a0 \u01a0\u015d\u01da\u0164\u0164\u0168\u0169\u0169 \u01db\u01db \u0183\u0183 ", - " \u016a \u01c3\u01dc\u019b \u01ab \u01c5\u01ce\u01dd\u01de\u01dd\u01cf\u01cf\u01cf \u0111\u0127\u0127\u01bd\u01bd\u01bd\u01b5\u01b5 \u01d3\u01df\u01df \u01d0\u01d0 \u01cb\u01cb \u01b6\u01b6\u01a7 \u01ae \u0184\u01d1\u01d1\u01d1\u01d1\u016b\u01d4\u01d4\u0173\u01c1\u01d5\u01e0\u01d6\u01d6\u01bf\u01c0\u01c0\u0181\u0181 \u01d7\u01d8\u01d9\u01a0 \u01a0\u01da\u0164\u0164\u0164\u01e1\u0169\u0169\u01b8 \u01db\u01db \u01e2 ", - "\u01e3 \u016a \u01c3 \u01dc\u01ab \u01c5\u01ce\u01dd\u01de\u01e4\u01dd\u01dd\u01cf\u01cf \u0111\u0127\u0127\u0128\u01bd\u01bd\u01be\u01e5 \u01e6 \u01e7\u01d3\u01df\u01df \u01d0\u01d0 \u01cb\u01cb\u01a7\u01a7 \u01ae \u01d1\u01d1\u01d1\u01d1\u01e8\u01e8\u01d4\u01d4\u01e9\u01e0\u01ea\u01eb\u01ec\u01ed\u01bf\u01bf\u01c0 \u01d7\u01ee\u01d8\u01d9\u01a0 \u01a0\u015d\u0164\u0164\u0168\u01e1\u01e1\u0169 \u01ef \u01f0\u01f0 \u01db\u01db\u01db \u01e2 ", - "\u01e3\u01e3\u016a \u01c3 \u01ab\u01ab\u01ab \u01f1\u01f1\u01dd\u01de \u01e4\u01f2\u01dd\u01dd\u01cf\u01cf\u0127\u0127\u0128\u01bd\u01bd\u01be\u01e5\u01e5\u01f3\u01e6\u01e6\u01e7\u01d3\u01d3 \u01df\u01df \u01d0\u01d0\u01a7\u01a7\u01cb\u01a7 \u01ae\u01f4\u01f4\u01d1\u01d1\u01f5\u01f6\u01f6\u01e8\u01d4\u01d4\u01ea\u01eb\u01f7\u01ed\u0181\u0181\u01bf\u01c0\u01c0 \u01ee\u01d8\u01d9\u01d9 \u01a0\u015d\u0164\u0164\u0168\u0169\u0169\u0169 \u01ef \u01f8\u01f0\u01f0\u01f0 \u01f9\u01db\u01db \u01e2 ", - " \u01e3\u01e3 \u01c3\u01fa \u01ab \u01c5\u01f1\u01dd\u01de\u01e4\u01e4\u01f2\u01fb \u01dd\u01cf\u0127\u0128\u01bd\u01bd\u01be\u01e5\u01e5 \u01f3\u01e7\u01e6 \u01e5\u01d3 \u01a7\u01a7\u01df\u01a7\u01a7\u01a7 \u01f4\u01f4\u01f4\u01f4\u01f4\u01fc\u01f5\u01f5\u01f6\u01f6\u01d4\u01d4\u01ed\u01ec\u0181\u0181\u0181 \u01bf \u01d7\u01d7\u01d8\u01d9\u01a0 \u01a0\u01a0\u015d\u0164\u0164\u0168\u0169\u0169 \u01ef \u01f8\u01f8\u01f9\u01f9\u01f0 \u01e2 ", - " \u01e3\u01e3 \u01fd\u01fa\u01fa \u01ab \u01c5\u01c5\u01ce \u01fe\u01e4\u01f2\u01f2\u01fb\u01dd \u0127\u0128\u01bd\u01bd\u01bd\u0170\u01e5\u01e5\u01e5 \u01f3\u01e5\u01e5\u01e5\u01d3\u01e5 \u01ff\u01ff\u01f4\u01f4\u01f4\u01f4 \u0173\u01fc\u01fc\u01f5\u01f6\u01f6\u0200\u01d4\u01ec\u0181\u0181 \u0201\u0202 \u01d7\u01ee\u01d8\u0203\u0203\u0203\u0164\u0164\u0168\u0169\u0169 \u01ef \u01f8\u01f8 \u01e2 ", - "\u0173 \u01e3\u01e3\u01e3 \u01fa\u01ab \u01c5\u01ce \u01fe \u0204\u0205\u0206\u01dd\u01dd\u0127\u0127\u01bd\u01bd\u01bd\u0170\u0170 \u01e5\u01e5\u01e5\u01e5\u01e5\u01e5\u01e5\u01d3\u01d3 \u01ff\u01ff\u01ff\u01ff\u01ff\u0207\u0207\u0207\u0207\u01f4 \u0173\u0173\u01c1\u01e9\u01fc\u01f5\u01f6\u01f6\u01f6\u01d4\u0181 \u0208\u0208 \u0201\u0202 \u0203\u0203\u0209\u0209\u020a\u0168\u0169\u0169 \u01ef \u01db\u01db \u01e2 ", - "\u0173\u0173 \u020b\u01e3\u01e3\u01e3 \u01fa\u01fa\u01fa \u01c5\u01ce\u01fe\u01fe\u0204 \u0205\u020c\u01dd\u0127\u0127\u0128\u01bd\u01bd\u01be\u0170 \u01e5\u01e5\u01e5\u01e5\u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u0207\u0207\u0207\u0207\u0207\u0207\u0207 \u0173\u0173\u01c1\u01e9\u01d6\u01d6\u01fc\u01fc\u01f5\u01f6\u01f6\u01d4\u020d \u0208\u0208\u020e \u0201\u0202 \u020f\u0203\u0209\u020a\u0210\u0210\u0210 \u01ef\u01db \u01db\u01db \u01e2 ", - "\u01c1\u0173\u0173 \u0211\u0212\u01e3\u01e3\u0213\u0213 \u01fa\u01fa\u01fa \u01c5\u01ce\u01fe\u01fe\u0204 \u0205 \u020c\u0127\u0127\u0128\u01bd\u01bd\u01bd\u0170 \u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u0214\u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u0207\u0207\u0207\u0207\u0207\u0207\u0207 \u0173\u0173\u01c1\u01e9\u01d6\u0177\u0177\u01f7 \u01fc\u01f5\u01f5\u0215\u0216\u020d\u0208\u0208 \u020e \u0201\u0202 \u020f\u020f\u0217\u0218\u0219\u0210\u0210\u0210\u01d9 \u01ef \u01db\u01db \u01e2 ", - "\u021a\u021a\u01c1\u0173\u0211 \u0212\u0212\u021b\u0213\u0213\u0213\u0213 \u01fa\u01fa\u01fa\u01c5\u01ce\u01fe\u0204\u0204\u0205 \u020c \u0127\u0128\u01bd\u01bd\u01bd\u0170 \u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u01ff\u021c\u0214\u0214 \u0207\u0207\u0207\u0207\u0207 \u0173\u0173\u01c1\u01e9\u01d6\u0177\u0177\u01f7 \u0181\u0181\u01fc\u021d\u021e\u021e\u0215\u020d\u020d \u0201\u0202 \u020f\u0217\u0217\u021f\u0218\u0220\u0220\u0210\u01d7\u01ee\u01d8\u01d9 \u01ef \u0221\u0221\u0221 \u01e2 ", - "\u0222\u021a\u021a\u0211\u0211\u0173 \u0212\u0212 \u021b\u0213\u0213\u0213\u0213 \u01c5\u01fa\u020c\u020c\u0204\u0205\u0205\u020c \u0127\u0127\u01bd\u01bd\u01bd\u0170\u01ff\u01ff\u01ff\u01ff\u01ff\u0223\u0224\u0224\u0225\u021c\u021c\u021c\u0214\u0214 \u0207\u0207\u0207\u0207\u0207 \u0173\u0173\u01c1\u01e9\u0226\u0177\u01d6\u01f7 \u0181\u0181 \u021d\u021e\u021e\u0215\u0215\u020d\u0197 \u0201\u0202 \u020f\u0217\u0217\u021f\u0220\u0220\u0220\u0227\u0227\u0227 \u01ee\u01ee\u01d8\u01d9 \u01ef \u0228 \u0221\u0221\u0221\u0221\u0221\u0221\u0221\u0221\u0221\u0221 ", - "\u0229\u0222\u021a\u0211\u0211\u0173\u0173 \u0212\u0212\u022a\u021b\u021b\u0213\u0213\u0213\u0213 \u020c\u0205\u020c \u0127\u0127\u0128\u01bd\u01bd\u01be\u01ff\u01ff\u01ff\u01ff\u01ff\u022b\u0223 \u021c\u021c\u021c\u022c\u022d \u0214\u0214\u0207\u0207\u0207 \u0173\u01c1\u01c1\u01e9\u0226\u01d6\u0177\u01f7 \u0181\u0181 \u021d\u021d\u021e\u021e\u0215\u020d\u020d \u0201\u0202 \u020f\u0217\u0217\u021f\u0220\u0220\u0220 \u022e \u0227 \u01d7\u01ee\u01d8\u01d9 \u01ef \u0228 \u01e2\u022f\u022f\u022f\u022f\u022f ", - " \u0229\u0229\u0222\u021a\u0211\u01c1\u0173\u0173 \u0230 \u021b\u021b\u0213\u0213\u0213\u0213 \u020c\u0127\u0127\u0128\u01bd\u01bd\u01bd\u01ff\u01ff\u01ff\u0231\u0232\u0232\u022b\u021c\u021c\u0224\u0224\u0225 \u022c\u022d \u0214\u0214\u0207 \u0173\u01c1\u01c1\u01e9\u01e9\u01d6\u0177\u01f7\u01f7\u0181\u0181 \u021d\u021e\u021e\u0215\u0215\u020d\u0197 \u0233\u0233\u0217\u0217\u021f\u0220\u0220\u0220 \u0234\u022e \u0227 \u01ee\u01ee\u01d8\u01d9 \u01ef \u0228 \u01e2 \u022f\u022f\u022f\u022f\u022f\u022f ", - "\u0235\u0235 \u0229\u0222\u021a\u021a \u01c1\u0173\u0230\u0230 \u021b\u021b\u0213\u0213\u0213\u0213\u0127\u0128\u01bd\u01bd\u01bd\u01ff\u01ff\u01ff \u0231 \u021c\u021c\u022b\u0223 \u0224\u0225\u0225\u022c\u022d\u0236 \u0173\u01c1\u01c1\u01e9\u01e9\u01d6\u01d6\u0177\u01f7\u0181\u0181 \u021d\u021d\u021e\u021e\u0215\u020d\u020d\u0237\u0238\u0239\u0239\u0239\u021f\u0220\u0220\u0220 \u023a \u0234 \u022e \u023b\u023b\u0227 \u01d7\u01ee\u01d8\u01d9 \u01ef \u0228 \u01e2 ", - " \u0235\u0235 \u0229\u0222\u021a\u021a\u0230\u0230\u0173\u0173\u0173 \u021b\u021b\u021b\u0213\u0213\u01bd\u01bd\u01bd\u01ff\u01ff\u01ff \u023c\u021c\u021c\u0232 \u022b \u0223\u0224 \u0225\u0236 \u0173\u01c1\u01c1\u01e9\u01e9\u01d6\u01d6\u01f7\u01f7\u0181\u0181 \u023d\u021d\u021e\u021e\u0215\u0237\u0237\u0237\u023e\u023f\u0240\u0241\u0220\u0220 \u023a\u023a \u0234 \u0242\u022e\u023b \u0227\u0227 \u01ee\u01ee\u01d8\u01d9 \u01ef \u0228 \u01e2 ", - " \u0235\u0235 \u0229\u0222\u0230\u0230 \u01c1\u01c1\u0173\u0173 \u021b\u0127 \u0243\u0243\u01ff\u01ff\u01ff \u023c\u0231 \u0232\u022b\u022b\u0223\u0236\u0224 \u0173\u0173\u01c1\u01e9\u01e9 \u01f7\u01f7\u01f7\u0181\u0181 \u023d\u023d\u023d \u021d\u0237\u0237\u0237\u0237\u023e\u023e\u023e\u0241\u0241\u0244 \u023a\u023a \u0234 \u0245\u0242\u0242 \u0227 \u01d7\u01ee\u01d8\u01d9 \u01ef \u0228 \u01e2 ", - "\u0246\u0246\u0246\u0246\u0246\u0235\u0235 \u0230\u0222\u021a\u021a\u021a\u01c1\u01c1\u0173\u0173\u0173 \u0247 \u0243\u0243\u0170\u01ff\u01ff \u023c \u0231\u0232 \u022b\u0236 \u0173\u0173\u01c1\u01e9\u01e9\u01e9\u01f7\u01f7\u01f7\u0181\u0181 \u023d\u023d\u0248 \u0249\u0237\u0237\u0237\u023e\u023e\u023e\u024a\u024a\u024b\u0244 \u023a\u023a \u0245 \u024c\u024c \u024d\u024e \u01d7\u01ee\u01d8\u01d9 \u01ef \u0228 \u01e2 ", - " \u0235\u0235\u024f \u0229\u0229\u0222\u021a\u021a\u021a\u01c1\u0173\u0173\u0250\u0250\u0251\u0243\u0243\u01ff\u01ff \u023c\u0231\u0236\u0232 \u0173\u0173\u01c1\u01e9\u01e9\u01e9\u01f7\u01f7 \u0181\u0181\u0181 \u0252\u0252\u0252\u0252\u0252\u0248\u0248\u0249 \u023e\u023e\u0253\u024a\u024a\u024b\u024b\u0254\u0255 \u023a \u0234 \u0256\u024d \u024e \u01d7\u01ee\u01d8\u01d9 \u01ef\u01ef \u0228 \u01e2 ", - "\u0257 \u0258\u0258\u0258 \u0259\u025a\u025a\u025a \u0229\u0229\u0222\u0222\u021a\u0250\u0250\u0251\u0251\u025b\u025b\u025c\u01ff \u025d\u025d \u023c\u0236 \u0173\u0173\u01c1\u01e9\u01e9\u01e9\u01f7\u01f7 \u0181\u0181\u0181 \u0252\u0252\u0252\u0252\u0252\u0252 \u025e\u0248\u0248 \u0222\u0222\u025f\u024a\u0260\u024b\u024b\u024b\u0254\u0254\u0255\u023a \u0256\u0256\u0256\u0256\u0256\u024c \u024e \u01d7\u01ee\u01d8\u01d9 \u01ef \u0228\u0228 \u01e2 ", - "\u0257\u0257\u0258\u0258\u0258 \u0259\u0261 \u025a\u025a\u025a \u0229\u0229\u0250\u0251\u0251\u025b\u025b\u025c\u025c \u025d\u025d\u025d\u025d \u0173\u0173\u0173\u01c1\u01e9\u01e9\u01e9\u01f7\u01f7 \u0181\u0181\u0181 \u0252\u0252\u0252\u0252 \u025e\u0222\u0222\u0222\u0262\u0263\u0264\u0260\u0260\u024b\u024b\u0215\u0254\u0254\u0255\u0265 \u024c \u024e\u024e \u01ee \u01d9\u01d9 \u01ef \u0228\u0228 \u01e2 ", - " \u0266\u0257 \u0259\u0267 \u0268\u0269 \u0250\u0250\u0251\u025b\u025b\u025c\u025c\u0181\u01c1\u0173\u0173\u01c1\u0173\u0173\u0173\u0173\u01c1\u0173\u01c1\u01c1\u01e9\u01e9\u01f7\u01f7\u01f7 \u0181\u0181\u0181 \u0252\u0252\u0252\u0252 \u0222\u0222\u0222\u0222\u0262\u0262\u026a\u0263\u026b\u026c\u024b\u024b\u021e\u021e\u0215\u0254\u0255\u0255\u0265\u0265\u0265\u0265 \u026d\u026d\u026d\u026d\u026d \u026e \u024e\u024e \u01d7\u01d7 \u01d9\u01d9\u01ef\u01ef \u0228 \u01e2 ", - "\u0266 \u0257\u0257 \u0261\u0261\u0267 \u026f \u0270\u0270\u0251\u025b\u025b\u025b\u025c\u0229\u0229\u0222\u0222\u0181\u0181\u0181 \u01e9\u01e9\u0271\u01f7\u01f7\u0181\u0181\u0181 \u0252\u0252\u0252 \u0222\u0222\u0222\u0222\u0262\u0262\u0262\u0262\u0272\u0272\u0263\u0273\u026c\u0274 \u021d\u021d\u021e\u0254\u0254\u0255\u020d\u020d\u0265 \u026d\u026d\u026d\u026d\u026d \u026d\u026d\u026e\u026d\u026d\u026d \u024e\u024e \u01d7\u01ee \u01d9 \u01ef \u0228 \u01e2 ", - "\u0266 \u0257\u0257 \u0261 \u0267 \u026f \u0270\u0270\u0275\u0275\u025b\u025b\u025c\u025c \u0229\u0229\u0222\u0181\u0181\u0181\u0181\u0181\u0181\u0181\u0181\u0181\u0181\u0276\u0276\u0276\u0252\u0252 \u0222\u0222\u0222\u0222\u0222\u0222\u0229\u0262\u0262\u0262 \u0272\u0277\u0263\u026b\u0278\u026c\u0279 \u027a\u021d\u021d\u0254\u0255\u0255\u027b\u020d\u027c \u026d\u026d\u026d \u027d\u027d\u027d\u027d\u027d\u027d\u027d\u027d\u027d \u026e \u026d\u026d\u026d \u01d7\u01d7\u01d8\u01d9\u01ef\u01ef \u0228 \u01e2 \u027e", - " \u0257\u0257\u0261 \u0267 \u026f \u0270\u0270\u0275\u0275\u027f\u027f\u025c\u025c\u0280 \u0281\u0282\u0229\u0229\u0222\u0222\u0222\u0276\u0276\u0276\u0276\u0276\u0222\u0222\u0222\u0222\u0222\u0222\u0222\u0222\u0229\u0262\u0262\u0262\u0262\u0262\u0262 \u0283\u0283\u0272\u0277\u0277\u026b\u0278\u0279\u0284\u0274 \u027a \u0254\u0254\u0255\u0215\u027c\u027c\u027c\u0285\u0286\u0287\u0288\u0288\u027d \u027d\u027d\u027d\u027d \u026d\u026d \u01d7\u01ee\u01d8\u01d9\u01ef \u0228\u0228 \u01e2 \u027e\u027e\u027e\u027e\u027e", - " \u0289\u0257 \u0267 \u026f \u0270\u0275\u0275\u027f\u027f\u028a\u028a \u0280 \u0281\u0281\u028b\u028b\u028b \u028c\u0276\u0276\u0276\u0276\u0229\u0229\u0262\u0262\u0262\u0262\u0262\u0262\u0262\u0262 \u0283\u028d\u028e\u0272\u0277\u0263\u0273\u0278\u0279\u0284\u0274 \u027a \u0254\u0255\u0255\u027c\u027c\u0285\u0285\u0286\u028f \u0288 \u027d\u027d\u027d \u026d\u026d \u01d7\u01ee\u01d8\u01d9\u01ef \u0228\u0228 \u01e2 \u027e\u027e\u027e\u027e\u027e\u027e\u0290\u0290\u0290", - " \u0289 \u0257\u0257 \u026f \u0270\u0270\u0275\u027f\u027f\u027f\u028a \u0280 \u0281\u0281\u028b\u028b \u028c\u028c\u028c \u0262\u0262\u0262\u0262\u0262\u0262 \u0283\u028d\u028d\u028d\u028e\u0277\u026b\u026b\u0278\u0279\u0284\u0274\u027a\u027a \u0254\u0255\u027c\u0285\u0285\u0286\u0286\u020d\u020d\u0291\u0292 \u027d\u027d\u027d \u026d \u01ee\u01ee\u01d8\u01ef\u01ef \u0228\u0228\u01e2\u01e2 \u027e\u027e\u027e\u027e\u027e\u027e\u0290\u0290\u0290\u0290\u0290\u0290 ", - " \u0289\u0289 \u0257\u0257 \u0270\u0270\u0275\u027f\u027f\u027f\u028a \u0280\u0281\u0281\u028b\u028b \u028c\u0262\u0262\u0262\u0262\u0262 \u0283\u028d\u028d\u028d\u028e\u0277\u0277\u0263\u0273\u0278\u0279\u0284\u0274\u027a\u027a \u0293\u0294\u027c\u0285\u0285\u0286\u021e\u0215\u027b\u020d\u0291\u0292 \u027d\u027d \u026d\u026d\u01d7\u01ee\u01d8\u01ef \u0228\u0228 \u027e\u027e\u027e\u027e\u027e\u027e\u0290\u0290\u0290\u0290\u0290\u0290 ", - " \u0289\u0289 \u0295\u0295\u0257\u0270\u0270\u0275\u0275\u027f\u027f\u028a\u028a \u0296\u028b\u028b \u028c\u028c\u0262\u0262\u0262 \u028d\u028d\u028e\u028e\u0277\u0277\u0297\u026c\u0278\u0284\u0284 \u027a\u027a \u0293\u0294\u0298\u0298\u0286\u0286\u021e\u021e\u021e\u0215\u020d\u020d\u0291\u0292\u0292\u0292\u0292 \u027d \u026d\u026d\u01d7 \u01d8\u01ef \u01e2 \u027e\u027e\u0299\u027e\u027e\u027e\u0290\u0290\u0290\u0290\u0290\u0290 ", - " \u0289 \u0295\u0295 \u029a\u029a\u0275\u0275\u027f\u027f\u029b\u029b \u0281\u0281\u028b\u0296 \u028c\u0262\u0262\u0262 \u029c\u029d\u028e\u028e\u0277\u0277\u026b\u026c\u0278\u0284\u0284 \u027a\u027a \u0293\u0298\u0298\u0286\u029e\u029f\u021d\u021e\u021e\u021e\u0215\u020d \u0292\u0292\u0292\u0292\u0292\u0292\u0292 \u027d\u027d \u026d\u01d7\u01d7\u01d8\u02a0\u01ef \u01e2\u01e2 \u02a1\u02a1\u02a1\u02a1\u027e\u0290\u0290\u0290\u0290\u0290\u0290 ", - " \u0289 \u0295\u0295 \u029a\u0275\u0275\u027f\u027f\u029b\u029b \u0281\u0281\u028b \u02a2\u02a2\u0262\u0262 \u029c\u029d\u028e \u0277\u0263\u0297\u026c\u0278\u0284\u0284 \u027a \u0293\u0298\u0298\u02a3 \u029f\u029f\u021d\u021d\u021e\u021e\u0215\u0215\u020d \u02a4 \u0292\u0292\u0292\u0292\u0292\u0292\u0292 \u027d\u027d \u026d\u01d7\u01d8\u01ef\u01ef \u02a5\u02a1\u02a1\u02a1\u02a6\u02a6\u02a6\u02a7\u02a7\u0290 ", - " \u0289 \u0295\u029a\u029a\u0275\u027f\u027f\u027f\u029b \u0281\u0281\u028b \u02a8\u02a9\u02a9\u02a9 \u029c\u029d\u028e \u0277\u0263\u026b\u026c\u0279\u0284\u0274\u027a\u027a \u0293\u0298\u0298 \u02aa\u029f \u021d\u02ab\u021e\u021e\u0215\u020d \u02a4 \u02ac\u0292\u0292\u0292\u0292\u0292\u0292\u027d\u027d \u01d7\u01ee\u01d8\u02a0 \u02a5\u02a5\u02a5\u02a5\u02a6\u02a6\u02a6\u02a6\u02a6\u02ad\u02ad ", - "\u0289\u0289 \u029a\u029a\u0275\u0275\u027f\u027f\u029b \u0281\u028b \u02ae\u02ae \u02a9\u02af \u029d\u028e\u028e\u02af\u0277\u026b\u0273\u026c\u0279\u0284\u0274\u027a\u027a \u0293\u0298 \u02aa\u02aa \u021d\u021d\u021e\u021e\u0215\u0215\u020d \u02a4 \u02ac \u027d\u027d \u026d\u02b0\u02b1\u02b2\u02b3\u02b3\u02b3\u02a5\u02a6\u02a6\u02a6 \u02ad\u02ad ", - "\u0289 \u029a\u029a\u0275\u0275\u027f\u027f\u029b\u02b4 \u02b5\u02b6 \u02a8\u02ae\u02ae \u02af \u029c\u029d\u028e\u028e\u0277\u0277\u0263\u026b\u0278\u0279\u0284\u0274\u027a\u027a \u0293\u0293\u0298 \u02aa\u02aa\u029f \u021d\u021d\u021e\u021e\u0215\u020d\u02b7 \u02a4 \u02ac \u027d \u026d\u02b3\u02b3\u02b8\u02b8\u02b8\u02b9 \u02ad\u02ad\u02ad\u02ad ", - " \u029a\u0275\u0275\u027f\u027f\u029b\u02b4\u02b4 \u02b5\u02b6 \u02a8\u02a8 \u02ba\u02af \u029c\u029d\u028e\u028e\u0277\u0263\u026b\u0273\u0278\u0284\u0284\u0274\u027a\u027a \u0293\u0293\u0298 \u02aa\u02aa \u029f \u02ab\u021d\u021e\u021e\u0215\u0215\u02bb \u02a4\u02a4 \u02ac \u027d \u02b3\u02b3\u02b8\u02b8\u02b8\u02b8\u01d9\u02bc\u02bc \u02ad\u02ad\u02ad\u02ad\u02ad ", - " \u029a\u029a\u0275\u027f\u027f\u029b\u02b4\u02b4 \u02b5\u02b5 \u02ae\u02ae \u02ba\u02ba \u02af \u029c\u029d\u028e\u02af\u0277\u0277\u0297\u0273\u0278\u0284\u0284 \u027a \u0293\u0293\u0298 \u02aa\u02aa \u029f \u021d\u02bd\u021e\u021e\u0215\u02bb\u02b7 \u02a4 \u02ac \u02be\u02b3\u02b8\u02b8\u02b8\u02b0\u02b2\u01d9\u01d9 \u02ad\u02ad\u02ad\u02ad\u02ad ", - " \u029a\u029a\u0275\u027f\u027f\u027f\u029b\u02b4 \u02bf\u02c0 \u02a8\u02ae \u02ba\u02ba \u02af \u029c\u029d\u028e\u02af\u0277\u0263\u026b\u026c\u0278\u0284\u0284\u027a\u027a \u0293\u0298\u0298 \u02aa\u02aa \u029f \u02bd\u021e\u021e\u0215\u0215\u02b7 \u02a4 \u02ac \u02be\u02be\u02be\u02c1\u02b8 \u026d\u02b0\u02b2\u01d9\u01d9 \u02c2\u02c3 \u02ad\u02ad\u02ad\u02ad\u02ad ", - " \u029a\u029a\u0275\u027f\u027f\u027f\u029b\u02b4 \u02c0 \u02a8\u02ae \u02ba\u02ba \u02af\u02af \u029c\u029d\u028e\u02af\u0277\u026b\u026b\u026c\u0279\u0284\u0274\u027a\u027a \u0293\u0293\u0298 \u02aa\u02aa \u029f\u029f \u02bd\u02bd\u021e\u021e\u0215\u02bb \u02a4 \u02ac \u02be\u02be\u02c1\u02c1 \u02b0\u02b1\u02b2\u01d9\u01d9 \u02c3\u02c3 \u02ad\u02ad\u02ad\u02ad ", - " \u029a\u0275\u0275\u027f\u027f\u029b\u02b4 \u02bf\u02c0\u02a8\u02ae \u02ba \u02af\u02af \u02c4\u02c4 \u029c\u029d\u028e\u028e\u0277\u0277\u0263\u0297\u0278\u0279\u0284\u0274\u027a\u027a \u0293\u0293\u0298 \u02aa\u02aa \u029f \u02bd\u021e\u021e\u0215\u02bb \u02a4 \u02ac \u02be\u02be\u02be\u02c1\u02c1 \u02b0\u02b0\u02b2\u01d9\u01d9 \u02c3 \u02ad\u02ad\u02ad\u02ad ", - " \u029a\u029a\u0275\u027f\u027f\u029b\u02b4\u02b4 \u02bf\u02c0\u02a8\u02ae \u02ba \u02af\u02c4\u02c4 \u029c\u029d\u028e\u028e\u0277\u0263\u026b\u0273\u0278\u0279\u0284\u0274\u027a\u027a \u0293\u0298\u0298 \u02aa\u02aa \u02c5\u02c5\u02c5\u02c5\u02c5 \u02bd\u021e\u021e\u0215 \u02a4 \u02ac \u02be\u02be\u02be\u02c1\u02c1 \u026d\u02b1\u02b2\u01d9 \u02c3 \u02ad\u02ad\u02ad\u02ad", - "\u02c6\u02c6 \u029a\u029a\u0275\u027f\u027f\u029b\u029b\u02b4 \u02bf\u02c0\u02a8\u02ae \u02ba \u02af \u029c\u029d\u028e\u028e\u0277\u0277\u0263\u0273\u0278\u0279\u0284\u0274\u027a \u0293\u0298 \u02aa \u02c5\u02c5 \u02c5\u02c5 \u02bd\u021e\u021e\u0215\u02b7 \u02a4\u02a4\u02a4\u02a4\u02a4\u02a4\u02a4 \u02ac \u02be\u02be\u02c7\u02c1\u02c8 \u026d\u02b0\u02b2\u02b2\u01d9 \u02c3 \u02ad", - " \u02c6\u029a\u029a\u0275\u027f\u027f\u027f\u029b\u02b4 \u02c0 \u02ae \u02ba\u02ba \u02af\u02af \u029c\u029d\u028e\u02af\u0277\u0263\u0297\u026c\u0278\u0284\u0284\u0274\u027a \u0293\u0293\u0298 \u02aa\u02c9 \u02c5\u02c5\u02c5 \u02c5 \u02bd\u021e\u02bb\u02bb \u02a4\u02a4\u02a4\u02a4\u02a4\u02be\u02be\u02be\u02c7\u02c7 \u02c8\u02c8 \u026d\u02b1\u02b1 \u01d9 \u02c3 ", - " \u029a\u029a\u0275\u0275\u027f\u027f\u029b\u02b4 \u02bf\u02c0\u02ae\u02ae \u02ba\u02ba \u02af\u02af\u02af\u029c\u029d\u028e\u02af\u0277\u0263\u026b\u026c\u0279\u0284\u0284\u027a\u027a \u0293\u0293 \u02ca\u02ca \u02cb\u02cb\u02c5\u02c5 \u02c5 \u02bd\u02bd\u02bb\u02cc \u02cd\u02cd\u02be\u02c7\u02c7 \u02ce\u02c8\u02cf\u02cf \u026d\u02b0\u02b2 \u01d9 \u02c3\u02c3 ", - " \u029a\u029a\u0275\u027f\u027f\u029b\u02b4\u02b4 \u02c0\u02c0\u02a8\u02ae \u02ba\u02ba \u029c\u028e\u028e\u02af\u0277\u0263\u0297\u026c\u0278\u0284\u0284\u027a\u027a \u0293\u02d0 \u02ca \u02cb \u02c5 \u02c5\u02d1\u02d1\u02bb \u02cd\u02cd\u02d2\u02d2 \u02ce\u02ce\u02ce \u02c8 \u02cf \u026d\u02b1\u02b2\u01d9\u01d9 \u02c3\u02c3 ", - "\u029a\u029a\u0275\u027f\u027f\u029b\u029b\u02b4 \u02bf\u02c0\u02a8\u02ae \u02ba\u02ba \u029d\u028e\u028e\u0277\u0277\u02d3\u026b\u026c\u0279\u0284\u0274\u027a\u027a \u0293\u02d4\u02d0 \u02ca \u02c5\u02c5 \u02c5\u02c5\u02c5\u02bd\u02bd\u02bb\u02b7 \u02cd\u02cd\u02c7\u02c7\u02d5 \u02c8\u02cf\u02cf \u02b0\u02b0\u02b2\u01d9\u01d9 \u02c3 ", - "\u029a\u0275\u027f\u027f\u027f\u029b\u02b4 \u02c0\u02a8\u02ae \u02ba\u02ba \u029d\u028e\u028e\u0277\u0277\u02d3\u0273\u0278\u0279\u0284\u0274\u027a\u027a \u0293\u0293\u02d0 \u02d6\u02d6\u02ca \u02c5\u02c5\u02c5 \u02d7\u02bd\u02bd\u02bb \u02cd\u02cd\u02c7\u02c7 \u02d5 \u02c8\u02c8\u02cf\u02cf \u026d\u02b1\u02b2\u01d9 \u02c3 ", - "\u0275\u027f\u027f\u027f\u029b\u02b4 \u02bf\u02c0\u02ae \u02ba\u02ba \u02af\u029d\u028e\u028e\u0277\u0277\u02d3\u02d8\u02d9\u0279\u0284\u0274\u027a \u0293\u02d0 \u02d6\u02d6\u02ca \u02d7\u02bd\u02bb\u02bb \u02cd\u02cd\u02c7\u02c7 \u02d5 \u02c8\u02c8\u02cf \u02b0\u02b2\u02b2\u01d9 \u02c3 ", - "\u0275\u027f\u027f\u029b\u02b4\u02b4 \u02c0\u02c0\u02a8\u02ae \u02ba \u02af\u02af\u029d\u029d\u028e\u02da\u0277\u02db\u02dc\u02d9\u02dd\u0284\u0274\u027a \u0293\u0293\u02d0 \u02d6\u02d6 \u02ca \u02d7\u02bd\u02bd\u02bb\u02b7 \u02cd\u02cd\u02c7\u02c7 \u02d5 \u02c8 \u02cf \u02b1\u02b2 \u01d9 \u02c3\u02c3 ", - "\u027f\u027f\u029b\u02b4\u02b4 \u02bf\u02c0\u02ae\u02ae \u02ba \u02af\u02af \u029d\u028e\u028e\u02da\u0277\u02d8\u02dc\u02dd\u02de\u02df\u027a\u027a \u0293\u0293\u02d0 \u02d6 \u02ca\u02ca \u02d7\u02bd\u02bd\u02bb\u02b7\u02b7\u02cd\u02cd\u02c7\u02c7 \u02d5 \u02c8 \u02cf \u02b0\u02b0\u02b2\u01d9\u01d9 \u02c3\u02c3 ", - "\u027f\u029b\u029b\u02b4 \u02bf\u02c0\u02a8\u02ae \u02ba \u02af \u029d\u028e\u028e\u02da\u0277\u02d8\u02dc\u02dd\u02df\u02df\u027a\u027a \u0293\u0293\u02d0 \u02d6 \u02ca \u02d7\u02d7\u02bd\u02bd\u02bb\u02bb\u02cd\u02cd\u02c7\u02c7\u02e0\u02e0\u02e1 \u02d5 \u02c8 \u02cf \u02b0\u02b1\u02e2\u01d9\u01d9 ", - "\u027f\u029b\u02b4 \u02bf\u02c0\u02ae \u02ba\u02ba \u02af \u029d\u028e\u028e\u02da\u0277\u02dc\u02d9\u02dd\u02df \u027a\u027a \u0293\u0293\u02d0 \u02d6\u02d6 \u02ca \u02d7\u02d7\u02bd\u02cc\u02e3\u02cd\u02e4\u02c7 \u02e1\u02e1\u02e1\u02d5\u02d5\u02d5\u02d5\u02d5 \u02c8\u02c8\u02e5\u02cf \u02b0\u02b1\u02b2\u01d9 ", - "\u029b\u02b4 \u02c0\u02c0\u02a8 \u02ba\u02ba \u02af\u029d\u028e\u02da\u02da\u0277\u02d9\u02dc\u02df\u02df \u027a\u027a \u0293\u02e6\u0293 \u02d6\u02d6 \u02ca \u02e7 \u02d7\u02bd\u02bd\u02e3\u02cc\u02e4\u02c7 \u02d5\u02d5\u02d5\u02d5\u02d5\u02d5\u02d5\u02c8\u02c8\u02e5\u02cf \u02e8\u02b1\u02e9\u01d9 ", - "\u02b4\u02b4 \u02bf\u02c0\u02ae\u02ae \u02ba\u02ba \u02af\u02af\u02da\u02da\u0277 \u02d9\u02de\u02de \u027a\u027a \u0293\u02e6\u02d0 \u02d6\u02d6 \u02ca\u02ca \u02e7\u02e7 \u02d7\u02ea\u02ea\u02cc\u02eb\u02c7 \u02d5\u02c8\u02e5\u02e5\u02cf \u02b0\u02b2\u02e2\u01d9 ", - "\u02b4 \u02bf\u02c0\u02a8\u02ae \u02da\u0277\u0277 \u02dd\u02de \u027a\u027a \u02e6\u02e6\u02d0 \u02d6\u02d6 \u02ca\u02ca \u02e7 \u02ec\u02ea\u02ea\u02ea\u02cc\u02cc\u02ed \u02ee\u02c8\u02e5\u02cf\u02cf \u02b0\u02e8\u02e9\u02e9\u01d9 ", - " \u02bf\u02a8\u02ae \u02da\u0277\u0277 \u02dd\u02ef \u027a\u027a\u0293\u0293\u02d0 \u02d6 \u02ca\u02ca \u02e7 \u02ec\u02ec\u02f0\u02f1\u02f1\u02d7\u02ed\u02ed\u02ed\u02ed \u02ee \u02c8\u02e5\u02cf\u02cf \u02f2\u02f2 \u02b0\u02e8\u02b2\u01d9\u01d9 ", - " \u02c0\u02c0\u02a8 \u02da\u0277\u02f3\u02ef\u02dd \u027a\u0293\u0293\u02d0 \u02d6\u02d6 \u02ca\u02ca \u02e7 \u02ec\u02ec\u02f1\u02f1\u02f4\u02f5\u02f5\u02ed\u02ed\u02ed\u02ed\u02ed\u02ed \u02ee \u02c8\u02c8\u02e5\u02cf\u02cf\u02f2\u02f2 \u02e8\u02b1\u02e9\u01d9\u01d9 ", - " \u02bf\u02c0\u02ae \u02da\u02da\u0277\u02f3\u02f6\u02ef\u027a\u027a\u0293\u0293\u0293 \u02d6\u02d6 \u02ca \u02e7 \u02f7\u02ec\u02ec\u02f1 \u02f4\u02f5\u02f5\u02f5\u02ed\u02ed\u02ed\u02ed\u02ed\u02ed\u02ed\u02ed\u02ed\u02ed\u02ed\u02ed\u02ed\u02f8\u02ed \u02f9\u02e5\u02e5\u02f2\u02f2 \u02b0\u02b1\u02e2\u01d9\u01d9 ", - "\u02bf\u02c0\u02a8\u02ae \u02da\u02da\u0277\u02f3\u02f6\u02fa\u02fb\u02fb\u0293\u0293\u02d0 \u02d6\u02d6 \u02ca\u02ca \u02e7 \u02fc\u02f7\u02ec\u02f1\u02f1 \u02f4\u02f5\u02f5\u02f5\u02f5\u02ed\u02ed\u02ed\u02ed\u02ed\u02ed\u02ed\u02ed\u02ed\u02f8\u02f8\u02ed\u02ed\u02ed\u02ed\u02ed\u02ed\u02f9\u02e5\u02e5\u02cf \u02b0\u02b0\u02b2\u02e2\u01d9\u01d9 ", - "\u02bf\u02ae\u02ae \u02da\u0277\u0277\u02f6\u02f6\u02fa\u02fb\u0293\u0293\u02d0 \u02d6\u02d6 \u02ca\u02ca \u02e7 \u02f7\u02f7\u02f7\u02ec\u02f1 \u02f4\u02f4\u02f5\u02f5\u02f5\u02f5\u02f5\u02f5\u02f5\u02f5\u02f5\u02f5\u02f5\u02f8\u02f5\u02f5\u02ed\u02ed\u02ed\u02ed\u02ed\u02f9\u02ed\u02e5\u02e5\u02cf \u02b0\u02b0\u02b2\u02e2\u01d9 ", - "\u02a8\u02ae \u02da\u0277 \u02f6\u02f6\u02fa\u02fb\u0293\u0293 \u02d6 \u02ca\u02ca \u02fc \u02f1\u02f1 \u02f4\u02f4\u02f4\u02f4\u02f5\u02f4\u02f4\u02f4\u02f4\u02f4\u02f8\u02f5\u02f5\u02f5\u02f5\u02f5\u02f5\u02f5\u02ed\u02ed\u02f9\u02ed\u02ed\u02e5\u02cf \u02b0\u02b1\u02b2 \u01d9 ", - "\u02ae \u02da\u02da\u0277 \u02fa\u02fa\u02fb\u0293\u02d0 \u02ca\u02ca \u02f5\u02f5\u02f5\u02f9\u02ed\u02ed\u02ed\u02cf\u02cf \u02b0\u02b1\u02b2 \u01d9 ", - "\u02ae \u02da\u02da\u0277 \u02fa\u02fa\u02fb\u0293\u02d0 \u02ca \u02f9\u02f5\u02ed\u02ed\u02ed\u02ed\u02cf \u02b0\u02b2\u02b2\u01d9\u01d9 ", - " \u02da\u0277\u0277 \u02fa\u02fa\u0293\u0293\u02d0 \u02ca\u02ca \u02f5\u02f5\u02f5\u02ed\u02ed\u02ed\u02cf \u02b0\u02b0\u02b2\u02b2\u01d9\u01d9 ", - " \u02da\u02da\u0277 \u02fa\u02fa\u0293\u0293 \u02ca\u02ca \u02f5\u02f5\u02ed\u02ed\u02ed\u02cf \u02b0\u02b1\u02b2\u02b2\u01d9 ", - " \u02da\u02da\u0277 \u02fa\u02fb\u0293\u02d0 \u02ca\u02ca \u02f5\u02f5\u02ed\u02ed\u02ed\u02cf \u02b0\u02b1\u02b2 \u01d9 ", - " \u02da\u0277 \u02fa\u02fb\u0293\u02d0 \u02ca\u02ca \u02f5\u02f5\u02ed\u02ed\u02ed\u02cf \u02b0\u02b1\u02b2 \u01d9 ", - " \u02da \u02fa\u02fa\u02fb\u0293\u02d0 \u02f5\u02ed\u02ed\u02ed\u02cf \u02b0 \u02b2\u01d9\u01d9 ", - " \u02fa\u02fa\u0293\u0293\u02d0 \u02f5\u02ed\u02ed\u02ed\u02cf \u02b0\u02b1\u02b2\u02b2\u01d9 ", - " \u02fa\u02fa\u0293\u0293\u02d0 \u02f5\u02ed\u02ed\u02ed\u02cf \u02b0\u02b1\u02b2 \u01d9 " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/road-casings-grouped-rendering-600-600-2.0-grid-reference.json b/tests/visual_tests/grids/road-casings-grouped-rendering-600-600-2.0-grid-reference.json deleted file mode 100644 index 47f94f0ea..000000000 --- a/tests/visual_tests/grids/road-casings-grouped-rendering-600-600-2.0-grid-reference.json +++ /dev/null @@ -1,847 +0,0 @@ -{ - "keys": [ - "", - "330", - "155", - "74", - "57", - "788", - "774", - "201", - "202", - "181", - "228", - "691", - "523", - "73", - "749", - "530", - "385", - "384", - "286", - "1", - "156", - "531", - "361", - "45", - "43", - "93", - "46", - "527", - "589", - "288", - "215", - "605", - "138", - "532", - "588", - "154", - "362", - "348", - "328", - "639", - "635", - "637", - "638", - "529", - "497", - "576", - "300", - "329", - "237", - "636", - "600", - "103", - "534", - "595", - "137", - "232", - "593", - "136", - "104", - "14", - "180", - "526", - "592", - "594", - "323", - "490", - "327", - "203", - "256", - "258", - "528", - "415", - "442", - "342", - "596", - "157", - "343", - "331", - "257", - "89", - "598", - "599", - "367", - "344", - "335", - "277", - "597", - "276", - "275", - "107", - "126", - "113", - "369", - "108", - "590", - "407", - "414", - "147", - "99", - "97", - "124", - "122", - "110", - "472", - "591", - "153", - "100", - "102", - "173", - "174", - "481", - "336", - "406", - "75", - "159", - "96", - "72", - "200", - "266", - "265", - "263", - "269", - "231", - "419", - "179", - "182", - "525", - "371", - "370", - "391", - "313", - "390", - "183", - "417", - "411", - "392", - "315", - "473", - "479", - "446", - "146", - "475", - "474", - "401", - "421", - "445", - "483", - "551", - "480", - "356", - "476", - "583", - "324", - "389", - "839", - "462", - "655", - "325", - "393", - "724", - "440", - "267", - "227", - "620", - "477", - "582", - "268", - "535", - "464", - "299", - "16", - "271", - "259", - "225", - "247", - "463", - "693", - "270", - "548", - "467", - "465", - "422", - "418", - "261", - "489", - "633", - "466", - "238", - "244", - "246", - "482", - "634", - "671", - "333", - "326", - "239", - "248", - "488", - "448", - "245", - "484", - "460", - "332", - "378", - "25", - "577", - "461", - "471", - "381", - "188", - "565", - "470", - "469", - "334", - "379", - "355", - "284", - "279", - "175", - "668", - "550", - "562", - "373", - "665", - "354", - "632", - "485", - "570", - "575", - "673", - "131", - "404", - "587", - "585", - "549", - "663", - "41", - "285", - "739", - "478", - "40", - "262", - "690", - "78", - "145", - "358", - "226", - "260", - "283", - "687", - "486", - "133", - "672", - "95", - "121", - "322", - "195", - "264", - "177", - "396", - "321", - "359", - "15", - "402", - "55", - "686", - "619", - "641", - "615", - "397", - "59", - "236", - "282", - "204", - "786", - "618", - "614", - "376", - "58", - "773", - "212", - "692", - "584", - "400", - "56", - "199", - "375", - "374", - "31", - "405", - "640", - "579", - "670", - "319", - "357", - "505", - "743", - "493", - "50", - "92", - "38", - "784", - "847", - "320", - "841", - "213", - "568", - "741", - "492", - "39", - "840", - "254", - "747", - "827", - "607", - "53", - "398", - "439", - "753", - "224", - "158", - "438", - "214", - "835", - "223", - "626", - "5", - "54", - "61", - "119", - "838", - "302", - "62", - "52", - "22", - "165", - "494", - "13", - "769", - "622", - "491", - "301", - "423", - "118", - "252", - "222", - "631", - "317", - "318", - "495", - "36", - "304", - "697", - "630", - "123", - "760", - "621", - "674", - "2", - "253", - "255", - "846", - "77", - "453", - "3", - "710", - "771", - "708", - "628", - "291", - "383", - "308", - "830", - "726", - "617", - "625", - "564", - "581", - "295", - "292", - "365", - "722", - "845", - "624", - "656", - "666", - "42", - "294", - "732", - "694", - "623", - "627", - "606", - "580", - "456", - "47", - "716", - "507", - "629", - "654", - "653", - "293", - "23", - "613", - "65", - "48", - "144", - "459", - "836", - "780", - "184", - "457", - "125", - "844", - "139", - "616", - "679", - "681", - "682", - "458", - "29", - "833", - "834", - "831", - "719", - "825", - "842", - "166", - "511", - "26", - "27", - "30", - "772", - "219", - "220", - "610", - "675", - "17", - "518", - "509", - "63", - "770", - "768", - "689", - "221", - "506", - "677", - "35", - "37", - "120", - "766", - "738", - "680", - "678", - "730", - "740", - "676", - "443", - "714", - "745", - "832", - "755", - "11", - "444", - "703", - "717", - "826", - "501", - "142", - "642", - "117", - "713", - "130", - "742", - "767", - "503", - "20", - "18", - "731", - "808", - "185", - "170", - "727", - "90", - "521", - "569", - "70", - "191", - "234", - "515", - "513", - "522", - "701", - "311", - "545", - "684", - "556", - "517", - "516", - "514", - "733", - "211", - "141", - "519", - "699", - "350", - "310", - "210", - "64", - "520", - "303", - "725", - "729", - "524", - "450", - "744", - "822", - "349", - "192", - "135", - "746", - "815", - "813", - "820", - "189", - "190", - "546", - "643", - "24", - "33", - "34", - "510", - "705", - "721", - "712", - "193", - "553", - "538", - "555", - "817", - "707", - "559", - "539", - "795", - "818", - "351", - "603", - "604", - "76", - "750", - "794", - "683", - "206", - "544", - "706", - "819", - "779", - "783", - "787", - "789", - "711", - "32", - "807", - "805", - "793", - "297", - "852", - "235", - "105", - "44", - "542", - "759", - "791", - "290", - "347", - "289", - "160", - "536", - "51", - "757", - "728", - "811", - "781", - "785", - "169", - "810", - "778", - "541", - "504", - "98", - "709", - "148", - "134", - "748", - "809", - "704", - "426", - "163", - "149", - "4", - "752", - "346", - "341", - "305", - "167", - "162", - "754", - "12", - "109", - "67", - "828", - "540", - "340", - "10", - "168", - "824", - "112", - "554", - "763", - "68", - "756", - "428", - "106", - "229", - "829", - "496", - "128", - "127", - "161", - "249", - "761", - "782", - "176", - "132", - "688", - "561", - "537", - "306", - "19", - "432", - "307", - "309", - "111", - "171", - "129", - "164", - "250", - "178", - "695", - "21", - "116", - "804", - "775", - "197", - "360", - "803", - "802", - "800", - "806", - "801", - "799", - "798", - "797", - "217", - "216", - "718", - "150", - "843", - "720", - "790", - "338", - "152", - "69", - "151", - "7", - "86", - "8", - "207", - "218", - "796", - "451", - "88", - "6", - "172", - "777", - "558", - "452", - "209", - "208", - "776" - ], - "data": {}, - "grid": [ - " !! ##$$ %%%%&&' (( )))) *** + ", - " !! ##$$ %%%,&& (( )))) **** ++ ", - " - . !! ###$$ %%%/,'' (( )))) **** ++ ", - " -- ... !! ###$$ %%//&' (( )))) **** +++ ", - " -- 00 ... !! ###$$1 22%%%/&&' (( )))33 *** +++ ", - " -- 00 .... !! ###$$1 222%%%,&&44 (( )))33 **** ++ ", - " -- 00 5.... !! ###$$1 222%%%/,'4444 (( ))))33 **** +++ ", - " -- 00 655.... !! 7777777 8##$$112229%%//&'4444 (( ))) 333**** ++++ ", - " -- 00 65555.... !! 7777777 ###$$112229%%/&&'4444 ( ))) 33*** ++++ ", - " -- 00 66 5555...:. !! 77 ##;$$12229%%%,&&4444 ( )) 33** ++++ ", - " << 00 66= 5555.:::. !! 77 ###$$$12229%%%,&'4444 (( ))>>*33* ++++++ ? ", - " <<<<<< @ 0 66=== 5555::.... !! 77 ###A$$1229%%//,''444 ( )) >>333++++++++ ???? ", - " -- <<<<<<@ BBB 666 ==C CC555D...... !! 77 EEEEF ###AAAG1299%%/&&'4444 ( )))*>*33+++ ??? ???? ", - " --HHIJJK<>> ? 1 9@@ 667<<000 !! 8 #..$=422 :%%&',,55; ( )) A**3 ------- BBBB ", - " / C>>>> ? D 9 @E EE66F 0000 ! 8 ##.GG=42 ::%%+',555 ( ) H 3--- BB BB ", - " / CI J>>KKK DDDD 9 E EEE ELFFF 000 ! MMMMMMNN #O.G= ::%%&+ ,55; ( ) * 3- B ", - " //PPPPPJ Q DDDDD99 E EE L FFF 000 ! R R N## GGS: :::%&+',555 ( )) **TT BB ", - " / PC IJPPQ DD EE EE UUU FFF 0000 ! R R #VVGS.::::%%&' ,55; () TT - BBBBBBBBB ", - "W/ PXXIJP Q EE E YYUUU FFF 000 ! R R ZZ VSS[:::%%&+', 55 ) TT] - BB ^ ", - "//PPP JP Q E E __YYY UU FFF 000 ! R R ZZ``Saa[[ %%&' ,555 ))TT] - BB ^ ", - "bb C PPPPQ E E c __ YY U dFF ee0 ! R RR Z``fg [[[%%&',,55 hh T ] - B ^^ ", - "/bbbb J Q EE LLLcc ___YY dd FFF e000 ! RRR ZZ``fg [[%&+',555 hhiT ] - B ^^ ", - " bbbbQ j kkk ccc__ d FFFe 000 !!l ZZ`mmmmm [%%&+ ,555 hh iT ] - B nnn ", - " o jj kkkccc d p qFFF 00r lll Z``stttmm[%%+', 55 hh iT ]]- B uun ", - " o jj kkkk d vvppq FFFF rr00llllll wZ` sx tm%%&+',55;y hh iT ]z-- B ^ u {{{{{{{{{{", - " oo jjjjj kkd ||vvvqpp FFFr 0000llll ZZ` s}}}m[%%&'~,55 yyh iT \u007f\u007f\u007f zzzzzz--- B {{{{{{\u0080{{{{{{{{{{{{{\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081", - " o j kk|||qvv pp rrFF 00000l Z`` ssssm[%%&',555 hh iT\u007f\u007f \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0083\u0083{{{{{{{{{{\u0081\u0081\u0081\u0081\u0081\u0080\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081 ", - " o j kkk q| vv\u0084\u0085\u0086\u0087 FFF\u0088\u0088\u008800000Z`\u0089\u008a\u008bx \u008cm%%&+',55\u008d\u008dh\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u008e\u008e\u008e\u008e\u008e\u008e\u008e\u008e\u008e\u008f\u008f\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0090\u0081\u0081 ", - " o j kq |||\u0084\u0084\u0091\u0087\u0086\u0086 \u0092\u0088\u0088\u0088\u0088\u0088\u0088\u0093\u0094`\u0095\u0095\u0095\u0095\u0095\u0095\u0095\u0096\u0096\u0096+\u0096,\u0096\u0096\u0096\u008d\u008d\u0082\u0082\u0082\u0082\u0082\u0097\u0097\u0097\u008e\u008e\u008e\u008e\u008e\u008e\u008e\u008e\u008e\u008e\u008e\u008e\u0098 -- \u0099 \u0090 ", - " o jj \u009a\u009b\u009a kkk| \u009c\u0087\u0091\u0091 \u0086\u0086 \u0092\u0092\u009d\u009d\u0088\u0088\u009e\u009f\u009f\u009f\u009f\u009f\u009f\u009f\u00a0\u00a0\u00a0&+\u00a0,\u00a0\u00a0\u0097\u0097\u00a1\u0097\u0097\u0097\u0097 \u00a2\u00a3\u00a4\u00a5\u00a5\u00a6 \u00a7\u00a7\u00a7\u00a7--- \u0099\u0099 \u0090 ", - " o jj \u009a\u009a\u009b \u009a\u009a\u009a k \u0087\u009c \u0091 k\u00a8\u009d\u00a9\u00aa\u009e\u00ab\u00ab\u00acx\u00ad %%%&',55 \u00ae \u00a2\u00a3 \u00af\u00af\u00a6\u00a7-- \u0099 \u0090 ", - " o j \u009a \u009b \u009a kkkkkkkkkk\u00b0kkk \u009d\u009d\u009e\u009e\u00b1\u00b2 x\u00b3 %%&&',55 \u00ae \u00a2\u00a3 \u00af - \u0099\u0099 \u0090 ", - "\u00b4\u00b4\u00b4 o j \u009a \u009b \u00b5 \u00b6\u00a8\u009d\u009e\u009e\u00b1\u00b2x \u00ad\u00b3 %%&+',55 \u00ae \u00a2\u00a3\u00b7\u00af - \u0099 \u0090 ", - " \u00b4\u00b4\u00b4o j \u009a\u009a \u009b\u009b \u00b8\u00b9 \u00b5 \u00b6\u00a8\u00ba\u009e \u00b1\u00b2x\u00ad \u00b3%%%&+',55 \u00ae \u00a2\u00a3\u00b7\u00af - \u0099 \u0090 ", - " \u00b4\u00b4\u00b4 jj \u009a\u009a \u009b \u00bb\u00bc \u00b8\u00b9\u00b9\u00b9 \u00bd\u00bd\u00bd\u00bd\u00be \u00bf\u00ba\u00ba\u009e\u00b1 \u00b2x\u00ad\u00b3 %%%&+',5\u00c0 \u00ae \u00a2 \u00a3\u00b7\u00af - \u0099 \u0090 ", - "\u00c1 \u00b4\u00b4\u00b4 jj \u009a \u009b \u00bb \u00bc\u00bc\u00bc \u00c2 \u00b9\u00b9 \u00bd\u00bd\u00bd \u00be \u00bf\u00ba\u009e\u009e\u00b1\u00b2 x\u00ad\u00b3 %% &+'55\u00c0 \u00ae \u00a2\u00a2\u00a3\u00b7\u00b7\u00af - \u0099 \u0090 ", - " \u00c1\u00c1 \u00b4\u00b4 j \u009a\u00c3 \u009b\u009b\u009b\u00bb \u00c4\u00c4\u00c2\u00b8 \u00b9 \u00c5 \u00c6 \u00bf\u00bf\u00ba\u009e \u00b1\u00b2x\u00ad\u00ad\u00b3 %% &+'55\u00c0 \u00ae \u00a2\u00a3\u00a3\u00b7\u00b7\u00af- \u0099 \u0090 ", - " \u00c1\u00c1 j \u009a\u009a\u00c3 \u009b\u00c7\u00c7 \u00c8 \u00b8\u00b8\u00b8\u00b8\u00b8\u00b9 \u00c5 \u00c6 \u00bf\u00c9\u00ba\u009e \u00ca\u00ca\u00b2\u00cb\u00b3\u00b3 %% \u00cc\u00cd,55 \u00ce \u00ae \u00a2 \u00a3 \u00b7\u00cf\u00cf- \u0099 \u0090 ", - " \u00c1\u00d0\u00d0\u00d0 jj j \u009a\u009a\u00c3\u00c3\u00d1\u00d1\u00d1\u00d1\u00d1\u00bb\u00d1 \u00d2\u00c7 \u00c8 \u00b9 \u00c5 \u00c6\u00c6 \u00bf\u00ba\u00ba\u009e \u00b2\u00cb\u00b3 %%%&\u00cc',55 \u00ce \u00ae \u00a2\u00a2\u00d3\u00d3\u00d4\u00d5 -- \u0099 \u0090 ", - " \u00c1\u00c1\u00d0\u00d0j jj \u009a\u00d1\u00d1\u00c3 \u00d6\u00d1\u00d1\u00d2 \u00c7\u00c8 \u00b9 \u00c5 \u00c6 \u00bf\u00ba\u009e\u009e x\u00cb\u00ad \u00d7%%&\u00cc',55 \u00ce \u00ae\u00ae \u00a2\u00d8\u00d3 \u00d5\u00d5 - \u0099 \u0090 ", - " \u00c1\u00c1 \u00d0\u00d0 \u009a\u00d1\u00d1 \u00c3\u00c3\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00da \u00d1\u00d1\u00c8 \u00b9 \u00c5 \u00c6 \u00db\u00bf\u00ba\u009e x\u00cb\u00ad %%%&\u00dc',55\u00ce\u00c0 \u00ae \u00a2\u00a2\u00dd\u00de \u00d5 - \u00df\u00df\u0099\u0099 \u0090 ", - " \u00c1\u00c1 \u00d0\u00d0 \u009a\u00e0\u00d1 \u00d9\u00d9 \u00e1 \u00d9\u00d9\u00d9 \u00e2\u00d1\u00d1 \u00b9 \u00c5 \u00e3\u00c6 \u00bfx\u00ba\u009e x\u00cb\u00ad \u00d7%% &\u00dc',55 \u00c0 \u00ae \u00a2 \u00de\u00de \u00d5 - \u00e4\u00df \u0099 \u0090 ", - " \u00c1 \u00d0\u00d0 \u009a\u009a\u00d1\u00e0\u00e0\u00e0 \u00e5\u00e5\u00e1\u00e5 \u00d9\u00e2 \u00d1 \u00b9 \u00c5 \u00c6 \u00bf\u00ba\u00ba\u009e x\u00cb\u00ad \u00d7%% &\u00cc',55 \u00c0 \u00ae \u00a2\u00a2 \u00dd\u00dd \u00d5 -- \u00e6\u00e7\u00e8 \u0099\u0099 \u0090 ", - " \u00c1 \u00e9 \u009a \u00d1\u00ea\u00ea\u00ea \u00e5 \u00e5\u00e5 \u00eb\u00d9\u00d9 \u00d1 \u00b9 \u00ec\u00ec \u00ed \u00bf\u00ba\u009e\u009e x\u00cb\u00ad \u00d7%% &\u00dc',55 \u00c0 \u00ae \u00a2 \u00dd\u00dd\u00dd -- \u00e6\u00e6\u00e7\u00e8 \u0099 \u0090 ", - " \u00c1\u00c1 \u00e9\u00ee \u00ef\u009a \u00d1\u00f0\u00f0\u00d9 \u00e5\u00e5 \u00eb\u00e5 \u00d9\u00d9 \u00d1\u00d1 \u00b9 \u00f1\u00f1\u00ec\u00ec\u00ec \u00ed \u00bf\u00ba\u009e\u009e x\u00cb\u00ad \u00d7%% &\u00cc',55 \u00c0 \u00ae \u00a2 \u00dd\u00dd\u00dd\u00dd- \u00e6\u00f2\u00f3\u00f3\u00f3\u0099 \u0090 ", - " \u00c1 \u00ee\u00ee\u00ef\u00ef \u009a\u00d1\u00f4\u00f0\u00d9 \u00e5 \u00e5 \u00d9\u00f5\u00f5\u00d1 \u00b9 \u00f6\u00f6\u00f1\u00f1\u00f1\u00ec\u00ec \u00ed \u00f7\u00bf\u00ba\u009e x\u00cb\u00ad \u00d7%% &\u00dc' 55 \u00c0 \u00ae \u00a2\u00a2 \u00d5\u00d5 - \u0099 \u0090 ", - " \u00c1 \u00f8\u00ef\u00f9\u00f9\u00f9\u00f9\u009a\u00d1 \u00d9 \u00fa\u00e5 \u00e5 \u00d9\u00f5 \u00d1 \u00b9 \u00f6\u00f6\u00f1\u00f1\u00ec \u00ed \u00fb\u00f7\u00f7\u00f7\u00f7\u00f7 x\u00cb\u00ad \u00d7\u00d7%% &\u00cc' \u00fc\u00fc \u00c0 \u00ae\u00ae \u00a2\u00a2 \u00d5 - \u0099 \u00fd ", - " \u00f8\u00f8\u00f8 \u00f9\u009a\u00d1 \u00d9\u00fa \u00e5\u00e5 \u00e5 \u00d9 \u00d1\u00b9\u00b9 \u00f6\u00f1\u00ec\u00ed\u00ed \u00fb\u00bf\u00ba\u009e\u009e\u00f7 x\u00cb\u00ad \u00d7\u00d7%% &\u00cd'\u00fc\u00fc\u00fe \u00c0 \u00ae \u00a2\u00a2 \u00d5 - \u0099 \u00fd ", - " \u00f8 \u00ef\u00ef\u00f9\u00f9\u009a \u00d1 \u00d9 \u00e5\u00ff\u00e5\u00e5 \u00e5\u00e5 \u00d9 \u00d1\u00b9 \u00f6\u00f6 \u00bf\u00ba\u009e\u00f7 x\u00cb\u00ad\u00ad \u00d7%% &\u00cd'\u00fc\u00fc\u00fe \u00c0\u00c0 \u00ae \u00a2 \u00d5 - \u0099 \u00fd ", - " \u00f8\u00f8 \u00ef\u00f9\u009a \u00d1\u00d1 \u0100\u00d9\u00d9\u00ff\u00ff \u0101 \u00d9 \u00b9\u00b9 \u0102 \u00ba\u00ba\u009e\u0103 x\u00cb\u00ad \u00d7%% &\u00cd,\u00fc\u00fc\u00fe\u00fe \u00c0 \u00ae \u00a2 \u0104\u0104\u0105 - \u0099 \u00fd \u0106\u0106\u0106", - " \u00f8\u00f8 \u00ef\u00ef \u00d1\u00d1\u0107 \u00d9\u00d9\u00d9 \u0101 \u00d9\u00d9 \u00d1\u00b9 \u0108 \u0102 \u00ba\u00ba\u009e\u0109xxx\u00cb\u00ad \u00d7%% &\u00cd'\u00fc\u00fc \u00fe \u00c0 \u00ae \u00a2\u0104\u0104\u0104\u0105\u00d5 -- \u0099 \u00fd \u0106\u0106\u0106\u0106 ", - " \u00f8 \u009a\u009a \u00d1 \u00d9\u010a\u00d9\u00d9\u00d9 \u010b \u00d1\u00b9\u00b9 \u0108\u010c \u0102 \u00bf\u00ba\u009e\u009e \u00cb\u00ad \u00d7%% &\u00cd'\u00fc\u010d\u010d\u010d \u00c0 \u00ae \u00a2\u00a2 \u0104\u00d5 - \u0099 \u00fd\u00fd \u0106\u0106\u0106\u0106 ", - " \u00f8 \u009a\u009a \u010a\u010e\u010e \u010b \u00d1\u010f \u0110\u010c\u010c\u010c\u010c\u0111 \u0112 \u0113\u0113\u00ba\u009e\u009e \u00cb\u00cb\u00ad \u00d7\u00d7%% &\u00cd\u00fc\u00fc\u010d \u010d \u00c0\u00c0 \u00ae \u00a2 \u0104\u00d5 - \u0099\u00fd\u00fd \u0106\u0106\u0106\u0106 ", - " \u00f8\u0114 \u009a\u009a \u010e \u00d1\u010b\u010f \u0110 \u010c\u010c\u0112 \u0113\u0115\u0115\u0115\u00ba\u00ba\u009e \u0116\u00ad \u00d7%%% &\u00dc'\u00fc\u010d \u010d \u00c0 \u00ae \u00a2 \u0104\u00d5 - \u0117\u00fd\u0106\u0106\u0106\u0106 ", - " \u00f8\u0118\u0118\u0114\u0114 \u009a \u010e\u00b9\u00b9\u010f\u010f \u010c\u010c \u010c\u010c \u0112 \u0113\u0115\u0115\u0115\u0119\u011a\u011b\u009e\u011c\u011c \u0116 \u00ad\u00ad\u00d7%% &\u011d\u00fc \u010d \u010d \u00c0 \u00ae \u00a2 \u0104\u00d5 -- \u0117\u0117\u0106 ", - "\u011e \u00f8 \u0118\u0118\u0114\u0114 \u009a\u009a \u011f\u00b9\u00b9\u00b9\u00b9 \u010f\u010f \u010c\u010c\u010c \u0112 \u0113\u0115\u0115\u0119\u0119\u0119\u011a\u0120\u0121\u011c\u011c\u0122\u0122\u0116 \u00d7\u00d7%% &\u00dc',\u010d \u010d\u010d \u00c0\u0123\u0123\u0123 \u00ae \u00a2 \u0104\u0104\u0124\u00d5\u00d5--\u0125\u0125\u0126 \u0117\u0117 ", - "\u0127\u0128\u0128 \u00f8 \u0118\u0114\u0114 \u009a\u009a \u011f\u0129\u0129 \u010f \u010c\u010c \u0112\u0113\u012a\u0115\u0119\u012b\u012b\u012b\u012c\u0121\u0121\u012d\u012e\u0122\u0122\u0122\u00d7\u00d7\u00d7\u00d7%% \u00fc\u00fc\u011d', \u010d \u010d\u010d\u00c0\u00c0 \u00ae\u00ae \u00a2 \u0104\u0124 \u012f\u0130\u0131\u0126 \u0117\u0117 \u0132\u0132", - " \u0127\u0128\u0128 \u00f8 \u0118\u0118\u0114\u0114 \u009a\u011f\u0129 \u0129 \u010f \u0112 \u012a\u012a\u012b \u012c\u012c\u0121\u0121\u0133\u012e\u012e\u0122\u0122\u00d7\u00d7\u00d7%% \u00fc\u00fc\u011d', \u010d \u010d \u0134 \u00ae\u00ae\u00ae \u00a2 \u0124 \u012f \u0131\u0131 \u0117\u0117 \u0132\u0132\u0132\u0132 ", - " \u0127\u0128 \u00f8\u00f8 \u0118\u0118\u0114\u0114 \u011f\u0129\u0129\u0129\u0129\u010f\u010f \u0112\u0113\u012a\u012b \u012c\u012c\u0121\u0121 \u0135\u012e\u012e %% \u00fc\u00fc\u0136\u00dc', \u010d \u0134 \u00ae\u00ae\u00ae\u00ae\u00ae\u00ae\u00ae \u00a2 \u0124 \u0130 \u0126 \u0117\u0117 \u0132\u0132\u0132\u0132\u0132 \u0137", - " \u0138 \u0127\u0128\u0128 \u0118\u0114\u0114 \u009a\u0129\u0129\u010f\u010f \u0112\u0113\u012a\u012a\u0139\u0139\u013a\u013a \u012c\u012c\u0121\u0121 \u013b \u0135\u012e %%% \u00fc\u00fc\u00fc\u013c\u013d\u00cd, \u010d \u013e\u010d \u00ae\u00ae\u00ae\u00ae\u013f\u013f\u013f \u0140 \u0141 \u0117\u0117 \u0132\u0132\u0132\u0132\u0132 \u0137\u0137\u0137\u0137 ", - " \u0142 \u0138 \u0127\u0128\u0128 \u0118\u0118\u0114 \u0143\u0144\u0129 \u0112\u0113\u012a\u012a\u0139\u0139\u0139\u0139\u013a\u013a\u012c \u0121 \u0145\u0146\u0135\u0135\u012e\u0147%% \u00fc\u00fc\u00fc\u0136\u013c\u00dc', \u010d \u013e \u010d \u013f\u013f\u013f\u013f\u013f\u013f\u013f\u013f\u013f\u013f\u0148\u0148\u0117\u0117 \u0132\u0132\u0132\u0132 \u0137\u0137\u0137\u0137 \u0149\u0149\u0149\u0149", - "\u00c1 \u0142 \u00f8 \u014a\u0127\u0128\u014b \u0118\u0118\u0114\u0114 \u0143\u0144\u0144 \u0112\u0112\u012a\u012a\u012b\u014c\u014c\u014d\u0139\u0139\u013a\u012c \u0121\u0146\u0146\u0145\u014e\u0135\u014f\u0150\u0150% \u00fc\u00fc\u0136\u013c \u013d\u011d' \u010d\u010d \u013e\u013e \u010d\u010d \u0151\u0151 \u0132\u0132\u0132\u0132 \u0137\u0137\u0137\u0149\u0149\u0149\u0149\u0152\u0152\u0152 ", - "\u00c1 \u00f8\u00f8 \u014a\u0127\u0128\u014b \u0118\u0114\u0114 \u0143\u0143\u0144 \u0153\u0153 \u0112\u0113\u012a\u012b\u014c\u014c\u014d\u014d\u0139\u0139 \u012c\u0154\u0146\u0146\u0121\u0121\u0155\u0156\u0157\u0150\u0158\u0158%\u00fc\u00fc\u0136 \u013c &\u011d', \u010d \u013e\u013e \u010d\u010d \u0132\u0132\u0132 \u0137\u0137\u0137\u0137\u0149\u0149\u0152\u0149\u0152\u0152 ", - " \u00f8\u00f8 \u0127\u0128\u0128 \u0118\u0118\u0114 \u0143\u0144 \u0153\u0159 \u015a\u0113\u012a\u012b\u014d\u014c\u014d\u014d\u0139\u015b\u015b\u015b\u012c\u0154 \u0121\u0121\u0156\u0150\u0150\u0158\u0158\u00fc\u00fc\u00fc\u0136 \u013c \u00dc\u011d', \u010d \u015c\u013e \u010d\u010d \u0137\u0137\u0137\u0137\u0149\u0149\u0149\u0149\u0152\u0152 ", - "\u015d \u00f8 \u014a\u0127\u0128 \u0118\u0118\u0114\u0114 \u0143\u0144\u0144 \u0159\u015e \u0112\u0113\u012a\u012a\u012b \u014d\u015b\u015b\u015b\u015b\u015b\u015b\u012c \u0150\u0150\u0150\u0158\u0158\u014f\u00fc\u00fc\u0136 \u013c &\u011d\u00cd, \u010d\u015c\u015c\u013e\u013e \u013e\u013e\u013e \u0137\u0137\u0137\u0149\u0149\u0149\u0149\u0152\u0152\u0152 \u015f", - "\u015d\u00f8 \u014a\u0160\u0161\u014b \u0118\u0118\u0114\u0114 \u0143\u0144\u0144 \u015e\u015e \u015e \u0112\u0113\u012a\u012a\u012b\u0162\u0162\u0162\u015b\u015b\u015b\u015b \u0163\u0163\u0164\u0164\u0164\u0150\u0150\u0150\u0150\u0121\u0158\u0158\u00fc\u00fc\u0136\u014f\u014f & ',, \u010d\u015c \u013e\u013e \u013e\u013e\u0165\u013e\u013e \u0137\u0137\u0137\u0149\u0149\u0149\u0149\u0152\u0152\u0152 \u015f\u0166\u0166", - " \u015d \u0127\u0128\u0128 \u0118\u0118\u0143\u0143\u0144 \u015e\u015e \u015e\u0167 \u0112\u0113\u012a\u012b\u0162\u0162\u0162\u0162\u0164\u0164\u0164\u0164\u0164\u0164\u0163\u0164\u0164\u0164\u0150\u0150\u0150 \u0158\u0158\u0158\u00fc\u00fc\u0157 \u014f \u0168 \u011d', \u010d\u010d \u013e\u013e \u013e\u0165\u0165\u0165\u013e\u013e\u013e \u0169\u0169\u0169\u0137\u0137\u0137\u0137\u0149\u0149\u0149\u0149 \u0152\u0152\u0152 \u015f\u0166\u0166\u016a\u016b", - "\u016c \u015d\u015d \u0127\u0161\u0128 \u0118\u0143\u0144 \u015e \u0167\u0167 \u0112\u0113\u012a\u012b\u0162\u0162\u0162\u016d\u016d\u016d\u016d\u016d\u016d\u016d\u016d\u0163\u016d\u0164\u0164 \u016e\u0158\u00fc\u00fc\u0136\u0156\u0157\u014f\u014f \u0168\u00dc\u011d',\u016f \u010d\u010d \u013e\u013e \u013e \u0165\u0165\u0169\u0169\u0169\u0169\u0169\u0169\u0169\u0169\u0169\u0137\u0137\u0137\u0149\u0149\u0149\u0149\u0170\u0170 \u0152\u0152 \u015f\u0166\u0166\u016a\u016b\u016b ", - "\u0171\u016c \u015d\u015d \u014a\u0161\u0128\u014b \u0143\u0144 \u015e \u0112\u0113\u012a\u012a\u0162\u0162\u016d\u016d\u016d\u016d\u016d\u0172\u0172\u0172\u016d\u016d\u0163\u016d\u016d\u016d \u016e\u0173\u0173\u0136\u0174\u0174\u0156\u0157\u014f \u0175\u00dc\u011d' ,\u016f \u0176\u0176\u010d\u010d \u013e\u013e\u0177 \u0169 \u0178\u0179\u0137\u0179\u0149\u0149\u0149 \u017a\u0170 \u0152\u0152 \u015f\u0166\u0166\u016a\u016b\u016b ", - "\u0171\u016c\u016c \u017b\u015d \u014a\u0127\u0128\u0128 \u0143\u0144\u0144 \u015e \u0112\u0113\u012a\u012a\u0162\u0162\u016d\u016d\u016d\u0172\u0172\u0172\u0172\u0172\u0172\u0172\u0172\u0163\u016d\u016d\u016d\u016d\u016d \u016e\u016e\u0173\u0173\u017c\u017d\u0174\u0174\u0157\u014f \u0168\u00dc \u011d',\u016f\u016f\u0176\u0176 \u0176\u0176\u0176\u010d \u0177\u0177\u0177 \u0169 \u0178\u0178\u0178\u0179\u017e\u0149\u0149 \u017a\u017a\u017a\u0170 \u0152 \u015f\u015f\u0166\u0166\u016a\u016b\u016b ", - "\u0171 \u016c\u016c\u017b \u015d \u0127\u0127\u0128 \u0143\u0143\u0144 \u015e\u015e \u0112\u0112\u0113\u012a\u0162\u0162\u016d\u016d\u0172\u0172 \u017f\u017f \u0163\u0172\u0172\u016d\u016d\u016d\u016d\u0180\u0180\u0181\u017c\u017c\u017d\u017d\u0174\u0156\u014f \u0168\u00dc \u011d',,\u016f\u0176 \u010d\u010d \u0169\u0169\u0169\u0178\u0178\u0178\u0182\u0179\u0183\u017e \u017a\u017a\u017a \u0170 \u0152 \u015f\u015f\u0166\u0184\u016a\u016b\u016b \u0185\u0185", - "\u0171\u016c\u016c\u017b\u017b \u015d\u015d \u014a\u0128\u0128\u014b \u0143\u0143\u0144 \u015e\u015e \u0112\u0113\u012a\u0162\u0162\u0162\u016d\u0172\u0172 \u017f \u017f\u017f\u017f\u017f \u0186\u0186\u0172\u0187\u0187\u016d\u016d\u0180\u0180\u0181\u017c\u017c\u017d\u017d\u0174\u0174\u0157\u014f \u0175\u00dc \u011d', \u016f \u010d\u010d \u0169\u0169\u0169\u0178\u0178\u0178\u0182\u017e\u017e\u0183 \u017a\u017a\u017a \u0170\u0170 \u0152 \u015f\u0166\u0166\u016a\u016a\u016b\u016b \u0185\u0185\u0185 ", - " \u016c\u017b\u017b \u015d\u015d \u014a\u0127\u0128\u014b\u0143\u0144 \u0188\u0189 \u0112\u0113\u012a\u012a\u0162\u0162\u016d\u0172\u0172 \u017f\u017f\u018a \u017f\u017f\u018b\u0186\u018b\u0187\u0187 \u016d\u0180\u0181\u0181\u017c\u017c \u017d\u017d\u0174\u0157\u014f \u0175\u00dc \u011d',, \u016f \u010d\u010d\u0169\u0178\u0178\u0178\u0182\u0182\u017e\u017e\u0183 \u017a\u017a \u018c\u018c\u0170 \u0152 \u015f\u0166\u0166\u016a\u016a\u016b\u016b \u0185\u0185 ", - "\u016c \u017b\u018d \u015d\u015d \u0127\u014b\u014b\u0144 \u0188 \u0189 \u0113\u012a\u012a\u0162\u0162\u016d\u0172\u0172 \u017f\u017f \u018a\u018a\u018a\u018a\u018a \u018e\u0186\u018b\u0187\u0187\u0187\u0180\u0180\u0181\u0181\u017c\u017c \u017d\u017d\u0174\u0157\u014f\u018f\u0175\u00dc\u0190\u0191\u011d\u00cd', \u016f \u0192\u0178\u0178\u0182\u0179\u017e\u017e\u0183 \u017a\u017a\u017a \u018c\u018c\u018c\u0170\u0170\u0152 \u015f\u0166\u0166\u016a\u016b\u016b\u016b \u0185\u0185 ", - " \u0193 \u015d\u015d \u0143\u014a\u0144 \u0194 \u0189 \u0113\u0113\u012a\u0162\u0162\u016d\u016d\u0172 \u017f\u017f \u0195\u0195 \u018a\u018a\u018a\u017f\u0186\u0186\u018b\u0187\u0187\u0180\u0180\u0181\u016d\u017c\u017c\u017c\u017d\u017d\u0174\u018f \u0175\u0196 \u0191\u0191\u011d',, \u016f \u0178\u0178 \u0182\u0179\u0197\u017e\u0183 \u017a\u017a\u017a \u018c\u018c \u0170\u0152\u0152 \u015f\u0166\u0166\u016a\u016b\u016b\u016b \u0185\u0185 ", - "\u017b \u015d\u015d \u0143\u0143\u0144 \u0194\u0194\u0189\u0189 \u0113\u012a\u0162\u0162\u0162\u016d\u0172\u0198\u0198\u0198\u0195\u0195 \u0195\u0195\u0195 \u018a\u017f \u0186\u018b\u0187\u0187\u0180\u0180\u0181\u016d\u016d\u017c\u017c\u017d\u017d\u0199\u019a \u0175\u0196 \u0191\u011d\u00cd', \u016f\u016f \u0178\u0178 \u019b\u0179\u0197\u017e\u0183\u0192 \u0170\u0170\u0170\u0170\u018c\u018c\u018c \u0170 \u0152 \u015f\u0166\u0166\u016a\u016b\u016b \u0185\u0185 ", - "\u019c \u019d\u019d\u015d \u0143\u0144 \u019e\u019e\u019e\u019e\u019e \u0113\u012a\u012a\u0162\u0162\u016d\u0172\u0198\u0198\u0198 \u0195\u0195\u0195\u0195 \u0186\u018b\u018b\u0187\u019f\u01a0\u01a0\u016d\u016d\u017c\u017c\u017d\u017d\u0199\u019a \u0175\u00dc \u0191 \u011d',, \u016f \u0178\u0178 \u0182\u0179\u017e\u017e\u0183\u0183 \u01a1\u01a1 \u0170\u0170\u0170\u0170\u01a2\u01a2\u0170\u0170\u0152 \u015f\u0166\u0166\u01a3\u016a\u016b\u016b \u0185\u0185 ", - " \u019d \u015d \u0143\u0144\u0144 \u019e\u019e\u01a4\u01a4\u01a4\u01a4 \u0113\u012a\u012a\u0162\u0162\u016d\u016d\u0198\u0198\u0198 \u0195 \u0186\u0186\u018b\u0187\u019f\u01a0\u01a0\u016d\u016d\u017c\u017c\u017d\u017d\u0199\u019a \u0175 \u0196 \u01a5\u011d\u00cd',\u01a6\u0178\u0178 \u0182\u0179\u017e\u017e\u0183\u0183 \u01a2\u01a2 \u0152\u0152 \u015f\u0166\u0166\u01a3\u016a\u016b\u016b \u0185\u0185 ", - " \u01a7 \u019d \u015d\u015d\u0143\u0144\u0144 \u01a4\u01a4\u01a4\u01a4\u01a4\u01a4\u01a4\u01a4 \u0113\u012a\u012a\u0162\u0162\u016d\u016d\u0198\u0198\u0198 \u01a8\u01a8\u01a9\u01a9\u01a9\u01a9 \u01aa\u01aa\u0186\u018b\u0187\u019f\u01a0\u01a0\u016d\u016d\u017c\u017c\u017d\u0199\u0199 \u0175 \u0196 \u011d\u01ab\u01a6\u01a6 \u0182\u0179\u017e\u017e \u0183\u0183 \u01a2\u01a2 \u0152 \u015f\u0166\u0166\u01a3\u016b\u016b\u016b \u0185\u0185 ", - " \u01a7\u01a7\u01ac\u01ac\u01ac \u015d\u0143\u0144 \u01a4\u01a4\u01a4 \u01a4\u01a4 \u0113\u012a\u0162\u0162\u0162\u016d\u0198\u0198\u0198 \u01a9\u01ad\u01a9 \u01a9\u01a9\u01a9 \u01ae\u01ae\u01af\u01af\u0186\u0186\u0187\u019f\u01a0\u01a0\u016d\u016d\u017c\u017c\u017d\u0199\u019a \u0175 \u0196\u00dc \u01b0\u0178\u01ab\u01a6\u0182\u017e\u017e \u0183\u0183 \u01a2\u01a2 \u0152 \u015f\u0166\u0166\u01b1\u01b1\u016b\u016b \u0185\u0185\u0185 ", - "\u01b2\u01b3 \u019d\u019d\u01ac \u01ac\u01ac\u01ac \u015d\u015d\u01b4\u01b5 \u019e\u01a4\u01a4\u01b6\u01b6\u01b6\u01b6 \u01a4\u01a4\u012a\u012a\u0162\u0162\u01b7\u0198\u0198 \u01b8\u01a9 \u01ad\u01ad \u01a9\u01ae\u01ae \u01af\u0186\u0186\u0187\u019f\u01a0\u01a0\u016d\u016d\u017c\u017c\u017d\u0199 \u0175\u0175 \u0196\u00dc \u0178\u0178\u01b0\u01b9\u0182\u01a6\u01a6 \u0183\u0183 \u01a2\u01a2\u01a2\u01a2\u01a2 \u01ba\u0152\u015f\u015f\u0166\u01b1\u016a\u016b\u016b \u0185\u0185 ", - "\u01b3\u01b2\u01b2 \u01bb\u01bb \u01ac \u01bc\u01bd\u01b4\u019e\u01a4\u01a4\u01b6\u01b6 \u01b6 \u01be\u0113\u012a\u012a\u01bf\u0162\u01c0\u01b7\u01b7 \u01a9\u01b8\u01b8\u01b8 \u01ad\u01ad \u01a9 \u01af\u0186\u0187\u019f\u01a0\u01a0\u016d\u016d\u017c\u017c\u0199\u0199 \u0175 \u01c1\u01c2\u01c3\u0178 \u0182\u0182\u017e\u01b0\u01ab\u01a6\u0183\u0183 \u01a2\u01a2\u01a2\u01a2 \u01a2\u01a2\u01a2 \u01ba\u0166\u0166\u01b1\u01b1\u016b \u0185\u0185 ", - "\u016c\u016c\u01c4\u01b2 \u01c5 \u01c6\u01ac \u01c7\u01c8\u01c9\u01a4\u01a4 \u01b6 \u01ca \u01cb\u01cc\u0113\u012a\u012a\u012b\u01bf\u01bf\u01c0\u01b7 \u01cd\u01cd \u01b8\u01b8 \u01ad\u01ad\u01ad\u01a9 \u01af\u0186\u0186\u019f\u019f\u01a0\u01a0\u016d\u017c\u017d\u0199\u019a \u0175\u0175 \u01c3\u01c2\u01c2\u01ce\u0182\u017e\u017e\u01b0\u01b9\u01ab\u01a6\u01a6 \u01a2\u01a2 \u01a2\u01a2\u0166\u0166\u0166\u016a\u01b1\u016b \u0185\u0185 ", - " \u016c\u016c \u01cf\u01c5 \u019d\u01c6\u01c6 \u01c7\u01d0\u01a4\u01d1\u01b6 \u01ca \u01ca\u01cb \u0113\u012a\u012b\u01bf\u01bf\u01c0\u01b7\u01b7 \u01d2\u01a9 \u01cd\u01cd \u01b8\u01b8 \u01ad\u01ad \u01af \u0186\u0187\u019f\u01a0\u01a0\u01d3\u01d3 \u0199 \u0175\u0175 \u01c3\u01c3\u01d4\u01c2\u01d5\u01d6\u017e \u0183\u0183\u01b0\u01d7\u01ab\u01d8 \u01a2\u01a2 \u01a2\u015f\u015f\u0166\u0166\u0184\u016b\u016b \u0185\u0185 ", - " \u016c \u01cf\u01cf\u019d\u019d\u01ac\u01ac \u01c7\u01d0 \u01d1\u01d1\u01d1\u01ca \u0113\u012a\u012b\u01bf\u01bf\u01c0\u01b7\u01b7\u01d9\u01d9\u01a9\u01a9\u01d2\u01d2 \u01cd\u01cd \u01b8\u01b8 \u01a9 \u01af \u0186\u0186\u019f\u01a0\u01d3\u01d3\u016d\u0199\u01da\u0175\u0175\u01c3\u01c3\u01d4\u01d5\u01d5\u01c2\u01d6 \u0183\u0183\u0183 \u01d7\u01db\u01d8\u01d8\u01a2\u01a2\u01a2\u01a2\u01a2 \u01a2\u015f\u01dc\u0166\u0166\u016a\u016b\u016b \u01dd\u01dd \u0185\u0185 ", - " \u016c \u01c5\u01de\u019d \u01ac \u01c7\u01d0\u01df\u01e0\u01df\u01d1\u01d1\u01d1 \u0113\u012a\u012a\u01bf\u01bf\u01bf\u01b7\u01b7 \u01d9\u01e1\u01e1 \u01d2\u01d2 \u01cd\u01cd \u01b8\u01b8\u01a9 \u01af \u0186\u019f\u01d3\u01d3\u016d\u016d\u01da\u01da\u0175\u01c3\u01d4\u01e2\u01d5\u01d5\u01e3\u01c2\u0183\u0183\u0183 \u01d7\u01db\u01d8\u01a2 \u01a2\u01dc\u0166\u0166\u0166\u01e4\u016b\u016b\u01ba \u01dd\u01dd \u01e5 ", - "\u01e6 \u016c \u01c5 \u01de\u01ac \u01c7\u01d0\u01df\u01e0\u01e7\u01df\u01df\u01d1\u01d1 \u0113\u012a\u012a\u012b\u01bf\u01bf\u01c0\u01e8 \u01e9 \u01ea\u01d9\u01e1\u01e1 \u01d2\u01d2 \u01cd\u01cd\u01a9\u01a9 \u01af \u01d3\u01d3\u01d3\u01a0\u01eb\u01eb\u0175\u01c3\u01ec\u01e2\u01ed\u01ee\u01ef\u01f0\u0183\u01c1\u0183 \u01d7\u01f1\u01db\u01d8\u01a2 \u01a2\u015f\u0166\u0166\u016a\u01e4\u01e4\u016b \u01f2 \u01f3\u01f3 \u01dd\u01dd\u01dd \u01e5 ", - "\u01e6\u01e6\u016c \u01c5 \u01ac\u01ac\u01ac \u01f4\u01f4\u01df\u01e0 \u01e7\u01f5\u01df\u01df\u01d1\u01d1\u012a\u012a\u012b\u01bf\u01bf\u01c0\u01e8\u01e8\u01f6\u01e9\u01e9\u01ea\u01d9\u01d9 \u01e1\u01e1 \u01d2\u01d2\u01a9\u01a9\u01cd\u01a9 \u01af\u01f7\u01f7\u01d3\u01d3\u01f8\u01f9\u0175\u01c3\u01ec\u01da\u01ed\u01ee\u01e3\u01f0\u0183\u0183\u0183\u01c2\u01c2 \u01f1\u01db\u01d8\u01d8 \u01a2\u015f\u0166\u0166\u016a\u016b\u016b\u016b \u01f2 \u01fa\u01f3\u01f3\u01f3 \u01fb\u01dd\u01dd \u01e5 ", - " \u01e6\u01e6 \u01c5\u01fc \u01ac \u01c7\u01f4\u01df\u01e0\u01e7\u01e7\u01f5\u01fd \u01df\u01d1\u012a\u012b\u01bf\u01bf\u01c0\u01e8\u01e8 \u01f6\u01ea\u01e9 \u01e8\u01d9 \u01a9\u01a9\u01e1\u01a9\u01a9\u01a9 \u01f7\u01f7\u01f7\u01f7\u01f7\u01fe\u0175\u01c3\u01ec\u01f9\u01da\u01da\u01f0\u01ef\u0183\u0183\u0183 \u01ff \u01d7\u01d7\u01db\u01d8\u01a2 \u01a2\u01a2\u015f\u0166\u0166\u016a\u016b\u016b \u01f2 \u01fa\u01fa\u01fb\u01fb\u01f3 \u01e5 ", - " \u01e6\u01e6 \u0200\u01fc\u01fc \u01ac \u01c7\u01c7\u01d0 \u0201\u01e7\u01f5\u01f5\u01fd\u01df \u012a\u012b\u01bf\u01bf\u01bf\u0172\u01e8\u01e8\u01e8 \u01f6\u01e8\u01e8\u01e8\u01d9\u01e8 \u0202\u0202\u01f7\u01f7\u01f7\u01f7 \u0175\u01c3\u01fe\u01ec\u01d5\u01d5\u01f0\u01da\u01ef\u0183\u0183 \u01ff\u0203 \u01d7\u01f1\u01db\u01d8\u0204\u015f\u0166\u0166\u016a\u016b\u016b \u01f2 \u01fa\u01fa \u01e5 ", - "\u0175 \u01e6\u01e6\u01e6 \u01fc\u01ac \u01c7\u01d0 \u0201 \u0205\u0206\u0207\u01df\u01df\u012a\u012a\u01bf\u01bf\u01bf\u0172\u0172 \u01e8\u01e8\u01e8\u01e8\u01e8\u01e8\u01e8\u01d9\u01d9 \u0202\u0202\u0202\u0202\u0202\u0208\u0208\u0208\u0208\u01f7 \u0175\u0175\u01c3\u01ec\u01d5\u01d5\u01e3\u01f9\u01ef\u01ef\u0183 \u0209\u0209 \u01ff\u0203 \u01d7\u01f1\u01db\u020a\u020b\u016a\u016b\u016b \u01f2 \u01dd\u01dd \u01e5 ", - "\u0175\u0175 \u020c\u01e6\u01e6\u01e6 \u01fc\u01fc\u01fc \u01c7\u01d0\u0201\u0201\u0205 \u0206\u020d\u01df\u012a\u012a\u012b\u01bf\u01bf\u01c0\u0172 \u01e8\u01e8\u01e8\u01e8\u0202\u0202\u0202\u0202\u0202\u0202\u0202\u0202\u0202\u0202\u0202\u0202\u0202\u0208\u0208\u0208\u0208\u0208\u0208\u0208 \u0175\u0175\u01c3\u01ec\u01d5\u01d5\u01fe\u01e3\u01f8\u01ef\u01f9\u01da\u020e \u0209\u0209\u020f \u01ff\u0203 \u0210\u0211\u020a\u020b\u0212\u0212\u016b \u01f2\u01dd \u01dd\u01dd \u01e5 ", - "\u01c3\u0175\u0175 \u0213\u0214\u01e6\u01e6\u0215\u0215 \u01fc\u01fc\u01fc \u01c7\u01d0\u0201\u0201\u0205 \u0206 \u020d\u012a\u012a\u012b\u01bf\u01bf\u01bf\u0172 \u0202\u0202\u0202\u0202\u0202\u0202\u0202\u0216\u0202\u0202\u0202\u0202\u0202\u0202\u0208\u0208\u0208\u0208\u0208\u0208\u0208 \u0175\u0175\u01c3\u01ec\u01d5\u0179\u0179\u01e3 \u01fe\u01f8\u01f8\u0217\u0218\u020e\u0209\u0209 \u020f \u01ff\u0203 \u0210\u0210\u0211\u0219\u021a\u0212\u0212\u01db\u01d8 \u01f2 \u01dd\u01dd \u01e5 ", - "\u021b\u021b\u01c3\u0175\u0213 \u0214\u0214\u021c\u0215\u0215\u0215\u0215 \u01fc\u01fc\u01fc\u01c7\u01d0\u0201\u0205\u0205\u0206 \u020d \u012a\u012b\u01bf\u01bf\u01bf\u0172 \u0202\u0202\u0202\u0202\u0202\u0202\u0202\u0202\u0202\u021d\u0216\u0216 \u0208\u0208\u0208\u0208\u0208 \u0175\u0175\u01c3\u01ec\u01d5\u0179\u0179\u01e3 \u0183\u0183\u01fe\u021e\u021f\u021f\u0217\u020e\u020e \u01ff\u0203 \u0210\u0211\u0211\u0220\u0219\u0221\u0221\u0212\u01d7\u01f1\u01db\u01d8 \u01f2 \u0222\u0222\u0222 \u01e5 ", - "\u0223\u021b\u021b\u01c3\u0175\u0175 \u0214\u0214 \u021c\u0215\u0215\u0215\u0215 \u01c7\u01fc\u020d\u020d\u0205\u0206\u0206\u020d \u012a\u012a\u01bf\u01bf\u01bf\u0172\u0202\u0202\u0202\u0202\u0202\u0224\u0225\u0225\u0226\u021d\u021d\u021d\u0216\u0216 \u0208\u0208\u0208\u0208\u0208 \u0175\u0175\u01c3\u01ec\u0227\u0179\u01d5\u01e3 \u0183\u0183 \u021e\u021f\u021f\u0217\u0217\u020e\u019a \u01ff\u0203 \u0210\u0211\u0211\u0220\u0221\u0221\u0221\u0228\u0228\u0228 \u01f1\u01f1\u01db\u01d8 \u01f2 \u0229 \u0222\u0222\u0222\u0222\u0222\u0222\u0222\u0222\u0222\u0222 ", - "\u022a\u0223\u021b\u0213\u0213\u0175\u0175 \u0214\u0214\u022b\u021c\u021c\u0215\u0215\u0215\u0215 \u020d\u0206\u020d \u012a\u012a\u012b\u01bf\u01bf\u01c0\u0202\u0202\u0202\u0202\u0202\u022c\u0224 \u021d\u021d\u021d\u022d\u022e \u0216\u0216\u0208\u0208\u0208 \u0175\u01c3\u01c3\u01ec\u0227\u01d5\u0179\u01e3 \u0183\u0183 \u021e\u021e\u021f\u021f\u0217\u020e\u020e \u01ff\u0203 \u0210\u0211\u0211\u0220\u0221\u0221\u0221 \u022f \u0228 \u01d7\u01f1\u01db\u01d8 \u01f2 \u0229 \u01e5\u0230\u0230\u0230\u0230\u0230 ", - " \u022a\u022a\u0223\u021b\u0213\u01c3\u0175\u0175 \u0231 \u021c\u021c\u0215\u0215\u0215\u0215 \u020d\u012a\u012a\u012b\u01bf\u01bf\u01bf\u0202\u0202\u0202\u0232\u0233\u0233\u022c\u021d\u021d\u0225\u0225\u0226 \u022d\u022e \u0216\u0216\u0208 \u0175\u01c3\u01c3\u01ec\u01ec\u01d5\u0179\u01e3\u01e3\u0183\u0183 \u021e\u021f\u021f\u0217\u0217\u020e\u019a \u01ff\u0234\u0211\u0211\u0220\u0221\u0221\u0221 \u0235\u022f \u0228 \u01f1\u01f1\u01db\u01d8 \u01f2 \u0229 \u01e5 \u0230\u0230\u0230\u0230\u0230\u0230 ", - "\u0236\u0236 \u022a\u0223\u021b\u021b \u01c3\u0175\u0231\u0231 \u021c\u021c\u0215\u0215\u0215\u0215\u012a\u012b\u01bf\u01bf\u01bf\u0202\u0202\u0202 \u0232 \u021d\u021d\u022c\u0224 \u0225\u0226\u0226\u022d\u022e\u0237 \u0175\u01c3\u01c3\u01ec\u01ec\u01d5\u01d5\u0179\u01e3\u0183\u0183 \u021e\u021e\u021f\u021f\u0217\u020e\u020e\u0238\u0239\u0239\u023a\u023a\u0220\u0221\u0221\u0221 \u023b \u0235 \u022f \u023c\u023c\u0228 \u01d7\u01f1\u01db\u01d8 \u01f2 \u0229 \u01e5 ", - " \u0236\u0236 \u022a\u0223\u021b\u021b\u0231\u01c3\u0175\u0175\u0175 \u021c\u021c\u021c\u0215\u0215\u01bf\u01bf\u01bf\u0202\u0202\u0202 \u023d\u021d\u021d\u0233 \u022c \u0224\u0225 \u0226\u0237 \u0175\u01c3\u01c3\u01ec\u01ec\u01d5\u01d5\u01e3\u01e3\u0183\u0183 \u023e\u021e\u021f\u021f\u0217\u0217\u0238\u0238\u023f\u0240\u0241\u0242\u0221\u0221 \u023b\u023b \u0235 \u0243\u022f\u023c \u0228\u0228 \u01f1\u01f1\u01db\u01d8 \u01f2 \u0229 \u01e5 ", - " \u0236\u0236 \u022a\u0223\u021b\u021b \u01c3\u01c3\u0175\u0175 \u021c\u012a \u0244\u0244\u0202\u0202\u0202 \u023d\u0232 \u0233\u022c\u022c\u0224\u0237\u0225 \u0175\u0175\u01c3\u01ec\u01ec \u01e3\u01e3\u01e3\u0183\u0183 \u023e\u023e\u023e \u021e\u0238\u021f\u0238\u0238\u023f\u023f\u023f\u0245\u0246\u0247 \u023b\u023b \u0235 \u0248\u0243\u0243 \u0228 \u01d7\u01f1\u01db\u01d8 \u01f2 \u0229 \u01e5 ", - "\u0249\u0249\u0249\u0249\u0249\u0236\u0236 \u0231\u0223\u021b\u021b\u021b\u01c3\u01c3\u0175\u0175\u0175 \u024a \u0244\u0244\u0172\u0202\u0202 \u023d \u0232\u0233 \u022c\u0237 \u0175\u0175\u01c3\u01ec\u01ec\u01ec\u01e3\u01e3\u01e3\u0183\u0183 \u023e\u023e\u024b \u024c\u024c\u0238\u0238\u023f\u023f\u023f\u024d\u024d\u024e\u0203 \u023b\u023b \u0248 \u024f\u024f \u0250\u0251 \u01d7\u01f1\u01db\u01d8 \u01f2 \u0229 \u01e5 ", - " \u0236\u0236\u0252 \u022a\u022a\u0223\u021b\u021b\u021b\u01c3\u0175\u0175\u0175\u0253\u0254\u0244\u0244\u0202\u0202 \u023d\u0232\u0237\u0233 \u0175\u0175\u01c3\u01ec\u01ec\u01ec\u01e3\u01e3 \u0183\u0183\u0183 \u0255\u0255\u0255\u0255\u0255\u0256\u0256\u024c \u023f\u023f\u0257\u024d\u024d\u0258\u020e\u01ff\u0203 \u023b \u0235 \u0259\u0250 \u0251 \u01d7\u01f1\u01db\u01d8 \u01f2\u01f2 \u0229 \u01e5 ", - "\u025a \u025b\u025b\u025b \u025c\u025d\u025d\u025d \u022a\u022a\u0223\u0223\u021b\u0253\u01c3\u0175\u0254\u025e\u025e\u025f\u0202 \u0260\u0260 \u023d\u0237 \u0175\u0175\u01c3\u01ec\u01ec\u01ec\u01e3\u01e3 \u0183\u0183\u0183 \u0255\u0255\u0255\u0255\u0255\u0255 \u024b\u024b\u0256 \u0223\u0223\u0261\u024d\u0262\u0258\u0258\u0217\u020e\u0263\u0264\u023b \u0259\u0259\u0259\u0259\u0259\u024f \u0251 \u01d7\u01f1\u01db\u01d8 \u01f2 \u0229\u0229 \u01e5 ", - "\u025a\u025a\u025b\u025b\u025b \u025c\u0265 \u025d\u025d\u025d \u022a\u022a\u0223\u0223\u0254\u021b\u021b\u01c3\u0175 \u0260\u0260\u0260\u0260 \u0175\u0175\u0175\u01c3\u01ec\u01ec\u01ec\u01e3\u01e3 \u0183\u0183\u0183 \u0255\u0255\u0255\u0255 \u024b\u0223\u0223\u0223\u0266\u0267\u0268\u0262\u0262\u0258\u021f\u0217\u0269\u0263\u020e\u026a \u024f \u0251\u0251 \u01f1 \u01d8\u01d8 \u01f2 \u0229\u0229 \u01e5 ", - " \u026b\u025a \u025c\u026c \u026d\u026e \u0253\u0253\u0254\u025e\u022a\u022a\u0223\u0183\u01c3\u0175\u0175\u01c3\u0175\u0175\u0175\u0175\u01c3\u0175\u01c3\u01c3\u01ec\u01ec\u01e3\u01e3\u01e3 \u0183\u0183\u0183 \u0255\u0255\u0255\u0255 \u0223\u0223\u0223\u0223\u0266\u0266\u026f\u0267\u0270\u0271\u0258\u021e\u021f\u021f\u0217\u0263\u0264\u020e\u026a\u026a\u026a\u026a \u0272\u0272\u0272\u0272\u0272 \u0273 \u0251\u0251 \u01d7\u01d7 \u01d8\u01d8\u01f2\u01f2 \u0229 \u01e5 ", - "\u026b \u025a\u025a \u0265\u0265\u026c \u0274 \u0275\u0275\u0254\u025e\u025e\u025e\u025f\u022a\u022a\u0223\u0223\u0183\u0183\u0183 \u01ec\u01ec\u0276\u01e3\u01e3\u0183\u0183\u0183 \u0255\u0255\u0255 \u0223\u0223\u0223\u0223\u0266\u0266\u0266\u0266\u0277\u0277\u0267\u0278\u0271\u0279 \u021e\u021e\u021f\u021f\u0263\u0264\u020e\u020e\u026a \u0272\u0272\u0272\u0272\u0272 \u0272\u0272\u0272\u0272\u0272\u0272 \u0251\u0251 \u01d7\u01f1 \u01d8 \u01f2 \u0229 \u01e5 ", - "\u026b \u025a\u025a \u0265 \u026c \u0274 \u0275\u0275\u027a\u027a\u025e\u025e\u025f\u025f \u022a\u022a\u0223\u0183\u0183\u0183\u0183\u0183\u0183\u0183\u0183\u0183\u0183\u027b\u027b\u027b\u0255\u0255 \u0223\u0223\u0223\u0223\u0223\u0223\u022a\u0266\u0266\u0266 \u0277\u027c\u0267\u0270\u027d\u0271\u027e \u027f\u021e\u021e\u021f\u0264\u0217\u0269\u020e\u020e \u0272\u0272\u0272 \u0280\u0280\u0280\u0280\u0280\u0280\u0280\u0280\u0280 \u0273 \u0272\u0272\u0272 \u01d7\u01d7\u01db\u01d8\u01f2\u01f2 \u0229 \u01e5 \u0281", - " \u025a\u025a\u0265 \u026c \u0274 \u0275\u0275\u027a\u027a\u0282\u0282\u025f\u025f\u0283 \u0284\u0285\u022a\u022a\u0223\u0223\u0223\u0223\u0223\u027b\u027b\u0223\u0223\u0223\u0223\u0223\u0223\u0223\u0223\u0223\u022a\u0266\u0266\u0266\u0266\u0266\u0266 \u0286\u0286\u0277\u027c\u027c\u0270\u027d\u027e\u0287\u0279 \u027f \u021e\u0263\u0264\u0217\u0217\u0269\u0288\u0272\u0289\u028a\u028b\u028b\u0280 \u0280\u0280\u0280\u0280 \u0272\u0272 \u01d7\u01f1\u01db\u01d8\u01f2 \u0229\u0229 \u01e5 \u0281\u0281\u0281\u0281\u0281", - " \u028c\u025a \u026c \u0274 \u0275\u027a\u027a\u0282\u0282\u028d\u028d \u0283 \u0284\u0284\u028e\u028e\u028e \u028f\u028f\u027b\u027b\u027b\u022a\u022a\u0266\u0266\u0266\u0266\u0266\u0266\u0266\u0266 \u0286\u0290\u0291\u0277\u027c\u0267\u0278\u027d\u027e\u0287\u0279 \u027f \u0263\u0264\u021f\u021f\u0288\u0292\u0292\u0289\u0293 \u028b \u0280\u0280\u0280 \u0272\u0272 \u01d7\u01f1\u01db\u01d8\u01f2 \u0229\u0229 \u01e5 \u0281\u0281\u0281\u0281\u0281\u0281\u0294\u0294\u0294", - " \u028c \u025a\u025a \u0274 \u0275\u0275\u027a\u0282\u0282\u0282\u028d \u0283 \u0284\u0284\u028e\u028e \u028f\u028f\u028f \u0266\u0266\u0266\u0266\u0266\u0266 \u0286\u0290\u0290\u0290\u0291\u027c\u0270\u0270\u027d\u027e\u0287\u0279\u027f\u027f \u0263\u0264\u021e\u0292\u0292\u0289\u0289\u020e\u020e\u0295\u0296 \u0280\u0280\u0280 \u0272 \u01f1\u01f1\u01db\u01f2\u01f2 \u0229\u0229\u01e5\u01e5 \u0281\u0281\u0281\u0281\u0281\u0281\u0294\u0294\u0294\u0294\u0294\u0294 ", - " \u028c\u028c \u025a\u025a \u0275\u0275\u027a\u0282\u0282\u0282\u028d \u0283\u0284\u0284\u028e\u028e \u028f\u0266\u0266\u0266\u0266\u0266 \u0286\u0290\u0290\u0290\u0291\u027c\u027c\u0267\u0278\u027d\u027e\u0287\u0279\u027f\u027f \u0297\u0298\u0288\u0292\u0292\u0289\u021f\u0217\u0269\u020e\u0295\u0296 \u0280\u0280 \u0272\u0272\u01d7\u01f1\u01db\u01f2 \u0229\u0229 \u0281\u0281\u0281\u0281\u0281\u0281\u0294\u0294\u0294\u0294\u0294\u0294 ", - " \u028c\u028c \u0299\u0299\u025a\u0275\u0275\u027a\u027a\u0282\u0282\u028d\u028d \u0284\u028e\u028e \u028f\u028f\u0266\u0266\u0266 \u0290\u0290\u0291\u0291\u027c\u027c\u029a\u0271\u027d\u0287\u0287 \u027f\u027f \u0297\u0298\u029b\u029b\u0289\u0289\u021f\u021f\u021f\u0217\u020e\u020e\u0295\u0296\u0296\u0296\u0296 \u0280 \u0272\u0272\u01d7 \u01db\u01f2 \u01e5 \u0281\u0281\u029c\u0281\u0281\u0281\u0294\u0294\u0294\u0294\u0294\u0294 ", - " \u028c \u0299\u0299 \u029d\u029d\u027a\u027a\u0282\u0282\u029e\u029e \u0284\u0284\u028e\u029f \u028f\u0266\u0266\u0266 \u02a0\u02a1\u0291\u0291\u027c\u027c\u0270\u0271\u027d\u0287\u0287 \u027f\u027f \u0297\u029b\u029b\u0289\u02a2\u02a3\u021e\u021f\u021f\u021f\u0217\u020e \u0296\u0296\u0296\u0296\u0296\u0296\u0296 \u0280\u0280 \u0272\u01d7\u01d7\u01db\u02a4\u01f2 \u01e5\u01e5 \u02a5\u02a5\u02a5\u02a5\u0281\u0294\u0294\u0294\u0294\u0294\u0294 ", - " \u028c \u0299\u0299 \u029d\u027a\u027a\u0282\u0282\u029e\u029e \u0284\u0284\u028e \u02a6\u02a7\u0266\u0266 \u02a0\u02a1\u0291 \u027c\u0267\u029a\u0271\u027d\u0287\u0287 \u027f \u0297\u029b\u029b\u02a8 \u02a3\u02a3\u021e\u021e\u021f\u021f\u0217\u0217\u020e \u02a9 \u0296\u0296\u0296\u0296\u0296\u0296\u0296 \u0280\u0280 \u0272\u01d7\u01db\u01f2\u01f2 \u02aa\u02a5\u02a5\u02a5\u02ab\u02ab\u02ab\u02ac\u02ac\u0294 ", - " \u028c \u0299\u029d\u029d\u027a\u0282\u0282\u0282\u029e \u0284\u0284\u028e \u02ad\u02ae\u02ae\u02ae \u02a0\u02a1\u0291 \u027c\u0267\u0270\u0271\u027e\u0287\u0279\u027f\u027f \u0297\u029b\u029b \u02af\u02a3 \u021e\u02b0\u021f\u021f\u0217\u020e \u02a9 \u02b1\u0296\u0296\u0296\u0296\u0296\u0296\u0280\u0280 \u01d7\u01f1\u01db\u02a4 \u02aa\u02aa\u02aa\u02aa\u02ab\u02ab\u02ab\u02ab\u02ab\u02b2\u02b2 ", - "\u028c\u028c \u029d\u029d\u027a\u027a\u0282\u0282\u029e \u0284\u028e \u02b3\u02b3 \u02ae\u02a6 \u02a1\u0291\u0291\u02a6\u027c\u0270\u0278\u0271\u027e\u0287\u0279\u027f\u027f \u0297\u029b \u02af\u02af \u021e\u021e\u021f\u021f\u0217\u0217\u020e \u02a9 \u02b1 \u0280\u0280 \u0272\u02b4\u02b5\u02b6\u01f2\u02b7\u02b7\u02aa\u02ab\u02ab\u02ab \u02b2\u02b2 ", - "\u028c \u029d\u029d\u027a\u027a\u0282\u0282\u029e\u02b8 \u02b9\u02ba \u02ad\u02b3\u02b3 \u02a6 \u02a0\u02a1\u0291\u0291\u027c\u027c\u0267\u0270\u027d\u027e\u0287\u0279\u027f\u027f \u0297\u0297\u029b \u02af\u02af\u02a3 \u021e\u021e\u021f\u021f\u0217\u020e\u02bb \u02a9 \u02b1 \u0280 \u0272\u02b4\u02b5\u02bc\u02bc\u02bc\u02bd \u02b2\u02b2\u02b2\u02b2 ", - " \u029d\u027a\u027a\u0282\u0282\u029e\u02b8\u02b8 \u02b9\u02ba \u02ad\u02ad \u02be\u02a6 \u02a0\u02a1\u0291\u0291\u027c\u0267\u0270\u0278\u027d\u0287\u0287\u0279\u027f\u027f \u0297\u0297\u029b \u02af\u02af \u02a3 \u02b0\u021e\u021f\u021f\u0217\u0217\u02bf \u02a9\u02a9 \u02b1 \u0280 \u02b7\u02b7\u0272\u02b4\u02bc\u01d8\u01d8\u02c0\u02c0 \u02b2\u02b2\u02b2\u02b2\u02b2 ", - " \u029d\u029d\u027a\u0282\u0282\u029e\u02b8\u02b8 \u02b9\u02b9 \u02b3\u02b3 \u02be\u02be \u02a6 \u02a0\u02a1\u0291\u02a6\u027c\u027c\u029a\u0278\u027d\u0287\u0287 \u027f \u0297\u0297\u029b \u02af\u02af \u02a3 \u021e\u02c1\u021f\u021f\u0217\u02bf\u02bb \u02a9 \u02b1 \u02c2\u02b7\u02bc\u02bc\u0272\u02b4\u02b6\u01d8\u01d8 \u02b2\u02b2\u02b2\u02b2\u02b2 ", - " \u029d\u029d\u027a\u0282\u0282\u0282\u029e\u02b8 \u02c3\u02c4 \u02ad\u02b3 \u02be\u02be \u02a6 \u02a0\u02a1\u0291\u02a6\u027c\u0267\u0270\u0271\u027d\u0287\u0287\u027f\u027f \u0297\u029b\u029b \u02af\u02af \u02a3 \u02c1\u021f\u021f\u0217\u0217\u02bb \u02a9 \u02b1 \u02c2\u02c2\u02c2\u02c5\u02bc \u0272\u02b4\u02b6\u01d8\u01d8 \u02c6\u02c7 \u02b2\u02b2\u02b2\u02b2\u02b2 ", - " \u029d\u029d\u027a\u0282\u0282\u0282\u029e\u02b8 \u02c4 \u02ad\u02b3 \u02be\u02be \u02a6\u02a6 \u02a0\u02a1\u0291\u02a6\u027c\u0270\u0270\u0271\u027e\u0287\u0279\u027f\u027f \u0297\u0297\u029b \u02af\u02af \u02a3\u02a3 \u02c1\u02c1\u021f\u021f\u0217\u02bf \u02a9 \u02b1 \u02c2\u02c2\u02c5\u02c5 \u02b4\u02b5\u02b6\u01d8\u01d8 \u02c7\u02c7 \u02b2\u02b2\u02b2\u02b2 ", - " \u029d\u027a\u027a\u0282\u0282\u029e\u02b8 \u02c3\u02c4\u02ad\u02b3 \u02be \u02a6\u02a6 \u02c8\u02c8 \u02a0\u02a1\u0291\u0291\u027c\u027c\u0267\u029a\u027d\u027e\u0287\u0279\u027f\u027f \u0297\u0297\u029b \u02af\u02af \u02a3 \u02c1\u021f\u021f\u0217\u02bf \u02a9 \u02b1 \u02c2\u02c2\u02c2\u02c5\u02c5 \u02b4\u02b4\u02b6\u01d8\u01d8 \u02c7 \u02b2\u02b2\u02b2\u02b2 ", - " \u029d\u029d\u027a\u0282\u0282\u029e\u02b8\u02b8 \u02c3\u02c4\u02ad\u02b3 \u02be \u02a6\u02c8\u02c8 \u02a0\u02a1\u0291\u0291\u027c\u0267\u0270\u0278\u027d\u027e\u0287\u0279\u027f\u027f \u0297\u029b\u029b \u02af\u02af \u02c9\u02c9\u02c9\u02c9\u02c9 \u02c1\u021f\u021f\u0217 \u02a9 \u02b1 \u02c2\u02c2\u02c2\u02c5\u02c5 \u0272\u02b5\u02b6\u01d8 \u02c7 \u02b2\u02b2\u02b2\u02b2", - "\u02ca\u02ca \u029d\u029d\u027a\u0282\u0282\u029e\u029e\u02b8 \u02c3\u02c4\u02ad\u02b3 \u02be \u02a6 \u02a0\u02a1\u0291\u0291\u027c\u027c\u0267\u0278\u027d\u027e\u0287\u0279\u027f \u0297\u029b \u02af \u02c9\u02c9 \u02c9\u02c9 \u02c1\u021f\u021f\u0217\u02bb \u02a9\u02a9\u02a9\u02a9\u02a9\u02a9\u02a9 \u02b1 \u02c2\u02c2\u02cb\u02c5\u02cc \u0272\u02b4\u02b6\u02b6\u01d8 \u02c7 \u02b2", - " \u02ca\u029d\u029d\u027a\u0282\u0282\u0282\u029e\u02b8 \u02c4 \u02b3 \u02be\u02be \u02a6\u02a6 \u02a0\u02a1\u0291\u02a6\u027c\u0267\u029a\u0271\u027d\u0287\u0287\u0279\u027f \u0297\u0297\u029b \u02af\u02cd \u02c9\u02c9\u02c9 \u02c9 \u02c1\u021f\u02bf\u02bf \u02a9\u02a9\u02a9\u02a9\u02a9\u02c2\u02c2\u02c2\u02cb\u02cb \u02cc\u02cc \u0272\u02b5\u02b5 \u01d8 \u02c7 ", - " \u029d\u029d\u027a\u027a\u0282\u0282\u029e\u02b8 \u02c3\u02c4\u02b3\u02b3 \u02be\u02be \u02a6\u02a6\u02a6\u02a0\u02a1\u0291\u02a6\u027c\u0267\u0270\u0271\u027e\u0287\u0287\u027f\u027f \u0297\u0297 \u02ce\u02ce \u02cf\u02cf\u02c9\u02c9 \u02c9 \u02c1\u02c1\u02bf\u02d0 \u02d1\u02d1\u02c2\u02cb\u02cb \u02d2\u02cc\u02d3\u02d3 \u0272\u02b4\u02b6 \u01d8 \u02c7\u02c7 ", - " \u029d\u029d\u027a\u0282\u0282\u029e\u02b8\u02b8 \u02c4\u02c4\u02ad\u02b3 \u02be\u02be \u02a0\u0291\u0291\u02a6\u027c\u0267\u029a\u0271\u027d\u0287\u0287\u027f\u027f \u0297\u02d4 \u02ce \u02cf \u02c9 \u02c9\u02d5\u02d5\u02bf \u02d1\u02d1\u02d6\u02d6 \u02d2\u02d2\u02d2 \u02cc \u02d3 \u0272\u02b5\u02b6\u01d8\u01d8 \u02c7\u02c7 ", - "\u029d\u029d\u027a\u0282\u0282\u029e\u029e\u02b8 \u02c3\u02c4\u02ad\u02b3 \u02be\u02be \u02a1\u0291\u0291\u027c\u027c\u02d7\u0270\u0271\u027e\u0287\u0279\u027f\u027f \u0297\u02d8\u02d4 \u02ce \u02c9\u02c9 \u02c9\u02c9\u02c9\u02c1\u02c1\u02bf\u02bb \u02d1\u02d1\u02cb\u02cb\u02d9 \u02cc\u02d3\u02d3 \u02b4\u02b4\u02b6\u01d8\u01d8 \u02c7 ", - "\u029d\u027a\u0282\u0282\u0282\u029e\u02b8 \u02c4\u02ad\u02b3 \u02be\u02be \u02a1\u0291\u0291\u027c\u027c\u02d7\u0278\u027d\u027e\u0287\u0279\u027f\u027f \u0297\u0297\u02d4 \u02da\u02da\u02ce \u02c9\u02c9\u02c9 \u02db\u02c1\u02c1\u02bf \u02d1\u02d1\u02cb\u02cb \u02d9 \u02cc\u02cc\u02d3\u02d3 \u0272\u02b5\u02b6\u01d8 \u02c7 ", - "\u027a\u0282\u0282\u0282\u029e\u02b8 \u02c3\u02c4\u02b3 \u02be\u02be \u02a6\u02a1\u0291\u0291\u027c\u027c\u02d7\u02dc\u02dd\u027e\u0287\u0279\u027f \u0297\u02d4 \u02da\u02da\u02ce \u02db\u02c1\u02bf\u02bf \u02d1\u02d1\u02cb\u02cb \u02d9 \u02cc\u02cc\u02d3 \u02b4\u02b6\u02b6\u01d8 \u02c7 ", - "\u027a\u0282\u0282\u029e\u02b8\u02b8 \u02c4\u02c4\u02ad\u02b3 \u02be \u02a6\u02a6\u02a1\u02a1\u0291\u02de\u027c\u02df\u02e0\u02dd\u02e1\u0287\u0279\u027f \u0297\u0297\u02d4 \u02da\u02da \u02ce \u02db\u02c1\u02c1\u02bf\u02bb \u02d1\u02d1\u02cb\u02cb \u02d9 \u02cc \u02d3 \u02b5\u02b6 \u01d8 \u02c7\u02c7 ", - "\u0282\u0282\u029e\u02b8\u02b8 \u02c3\u02c4\u02b3\u02b3 \u02be \u02a6\u02a6 \u02a1\u0291\u0291\u02de\u027c\u02dc\u02e0\u02e1\u02e2\u02e3\u027f\u027f \u0297\u0297\u02d4 \u02da \u02ce\u02ce \u02db\u02c1\u02c1\u02bf\u02bb\u02bb\u02d1\u02d1\u02cb\u02cb \u02d9 \u02cc \u02d3 \u02b4\u02b4\u02b6\u01d8\u01d8 \u02c7\u02c7 ", - "\u0282\u029e\u029e\u02b8 \u02c3\u02c4\u02ad\u02b3 \u02be \u02a6 \u02a1\u0291\u0291\u02de\u027c\u02dc\u02e0\u02e1\u02e3\u02e3\u027f\u027f \u0297\u0297\u02d4 \u02da \u02ce \u02db\u02db\u02c1\u02c1\u02bf\u02bf\u02d1\u02d1\u02cb\u02cb\u02e4\u02e4\u02e5 \u02d9 \u02cc \u02d3 \u02b4\u02b5\u02e6\u01d8\u01d8 ", - "\u0282\u029e\u02b8 \u02c3\u02c4\u02b3 \u02be\u02be \u02a6 \u02a1\u0291\u0291\u02de\u027c\u02e0\u02dd\u02e1\u02e3 \u027f\u027f \u0297\u0297\u02d4 \u02da\u02da \u02ce \u02db\u02db\u02c1\u02d0\u02e7\u02d1\u02e8\u02cb \u02e5\u02e5\u02e5\u02d9\u02d9\u02d9\u02d9\u02d9 \u02cc\u02cc\u02e9\u02d3 \u02b4\u02b5\u02b6\u01d8 ", - "\u029e\u02b8 \u02c4\u02c4\u02ad \u02be\u02be \u02a6\u02a1\u0291\u02de\u02de\u027c\u02dd\u02e0\u02e3\u02e3 \u027f\u027f \u0297\u02ea\u0297 \u02da\u02da \u02ce \u02eb \u02db\u02c1\u02c1\u02e7\u02d0\u02e8\u02cb \u02d9\u02d9\u02d9\u02d9\u02d9\u02d9\u02d9\u02cc\u02cc\u02e9\u02d3 \u02ec\u02b5\u02ed\u01d8 ", - "\u02b8\u02b8 \u02c3\u02c4\u02b3\u02b3 \u02be\u02be \u02a6\u02a6\u02de\u02de\u027c \u02dd\u02e2\u02e2 \u027f\u027f \u0297\u02ea\u02d4 \u02da\u02da \u02ce\u02ce \u02eb\u02eb \u02db\u02ee\u02ee\u02d0\u02ef\u02cb \u02d9\u02cc\u02e9\u02e9\u02d3 \u02b4\u02b6\u02e6\u01d8 ", - "\u02b8 \u02c3\u02c4\u02ad\u02b3 \u02de\u027c\u027c \u02e1\u02e2 \u027f\u027f \u02ea\u02ea\u02d4 \u02da\u02da \u02ce\u02ce \u02eb \u02f0\u02ee\u02ee\u02ee\u02d0\u02d0\u02f1 \u02f2\u02cc\u02e9\u02d3\u02d3 \u02b4\u02ec\u02ed\u02ed\u01d8 ", - " \u02c3\u02ad\u02b3 \u02de\u027c\u027c \u02e1\u02f3 \u027f\u027f\u0297\u0297\u02d4 \u02da \u02ce\u02ce \u02eb \u02f0\u02f0\u02f4\u02f5\u02f5\u02db\u02f1\u02f1\u02f1\u02f1 \u02f2 \u02cc\u02e9\u02d3\u02d3 \u02f6\u02f6 \u02b4\u02ec\u02b6\u01d8\u01d8 ", - " \u02c4\u02c4\u02ad \u02de\u027c\u02f7\u02f3\u02e1 \u027f\u0297\u0297\u02d4 \u02da\u02da \u02ce\u02ce \u02eb \u02f0\u02f0\u02f5\u02f5\u02f8\u02f9\u02f9\u02f1\u02f1\u02f1\u02f1\u02f1\u02f1 \u02f2 \u02cc\u02cc\u02e9\u02d3\u02d3\u02f6\u02f6 \u02ec\u02b5\u02ed\u01d8\u01d8 ", - " \u02c3\u02c4\u02b3 \u02de\u02de\u027c\u02f7\u02fa\u02f3\u027f\u027f\u0297\u0297\u0297 \u02da\u02da \u02ce \u02eb \u02fb\u02f0\u02f0\u02f5 \u02f8\u02f9\u02f9\u02f9\u02f1\u02f1\u02f1\u02f1\u02f1\u02f1\u02f1\u02f1\u02f1\u02f1\u02f1\u02f1\u02f1\u02fc\u02f1 \u02fd\u02e9\u02e9\u02f6\u02f6 \u02b4\u02b5\u02e6\u01d8\u01d8 ", - "\u02c3\u02c4\u02ad\u02b3 \u02de\u02de\u027c\u02f7\u02fa\u02fe\u02ff\u02ff\u0297\u0297\u02d4 \u02da\u02da \u02ce\u02ce \u02eb \u0300\u02fb\u02f0\u02f5\u02f5 \u02f8\u02f9\u02f9\u02f9\u02f9\u02f1\u02f1\u02f1\u02f1\u02f1\u02f1\u02f1\u02f1\u02f1\u02fc\u02fc\u02f1\u02f1\u02f1\u02f1\u02f1\u02f1\u02fd\u02e9\u02e9\u02d3 \u02b4\u02b4\u02b6\u02e6\u01d8\u01d8 ", - "\u02c3\u02b3\u02b3 \u02de\u027c\u027c\u02fa\u02fa\u02fe\u02ff\u0297\u0297\u02d4 \u02da\u02da \u02ce\u02ce \u02eb \u02fb\u02fb\u02fb\u02f0\u02f5 \u02f8\u02f8\u02f9\u02f9\u02f9\u02f9\u02f9\u02f9\u02f9\u02f9\u02f9\u02f9\u02f9\u02fc\u02f9\u02f9\u02f1\u02f1\u02f1\u02f1\u02f1\u02fd\u02f1\u02e9\u02e9\u02d3 \u02b4\u02b4\u02b6\u02e6\u01d8 ", - "\u02ad\u02b3 \u02de\u027c \u02fa\u02fa\u02fe\u02ff\u0297\u0297 \u02da \u02ce\u02ce \u0300 \u02f5\u02f5 \u02f8\u02f8\u02f8\u02f8\u02f9\u02f8\u02f8\u02f8\u02f8\u02f8\u02fc\u02f9\u02f9\u02f9\u02f9\u02f9\u02f9\u02f9\u02f1\u02f1\u02fd\u02f1\u02f1\u02e9\u02d3 \u02b4\u02b5\u02b6 \u01d8 ", - "\u02b3 \u02de\u02de\u027c \u02fe\u02fe\u02ff\u0297\u02d4 \u02ce\u02ce \u02f9\u02f9\u02f9\u02fd\u02f1\u02f1\u02f1\u02d3\u02d3 \u02b4\u02b5\u02b6 \u01d8 ", - "\u02b3 \u02de\u02de\u027c \u02fe\u02fe\u02ff\u0297\u02d4 \u02ce \u02fd\u02f9\u02f1\u02f1\u02f1\u02f1\u02d3 \u02b4\u02b6\u02b6\u01d8\u01d8 ", - " \u02de\u027c\u027c \u02fe\u02fe\u0297\u0297\u02d4 \u02ce\u02ce \u02f9\u02f9\u02f9\u02f1\u02f1\u02f1\u02d3 \u02b4\u02b4\u02b6\u02b6\u01d8\u01d8 ", - " \u02de\u02de\u027c \u02fe\u02fe\u0297\u0297 \u02ce\u02ce \u02f9\u02f9\u02f1\u02f1\u02f1\u02d3 \u02b4\u02b5\u02b6\u02b6\u01d8 ", - " \u02de\u02de\u027c \u02fe\u02ff\u0297\u02d4 \u02ce\u02ce \u02f9\u02f9\u02f1\u02f1\u02f1\u02d3 \u02b4\u02b5\u02b6 \u01d8 ", - " \u02de\u027c \u02fe\u02ff\u0297\u02d4 \u02ce\u02ce \u02f9\u02f9\u02f1\u02f1\u02f1\u02d3 \u02b4\u02b5\u02b6 \u01d8 ", - " \u02de \u02fe\u02fe\u02ff\u0297\u02d4 \u02f9\u02f1\u02f1\u02f1\u02d3 \u02b4 \u02b6\u01d8\u01d8 ", - " \u02fe\u02fe\u0297\u0297\u02d4 \u02f9\u02f1\u02f1\u02f1\u02d3 \u02b4\u02b5\u02b6\u02b6\u01d8 ", - " \u02fe\u02fe\u0297\u0297\u02d4 \u02f9\u02f1\u02f1\u02f1\u02d3 \u02b4\u02b5\u02b6 \u01d8 " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/road-casings-non-grouped-rendering-600-600-2.0-grid-reference.json b/tests/visual_tests/grids/road-casings-non-grouped-rendering-600-600-2.0-grid-reference.json deleted file mode 100644 index fd52148a6..000000000 --- a/tests/visual_tests/grids/road-casings-non-grouped-rendering-600-600-2.0-grid-reference.json +++ /dev/null @@ -1,856 +0,0 @@ -{ - "keys": [ - "", - "330", - "155", - "74", - "57", - "788", - "774", - "201", - "202", - "181", - "228", - "691", - "523", - "73", - "749", - "530", - "385", - "384", - "286", - "1", - "156", - "531", - "361", - "45", - "43", - "93", - "46", - "527", - "589", - "288", - "215", - "605", - "138", - "532", - "588", - "154", - "362", - "348", - "328", - "639", - "635", - "637", - "638", - "529", - "497", - "576", - "300", - "329", - "237", - "636", - "600", - "103", - "534", - "595", - "137", - "232", - "593", - "136", - "104", - "353", - "14", - "180", - "526", - "592", - "594", - "323", - "490", - "327", - "203", - "256", - "258", - "528", - "415", - "442", - "342", - "596", - "157", - "343", - "331", - "257", - "89", - "598", - "599", - "367", - "344", - "335", - "277", - "597", - "371", - "276", - "275", - "126", - "113", - "369", - "108", - "107", - "590", - "407", - "414", - "147", - "99", - "97", - "124", - "122", - "110", - "472", - "591", - "153", - "100", - "102", - "173", - "174", - "481", - "336", - "406", - "75", - "159", - "96", - "72", - "200", - "266", - "265", - "263", - "269", - "231", - "419", - "179", - "182", - "525", - "392", - "391", - "313", - "390", - "183", - "417", - "411", - "315", - "473", - "479", - "446", - "146", - "475", - "474", - "401", - "421", - "445", - "483", - "551", - "480", - "356", - "476", - "583", - "324", - "839", - "462", - "655", - "325", - "389", - "393", - "724", - "440", - "267", - "227", - "620", - "477", - "582", - "268", - "535", - "464", - "299", - "16", - "271", - "259", - "225", - "247", - "463", - "693", - "270", - "548", - "467", - "465", - "422", - "418", - "261", - "489", - "633", - "466", - "238", - "244", - "246", - "482", - "634", - "671", - "333", - "326", - "239", - "248", - "488", - "448", - "245", - "484", - "460", - "332", - "378", - "25", - "577", - "461", - "471", - "381", - "188", - "565", - "470", - "469", - "334", - "379", - "355", - "284", - "279", - "175", - "668", - "550", - "562", - "373", - "665", - "354", - "632", - "485", - "570", - "575", - "673", - "131", - "404", - "587", - "585", - "549", - "663", - "41", - "285", - "739", - "478", - "40", - "773", - "262", - "690", - "78", - "145", - "358", - "226", - "260", - "283", - "687", - "486", - "133", - "672", - "95", - "121", - "322", - "195", - "264", - "177", - "396", - "321", - "359", - "15", - "402", - "686", - "619", - "641", - "615", - "397", - "59", - "236", - "282", - "204", - "786", - "618", - "614", - "403", - "376", - "58", - "212", - "692", - "584", - "400", - "56", - "55", - "199", - "375", - "374", - "31", - "405", - "319", - "640", - "579", - "670", - "357", - "505", - "743", - "493", - "50", - "92", - "38", - "784", - "847", - "320", - "841", - "213", - "568", - "741", - "492", - "39", - "840", - "254", - "747", - "827", - "607", - "53", - "158", - "398", - "439", - "753", - "224", - "438", - "214", - "835", - "223", - "626", - "5", - "54", - "61", - "119", - "838", - "302", - "62", - "52", - "22", - "165", - "494", - "13", - "769", - "622", - "491", - "301", - "423", - "118", - "252", - "222", - "631", - "317", - "710", - "318", - "495", - "36", - "304", - "762", - "697", - "630", - "123", - "760", - "621", - "674", - "2", - "253", - "255", - "846", - "77", - "453", - "3", - "708", - "628", - "291", - "383", - "308", - "726", - "771", - "617", - "625", - "564", - "581", - "295", - "292", - "365", - "830", - "722", - "845", - "624", - "656", - "666", - "42", - "294", - "694", - "623", - "627", - "606", - "580", - "456", - "47", - "716", - "732", - "836", - "507", - "629", - "654", - "653", - "293", - "23", - "758", - "837", - "613", - "65", - "48", - "144", - "459", - "834", - "780", - "184", - "457", - "125", - "833", - "764", - "831", - "719", - "844", - "139", - "616", - "679", - "681", - "682", - "458", - "29", - "766", - "768", - "825", - "842", - "166", - "511", - "26", - "27", - "30", - "772", - "219", - "220", - "610", - "675", - "17", - "518", - "509", - "63", - "770", - "689", - "221", - "506", - "677", - "35", - "37", - "120", - "832", - "714", - "738", - "680", - "678", - "755", - "730", - "676", - "443", - "740", - "713", - "11", - "444", - "703", - "742", - "717", - "745", - "826", - "501", - "142", - "642", - "117", - "130", - "767", - "503", - "20", - "18", - "731", - "808", - "185", - "170", - "727", - "90", - "521", - "569", - "70", - "191", - "234", - "515", - "513", - "522", - "701", - "311", - "545", - "684", - "556", - "517", - "516", - "514", - "733", - "211", - "141", - "519", - "696", - "350", - "310", - "210", - "64", - "520", - "303", - "699", - "736", - "729", - "524", - "450", - "345", - "725", - "816", - "822", - "349", - "192", - "135", - "746", - "815", - "813", - "189", - "190", - "546", - "643", - "24", - "33", - "34", - "510", - "705", - "744", - "721", - "712", - "193", - "553", - "538", - "555", - "750", - "817", - "559", - "539", - "795", - "818", - "707", - "351", - "603", - "604", - "76", - "794", - "683", - "206", - "544", - "819", - "779", - "783", - "787", - "789", - "32", - "706", - "807", - "805", - "793", - "297", - "235", - "105", - "44", - "543", - "542", - "759", - "791", - "711", - "852", - "290", - "347", - "289", - "160", - "536", - "51", - "757", - "728", - "811", - "781", - "785", - "169", - "810", - "778", - "541", - "504", - "98", - "709", - "148", - "134", - "748", - "809", - "704", - "426", - "163", - "149", - "4", - "752", - "346", - "341", - "305", - "167", - "162", - "754", - "12", - "109", - "67", - "828", - "540", - "340", - "10", - "168", - "824", - "112", - "554", - "763", - "688", - "68", - "756", - "428", - "106", - "782", - "229", - "829", - "496", - "128", - "127", - "161", - "249", - "761", - "176", - "132", - "561", - "537", - "306", - "19", - "432", - "307", - "309", - "111", - "171", - "129", - "164", - "250", - "178", - "695", - "21", - "116", - "804", - "775", - "197", - "360", - "803", - "802", - "800", - "806", - "801", - "799", - "798", - "797", - "217", - "216", - "718", - "150", - "843", - "720", - "790", - "338", - "152", - "69", - "151", - "7", - "86", - "8", - "207", - "218", - "796", - "451", - "88", - "6", - "172", - "777", - "558", - "452", - "209", - "208", - "776" - ], - "data": {}, - "grid": [ - " !! ##$$ %%%%&&' (( )))) *** + ", - " !! ##$$ %%%,&& (( )))) **** ++ ", - " - . !! ###$$ %%%/,'' (( )))) **** ++ ", - " -- ... !! ###$$ %%//&' (( )))) **** +++ ", - " -- 00 ... !! ###$$1 22%%%/&&' (( )))33 *** +++ ", - " -- 00 .... !! ###$$1 222%%%,&&44 (( )))33 **** ++ ", - " -- 00 5.... !! ###$$1 222%%%/,'4444 (( ))))33 **** +++ ", - " -- 00 655.... !! 7777777 8##$$112229%%//&'4444 (( ))) 333**** ++++ ", - " -- 00 65555.... !! 7777777 ###$$112229%%/&&'4444 ( ))) 33*** ++++ ", - " -- 00 66 5555...:. !! 77 ##;$$12229%%%,&&4444 ( )) 33** ++++ ", - " << 00 66= 5555.:::. !! 77 ###$$$12229%%%,&'4444 (( ))>>*33* ++++++ ? ", - " <<<<<< @ 0 66=== 5555::.... !! 77 ###A$$1229%%//,''444 ( )) >>333++++++++ ???? ", - " -- <<<<<<@ BBB 666 ==C CC555D...... !! 77 EEEEF ###;AAG1299%%/&&'4444 ( )))*>*33+++ ??? ???? ", - " --HHIJJK<>>555???@;; > ??DEFGGG GH$IJB B 4BBK = L LMM C ", - " & & & NN > ?? F G GOPJJP BBQR LLLMS C ", - " & && TTU VV FF WW P J XXX L L SSCCCC ", - " &&&& T T VVY YY WZ[ [ X ] L L ", - " ^^ & &&&&& T T Y Y _Z Z[P XX X `` L] L L ", - " ^^ && & aab Y _Z ZPPPX ``] ] L L ", - " ^^ c aa bd ef Y _ ggh ]X ]i]L j L ", - " ^ ^ ccc aa b d e eYYk Z Z h ]] ] lj jL ", - " ^ ^^ mnn e kZ ohh ] ] pl lj q ", - " ^^rst uubb ve e k k wo o ] lj q ", - " t xy uuud vzv{ k k |o}} ]] lljj qq ", - " ~\u007f\u007fxy y \u0080 \u0081v z {f\u0082\u0082k k } } ]\u0083 j q ", - " x y \u0084\u0084 \u0085 \u0086 z { \u0082 k| }} \u0083\u0083 l \u0087 qq ", - " x yy \u0088\u0088\u0089 \u0085 \u0082\u0082 \u008a\u008a\u008b\u008b \u008c}} \u008d\u008d\u0087 \u0087\u008d ", - " \u008e xxy \u008f \u008f \u0090\u0090 \u008a \u008b\u008b \u008c \u008d\u008d\u0087 \u008d\u008d \u008d\u008d\u008d\u008d ", - " \u0091\u0091\u0091 \u008f\u008f\u008f \u0090\u0090\u008a \u008b\u0092\u008c } \u008d \u008d\u008d\u008d \u008d\u008d\u008d\u008d\u008d ", - " \u0091 x \u008f \u008a \u0092 \u0092 \u008d \u008d\u008d \u008d \u0093 \u0093\u0093 ", - " \u0091 \u008f \u0094\u0094\u008a\u008a \u0095 \u0092 \u008d\u008d\u008d \u008d \u008d\u0093\u0093\u0093 \u0096 ", - " \u0091 \u0091\u008f\u008f \u0094 \u008a\u0095 \u0092\u0092\u0092 \u0097 \u0097 \u0093 ", - " \u0091 \u008f \u008f \u0094 \u0094\u0094\u008a\u0095\u0098 \u0099 \u0097 \u0097 ", - " \u0091\u0091 \u008f \u0095 \u009a\u009a\u009b\u0098\u009b \u0099 \u0099 \u0097 \u0097\u0097 \u0097 ", - " \u009c \u009d\u009d \u009a \u009b \u0099 \u0097 \u0097 \u009e ", - " \u009c\u009c\u009f\u009d\u008f\u009d \u008f \u00a0 \u009a \u0099\u0099 \u0097 \u0097 \u009e ", - " \u009c \u009d\u008f \u008f \u00a0 \u00a1 \u0099 \u0097 \u0097 ", - " \u009d\u009d \u00a0\u00a0 \u0097 ", - " \u009c \u008f \u008f \u00a2 \u0097 ", - " \u009c\u009c \u00a3 \u00a3 \u00a4\u00a4\u00a4\u00a4 \u0097\u0097\u0097 \u0097\u0097 \u0097 ", - " \u009c\u009c \u0097 \u00a5", - " \u009c\u009c \u00a6\u00a6 \u0097 \u00a5\u00a5", - " \u009c\u00a6 \u00a6 \u0097\u0097 \u00a5\u00a5 ", - " \u009c \u00a6 \u00a5 \u00a5 ", - " \u009c \u00a6 ", - " \u009c\u009c ", - " \u009c\u009c\u00a6 \u00a7 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!!!!!! ######### ", - " ! !!!!!!! !!#### #### %%%%%%% $$$ ", - " !!!!! !!!!! !! ### # %% $ $$$ $ ", - " ! ! ! !! # ### $$$$$ $$ ", - " &&& !!!!!! ! !! !! # ### $$ $ $ $$ $$$$$$$$$$$$$ ", - " & !!!!!!!! !! !! !! # ## ')) *$$$$$$$$$$$$$$ $$ $", - " &&& !!! ! # (((( ')' )) $$ $ $", - " & & !!!! !!!!! ## # ' ) * $ $$ $", - " & &&&&&&&& ! !!! ! # '' ) * $ $$$$ $$$ ", - " & !&& ! !! !! ++ )) 00$ $$ $$ ", - " ! !! !! !! 1 + -////\u00a8\u00a8$$ $$$ $$ $ $ $ $ ", - " !! !!!! ! ! ++55- / 33 $$ $$$ $$ $$ $$$$ $ $ $$ $ ", - " &&&&&&&&&&!&&& !!!! !! 5 5--7\u00a933 3$ $4 4=L === $$ $ ", - " && & !&&! ! ? ?@\u00aa<<<<3$ $ 4B4 4 == == LL$ C ", - " & && & > >>5 ? ? A GG$$$ JBJ BB K44 === LL CC ", - " & > > ? ?FFG PPIJ BBB L LL C ", - " & & >> UUU F GGGGGG JJP QQQXX L CCC ", - " & & TTU WW P P XQXL] L C ", - " ^^^&^ & TTT Y Y___\u00ab [[ X Q L L ", - " ^^^ & && & aaU Y Y Z Z PPP P ] `LLLLL L ", - " ^ ^^ & abbU YY Y _ gg XXXX ] p p L ", - " ^ ^^ ^ccc ab b d eefY Y_k__Z Z h ] i] Ljj L ", - " ^ ^^^ c Ue ef k k ZZh ] ] p p j ", - " ^^ ^ bb de e f wwZZooo ] p l\u00acl q ", - " rtt uu dvve{ee f k|woo ] pll\u00adj q ", - " t xyy \u00ae \u0081 v { {f \u0082 }}}} ]] l jj ", - " \u007f\u007f y \u0084 \u0081 { { \u0082\u0082 kk k } \u0087 ", - " x y y\u0084\u0088 \u0081\u0081 { \u00af\u008a\u008a\u0082\u0082 kk |}} \u0083 \u008d l ", - " x \u008fyy \u0084\u0088 \u0090\u0082\u0082\u008a \u008a\u008c \u008c} \u008d\u0087 \u008d\u008d\u008d ", - " \u008e\u0091\u0091\u008fx \u0090\u0090\u008a\u008a \u0092\u008c } \u008d\u008d \u008d\u008d \u008d\u008d ", - " \u0091 \u0091 \u008f\u008f\u008f \u008a\u008a \u0092 \u0092\u008c \u008d \u008d\u008d\u008d\u008d\u008d \u008d \u0093 \u0093 ", - " \u0091 \u0091 \u008f \u008a\u0094\u0094 \u0092 \u0092 \u008d\u008d \u008d \u0093 ", - " \u0091\u008f\u008f \u008a\u008a \u0092\u0092\u0092 \u008d \u008d\u0093\u0093\u0093 ", - " \u0091 \u009f\u009f \u008f \u0094\u008a\u008a\u0095\u0098\u009b\u009b \u0097\u0097 \u0097 ", - " \u0091\u0091\u0091\u009f \u008f \u008f \u0095 \u009b \u0099 \u0097 \u0097 \u0097 ", - " \u009c\u009f \u009f \u00a0\u00a0\u00a0\u00a0\u009a\u009a\u009a\u009a\u0098 \u0099\u0099 \u0097 \u0097 ", - " \u009c\u009c \u009f\u009d\u008f \u00a0 \u00a0\u00a1\u009a \u009b \u0099 \u0097 \u0097 \u009e ", - " \u009c\u009c\u00a6\u009d \u009d \u008f \u00a0 \u00a0 \u00a1\u00a4 \u0099 \u0097 \u0097 ", - " \u009c \u009d\u009d \u00a1 \u00a4 \u0097 ", - " \u00a6 \u008f \u00a4\u00a0 \u00a4 \u0097 \u0097 ", - " \u009c \u008f\u008f \u00a4 \u0097 \u0097\u0097\u0097 \u0097 ", - " \u009c\u009c \u00a6 \u00a4 \u0097 \u00a5 ", - " \u009c\u009c \u00a6 \u0097\u0097\u0097\u0097 \u00a5\u00a5", - " \u00a6 \u00a6 \u0097 \u00a5\u00a5 ", - " \u00a5 ", - " \u009c\u009c \u00a6 \u00a5 ", - " \u009c \u00a6 ", - " \u009c\u009c\u009c ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!!!!! #### # ## ", - " ! !!### # # ", - " !! ## # $$ $$$$$ ", - " !! # # $$ $$$ $$ $$$$$ ", - " & &&&! !!!!!!!!!!!!!!! # # '' $$$$ $$ $$ ", - " & & !!!!! ! ! !! ## # ( '''$$$ $$$ $$ $", - " & & !! !! !!!! ! # # ''') *$* $$ ", - " & && ! ! ! !!! ## ' ' ) **$ $$$$ $", - " && &&!& ! ! ! $ $ $ ", - " & && !! ! ! ) $ $$$$$$$$ $ $ $ ", - " ! !!! ! +++ - / / $ $$$ 44 LL $$ ", - " !! && !! 55 - / 33 $ $ 4 === L $ ", - " &&&& !!!!!& && 5 5 ?- << 33 3$ $ L === == L $LL ", - " & && &&!&!! >>> 5? ? $$4 BBB L4 = =LL L LL$$ ", - " & > ? FF GG $ J B BBK LL M C ", - " & & >> ? G GP PJP JBB L M C ", - " & UU W [ QX L C ", - " && & TTTT Y W[ P Q X ] L ", - " ^^ &&& & TTT U YYY Y__ ZZZZPP X ] ] L p ", - " ^^^ &&& & b Y Y _Z Z PPX X ] L] L ", - " ^^ c abbd YY Y _ Z ]X ]L jLLL ", - " ^^ ^^ ccc a b dU U eYYY kk ZZZZZZ ] ] L j ", - " ^^^ bbd de f k oh ] ] l j ", - " ^ e e f k oo ] ] l j ", - " xy u dd { {{f k ||o } ] j ", - " x y \u00ae\u00ae {{{f k |k } ]] j ", - " x y y\u0084 { \u00af \u0082 \u0082\u0082kk k } \u0087 ", - " xy y\u0084\u008f \u00af \u00af\u00b0 \u008a \u008b } \u0087 ", - " xxy\u008f \u0084 \u008f \u00af\u008a\u008a \u008b } \u0087\u008d \u008d ", - " \u0091\u008f \u008f\u008f \u008a \u008a\u0092\u0092 \u008d \u008d ", - " \u0091\u0091 \u0091 \u008f \u008a \u008a\u0092 \u0092 \u008d ", - " \u0091 \u008f\u0091 \u008f \u0094\u008a\u0094 \u0092 \u0092 ", - " \u0091 \u0091\u008f \u0094 \u008a\u0095\u0095\u0095\u0095\u0092\u009b \u0097 ", - " \u0091\u0091\u009f\u008f \u008f \u0095 \u0095\u009b \u009b \u0097\u0097 ", - " \u0091\u009f \u009f\u008f \u008f \u0095\u0095\u009a\u009a \u0099 \u0097 \u0097 ", - " \u0091 \u009d\u009f \u00a0 \u00a0\u00a1 \u009b \u009b \u0097\u0097 \u0097 ", - " \u009c \u009f \u009d \u008f \u00a0 \u00a1\u00a4 \u0099 \u0097 ", - " \u009c \u00a6\u008f \u008f \u00a0 \u00a1\u00a4 \u009b \u0097 \u0097 ", - " \u009c \u008f \u008f \u00a4\u00a0 \u00a4 \u0097 ", - " \u009c\u009c \u00a6 \u008f \u00a4\u00a4 \u00a4 \u0097 \u0097 ", - " \u009c\u00a6 \u00a6\u008f \u00a4 \u0097 ", - " \u009c\u00a6 \u00a6 \u0097\u0097\u0097\u0097\u0097\u0097 ", - " \u00a6 ", - " \u00a5 ", - " \u009c\u009c \u00a6 \u00a5 ", - " \u009c\u00a6 ", - " \u009c\u009c ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!!! ######### ", - " #### # # ", - " !!! # # $$$$ ", - " ! # # $$$$$$ $$$$$ ", - " & !!!!!! !!! # # $$$$$$ $$$ $$$$$ ", - " & & !!!!!!!!! !!!! # # )''$ $$$ $", - " & ! !! !!!!! ! !!!!! # # ') $$ $ ", - " & & !! !! # # '' ) $ ", - " & & !!! ! ! $ $ ", - " &! !!!!!! $ $ ", - " ! !!! !!!! $ 44$4$$$ L $ ", - " ! !!!!!!!!!!! 33 $ 44 $ 4 $$$ LL L L $ ", - " &&&&&&&&&& &&& !!! 3 $ 444 $ $$$ L $ ", - " & &&& $ $ 444 4 ===L $$$ $ ", - " & & $ $ 44 LL $$ ", - " & & P LL L L C ", - " & & U PP XL L C ", - " & & U U PP QX ] ] L L C ", - " ^^ & & U U YYY P Q X ] ]] L ", - " ^^^ & & U YYY PX ] L] L L ", - " ^^ d UUU U X ] L L ", - " ^ dd ] LLL ", - " ^ d eeee ] ] ", - " ee ] ", - " dd ] ] ", - " ]] ", - " ] ", - " \u008f \u008a ", - " \u008f \u008f\u008f \u008a ", - " \u008f \u008f\u008f \u008a \u008a ", - " \u008f \u008f\u008f \u008a \u008a ", - " \u0091 \u008f \u008f\u008f \u008a \u008a ", - " \u0091\u008f \u008f \u008a\u008a ", - " \u0091\u008f \u008f \u008a\u008a \u0097\u0097 ", - " \u0091\u008f \u0097 \u0097 ", - " \u008f \u0097 ", - " \u008f \u008f \u0097 \u0097 ", - " \u00a6\u00a6\u008f \u008f \u00a4 \u0097 \u0097 ", - " \u00a6 \u008f\u00a6 \u008f \u00a4 ", - " \u00a6 \u00a6 \u008f \u0097 ", - " \u00a6 \u00a6\u008f \u0097 \u0097 ", - " \u00a6 \u00a6 \u0097\u0097\u0097\u0097\u0097 \u0097 ", - " \u00a6 \u0097\u0097 ", - " \u00a6 \u00a6 ", - " ", - " \u00a6 ", - " \u00a6 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/simplify-douglas-peucker-500-1000-2.0-grid-reference.json b/tests/visual_tests/grids/simplify-douglas-peucker-500-1000-2.0-grid-reference.json deleted file mode 100644 index 7be0c9a70..000000000 --- a/tests/visual_tests/grids/simplify-douglas-peucker-500-1000-2.0-grid-reference.json +++ /dev/null @@ -1,369 +0,0 @@ -{ - "keys": [ - "", - "24", - "71", - "238", - "245", - "207", - "154", - "82", - "189", - "60", - "205", - "51", - "103", - "153", - "72", - "163", - "102", - "98", - "65", - "206", - "110", - "86", - "182", - "186", - "80", - "22", - "170", - "210", - "30", - "89", - "74", - "200", - "202", - "94", - "84", - "194", - "114", - "2", - "88", - "31", - "162", - "120", - "107", - "190", - "83", - "50", - "175", - "235", - "116", - "155", - "113", - "226", - "118", - "41", - "126", - "188", - "14", - "18", - "214", - "36", - "193", - "172", - "79", - "208", - "54", - "220", - "158", - "38", - "181", - "152", - "56", - "25", - "212", - "76", - "87", - "69", - "40", - "185", - "164", - "104", - "121", - "21", - "157", - "35", - "28", - "204", - "92", - "223", - "49", - "67", - "161", - "203", - "166", - "6", - "221", - "17", - "108", - "122", - "9", - "123", - "160", - "216", - "222", - "124", - "33", - "180", - "8", - "178", - "209", - "159", - "101", - "93" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!!!!!!!!!! ###### ######## ", - " !!!!!!!!!!!! ###### ### $$$$$$$ %%%% ", - " !!!!! !!!!!!!!! ### ## $ %%%% %%%%%%%% %%%%% ", - " !! !! !!!! !!!!!! ## ##### %% %%%%%%% %%%% %% ", - " &&&&&&&! !!!!!!! !!!!!!!! ## ### '''''' % % %% %%%%%%%%%%%%%%% ", - " && !!! ! !!! # ### ( '))) *%%%%%%%%%%%%%%%%%% %", - " &&&& !!!!!!! ! # # ((( ')'))* %%%% %%%", - " & && ! !! !!!!! ### '' )) **% %%%%%%%%%", - " &&&&&&&&&&& ! !! !! + ))) * % %%%% %%% ", - " && !&& !! ! !! ,++ ) --%% % % %% ", - " & !& !! !! !! , +++.//0000111% %%%2 %%2 %% %%% % ", - " ! && ! ! !! !! , +++3// /000444 %% %%22 %%%%% 5%%%%%% %% %% % ", - " && &&&&&& !&&&& &&!!!! 3 36777444444% %22 255 555 %% %% ", - " & & & !&&&!!! 8 3 696999:;; %% % 2<<< =2 555 555 = % >>> ", - " & &&& & 8 8 666 ? @@@@@%% A ", - " & && & 888 66 ??@ @CCA <<
> ", - " & & 8E FFF @@@@@G CCHHIIII = >>>> ", - " &&J && EEFE KKKKKK LL GC CIIHIMM = ", - " &&&JJ &&&&&& EEEE K K NO OO C IHHMI =M===== = ", - " J &&&& & PPQ K K O OCCCCI I RRRMMM = ", - " J J PPQQS KK K O OTU IIII MMM = == ", - " J J JVVVV P Q SS WWWWKKXXXXNO OOU M MYZ =[[=== ", - " J JJJJ Q SW W ]X XXO OOUU M MM Z^^^[ _ ", - " JJJJ` QQQQ aW W X] Xbccccc M M Z Z ^[ _ ", - " dd e ffSSSaagggg X Xhbcc M M Z^i[[ _ ", - " d jjjj kSlam g g]]nX X oooo MM ^ [[ _ ", - " p ejj j qklmmg g nn X X oo M r^ r ", - " e jjsjtts l gu nvnnXXwXxooo y ^ rry ", - " z sjj ss {{n v ww oo yyryyyyyyy ", - " z||se {{{vv }wx o yr y yyy yyyy ", - " | s| sssss vv } }} yy y yy y y~ ~ ", - " || | s vv\u007f\u007f \u0080 } yyy y yy ~ ~ ", - " | ||s\u0081 vv \u0080} } \u0082 y y~~~~ ", - " | s\u0081 s \u0080\u0080\u0080\u0080 \u0083 \u0082 \u0084\u0084\u0084 \u0084 ", - " ||\u0081 ss s \u0080\u0080\u0083\u0083\u0085\u0083 \u0082\u0082 \u0084\u0084 \u0084\u0084 \u0084 ", - " |\u0081 \u0081\u0086 \u0087 \u0087\u0087\u0088\u0088\u0088\u0088\u0085 \u0082\u0082 \u0084 \u0084 \u0084 \u0089 ", - " \u008a\u008a\u0081\u0086\u0086\u0086 s \u0087 \u008b\u0087 \u008b\u0088 \u0083 \u0082 \u0084\u0084 \u0084 \u0089 ", - " \u008a\u008a \u0086\u008c\u0086 s \u0087 \u0087\u008b\u008b\u008d\u0083 \u0082 \u0084 \u0084 \u0089 ", - " \u008a\u008a \u0086s\u008c s \u0087\u008b \u008d\u008d \u0082 \u0084 ", - " \u008a\u008c \u008e\u008c s \u008d\u0087 \u008d \u0084 ", - " \u008a \u008e\u008e\u008e \u008d \u008d\u008d \u0084 \u0084\u0084\u0084\u0084\u0084 \u0084 ", - " \u008a \u008c \u0084 \u0084 \u0084 \u008f\u008f", - " \u008a\u008a \u008c\u008c \u0084\u0084\u0084\u0084 \u008f\u008f", - " \u008a\u008c \u008c \u0084 \u008f ", - " \u008a \u008c \u0084 ", - " \u008a \u008c ", - " \u008a\u008a\u008c ", - " \u008a\u008a\u008a ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!!!!!! ###### ####### ", - " !!!!!! !###### ## # $$$$$$$ ", - " !!!!!!!! # ## %%%% %%%%%%%% ", - " !!! ! ## # % %%% %%% %%%%%%% ", - " &&&&&&&&! !!!!! !!!!!! ## ## *%' %%%%%% %%% %%%%%%% ", - " & & !!!!!!! ! !!!!! # # ( ))''%% %%%%% %%%% %", - " & & !! !!!!! ! !!!! ## ## ((( ')) * % %%%% % ", - " & && & !! !!! !!!! #### ''')) **** %%%% %% ", - " && &&& & !! ! !! !! ' )) % %%%% %% ", - " && &&& !! !! ! !! \u0090\u0090\u0090\u0090% 2%%%% % %% ", - " & !! !!!!! !! ++++ % %%%% 222 %%%%%%%%% % %% ", - " ! & !! !!! +++3 4444% %%22 222 == %% % % ", - " &&&&&&&&&!!&&!!!!!!&& 33 3 4444 % %222 =2 555555555555 % ", - " & & &&& !!! 8 33 ;; %% % <<<22 =2 555 == =% ", - " & && & 8 8883 ? @@ %% AA< <<<\u00912 == = B% > ", - " & & 888 @@@@ @@CCCAA A<
", - " & & 8 FF LLG@ C HI=M = > ", - " J&J & EEEEEF N LG GC CHHIIM MM = > ", - " JJ&&&& & EEEE F KKKKN GO CC C I I ===MM = ", - " JJ J &&&& & EFQ K K NNO O CCII IM MM= = ", - " J J & PPQS KK K NOO OOU IIII MZ ===== ", - " J JJ VVVVV P QSS FF ]KKKNXXNOO OO M M Z^ [ ", - " JJJJJJJ QQQ SWWW W ]KX XXOO O M M Z ^^[ ", - " Q WS W ]]X X Occc M M Z ^ [ ", - " ff SSS ggggg]X hhcc M M Z^^[ ", - " ejjj kS g g] XX hX oo o MM ^ [ ", - " e jj j g u nnnn XXXhhhoh M r ", - " e je js uu u nnnn X o r ", - " e jj ss uu v v o rry y ", - " ees ss vv v}} oo y y ", - " ||||| s vv v}} y ", - " | s| s vv v}}} yyyyy ", - " | |s s \u007f vv\u0080\u0080\u0080\u0080}} \u0084 ", - " ||\u0081s s \u007f \u0080v\u0080\u0083\u0083\u0083 \u0082 \u0084\u0084\u0084 ", - " |\u0081\u0081ss s \u0080\u0080\u0083\u0088 \u0083 \u0082 \u0084\u0084 \u0084 ", - " \u008a\u0081 \u0081s s \u0087\u0087\u0087\u0087\u0088\u0088\u0088 \u0083 \u0082 \u0084\u0084\u0084 \u0084 ", - " \u008a \u0081\u0086\u0081s s \u0087 \u0087\u008b\u008b\u008d \u0083 \u0082 \u0084\u0084 \u0084 ", - " \u008a\u008c \u008c\u0086\u0086 s \u0087\u008b\u0087\u008b\u008b\u0083\u0083 \u0084 \u0084 ", - " \u008a\u008a\u008c s s \u0087\u008d \u008d \u0084 ", - " \u008a\u008a \u008c s \u0087 \u008d \u0084 \u0084 ", - " \u008a\u008a \u008cs \u008d\u008d \u0084 \u0084 ", - " \u008a\u008c \u008c \u0084\u0084\u0084\u0084\u0084\u0084\u0084\u0084 \u0084 ", - " \u008a\u008c \u008c ", - " \u008a\u008c \u008c \u008f ", - " \u008a\u008a \u008c \u008f ", - " \u008a\u008a \u008c ", - " \u008a\u008a ", - " \u008a ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/simplify-radial-distance-500-1000-1.0-grid-reference.json b/tests/visual_tests/grids/simplify-radial-distance-500-1000-1.0-grid-reference.json deleted file mode 100644 index 78aa6c267..000000000 --- a/tests/visual_tests/grids/simplify-radial-distance-500-1000-1.0-grid-reference.json +++ /dev/null @@ -1,396 +0,0 @@ -{ - "keys": [ - "", - "24", - "71", - "245", - "238", - "207", - "154", - "82", - "189", - "60", - "205", - "45", - "53", - "51", - "163", - "103", - "102", - "153", - "98", - "30", - "65", - "129", - "72", - "191", - "182", - "170", - "206", - "110", - "186", - "86", - "80", - "236", - "22", - "210", - "112", - "74", - "200", - "68", - "3", - "202", - "93", - "94", - "89", - "84", - "31", - "194", - "96", - "114", - "2", - "199", - "190", - "88", - "162", - "120", - "107", - "175", - "83", - "50", - "155", - "235", - "116", - "226", - "14", - "18", - "41", - "113", - "126", - "214", - "36", - "188", - "193", - "244", - "48", - "54", - "220", - "118", - "172", - "75", - "79", - "158", - "181", - "208", - "56", - "99", - "212", - "197", - "152", - "185", - "25", - "39", - "164", - "38", - "183", - "87", - "35", - "40", - "77", - "157", - "104", - "26", - "121", - "59", - "28", - "204", - "92", - "223", - "49", - "21", - "67", - "161", - "203", - "27", - "166", - "6", - "221", - "9", - "123", - "108", - "222", - "122", - "33", - "160", - "180", - "124", - "17", - "216", - "8", - "178", - "209", - "159", - "101", - "57", - "105", - "81", - "165", - "91", - "76", - "69", - "19" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!!! !!######## ###### $ $$ $$ $$ ", - " !! !!! !!!!!!!!## # %%%%% $ $$$ ", - " !!!!!! !!!!!!!! #### ## $$$ $$$$ $$ $$$$$$ ", - " ! !!!!!! ! !!!! # ### $ $$ $$ $$ $ $$$$ $$$$ ", - " & &&&! !!!!!!!! !!!! !!!!! ! ## ## '''''$$ $$$ $ $$$$$$$", - " && !!! ! !! ## ## (( ) ) $$$$$$ $$$ ", - " & && ! !! !!!!! ! # (( ') )** $ $$ $", - " & &&& ! ! !! ## ' )* $ $$$ $ ", - " & & && ! ! !!! + ', ) -$ $$ $ $ $ ", - " && & !!! ! .++ ))/$01$ $$$ $ $ ", - " ! !! ! ..+ 2 / 11 $$ $ 3 $ $ $4$ $ $ ", - " !!!!!!! & !!! ! ++5556 7/// $$ $ $$$$$ $$$$$$4 $ $$ ", - " & & &!! !! 5 8899:: : ;$ $3 33 < <4 $$$ $ ", - " !&&& === 55>>?@@:A ; $$ $3 B BB < < $$ ", - " & = >> CDEE EEEFG HB B BBBII < JJ K ", - " & & = = >> D E EGLHHL BBMN 4JO K ", - " & PPQ RR DD S ST H UUU 4 O KKK ", - " &&V& P P RWW WW SX T U Y Y K ", - " VV && &&& && PP Q W ZX XXL UU U [[ Y 4 ", - " VV && & ]]^ Q W ZX XL_LU Y [`Y a 4 ", - " VV b ]] ^c QdW W Z _ U YYY 4 e 4 ", - " V VV bb ]] ^ c d dfWg gX he e4 i ", - " V VV jj ^ d d kXXllmm Y Y ah he n ", - " Vopq rr^c sd d gtl l Y ue nn ", - " qq vv rrrc swsx xx g g t y Y hhze n ", - " {||}vv v ~ \u007fs w x\u0080\u0081\u0081 t y YY h e n n ", - " v \u0082\u0082\u0083 \u0084 \u007f wx x g yy \u0085 \u0086 \u0086 n ", - " vvv\u0082 \u0087 \u0081\u0088\u0081 \u0088g\u0089\u008a\u008ay y \u008b\u008b \u0086\u008b \u008b ", - " \u008c\u008c }\u008dv \u0082 \u008d \u008e\u008e \u0089 y \u008b\u008b \u008b\u008b\u008b\u008b\u008b\u008b\u008b\u008b ", - " \u008f\u008f\u008f \u008d \u008d \u008e\u008e\u0088 \u0090\u0090\u0090 y \u008b \u008b \u008b\u008b\u008b \u008b\u008b\u008b\u008b\u008b ", - " \u008f \u008f} \u008d \u0091 \u0090 \u0090 \u008b \u008b \u008b \u0092 \u0092\u0092 ", - " \u008f \u008f \u008d \u0093\u0088\u0088\u0088 \u0094 \u0090 \u008b\u008b\u008b \u008b \u008b\u0092\u0092\u0092 ", - " \u008f \u008f\u008d \u008d \u0093 \u0088\u0094 \u0094 \u0090 \u0095 \u0092\u0092 ", - " \u008f \u008d \u008d \u0093 \u0094 \u0094\u0094\u0096 \u0097 \u0095\u0095 \u0095 ", - " \u008f\u008f \u008d \u008d \u0093 \u0094 \u0098\u0098\u0098 \u0099 \u0097 \u0097 \u0095 \u0095\u0095 \u0095 ", - " \u009a \u009b\u009b \u009c \u0098\u0099 \u0097 \u0095 \u0095 \u009d ", - " \u009a\u009a\u009e\u009b\u009b \u008d \u009f \u009c\u0098 \u0097 \u0095 \u0095 \u009d ", - " \u009a\u00a0 \u009b \u00a0 \u008d \u009c \u0099 \u0097\u0097 \u0095 \u0095 ", - " \u009a \u009b\u009b \u009f\u009f \u00a1 \u0095 ", - " \u009a \u00a2 \u008d \u00a1 ", - " \u009a \u008d \u00a1\u00a1\u00a1\u00a1 \u0095\u0095 \u0095\u0095 \u0095 ", - " \u009a\u009a \u0095 \u0095 \u00a3 ", - " \u009a \u00a0 \u00a3 ", - " \u009a \u00a0 \u0095\u0095 \u00a3 ", - " \u009a \u00a0 \u00a3 ", - " \u009a ", - " \u009a ", - " \u009a\u009a\u00a0 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!! ######### ", - " !!! !!!!! # ### %%%% $$$$ ", - " !! !! !!!!!!! # %% $$ $$$$$ ", - " !!!! !!!! # ## $$ $ $$$$ ", - " &&& ! !! ! ! !! # ## ' $ $$$ $$$$ $$$$$ ", - " && & !! !!!! !!!!!!!! ! !! # ## ')) $ $$ $$$$$$ $ $$ $$ $", - " && !!! ! ! # # (((( ) $$ $ $", - " &! ! ! !! # # ' ' ) $ $$", - " & &&&&&&& ! !!! '' ) * $$$$$ $ $ ", - " && & !! ! + )) \u00a4\u00a4$ $$ $ ", - " ! ! ! !! ++ 7 /// $ $$$$$$ $ $$$ $$ ", - " ! !! +557 / ;$; $$$$33 3$$ $$$$$< $$ $ $$ ", - " &&&&&&&&& !!! !!! 77\u00a5 \u00a6\u00a7; ;$ 3 44 < $ $ $ ", - " & !&&!!! 5 > > \u00a7: :; 3 B3 33 <4 < 4 $ ", - " & & & = = >>> AA EE FFF 3HB BBB33I <<<< J$ ", - " & = = > E E H BBBII4 4 J K ", - " & \u00a8= QQRR EEEEST H HMMN KK ", - " && & P P R ST UY Y KKK ", - " V V&& & P P W W ZZZ \u00a9 XTT MMU U 4 ", - " V V & & P]Q W W Z XLL U U [[44Y4 4 ", - " VV V ] ]^Q W W X X__ UU YY ", - " V V bb ]] ^ c Qdd WWWZgggX m Y a ee44 ", - " V VVV cd dffg X mm Y Y a he ", - " VVV ^^ ^ cc gk XX l Y Y e ", - " q rr cs xxxd g gtkll Y ahze n ", - " } v \u00aa \u00abss \u0080 yy h e ", - " }} \u00aa\u007f\u007f\u00ab\u00ac x \u0081\u0081 g g y h n ", - " v v\u0082 \u007f \u0080 \u0081 \u0081\u0081g g\u008atty \u008b h \u0086\u0086 ", - " } vv \u008d \u008e\u0081 \u0089\u0089 y \u008b\u0086 \u0086\u008b\u008b \u008b ", - " \u008c\u008f \u008d} \u008d\u008d \u008e\u008e\u0091 \u0088\u0089\u008a\u008ay \u008b \u008b \u008b\u008b \u008b\u008b ", - " \u008c \u008f \u008d\u008d \u0091\u0088 \u0090 \u008b\u008b \u008b \u008b \u008b \u0092 ", - " \u008f \u008f \u008d \u0088\u0088\u0088 \u0090 \u0090 \u008b\u008b\u008b \u008b\u0092\u0092 ", - " \u008f \u008d \u008d \u0093 \u0088 \u0094\u0090 \u008b \u0092 ", - " \u008f\u009e\u008d \u0093 \u0094\u0094 \u0094\u0090\u0099 \u0095\u0095\u0095 \u0095 ", - " \u008f\u008f\u008f \u009e \u008d \u0093 \u0093 \u0098\u0099\u0096\u0099 \u0097 \u0095 \u0095 \u0095 ", - " \u009a \u008d \u009f\u009f\u009f\u009f\u0094 \u0098 \u0099 ", - " \u009a\u009e \u009b\u009b \u008d \u009f \u009f \u0098 \u0099 \u0097 \u0095 \u0095 ", - " \u009a\u009a \u009b \u009b \u008d \u009c \u009c\u00a1\u0099 \u0097\u0097 \u0095 \u0095 ", - " \u009a\u00a0 \u009b\u009b \u00a1\u009c\u00a1 \u00a1 \u0095 ", - " \u009a \u008d \u008d \u00a1 \u00a1 \u0095 ", - " \u009a \u00a0\u00a2\u00a2 \u00a1 \u00a1 \u0095 \u0095\u0095\u0095\u0095 \u0095 ", - " \u009a \u00a1 \u0095\u0095 \u0095 \u00a3 ", - " \u009a\u009a \u00a0 \u0095\u0095\u0095\u0095 \u00a3", - " \u00a0 \u00a3 ", - " \u009a \u00a3 ", - " \u009a \u00a0 ", - " \u00a0\u00a0 ", - " \u009a ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!! ! ##### ###### ", - " !!! # # ", - " !! !!! ## $$$ $$ ", - " !!! # # $$$$ $ $$$ $$ ", - " & && ! !!!! !!! !! ! # '** $$$ $$$$$$", - " ! !!! # # ' ) *$$$$$$$ $", - " & &! ## ## '' ) ** $ ", - " & &! ! ' ' ) $ $$$ ", - " & & & ! !!! ) $ $$ $$ ", - " !! !! ! $ 33 $ ", - " ! ! $ $3 3$ $ 44 ", - " !!!!!! & ! ; $ $$3 3 $$$< $$$$$$$$$ $ ", - " && !&& ! > 3 3 4< <4 $ ", - " && == > > $ 3BBB3333 4 <44 <4 4$$ ", - " & & = = > EEEEE 3 BB II 4 K ", - " & & = EE EELLL HHHH 4 4 K ", - " & & Q Q L L MUY 4 K ", - " &&& Q Z X L L U U Y 4 ", - " & &&&& & Q WWW Z Z XX L L U Y Y4 4 ", - " V V& ^]^Q W WZ Z X L UUU Y a 4 ", - " V V ] ^cQ Q WW ZZ X X Y 44 e 44 ", - " VVVV ] ^ c d ff g X ah e ", - " VV V ^ c c d d g g XXl Y Y huee ", - " d d g g ll Y Y h e ", - " }v c xx fff gtl Y h ", - " } v v x \u0081 g g t ", - " } v x \u0080\u0081\u0081\u0081g gt y ", - " } }v\u008d \u008d\u008d \u0080\u0081\u0081 \u008a y \u008b\u008b ", - " }} \u008d \u008d \u0088 \u0088 \u008a \u008b \u008b ", - " \u008d \u008d\u008d \u0091\u0088 \u0088\u0090\u0090 \u008b \u008b \u0092 ", - " \u008f \u008d \u008d \u0088 \u0090 \u0090\u008a \u008b\u008b \u0092 ", - " \u008f\u008f\u008f \u0093\u0093\u0093\u0088 \u008b \u0092 ", - " \u008f\u008d \u008d \u0093 \u0093\u0088\u0094 \u0099 \u0095 ", - " \u009e \u008d \u008d \u0093 \u0093 \u0094 \u0099\u0099 \u0097 \u0095\u0095 \u0095 ", - " \u009e \u008d \u008d \u0093\u0093 \u0094\u0094 \u0099 \u0097\u0097 \u0095 \u0095\u0095 \u0095 ", - " \u009a \u008d \u009f \u0097\u0097 \u0095 \u0095 ", - " \u009a \u009e \u008d \u009f \u00a1\u00a1 \u0097 \u0095 ", - " \u009a\u00a0 \u00a0\u00a0 \u008d \u009f \u00a1 \u00a1 \u0097 \u0095 \u0095 ", - " \u009a \u00a0\u008d \u009f \u00a1 \u0095 ", - " \u00a0 \u00a0 \u00a1 \u0095 ", - " \u009a \u00a0 \u00a1\u00a1 \u0095\u0095\u0095\u0095\u0095 \u0095 \u0095 ", - " \u009a ", - " \u009a \u00a0 ", - " ", - " \u00a0 ", - " \u00a0 ", - " \u00a0 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !! ######## ", - " ! # # ", - " !! ## ## $$$ ", - " # # $$ $$ ", - " & # $$$$ $$$ ", - " && !!!!!!!!!!!!! # # ' $$$ $ ", - " & ! ! # # '' $ ", - " & ! ## ' ' $ $ ", - " & &&! ! !! ' $ ", - " &&& ! ! !! ! $ $$$ $ ", - " ! $ 3 $$$ 4 $ $$ ", - " ! ! $ $$$ 33$$ 4 $ ", - " !!!!!&&&! ! $ $ 3 3 <<<< $$4 $ ", - " & &&!! $ $ 3 344 << 444 $ ", - " & 333 3 444 $ ", - " & L 4 4 ", - " & & LL 4 4 ", - " & & LL YY Y 4 ", - " && & L 4YY 4 ", - " V&& Y 4 Ya 4 ", - " V &&&& Y Y44 4 ", - " V g Y Y 4 ", - " V g Y Y ", - " g Y ", - " g ", - " ", - " gg ", - " \u008d \u0088 g ", - " \u008d \u0088 g ", - " \u008d \u008d \u0088 \u0088 ", - " \u008d \u0088 \u0088 ", - " \u008d \u0088\u0088 \u0088 ", - " \u0088\u0088 ", - " \u008d \u0088\u0088 \u0095 ", - " \u008d \u008d \u0095 ", - " \u009a \u008d \u008d \u0095\u0095\u0095\u0095\u0095\u0095\u0095 ", - " \u009a \u008d \u0095 ", - " \u009a \u008d \u0095 \u0095 ", - " \u009a \u00a0 \u008d \u008d \u0095 \u0095 ", - " \u009a \u00a0 \u008d\u008d \u0095 \u0095\u0095 ", - " \u009a \u00a0 \u0095 ", - " \u009a \u0095\u0095\u0095\u0095\u0095\u0095\u0095 ", - " \u009a ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/simplify-radial-distance-500-1000-2.0-grid-reference.json b/tests/visual_tests/grids/simplify-radial-distance-500-1000-2.0-grid-reference.json deleted file mode 100644 index 352b52d93..000000000 --- a/tests/visual_tests/grids/simplify-radial-distance-500-1000-2.0-grid-reference.json +++ /dev/null @@ -1,367 +0,0 @@ -{ - "keys": [ - "", - "24", - "71", - "238", - "245", - "207", - "154", - "82", - "189", - "60", - "205", - "101", - "98", - "72", - "163", - "102", - "206", - "30", - "65", - "86", - "57", - "105", - "170", - "110", - "186", - "210", - "165", - "22", - "74", - "200", - "68", - "202", - "93", - "94", - "84", - "194", - "89", - "2", - "199", - "190", - "88", - "31", - "162", - "83", - "114", - "107", - "120", - "50", - "175", - "235", - "116", - "226", - "155", - "113", - "118", - "99", - "41", - "126", - "188", - "18", - "214", - "36", - "54", - "220", - "193", - "172", - "181", - "208", - "158", - "38", - "152", - "56", - "25", - "212", - "76", - "87", - "19", - "40", - "185", - "77", - "69", - "121", - "21", - "35", - "28", - "204", - "92", - "223", - "49", - "67", - "161", - "203", - "166", - "27", - "6", - "221", - "17", - "9", - "122", - "108", - "222", - "123", - "33", - "160", - "216", - "180", - "8", - "178", - "209", - "159" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ! !!!!!!!!!################### ", - " !!! !!! !!!#### ## $$$$$ %%%% ", - " !!!!! !!!!!!!! ##### $ %%%% %%%%%%%% %%% ", - " !!!!!! !!!! # ## %%% % %% %%%%%%%% %%% ", - " &&&&&&&! !!! !! !! !!!!! ! ## ### ''' % % %%%%%% %%%%%% % ", - " &&& & !!!!!!!!!! ! ! !!! ## #### ( ))) %%%%%%%%%% %%%%% %", - " &&& &! !!!!! !! ! # ## ((((( ') )* %%%% %%%", - " & &! ! !!! ### '' ' ) *% %% %%%", - " &&&&&& &&&& ! !!! + '' ) **% %%%%% %%% ", - " && & !!! !! ++ ) ,,% - %% %% ", - " !! !! !! + + .../ / 0%1 %%-%%%%% %2 %% % ", - " !! !!!!! +33. ./// 11%%1 %%%%-- -%%%%%%%%%%%%%% %% %% ", - " &&&&&&&& &&& !!! !! 3 345 6711 1% % -228 8 % % % ", - " & & !&&&!! 993 34 4 777 %%% - ::: -- 888 88 % % ", - " & & & ;9 9 444 <=<>>>>??? @@: :::-AA 888 2B% ", - " & & 9 9 4=>> >>C @@ :::DD2 2 B E ", - " && & ;9FFFGG >>>>HI @@@JKKL EEE ", - " &&& & MMFM GN NN HI I KKL L 2 EE ", - " OO O&& &&&&& MMM NGN N PQ QQI KKKK K L L 2 ", - " OO O&& RRS N N PQ QQCTCK K UULLL2 2 ", - " OO O RRRSV NNN N PQ TTW KK LLL X 2 ", - " O O YYY R S VVFZZZZ NN[[[[Q QWW LL L ] ^^22 ", - " OO OO S S VZ Z _[ [`QaaaWW L LL ]] b^ c ", - " OOO SSdS eVZ Z_ [ [` aQaa L L ]]]b^^ c ", - " f g d VVVeehhh [ [iiaa LLL ]bj^ c ", - " gg kkk l meen h_ o[ [ pp p b ^ c ", - " gkkk kq mmrnh h o [ [ ip bb s c ", - " g k kq t m u ooov[[w[xipp yyb sy ", - " z tkk t {{ov ww p yysssyy yy ", - " z|||g ttt {{v }wxxp y yyy yy yy~ ", - " | | ttt \u007fv } } yy y y yyy~~ ", - " | | t \u0080vv \u0081 } yyy y~~ ", - " | t|\u0082 t \u0080 v \u0081\u0081}} \u0083 ~ ", - " | |\u0082tt t \u0080 \u0081\u0081\u0081 \u0081}\u0084 \u0085 \u0083\u0083\u0083\u0083 \u0083 ", - " ||| \u0082t t \u0080 \u0080\u0080\u0081\u0081\u0086\u0084\u0087\u0084 \u0085\u0085\u0085 \u0083\u0083 \u0083\u0083 \u0083 ", - " \u0088 \u0089 t \u008a\u008a\u008a\u008a\u0081\u0086 \u0086\u0084 \u0083 \u0083 ", - " \u0088\u0088\u0082\u0089\u0089 t \u008a \u008b\u008a \u0086\u0086\u0084 \u0085 \u0083\u0083 \u0083 ", - " \u0088\u0088 \u0089\u008c\u0089\u0089 tt \u008d\u008b\u008b\u008b\u008d\u0084 \u0085\u0085 \u0083 \u0083 ", - " \u0088\u008c \u0089t t \u008a\u008a\u008b \u008d \u0083 ", - " \u0088 \u008et t \u008d \u008d \u0083 ", - " \u0088 \u008e\u008e\u008e \u008d \u008d\u008d \u0083 \u0083\u0083\u0083\u0083\u0083 \u0083 ", - " \u0088\u0088 \u008e \u0083 \u0083\u0083 \u0083 \u008f ", - " \u0088\u0088 \u008c\u008c \u0083\u0083\u0083 \u008f\u008f", - " \u0088 \u008c \u008f ", - " \u0088 \u008c \u008f ", - " \u0088 \u008c ", - " \u0088\u0088 ", - " \u0088 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!!! ################# ", - " !!! ## # ", - " !!! !!!!!! ## # %%%%%%% ", - " !! ## # %% %% %%%% ", - " &&&&&&&!! !!!! !!!!!! # # ''* %% %%%% %%%%% ", - " & & !!!!!!!!!! ! !! # # ')) *%%%%%%%%% %", - " & &! ! ! ### ## ((( '' ) *% % ", - " & &! ! # ''' ) % %%% ", - " & &&&&&&& ! !!! '' ) % %%%%%%%% ", - " && && !!!!!! !! %% - % ", - " !! !! %% %%- %%%% 22 % % ", - " ! !! 11 % %%%% -%%%%%8 %%%%%%%%%% % % ", - " && !&&&& !! 4 1 % %-- - 88 882 %2 % ", - " &&& !& 9 44 %% --:::-- --22 82 882 2%% ", - " &&& & 9 99 44 >>> -::: AA 88888 2 E ", - " & & 999 4 >>> >>CCC @@@: 2 2 E ", - " & & 9FFF >> C CC KL 2 E ", - " &&& & F F P CC C KKKLL 2 E ", - " OO&& &&& & F F NN PPPPQQQQCC C KKLK 2L 2 ", - " O &&& & R F N NP PP Q CC KKKK LLLL ] 2 ", - " O O R SVF F NN NPP Q Q KK L L222 ^ 2 ", - " O OOOOO R S VVFZZZ__NN [ Q Q L L ]X ^22 ", - " OOO OO S S VVZ Z _[ [ Q Qa L L ]bX^^ ", - " OO SSSS V Z Z _[ [ Qaa L L bbX^ ", - " VV hh _ [ [iaaa L b ^ ", - " ggkkkk V hh _[ [ p b ^ ", - " gkg k h uoo[ [iip ", - " g kgkttt huoooo[[[ p yy ", - " gggkk tt uv v x yy y ", - " tt t \u007fv v}}xx y y y ~ ", - " | t t v } }x yy ~ ", - " || t vvvv }}}} yy ~~ ", - " || t \u0080 \u0080\u0080v\u0081v \u0084 yy ~~ ", - " \u0082\u0082t t \u0080 \u0080 \u0081v \u0084\u0084 \u0085 \u0083 \u0083\u0083 ", - " \u0088\u0082\u0082t\u0082 t \u0080\u0080 \u0081\u0081 \u0084 \u0085\u0085 \u0083\u0083 \u0083\u0083\u0083 \u0083 ", - " \u0088\u0082 \u0082t \u008a\u008a\u008a\u008a\u0081\u0081 \u0084 \u0085\u0085 \u0083\u0083 \u0083 ", - " \u0088\u008c\u0082 t t \u008a \u008a \u008d\u0084 \u0085\u0085 \u0083 \u0083 ", - " \u0088\u008c \u008ct tt \u008a\u008d\u008a\u008d \u008d \u0085 \u0083 \u0083 ", - " \u0088\u0088 t\u008ctt \u008a \u008d \u0085 \u0083 \u0083 ", - " \u0088 tt \u008d \u008d \u0083 ", - " \u0088 \u008c \u008d \u008d\u008d \u0083 \u0083\u0083\u0083\u0083\u0083\u0083 \u0083 ", - " \u0088 \u008c \u008d \u0083 \u0083 ", - " \u0088 \u008c\u008c \u0083\u0083\u0083\u0083 ", - " \u0088 \u008c ", - " \u0088\u008c ", - " \u008c\u008c ", - " \u008c ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/simplify-visvalingam-whyatt-500-1000-1.0-grid-reference.json b/tests/visual_tests/grids/simplify-visvalingam-whyatt-500-1000-1.0-grid-reference.json deleted file mode 100644 index b757b4cc3..000000000 --- a/tests/visual_tests/grids/simplify-visvalingam-whyatt-500-1000-1.0-grid-reference.json +++ /dev/null @@ -1,359 +0,0 @@ -{ - "keys": [ - "", - "24", - "71", - "238", - "245", - "207", - "154", - "60", - "189", - "82", - "205", - "101", - "102", - "98", - "72", - "206", - "65", - "163", - "86", - "81", - "170", - "110", - "186", - "210", - "30", - "89", - "74", - "200", - "202", - "93", - "94", - "84", - "194", - "114", - "199", - "190", - "88", - "162", - "83", - "107", - "175", - "120", - "50", - "31", - "155", - "235", - "116", - "41", - "113", - "126", - "36", - "118", - "214", - "188", - "193", - "220", - "18", - "99", - "158", - "181", - "38", - "212", - "208", - "152", - "56", - "185", - "25", - "76", - "87", - "19", - "35", - "40", - "77", - "121", - "21", - "157", - "28", - "204", - "92", - "223", - "49", - "67", - "161", - "203", - "27", - "166", - "6", - "221", - "9", - "17", - "108", - "222", - "122", - "160", - "33", - "216", - "180", - "178", - "209", - "8", - "159", - "2" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!! !!### ## ", - " !!!! !### $ $$ ", - " !!!!! !!!!! ## # %%%%% %% ", - " !!!!!!!! !! # # % %%% %%%% %%%% ", - " && &&&! !!!! ! !!!!!!! !! # ### '' (%% %%% % %%%%%%", - " && !!! ! !!! # # ') ( %%%%%%% % ", - " && ! !! # * '') ) % %% %", - " & && ! !! ! ## ' ( % % %%%% ", - " &&& ! !! ! ! ! + '' ) ,% %% %% ", - " ! !!! ! ++ ) -% .%%% % % ", - " ! ! + + / / -00% % % %%% % % ", - " !&&&&&&&&&&& !! 11 1/ /222 %% % %%%% % %%%% % %% ", - " & && ! 1 33 45 5000 % .. 6 6 % % ", - " && &&! 771 13 3 555 %% % .8888 . 6 6 9 ::: ", - " & & 7 3 ;;<<< < =. 8 .> > 6 ?? : ", - " & 7 7 ; < <@@==@ 88AA 9 ? : ", - " & & BBB CC DD E = FGG 9 ::: ", - " &&&& & B B CCH HH DI E F G 9 ", - " J & &&& && BBB H H KI II@ FL F GM G9 9 ", - " J & NOO H H KI @@ F MM G 9 ", - " J J P NN OQ HRS H K I T F GGG9 U 9 ", - " J J J PP NN O Q R S HV I I T G WUUU ", - " J JJ R V VI XXTT G G YWYWZ ", - " JJ [ ]]OO QQR R V X G G WWW ", - " [ ^_ ]]Q Q``a a V V b c G d ", - " ^ _ ee f g h iiV V c c G ", - " __ j f g a i Vb c k ", - " ^ _l_mm h in nooppc c qq kq ", - " r^ l_ j l ss oo c qq qqq qqq ", - " rttt ll ssn ouppc qq qq q ", - " tt l l vn u q q q w ", - " t t l xxnn u u qww ", - " tll x n yuu z ", - " t {l l x x y | z z z ", - " tt l y }}~ ~ | | z z ", - " t \u007f } ~ | z z ", - " \u0080\u0080{\u007fl\u007f l \u0081 } | z z ", - " \u0080 \u007f l \u0082\u0083\u0083~ || z z ", - " \u0080 \u007f \u0081\u0081 z ", - " \u0080 l l \u0083 ", - " \u0080 \u0084\u0084l \u0083\u0083\u0083 z zz z z ", - " \u0080\u0080 \u0085 z \u0086 ", - " \u0080 \u0085\u0085 z \u0086\u0086", - " \u0080 \u0085 \u0086\u0086 ", - " \u0080 \u0085 \u0086\u0086 ", - " \u0080 ", - " \u0085 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!!!!!! ############# ", - " !! !# ## ", - " !!!! !! ### %%% ", - " !!!!! # ## %%% %%% ", - " &&& ! ! ! ! !! # # %%% %%% %%%% ", - " && !! !!!!!!!!!! ! !!! ! # ## '') (%%%% %%% %%%%", - " & ! ! ! # ## ') )) %% % %", - " & ! ! !! # ' ' )( (% % %%", - " & & &!! ! ! # '' ) ( % %%%%%%%%% ", - " && !! ! ! + ) % %% % % ", - " ! ! ++ /2222--%% %% .% 9 %% % ", - " ! !!! 11 /2 0-- %% %%%%% %%% %% % 9% % % ", - " && 1 // 00 % . .6 66 9 % % ", - " & && & 133 555 % %. 88. . 6 6 9%% ", - " & & 77 3 <<< %% .=8 8 >>> 66666 99 ", - " 7 3 @@ = 88 >> 9 : ", - " & & 777\u0087\u0087\u0087 <<<<<<< = = LF9 9 :: ", - " & & BB\u0087 DD @ F G 9 :: ", - " & & & B B H HHHHKKK IEE FF F G ", - " J &J& & B \u0087 H H I @ F F GG99GG 9 ", - " J O O\u0087 H H I I T@FFFF G Y ", - " J O O Q \u0087RRHH VVVVVI I T GGY 9999999 ", - " J JJJJ R R V XIT G W ", - " JJ J OOO R R II T G G Y W W ", - " QQ Raaa V VbbXX G WW ", - " ^__ e f a a i cccc G ", - " ^ ff hii V V c G ", - " ^ _ l f h hiiiVVVV bcc q ", - " ^ l_l lll hsh no c q q q ", - " rtt^ ll ssn oo c qq q q ", - " t t ll n u up qqq q w ", - " t l xnx u u q w ", - " t tll x nn ynu qwww ", - " t{ l x xyny u zz z ", - " t t l l y~ ~ || z z ", - " t l \u0081\u0081\u0081\u0081}}}}~ | z z z ", - " \u0080{ {\u007fl l \u0081 } ~ | zz z ", - " \u0080\u0080\u0085\u007f \u007f ll \u0081 \u0082\u0083 | z z ", - " \u0080 \u007f l \u0082 z ", - " \u0080 l l \u0083 \u0083 z z ", - " \u0080 l \u0083 z zz z ", - " \u0080\u0080 \u0085 \u0083 zz z \u0086 ", - " \u0080 \u0085 zzzz \u0086\u0086", - " \u0080 \u0085 \u0086\u0086", - " ", - " \u0080 ", - " \u0085 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!! #### ## ", - " !! !## # ", - " ! ## ## %%%%%% %% ", - " ! !!!! # # %%% %%%% %%% ", - " && &&&! ! !! !!!! !! # ## ' ( %%% %%% %", - " !!!! ! ! # ## ') ( %%% ", - " ! ! # # ') ) ((%% %", - " & ! !!! ## ' ' ) % %%%%%% ", - " && &&& ! !! ! ! ' )) %% ", - " ! !!! ! ) % .% % ", - " ! ! %% % ..% %. 6 %% % ", - " !&&&&&&&&&&& ! 11 00 0 % .% .%%%%%%%%%% 9 9% % ", - " && && 1 1 3 000 .. 9 6 6 9% % ", - " && 771113 3 %% 8888...... 966 6 9% ", - " & & 77 3 << = 88 9 6 99 : ", - " & & 77 < <@ @@= = :: ", - " & & \u0087 @ =LLFF9 : :: ", - " &&&& BBBB HHHHHH @ L F FGG ", - " JJJ& && BBB H H II @ F G GG99999 9 ", - " && O H H I I @@ FF G9 9 ", - " J J O OQ \u0087HHS H K I F GY 9 9 ", - " J J JJ O Q\u0087R RS HV V I I G 9 ", - " J J Q R VI II G G YY ", - " JJ O QRRR V V X G G Y ", - " _ QQ a a V Vbb c ", - " ^^ __ a h S V b b G ", - " ^ ^ _ aaa h V b bc ", - " __ l h hn n bcc q ", - " ^^ l_ l n c q ", - " ^^ ll nu c q qqq ", - " t l l nu u q w ", - " tll l x x uu q ", - " t t l x nnyy u~ z ", - " t t{{l l y ~ | z z ", - " { l yy ~~ || zz z z ", - " \u0080 { l \u0082 ~ || z z ", - " \u0080 { l l \u0081 \u0081\u0082 \u0083 | z ", - " \u0080\u0085 \u0085l l \u0082 \u0083 | z z ", - " \u0080\u0085 l \u0081\u0081 ", - " \u0080 \u0085l \u0083 z z ", - " \u0080 \u0085l \u0083\u0083 z zz z z ", - " \u0080\u0080 z ", - " \u0080 \u0085\u0085 ", - " \u0080 ", - " \u0085 ", - " \u0080\u0085 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!!! ############# ", - " !! ! # ", - " !!! # ## %%% ", - " # # %%% %%%% ", - " &&& # # %%% %%%%%%%% ", - " & !!!!!!!!!!!!! # ## ) %%% ", - " & ! # )) % %", - " & ! ! # # % %%%", - " && ! ! ! # ) % %%%% ", - " && !! ! ! ) % % ", - " ! ! % %%% .% 9 % ", - " ! ! % %.. %%%% 6 6 %% 9% % ", - " & & !! % ..% .996 66 % % ", - " & !& &&& % .... . 66 96 9 % ", - " &&! & % 9 666 99 ", - " & & < < @@ 9 9 ", - " & \u0087 <<<<<<< @ F9 9 ", - " & \u0087 \u0087 @ FFFG 9 ", - " && && \u0087 HHH @ F F G ", - " J && &&& \u0087 \u0087HH H K II I @ F G GGGGGG ", - " J J OO\u0087 H H KI @ F G 9 ", - " J O O Q \u0087 HH HKVKKI I G 9999999 ", - " J O Q Q S HV V II G ", - " JJJ O Q S V II G G ", - " Q V Vb G ", - " ^__ S V b GG ", - " V V b G ", - " ^ ^_ l nnnV bb ", - " ^ ^_l l n n ", - " r ^^^l ll n ", - " ^ ll n ", - " l l x ", - " l xxnn ", - " l l x x n zz z ", - " { l l x z z ", - " \u0080{ l \u0081\u0081\u0081\u0081 zz ", - " \u0080 { l \u0081 \u0081 z z ", - " \u0080 \u0085\u0085 l \u0081 \u0081 \u0083\u0083 z z ", - " \u0080\u0085 \u0085 \u0081\u0083 ", - " \u0080\u0085 \u0083 \u0083 z z ", - " \u0080\u0085 \u0085l \u0083\u0083 z zzz z ", - " \u0080\u0080 z zz ", - " \u0080 \u0085 z ", - " \u0080\u0085 \u0085 ", - " \u0085 \u0085 ", - " \u0080\u0085\u0085 ", - " \u0085 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/simplify-visvalingam-whyatt-500-1000-2.0-grid-reference.json b/tests/visual_tests/grids/simplify-visvalingam-whyatt-500-1000-2.0-grid-reference.json deleted file mode 100644 index 36900a513..000000000 --- a/tests/visual_tests/grids/simplify-visvalingam-whyatt-500-1000-2.0-grid-reference.json +++ /dev/null @@ -1,336 +0,0 @@ -{ - "keys": [ - "", - "24", - "71", - "245", - "207", - "60", - "154", - "189", - "205", - "98", - "72", - "163", - "102", - "206", - "65", - "30", - "110", - "186", - "86", - "170", - "210", - "200", - "202", - "93", - "89", - "84", - "114", - "2", - "190", - "88", - "162", - "107", - "83", - "120", - "50", - "175", - "31", - "116", - "113", - "36", - "118", - "126", - "188", - "18", - "193", - "220", - "152", - "56", - "38", - "212", - "76", - "87", - "40", - "185", - "35", - "223", - "21", - "28", - "204", - "92", - "49", - "67", - "161", - "203", - "166", - "6", - "221", - "17", - "108", - "9", - "122", - "216", - "222", - "33", - "160", - "180", - "178", - "8", - "159" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!!!!!!!!######### ####### ", - " !! ### # ", - " !!!!!!! #### # $$$$$$$$ ", - " !!!!! ! !!!! # ## $$$$ $$$$$ $$ ", - " %%%%%%%%! !!! !! ! !!!!! !!! ## ## &$ $$$$ $$ $$$$$ ", - " %%% !!!!!!!!! ! !! ! # #### '((&&$$$$$$$$$ ", - " % % !! ! ! ## ## '(( (& $$$$ $", - " % % % !! !!!! ## ''''((&&&$ $$ $$$$", - " % %% !! !!! ! !! # ''(( $ $$$$$$$$ ", - " % ! !!!!! !! )) ( $$ *$ $$ $ $ ", - " ! !! ))) ++,,,,--.$ $ $$ $$$ $$ $ ", - " ! %%%% !!! ///+++ ,,.-- $$ $$ $$ $$$$$$$ $$$ $$$ 0$ $ $ ", - " % !%% % / + .... .$ $ *11 111 $ $ ", - " %%%% % 2 ///333 44 $$$ $**5555****0* 1 11 0$$ ", - " % % %% ! 2 2 33 666666$$ 77555 8888 11111 00 9 ", - " % % 2 2 3 6 6:::7 5 8 00 9 ", - " % %% ;2 <<< 6 ===> 777 ?0 0 999 ", - " %%%% % ; ;; @@ @ == :> : ? AA 0 99 ", - " B %B %%%%%% ;;;; @ @@@@ CD DD>: ??E ? A0 00 0 ", - " B %%% % ;<< @ @ D D :: ? ? AAAAAA 0 ", - " B B F FG @@H @ D D I ???? A 0 0 ", - " B B B F F GG??@AA:: 2 %% %< B BB < 6 6 %% C % ", - " &&& = = ? ??DEFGG GGGH IJBBB BBBK 6 LMM C ", - " & && NNN N= == O?? FFG PQPJJJ BBRR LLLMS C ", - " & && TTT OO FFUUV V J WXW L SSCCCC ", - " &&&& Y T TT OOZ ZZ V[ W X L CC C ", - " ] && &&&&&& ==TT Z Z ^[ [_P WW W ``` LX LL ", - " ]] & &a bbc Z Z ^[ [Pd W ``X X ee C C ", - " & ]] &faa bb cg ZhZ Z ^[ idd WW XXXLj k LLeC ", - " & ] ] ]] ff&a bb c g h h Zl l[ m X XX j n kkL L ", - " ] ] ]]] oopqrst h h l[ uu m X X jn nk v w ", - " ]xyz { | }cc ~h h l\u007fu u X X jj nk vv w \u0080 ", - " z \u0081 \u0081\u0082 \u0083\u0084 }}}g ~\u0085~\u0086 l \u0087 \u0087\u0088 uu X Xjnn\u0089k vvv \u0080\u0080 ", - " \u008a\u008b\u008b\u0081\u0083 \u0083 \u008c ~ \u0085 \u0086\u008d\u008e\u008e l \u008f \u008f XX n kk v vv \u0080\u0080 ", - " \u0083\u0083 \u0083\u0090\u0091 \u0092 \u0093\u0085\u0086 \u0086 l l \u008f \u0094 \u0095\u0095 X n\u0096 \u0096vvv \u0097 \u0098 \u0098 \u0098\u0098 \u0080\u0080 ", - " \u0099 \u0081 \u0083\u0083\u0083 \u009a \u0092 \u0086 \u008e\u008e\u009b \u009c\u009c\u009d\u009d\u008f \u008f \u0094 \u009e\u009e\u0096 \u009e \u0096\u009e \u009e\u009e ", - " \u009f \u00a0 \u00a0\u00a1 \u0081\u0081\u0083 \u00a2 \u00a2 \u00a3\u00a3 \u009c \u008f \u0094 \u009e\u009e\u009e\u009e \u009e\u0096\u009e\u009e\u009e\u009e\u009e \u0099 ", - " \u00a1\u00a1\u00a1 \u00a2\u00a2 \u00a2 \u00a3\u00a3\u009b \u009c\u00a4\u00a4 \u008f \u009e \u009e\u009e \u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u00a5 \u00a5 \u0099 ", - " \u0099 \u00a1 \u00a1\u00a1 \u00a2 \u009b \u00a4 \u009e\u009e \u009e\u009e \u009e\u009e\u009e \u00a5\u00a5\u00a5\u00a5 \u00a5 ", - " \u00a1 \u00a1 \u00a2 \u00a6 \u009b\u009b \u00a4 \u00a4 \u00a7 \u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e \u009e\u009e\u00a5\u00a5\u00a5 \u00a8\u00a8\u00a8 ", - " \u00a9 \u00a1 \u00a1\u00a2\u00aa \u00a2 \u00a6 \u009b\u00ab \u00ab\u00a4\u00a4 \u00ac \u00ad \u00ae \u009e\u009e \u00af \u00af \u00af \u00a5 \u00a8\u00a8\u00a8 ", - " \u00b0\u00b1\u00b1 \u00a1 \u00a2 \u00a2 \u00a6 \u00ab \u00ab \u00b2\u00b3 \u00af\u00af \u00af \u00af \u00b4 ", - "\u00b5 \u00a9 \u00a1\u00a1 \u00a2 \u00a2 \u00ab \u00b6\u00b6\u00b7\u00b8\u00b7 \u00b3 \u00b3 \u00af\u00af\u00af \u00af\u00af \u00af \u00b4 \u00b5", - "\u00b5 \u00b9 \u00ba \u00a9 \u00bb \u00bc\u00aa \u00bd \u00be \u00b6\u00b7 \u00b3\u00b3 \u00af \u00af \u00bf\u00bf \u00b4 ", - " \u00a9 \u00a9 \u00bb\u00bb\u00aa\u00bc\u00bc\u00bc \u00a2 \u00bd \u00b6 \u00b7 \u00b3 \u00af \u00af \u00bf\u00bf ", - " \u00c0 \u00c0 \u00bb\u00bb \u00bc \u00a2 \u00be\u00c1 \u00b7 \u00b3\u00b3 \u00af \u00af ", - " \u00c2 \u00bc\u00bc \u00a2 \u00bd\u00bd \u00c1\u00b7 \u00af ", - " \u00bb \u00c3 \u00a2 \u00c4\u00c1 ", - " \u00bb \u00bb \u00c3 \u00c3 \u00c1\u00c1\u00c1\u00c1 \u00af\u00af\u00af \u00af\u00af \u00af \u00c5 ", - " \u00bb\u00bb \u00c6 \u00af\u00af \u00c5 ", - " \u00bb \u00c2 \u00af \u00c5\u00c5", - " \u00bb \u00c2 \u00af\u00af \u00c5\u00c5 ", - " \u00bb\u00bb\u00bb\u00c2 \u00c5 \u00c5 ", - " \u00bb\u00bb \u00c2 \u00c7 \u00c5 ", - " \u00bb\u00bb\u00c2 \u00c8\u00c8 \u00c5 ", - " \u00bb\u00bb\u00c2 \u00c9 \u00ca ", - " \u00bb \u00c9 ", - " \u00c9 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ! !!!!!!!! ############ ", - " !!!!!!!!!!!!!## #### $$$$$$$$$$ %%%%%% % %%%%% ", - " !!!!!!!!!!!!!!!! #### ### $$$$$ %% % %%%%%%% % ", - " !!!!! !!!!!!!!!!! ## #### $ %%% % %%%%% %%%%%%%% %%%% ", - " %% &&&& ! !!! !!!!!!!!! !!!!! ### #### $$ ''' %%% % %%%% %%%%% %%%%%%% ", - " && !!! !!!!!!!!!!!!!!!!!!!!! ## ### '')) %%%%%%%%%% %% %% %%%%% ", - " &&&& !!!!!!! !!! ## ## ((((( '') )) %%%%% %%", - " && & !! !!!!!!! ##### + ''') )* % %% %%", - " & &&&&&&&&&&& ! !!! ! ! ### ,, ''' ))\u00cb*\u00cc% %%% %%%% ", - " && &&&& &&& !! !! ! ! ,,, \u00cd\u00cd)))//% %% % % ", - " &&& !&! ! !!! 0,,, 11..5%%/ %% <%% %%% % %%% %% % ", - "&& !!! ! !!! 0 ,,,1. \u00ce5 2\u00cf\u00cf%% %%%%% %% %%66 % % %% % ", - " && &&! !!!!!!! 4 8..\u00ce\u00d0222 % % <6 6 %% %% % ", - " & &&&!! 4 ? 9@\u00d1A 222% %< @AA:\u00d3 2 %% %< B : ? @ABBC6C6$$ $00DD00 00 === == $$ E$$ ", - " ' ''' >> >>>FFFFGBHIIIIIJ$$KKDDKDDDD00L 88= MM$ EE ", - " '' ''' NNN N> >>>FOFFFHII IP KK DDDQQ 88MMR E ", - " '' ''' NS>TTTOOUU HIIIIIIII PK KKKDVWWW 88RREEEE ", - " ''' '' X SS S OYY YZ []] ^ WWW__ 88 RREE E ", - " `` '' ''''''' >SSS O Y Y ZabbbbcP WWW W d88 8_ 88 EE E ", - " ' ``` '' '' >>eee Y Y fb bbPg W W ddd___8 888 E EE ", - " ' ``` ` '''h ee ii YYj Y bb ggg WWWW ___8k 88lEE E E ", - " ''' ``` ` `mmm'nn eee i oT ppppYYqqqqqb bgr ___ _kk 8sss8t8 u ", - " ``` `````` vw'xyz{{ i op p q qbb | r _ __ k}}}s8 uu ~ \u007f ", - " ``\u0080`\u0080\u0080 { \u0081 \u0082\u0082ii pp p q q\u0083||||r _ __ kk} }s uu ~ \u0084\u0084 ", - " \u0085\u0086\u0086\u0087 \u0087\u0088 \u0089\u008a \u0082\u0082\u0082o \u008b\u008c\u008b\u008d\u008d\u008d\u008d q q\u008e|| || ___ _k}}ss uuuu \u008f \u0084 ", - " \u0090\u0090\u0090\u0087\u0091\u0091\u0088\u0091\u0091\u0091 \u0092\u0092oo\u008b\u008b\u008c\u008d \u008d\u0093j\u0094q q \u0095\u0095 \u0095 ____ _ k}ssss uuu \u0084\u0084 ", - " \u0096\u0090\u0090\u0090 \u0091\u0087 \u0091\u0097 \u0092\u0098 \u0099\u008c\u008d \u008d \u0094 q q\u008e \u0095\u0095 \u009a_\u009b\u009b _ } \u009cuuuu \u009d \u009e\u009e\u009e\u009e \u009e\u009e \u0084\u0084\u0084 ", - " \u009f \u0087 \u0091\u0091\u0091\u00a0\u00a0\u00a1 \u0098\u0098\u00a2\u0099\u008c\u008d\u008d\u0093 \u0094\u0094\u0094\u0094qq\u00a3q\u00a4\u0095 \u0095 \u009a _\u00a5}} \u00a5\u009c\u00a6\u00a5\u00a5 \u00a5\u00a5 \u009e \u009f ", - " \u009f \u00a7 \u00a7 \u0087\u0091\u0091 \u0097\u0097 \u00a8 \u00a9\u00aa\u00aa\u0094 \u00a3\u00a3 \u0095\u0095 \u009a\u009a \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5 \u009f ", - " \u009f \u00a7 \u00a7\u00ab\u00ab\u0087 \u00a8\u00a8\u00a8\u00a8\u00a8 \u00ac\u00aa\u00aa\u00aa\u00ad \u00a3\u00a3\u00a4 \u0095 \u009a \u00a5\u00a5\u00a5\u00a5\u00a5 \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00ae \u00ae \u009f ", - " \u009f \u00ab\u00ab \u00a8\u00ab \u00a8\u00a8 \u00a8\u00a8\u00a8\u00a8\u00a8 \u00aa\u00aa\u00ad \u00af \u00af\u00af \u00b0 \u00a5\u00a5\u00a5\u00a5 \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5 \u00a5\u00ae\u00ae \u00ae\u00ae \u00b1 ", - " \u00b2 \u00ab \u00ab \u00a8 \u00b3\u00ad\u00ad\u00ad\u00ad \u00b4 \u00af \u00b0 \u00b5 \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00ae\u00ae\u00ae \u00ae\u00b1\u00b1 \u00b6", - " \u009f \u00b2\u00b2\u00b2 \u00ab \u00ab\u00ab\u00a8\u00b7 \u00a8 \u00b3 \u00ad\u00ad \u00b4\u00b4 \u00af \u00b0 \u00b8 \u00b9 \u00ba \u00a5\u00a5\u00a5\u00a5\u00bb\u00bc\u00bc \u00bc\u00a5\u00ae\u00ae\u00ae\u00ae\u00ae\u00b1\u00b1\u00b1\u00b1 ", - " \u00bd \u00be \u00ab \u00ab \u00a8\u00a8 \u00a8 \u00b3 \u00b4\u00b4\u00b4\u00b4\u00b4 \u00bf \u00c0\u00c1 \u00b9 \u00bc\u00bc\u00bc\u00bc\u00bc \u00bc \u00b1\u00b1\u00c2 \u00c3", - "\u00c3 \u00be \u00b2\u00b2 \u00ab\u00ab \u00a8\u00a8 \u00a8 \u00b3\u00b3\u00b3 \u00b4 \u00c4\u00c4\u00bf \u00bf \u00c1\u00c1\u00c1 \u00bc\u00bc\u00bc \u00bc\u00bc\u00bc \u00bc \u00c2\u00c2 \u00c3", - "\u00c3 \u00c5 \u00c6\u00c6 \u00b2\u00b2 \u00ab \u00c7\u00a8 \u00a8 \u00c8 \u00c8\u00c8\u00c4\u00c4 \u00c4\u00c9 \u00c1\u00c1 \u00bc \u00bc\u00bc \u00ca \u00c2 \u00c3\u00c3", - "\u00c3\u00c5\u00c5 \u00c6 \u00b2 \u00b2 \u00cb\u00cb\u00b7\u00c7\u00c7\u00c7 \u00a8 \u00a8 \u00c8 \u00cc \u00cc\u00c4\u00bf\u00bf \u00c1\u00c1 \u00bc\u00bc \u00bc \u00ca\u00ca ", - " \u00b2 \u00cd\u00cd\u00cd \u00cb\u00cb \u00c7\u00c7\u00c7\u00ce \u00a8\u00a8 \u00c8 \u00c8 \u00cc\u00cc\u00cf\u00bf \u00c1\u00c1 \u00bc \u00bc\u00bc \u00ca ", - " \u00cb\u00cb \u00cb\u00cb \u00c7\u00c7 \u00a8 \u00c8\u00c8\u00cc \u00d0\u00d0 \u00bc \u00bc ", - " \u00ce \u00d1\u00ce \u00a8 \u00c8 \u00d2\u00cf \u00bc \u00bc ", - " \u00cb \u00cb\u00cb \u00d1\u00d1\u00d1 \u00cf \u00cf \u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc \u00bc ", - " \u00cb\u00cb \u00ce \u00bc\u00bc\u00bc \u00bc \u00d3 ", - " \u00cb\u00cb \u00ce\u00ce\u00ce \u00bc\u00bc\u00bc \u00d3\u00d3", - " \u00cb\u00cb\u00ce \u00ce\u00ce \u00bc\u00bc\u00bc \u00d3\u00d3 ", - " \u00d3 \u00cb\u00cb\u00cb \u00ce \u00bc \u00d3\u00d3 ", - " \u00cb\u00cb \u00ce\u00ce \u00d4 ", - " \u00cb\u00cb\u00ce\u00ce \u00d5 \u00d4\u00d4 \u00d3\u00d3\u00d3 ", - " \u00cb\u00cb\u00cb\u00cb \u00d5\u00d5 \u00d6 \u00d7 \u00bc ", - " \u00cb\u00cb\u00cb\u00cb \u00d6\u00d6 \u00d6 \u00bc ", - " \u00d6\u00d6\u00d6 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!!!!!!!!#################### $$$$$$ $ $ ", - " !!!!!!!!!!!!!!!#### ##### %%%%%%%%%%% $$$$$ $ $$$$$$$$ ", - " !!!!!!!!!!!!!!!!!!###### #### %%%%%% $$$$$$ $$$$$$$$$$$$$$ $$$$$ ", - " !!!!!!!!!!!!!!!!!!!! ### ##### % & $$$$ $$$$$$$$ $$$$$$$$$$$$$$$ ", - " $$ ''''''''!!!!!!!!!!! !!!!!!!!!!!!!!! ### #### %% &&&&&$$ $$$$$$$$$$$$ $$$$$$$$$$$$ $$ ", - " '''' !! !!!!!!!!!!!!!!!!!!!!!#### #### ( &&&)) $$$$$$$$$$$ $$$$$ $$ ", - " ''''' ' !!!!!!!!!!!! ####### (((((( &&)))))*$$$$$ $$$", - " ''' ''' ' !! !!!!!!!! ###### + &&&&) ** $$ $$$$ $$$", - " ' ''''''' '''' ! !! !!!! ### ,,, &&)))))*$$ $$$$$$$$ ", - " '' ''''' '''! !!!!! !!!! ,,,, -.))/$/$$ 0$ $$ $ $$ ", - " '''''' ''!! !!! !!!! 1,,,,22-33$33/$$ $$ $$$$ $88 $$$ $$ $ ''", - " !!!! '''' ! !!!!!! 1,,4,2- -333666 $6 $$$$$$ $$$$$$$$$$$$$$ $$8 $$ $ ", - " '' ''! ''!!!9! ::: ;;<<666666$$ $ 80==8 == $$$ $$ $$ ", - " '' !''''!!!! > : ? @ABBC6C6$$ $000DDD 00 === == 8$$ E$$ ", - " ' ''' >> >>>FF FG\u00d8HIIIIIJ$$KKDDK00DD00L 88= MM$ EE ", - " '' ''' NNN N>>>>>FOFFFHII IP KK DDDQQ 88MMR E ", - " '' ''' N>> TTTOUU HIIIIIIII PKPKKKDVWWW 88RREEEE ", - " ''' '' X SSSS OYY YZ []f^ ^ PVWWW__ 8 RREE E ", - " `` '' ''''''' >SSS O Y Z ZbbbbbcP WWW _W d8 _ 8 EE E ", - " ' ``` ''' '' >>Sei Y Y Zb bbbPgPW W ddd___ 888 E EE ", - " ' ``` ` '''h eei i Yp Y bb ggg WWW_ ___ 8 88lEE E E ", - " ''' ``` ` `mmm'nn ee ioT TppjYYqqqqqb bgr ___ _kk \u00d9sss8t8 u ", - " ``` `````` vw'xyz{{ op p jq qbb bb _ __ k}}}ss uu ~ \u007f ", - " ``\u0085`\u0080\u0080 { \u0081 \u0082iiii po p q q\u0083||||| _ __ kk} ss uu ~ \u0084\u0084 ", - " \u0085\u0086\u0086\u0087 \u0087\u0088 \u0089\u008a \u0082\u0082\u0082\u0082 \u008b\u008b\u008b\u008d\u008d\u008d\u008d jq q\u008e| || ___ _k}}ss uuuu \u008f \u0084 ", - " \u0090\u0090\u0090\u0087\u0091\u0091\u0088\u0091\u0091\u0091 \u00da\u0092\u0092\u008b\u008b\u008b\u008c\u008d \u008djj\u0094\u0094 q \u0095\u0095 \u0095 ____ _ k}sss uuu \u0084\u0084 ", - " \u0096\u0090\u0090\u0090\u0087\u0091 \u0091\u0097 \u0092\u0098 \u00a2\u0099\u008c\u008d \u008d \u0094 qqq\u008eq \u008e\u008e\u0095 \u009a_\u009b\u009b _ } \u009cuuuu \u009d \u009e\u009e\u009e\u009e \u009e\u009e \u0084\u0084\u0084 ", - " \u009f \u0087 \u0087\u0091\u0091\u0091\u00a0\u00a0\u00a1\u00a8 \u0098\u0098\u00a2\u0099\u008c\u008d\u008d\u0093\u0093\u0094 \u0094\u0094\u0094 \u00a3q\u00a4\u00a4\u0095 \u009a _\u00a5}} \u00a5\u009c\u00a6\u00a5\u00a5 \u00a5\u00a5 \u009e \u009f ", - " \u009f \u00a7 \u00a7 \u0087\u0091\u0091 \u0097 \u00a8 \u00a9\u00aa\u00aa\u0094\u00ad \u00ad\u00a3\u00a3\u00a4 \u0095\u0095 \u009a\u009a \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5 \u009f ", - " \u009f \u00a7 \u00ab\u00a7\u00ab\u00ab\u0087 \u00a8\u00a8\u00a8\u00a8\u00a8 \u00ac\u00aa\u00aa\u00aa\u00ad \u00a3\u00af\u00a4 \u0095 \u009a \u00a5\u00a5\u00a5\u00a5\u00a5 \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00ae \u00ae \u009f ", - " \u009f \u00ab \u00ab \u00a8\u00a8 \u00a8\u00a8 \u00a8 \u00db\u00ad\u00ad \u00af\u00af\u00af\u00af \u00b0 \u00a5\u00a5\u00a5\u00a5 \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5 \u00a5\u00ae\u00ae \u00ae\u00ae \u00b1 ", - " \u00b2 \u00ab \u00ab \u00a8\u00a8 \u00b3\u00ad\u00ad\u00ad\u00b3 \u00b4\u00af\u00af\u00af \u00b0 \u00b5 \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00ae\u00ae\u00ae \u00ae\u00b1\u00b1 \u00b6", - " \u009f \u00b2\u00b2\u00b2 \u00ab \u00ab\u00a8\u00b7\u00b7 \u00a8 \u00b3 \u00ad\u00ad \u00b4\u00b4\u00af\u00af\u00bf\u00b0 \u00b8 \u00b9 \u00ba \u00a5\u00a5\u00a5\u00a5\u00bb\u00bc\u00bc \u00bc\u00a5\u00ae\u00ae\u00ae\u00ae\u00ae\u00b1\u00b1\u00b1\u00b1 ", - " \u00bd \u00be \u00ab \u00b7\u00a8\u00a8 \u00a8 \u00b3 \u00b4\u00b4\u00b4\u00b4\u00c9 \u00bf \u00c0\u00c1 \u00b9 \u00bc\u00bc\u00bc\u00bc\u00bc \u00bc \u00b1\u00b1\u00c2 \u00c3", - "\u00c3 \u00be \u00b2\u00b2 \u00ab\u00ab\u00b7 \u00a8\u00b7 \u00a8 \u00b3\u00b3 \u00b3\u00b4\u00c4\u00c4\u00bf\u00bf \u00c1\u00c1\u00c1 \u00bc\u00bc\u00bc \u00bc\u00bc\u00bc \u00bc \u00c2\u00c2 \u00c3", - "\u00c3 \u00c5 \u00c6\u00c6 \u00b2\u00b2 \u00cb\u00b7 \u00c7\u00a8 \u00a8 \u00c8 \u00c8\u00c8\u00c4 \u00c4\u00c4\u00c9 \u00c1\u00c1 \u00bc\u00bc \u00bc\u00bc \u00ca \u00c2 \u00c3\u00c3", - "\u00c3\u00c5\u00c5 \u00c6 \u00b2 \u00b2 \u00cb \u00b7\u00c7\u00c7\u00a8 \u00a8 \u00a8 \u00c8 \u00c8\u00c8 \u00c4\u00c4 \u00bf \u00c1 \u00bc\u00bc \u00bc \u00ca\u00ca ", - " \u00b2 \u00cd\u00cd\u00cd \u00cb\u00ce \u00ce\u00c7\u00c7\u00c7 \u00a8\u00a8 \u00c8\u00c8\u00cc\u00cc\u00cc\u00cf\u00bf \u00c1 \u00bc \u00bc\u00bc \u00ca ", - " \u00cb\u00cb \u00cb\u00ce \u00c7\u00a8 \u00a8 \u00c8\u00c8\u00cc \u00d0\u00d0 \u00bc \u00bc\u00bc ", - " \u00cb\u00ce \u00d1\u00a8 \u00a8 \u00d2\u00cf \u00bc \u00bc ", - " \u00cb \u00cb\u00cb \u00d1\u00d1\u00a8 \u00cf\u00cf\u00cf \u00bc \u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc \u00bc ", - " \u00cb\u00cb \u00d1 \u00bc\u00bc\u00bc \u00bc \u00d3 ", - " \u00cb\u00cb \u00ce\u00ce\u00ce \u00bc\u00bc \u00d3\u00d3", - " \u00cb\u00cb\u00ce \u00ce\u00ce \u00bc\u00bc\u00bc \u00d3\u00d3 ", - " \u00d3 \u00cb\u00cb\u00ce \u00ce \u00bc \u00d3\u00d3 ", - " \u00cb\u00cb \u00ce \u00d4 ", - " \u00cb\u00cb\u00ce \u00d5 \u00d4\u00d4 \u00d3\u00d3\u00d3 ", - " \u00cb\u00cb\u00cb\u00cb \u00d5\u00d5 \u00d6 \u00d7 \u00bc ", - " \u00cb\u00cb\u00cb\u00cb \u00d6\u00d6 \u00d6 \u00bc ", - " \u00d6\u00d6\u00d6 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/style-level-compositing-tiled-0,0-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/style-level-compositing-tiled-0,0-512-512-1.0-grid-reference.json deleted file mode 100644 index 6dd6a4db4..000000000 --- a/tests/visual_tests/grids/style-level-compositing-tiled-0,0-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,190 +0,0 @@ -{ - "keys": [ - "", - "71", - "24", - "245", - "207", - "238", - "82", - "132", - "205", - "51", - "65", - "231", - "186", - "165", - "114", - "2", - "120", - "235", - "116", - "13", - "113", - "41", - "234", - "34", - "78", - "48", - "15", - "90", - "173", - "215", - "1", - "75", - "224", - "181", - "79", - "42", - "158", - "208", - "38", - "127", - "70", - "167", - "212", - "76", - "39", - "164", - "183", - "87", - "69", - "104", - "77", - "157", - "59", - "21", - "49" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!! ", - " !!!!!!!!!! ", - " !!!!! !!!!!! ! ", - " ### #### !!!!!!!!!!!!!! ", - " ### ######### ! !!!!!!!!!!!!!!! ", - " ############ !!!! !!!!!!!!!!!!! ", - " ############## ! !!!!!!!!!!!!!!!!!! ", - " ## ############### !! !! !!!!!!!!!!!!!!!!! ", - " # ################# !!! ! !! !!!!!!!!!!! ", - " ################### !!!!!!!!!!! !!!!!!!!! !!! !! ! ", - " ################## !!!!!!!!!!!!!!!!!!!!!!!!! !!! !!! ", - " ################# # !!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!! ", - " ## ################# !!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!! ", - " ## ######## ######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ### ####### ######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " #### ## ######### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ###### ######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ##### ## ######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " # ################## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ###### ### ##### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ## ########### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ## ##### ####### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ### #### # ###### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ## ###### ############# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " #### ## ############# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ", - " # # ## ####### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ## # ## # ##### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ## ## # # ## ## #### ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ### # # ####### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " #### # ### ######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ### # # # ### ############# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ### #### ## # ### ## # !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " # ### ### #### ## ### !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ######## ##### ######### !!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ######## # ## ## ######### !!!!!!!!!!!!!!!!!!!!!!!!!!! ! ", - " ### # ######## !!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ### !!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ###### # ##### !!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ###### ### ### #### ### #### !!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ####### ### ####### ## ###### !!!!!!!!!!!!!!!!!!!!!!!! ", - " ######## # #### ######## ###### ## !!!!!!!!!!!!!!!!!!!!!!!!! ", - " ############ ## #### # ### ####### !!!!!!!!!!!!!!!!!!!!!! ! ", - " #### ####### ## ### ############ !!!!!!!!!!!!!!!!!!!!!!!! ", - " $ ### ########## # ## ############## ! !!!!!!!!!!!!!!!!!!!!!! ", - " %%% ########## ## ############# !!!!!!!!!!!!!!!!!!!!!! & ", - " %%%%%%% # # ####### ### ############### !!!!!!!!!!!!!!!!!!!! !! ", - " %%%%%%%%%%%% % # # # ############ ### ###### ######## !!!!!!!!!!!!!!!!!!!!!!!! ", - " %%%%%%%%%%%%%%%%## ###### ## ########## ###### ## ########## !!!!!!!!!!!!!!!!!!!!!! ", - " %%%%%%%%%%%%%%%%%### ############# ##### ### ### ### ### # ###### !!!!!!!!!!!!!!!!!!! ", - " %%%%%%%%%%%%%%%%%%###################### ### # #### #### # ##### !!!!!!!!!!!!!!!!!!!! ", - " %%%%%%%%%%%%%%%%%%################### # ### ############ ######### !!!!!!!!!!!!!!!!! ", - " %%%%%%%%%%%%%%%%###################################### #### ## ###### !!!!!!!!!!!!!!! ", - " %%%%%%%%%%%%%%%########################################### ######### !!!!!!!!!!!!!! ", - " % %%%%%%%%%%%%%%%########################################## ######### !!!!!!!!!!!!!! ' ", - " %%%%%%%%%%%%%%%%%%%####################################### # ##### ## !!!!!!!!!! ! '' '''' ", - " %%%%%%%%%%%%%%%%%%###################################### ## ######## ## !!!!!!!!! ''''''' ", - " $ %%%%%%%%%%%%%%%%%%###################################### ### ######### !!!!!!!!! '''''' ", - " %%%%%%%%%%%%%%###################################### #### ####### !!!!!!!!! ''''' ", - " %% %%%%%%%%%%%%%%%#################################### # # # ###### !!!!!!!! '' ", - " %%%%%%%%%%%%%%%%%################################### # ### # !!!!!!! ", - " %%%%%%%%%%%%%%%%%%################################### # # #### ## !!!!! ( ", - " %%%%%%%%%%%%%%%%%%################################## ##### !!!!! ( ", - " %%%%%%%%%%%%%%%%%################################# ####### !!!! ", - " %%%%%%%%%%%%%%% %%%%%############################### ###### # !! )", - " %%%%%% %% %%%%############################ ###### # ", - " % %%%% %%%############################# ######## ### ) ", - " %%%% %%%############################# ########### ))) ", - " % % %% %%############################## ########### ))) ", - " %%% % %%%############################### ## ########### )))) ", - " %% %%%################################ ############# ))) ", - " %% % %%################################## ############### *) )))", - " % #################################### ################ *** ))", - " % # ##################################################### *** )))", - " % % ################################## ################# *** )))", - " % ################################## ################# * )))", - " ################################################# ## )))", - " ########################################### ## ### +", - " ##%%%%%%%%%%%%%%%%%%%%%##################### #### + +", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%################ ##### +++", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%###########%## # , # +", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%#########%%###### +", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#####%%%%%% ## +", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%####%%%%%% # # +", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%##%%%%%% ------", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ------", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .-----", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .-----", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .-----", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .-----", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - ", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ///0", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ////0", - " %%%%%%%%%%%%%%%%%%%%%%%%%%% //////", - " 111%%%%%%%%%%%%%%%%%%%%%%% /////00", - " 1 11111%%%%%%%%%%%%%%%%%% ////000", - " 11111111%1%%%%% %% %% //00000", - " 11 11111111%%% %% ---///000000", - " 11 11111111% %% 222300000", - " 11111111111 % 2233333000", - " 1 1111111 4 22233335500", - " 1 111111 666 22233335550", - " % 1111111 666666 7 222333335555", - " 1111111 111 6666 33333335555", - " % 1 111111 111 8 9::: 33333335555", - " 111111111; < : = > ? 33333335555", - " 111111@; A BB333333555", - " 1@@CCCC D BBBB35555555", - " @CCEE BBBB555555FF", - " EEEE GH I BBJB55555FFF", - " EE GGKKK K LLLL55FFFF", - " MMN GGK KKKKKKK OOLPPPPFQ", - " NN NNGGGKKKKKKKKK OORPPPPPQ", - " GGGGKKKKKKKKKS RRRPPPQQ", - " GGGGGGGKKKKKSSSTTU RRPPPPQ", - " GGGGGGGKKKKVVSTTTUU ", - " GGGGGGGGKKKVVVSSTTUV ", - " WGGGGGGVGKKVVVSVVVVVV " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/style-level-compositing-tiled-0,0-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/style-level-compositing-tiled-0,0-512-512-2.0-grid-reference.json deleted file mode 100644 index 6dd6a4db4..000000000 --- a/tests/visual_tests/grids/style-level-compositing-tiled-0,0-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,190 +0,0 @@ -{ - "keys": [ - "", - "71", - "24", - "245", - "207", - "238", - "82", - "132", - "205", - "51", - "65", - "231", - "186", - "165", - "114", - "2", - "120", - "235", - "116", - "13", - "113", - "41", - "234", - "34", - "78", - "48", - "15", - "90", - "173", - "215", - "1", - "75", - "224", - "181", - "79", - "42", - "158", - "208", - "38", - "127", - "70", - "167", - "212", - "76", - "39", - "164", - "183", - "87", - "69", - "104", - "77", - "157", - "59", - "21", - "49" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!! ", - " !!!!!!!!!! ", - " !!!!! !!!!!! ! ", - " ### #### !!!!!!!!!!!!!! ", - " ### ######### ! !!!!!!!!!!!!!!! ", - " ############ !!!! !!!!!!!!!!!!! ", - " ############## ! !!!!!!!!!!!!!!!!!! ", - " ## ############### !! !! !!!!!!!!!!!!!!!!! ", - " # ################# !!! ! !! !!!!!!!!!!! ", - " ################### !!!!!!!!!!! !!!!!!!!! !!! !! ! ", - " ################## !!!!!!!!!!!!!!!!!!!!!!!!! !!! !!! ", - " ################# # !!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!! ", - " ## ################# !!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!! ", - " ## ######## ######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ### ####### ######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " #### ## ######### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ###### ######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ##### ## ######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " # ################## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ###### ### ##### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ## ########### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ## ##### ####### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ### #### # ###### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ## ###### ############# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " #### ## ############# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ", - " # # ## ####### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ## # ## # ##### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ## ## # # ## ## #### ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ### # # ####### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " #### # ### ######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ### # # # ### ############# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ### #### ## # ### ## # !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " # ### ### #### ## ### !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ######## ##### ######### !!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ######## # ## ## ######### !!!!!!!!!!!!!!!!!!!!!!!!!!! ! ", - " ### # ######## !!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ### !!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ###### # ##### !!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ###### ### ### #### ### #### !!!!!!!!!!!!!!!!!!!!!!!!!! ", - " ####### ### ####### ## ###### !!!!!!!!!!!!!!!!!!!!!!!! ", - " ######## # #### ######## ###### ## !!!!!!!!!!!!!!!!!!!!!!!!! ", - " ############ ## #### # ### ####### !!!!!!!!!!!!!!!!!!!!!! ! ", - " #### ####### ## ### ############ !!!!!!!!!!!!!!!!!!!!!!!! ", - " $ ### ########## # ## ############## ! !!!!!!!!!!!!!!!!!!!!!! ", - " %%% ########## ## ############# !!!!!!!!!!!!!!!!!!!!!! & ", - " %%%%%%% # # ####### ### ############### !!!!!!!!!!!!!!!!!!!! !! ", - " %%%%%%%%%%%% % # # # ############ ### ###### ######## !!!!!!!!!!!!!!!!!!!!!!!! ", - " %%%%%%%%%%%%%%%%## ###### ## ########## ###### ## ########## !!!!!!!!!!!!!!!!!!!!!! ", - " %%%%%%%%%%%%%%%%%### ############# ##### ### ### ### ### # ###### !!!!!!!!!!!!!!!!!!! ", - " %%%%%%%%%%%%%%%%%%###################### ### # #### #### # ##### !!!!!!!!!!!!!!!!!!!! ", - " %%%%%%%%%%%%%%%%%%################### # ### ############ ######### !!!!!!!!!!!!!!!!! ", - " %%%%%%%%%%%%%%%%###################################### #### ## ###### !!!!!!!!!!!!!!! ", - " %%%%%%%%%%%%%%%########################################### ######### !!!!!!!!!!!!!! ", - " % %%%%%%%%%%%%%%%########################################## ######### !!!!!!!!!!!!!! ' ", - " %%%%%%%%%%%%%%%%%%%####################################### # ##### ## !!!!!!!!!! ! '' '''' ", - " %%%%%%%%%%%%%%%%%%###################################### ## ######## ## !!!!!!!!! ''''''' ", - " $ %%%%%%%%%%%%%%%%%%###################################### ### ######### !!!!!!!!! '''''' ", - " %%%%%%%%%%%%%%###################################### #### ####### !!!!!!!!! ''''' ", - " %% %%%%%%%%%%%%%%%#################################### # # # ###### !!!!!!!! '' ", - " %%%%%%%%%%%%%%%%%################################### # ### # !!!!!!! ", - " %%%%%%%%%%%%%%%%%%################################### # # #### ## !!!!! ( ", - " %%%%%%%%%%%%%%%%%%################################## ##### !!!!! ( ", - " %%%%%%%%%%%%%%%%%################################# ####### !!!! ", - " %%%%%%%%%%%%%%% %%%%%############################### ###### # !! )", - " %%%%%% %% %%%%############################ ###### # ", - " % %%%% %%%############################# ######## ### ) ", - " %%%% %%%############################# ########### ))) ", - " % % %% %%############################## ########### ))) ", - " %%% % %%%############################### ## ########### )))) ", - " %% %%%################################ ############# ))) ", - " %% % %%################################## ############### *) )))", - " % #################################### ################ *** ))", - " % # ##################################################### *** )))", - " % % ################################## ################# *** )))", - " % ################################## ################# * )))", - " ################################################# ## )))", - " ########################################### ## ### +", - " ##%%%%%%%%%%%%%%%%%%%%%##################### #### + +", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%################ ##### +++", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%###########%## # , # +", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%#########%%###### +", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#####%%%%%% ## +", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%####%%%%%% # # +", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%##%%%%%% ------", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ------", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .-----", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .-----", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .-----", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .-----", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - ", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ///0", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ////0", - " %%%%%%%%%%%%%%%%%%%%%%%%%%% //////", - " 111%%%%%%%%%%%%%%%%%%%%%%% /////00", - " 1 11111%%%%%%%%%%%%%%%%%% ////000", - " 11111111%1%%%%% %% %% //00000", - " 11 11111111%%% %% ---///000000", - " 11 11111111% %% 222300000", - " 11111111111 % 2233333000", - " 1 1111111 4 22233335500", - " 1 111111 666 22233335550", - " % 1111111 666666 7 222333335555", - " 1111111 111 6666 33333335555", - " % 1 111111 111 8 9::: 33333335555", - " 111111111; < : = > ? 33333335555", - " 111111@; A BB333333555", - " 1@@CCCC D BBBB35555555", - " @CCEE BBBB555555FF", - " EEEE GH I BBJB55555FFF", - " EE GGKKK K LLLL55FFFF", - " MMN GGK KKKKKKK OOLPPPPFQ", - " NN NNGGGKKKKKKKKK OORPPPPPQ", - " GGGGKKKKKKKKKS RRRPPPQQ", - " GGGGGGGKKKKKSSSTTU RRPPPPQ", - " GGGGGGGKKKKVVSTTTUU ", - " GGGGGGGGKKKVVVSSTTUV ", - " WGGGGGGVGKKVVVSVVVVVV " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/style-level-compositing-tiled-0,1-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/style-level-compositing-tiled-0,1-512-512-1.0-grid-reference.json deleted file mode 100644 index 3f8724276..000000000 --- a/tests/visual_tests/grids/style-level-compositing-tiled-0,1-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "keys": [ - "", - "49", - "161", - "38", - "21", - "95", - "64", - "17", - "218", - "196", - "61", - "33", - "160", - "8", - "209", - "62", - "243" - ], - "data": {}, - "grid": [ - " ! !!!#$$$$%%%%%%%%%%%%%%% ", - " !!!##$$$%%%%%%%%%%%%%%%%%% ", - " !!######%%%%%%%%%%%%%%%%%%%%% ", - " & #########%%%%%%%%%%%%%%%%%%%%%%% ", - " & ######%%%%%%%%%%%%%%%%%%%%%%%%%% ", - " #####%%%%%%%%%%%%%%%%%%%%%%%%%%%% ", - " ####%%%%%%%%%%%%%%%%%%%%%%%%%%%% ", - " & ' #####%%%%%%%%%%%%%%%%%%%%%%%%% ", - " & ######(((%%%%%%%%%%%%%%%%%%%% ", - " ######(((%%%%%%%%%%%%%%%%%% ", - " ) ######(((((%%%%%%%%%%%%%%%% ", - " * ####((((((%%%%%%%%%%%%%%%% ", - "+ ###((((((((%%%%%%%%%%%%%% ", - " #((((((((%%%%%%%%%%%%% ", - " * ,,((((---%%%%%%%%%%%%% ", - " ,,((((---%%%%%%%%%%%%% ", - " ,,((((-----%%%%%%%%%% ", - " ,,,...-----%%%%%%%% ", - " ,,......----%%%%% ", - " ,,.......---%%%% ", - " , ,,.......--.%%%% ", - " ,.........%%%%%% ", - " ,,.........%%%%% ", - " ,,........//%%%% ", - " ,,........///%% ", - " ,,........///% ", - " ,,......../// ", - " ,.......... ", - " ,,.......... ", - " ,,.......... ", - " ,,........ ", - " ,....... ", - " ,....... ", - " ,..... ", - " ,,...... ", - " ,,..... ", - " ,,,.... ", - " ,,,.. ", - " ,,..... ", - " ,,..... ", - " ,,,.... ", - " ,.... ", - " ,,.. ", - " ,,... 00 ", - " ,,,, ", - " ,,,,, ", - " ,,,. 1 ", - " ,,,. ", - " , ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/style-level-compositing-tiled-0,1-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/style-level-compositing-tiled-0,1-512-512-2.0-grid-reference.json deleted file mode 100644 index 3f8724276..000000000 --- a/tests/visual_tests/grids/style-level-compositing-tiled-0,1-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "keys": [ - "", - "49", - "161", - "38", - "21", - "95", - "64", - "17", - "218", - "196", - "61", - "33", - "160", - "8", - "209", - "62", - "243" - ], - "data": {}, - "grid": [ - " ! !!!#$$$$%%%%%%%%%%%%%%% ", - " !!!##$$$%%%%%%%%%%%%%%%%%% ", - " !!######%%%%%%%%%%%%%%%%%%%%% ", - " & #########%%%%%%%%%%%%%%%%%%%%%%% ", - " & ######%%%%%%%%%%%%%%%%%%%%%%%%%% ", - " #####%%%%%%%%%%%%%%%%%%%%%%%%%%%% ", - " ####%%%%%%%%%%%%%%%%%%%%%%%%%%%% ", - " & ' #####%%%%%%%%%%%%%%%%%%%%%%%%% ", - " & ######(((%%%%%%%%%%%%%%%%%%%% ", - " ######(((%%%%%%%%%%%%%%%%%% ", - " ) ######(((((%%%%%%%%%%%%%%%% ", - " * ####((((((%%%%%%%%%%%%%%%% ", - "+ ###((((((((%%%%%%%%%%%%%% ", - " #((((((((%%%%%%%%%%%%% ", - " * ,,((((---%%%%%%%%%%%%% ", - " ,,((((---%%%%%%%%%%%%% ", - " ,,((((-----%%%%%%%%%% ", - " ,,,...-----%%%%%%%% ", - " ,,......----%%%%% ", - " ,,.......---%%%% ", - " , ,,.......--.%%%% ", - " ,.........%%%%%% ", - " ,,.........%%%%% ", - " ,,........//%%%% ", - " ,,........///%% ", - " ,,........///% ", - " ,,......../// ", - " ,.......... ", - " ,,.......... ", - " ,,.......... ", - " ,,........ ", - " ,....... ", - " ,....... ", - " ,..... ", - " ,,...... ", - " ,,..... ", - " ,,,.... ", - " ,,,.. ", - " ,,..... ", - " ,,..... ", - " ,,,.... ", - " ,.... ", - " ,,.. ", - " ,,... 00 ", - " ,,,, ", - " ,,,,, ", - " ,,,. 1 ", - " ,,,. ", - " , ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/style-level-compositing-tiled-1,0-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/style-level-compositing-tiled-1,0-512-512-1.0-grid-reference.json deleted file mode 100644 index 2ded48389..000000000 --- a/tests/visual_tests/grids/style-level-compositing-tiled-1,0-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "keys": [ - "", - "245", - "238", - "154", - "60", - "189", - "142", - "53", - "101", - "45", - "103", - "102", - "72", - "163", - "98", - "205", - "153", - "30", - "207", - "206", - "110", - "65", - "129", - "58", - "136", - "105", - "191", - "57", - "81", - "171", - "86", - "170", - "182", - "80", - "236", - "16", - "210", - "89", - "140", - "22", - "68", - "186", - "4", - "112", - "200", - "202", - "93", - "94", - "74", - "5", - "3", - "84", - "194", - "96", - "31", - "2", - "199", - "190", - "88", - "162", - "44", - "83", - "107", - "100", - "139", - "91", - "175", - "50", - "97", - "155", - "32", - "18", - "168", - "226", - "118", - "14", - "244", - "126", - "214", - "113", - "36", - "188", - "193", - "99", - "131", - "172", - "220", - "54", - "208", - "152", - "56", - "25", - "73", - "19", - "35", - "185", - "197", - "40", - "26", - "63", - "230", - "69", - "119", - "121", - "223", - "229", - "28", - "204", - "92", - "27", - "52", - "67", - "95" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ! !! ", - " ! ", - " !!!! ", - " ! !!! ! ! !! ", - " !!! !! ! !!!! ", - " !! !! !!! !!!! ", - " # ## ! !!!! !!!! ", - " ##### # # !! !! !!!! ", - " # ####### ! !!!!!! ", - " ########### ! ! !!!!! ", - " ########## !!!!!! ", - " ###### !!! !! ", - " ######## ## !! !!! ", - " ######## !!!! ", - " ## ## # !!! ", - " #### ## ", - " #### ### ", - " ### # !!!! ", - " ## !! !!! ! ", - " ## !! !!!!! ", - " !!! !!!!!!!!!! ", - " !!!!! !!!!!!!!!!!! ! ", - " !!!! !!!!!!!!!!!!!!! !! !! ", - " !!!! !!!!!!!!!!!!!!!!! !!!!!!! ", - " !!!! !!!!!!!!!!!!!!!!!!! !!!!! !!!! ", - " !!! !!!!!!!!!!!!!!!!!!! ! ", - " !!! ! !!!!!!!!!!!!!!!!! ! ", - " !!! ! !!!!!!!!!!!!!!!!!!! ! ", - " !! ! !!!!!!!!!!!!!!!!!!!! !!! !!! !! !! ", - " !!! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! ", - " !!! !!! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! ", - " !! !!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!! ", - " !!! !!! !!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!! ", - " !!! !!!!!! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!! ", - " $$ $ !!! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!! !", - " $$$$$$ ! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " $ $$$$$ ! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ", - " $$$$$$%%!!! !!! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!! ", - " $$$$%$$$%%!!!!! ! !!!!! !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!", - " $$$$&%%%%!!!!!!!! !! !! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$&&&&%%%%!!!!!!!! !! !!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $&&&&&%%%%!!!!!!!!! !! !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$&&&&&%%%%!!!!!!!!! ! !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$&&&&&&%%%%!!! !!! ! !!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$&&&&&&&%%%%!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $&&&&&& %%%!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$&&&&&& %%%!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$&&&&&&& %%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " $$$&&&&& %%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$$$&&&&& %%%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$$$$&&&& %%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " $$$$$&&&& %%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!! ", - " $$$$$&&&& %%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!! ", - " $$$$$&&&&&'%%%% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! ! ", - " $$$$$&&&&& ((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! !!! ", - " $$$ &&&&& (((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! ", - " &&&& )(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! ", - " ** &&&&& )))))!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! ", - " ** &&& )+)))!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!! ", - " ***&& ++++,,,!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!! ", - " --* .!!!++,,,!!!!!!!!!!!!!!!!!!!!!!!!!!///!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!! !! ", - " ----.......++,,,,!!!!!!!!!!!!!!!!!!!!!!//////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! ", - "0 11----.......,,,,,,!!!!!!!!!!!!!!!!!!!!!////////////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2!!!!!!!!!!!!!! !!! ", - "00 111-----......,,,,,,!!!!!!!!!!!!!!!!!!!!!////////////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2222!!!!!!!!!!!! !! 3 ", - "0 11------......4444,444!!!!!!!!!!!//!!!!!!/////////////!!!!!!!!!!!!!55!!!!!!!!!!!!!!2222!!!!!!!!!!!! ! 3", - " 6677-----8......44444444!!!!!!!!!!///////!/////////////////!!!!!!!!!!555!!!!!!!!!!!!222222!!!!!!!!! !! ! ", - "66669----8888...444444444444!!!!!!///////////////////////////!!!55555!5555555!!!!55!!222222!!!!!!!!! !! ! ", - "666666----88::::4444444444444!!!!!////////////////////////////2555555555555555555552222222222!!!!!!! ! ", - "666666;---<<=:==444>>4444444!!!!!!///////////////////////////22255555555555555555552522222222!!2!!!! ! ", - "66666;;;?<<<====@@@@>444444 !!!!!!!////////////////////////2/22225555555555555555555552222222222!!! !! ! ", - "66666;????AAB=C@@@@@>4 4 !!!!!!!! /////////////////////222222555555555555555555222222222222!!! ! ", - "66666???? BBDBCC@@@@@@ 44!!!!!!!! ////EEE///////////////22222222555555555555555522222222222!!!!! F ! ", - "666666 ??? BDDCCC@@@@ !!!!!! ////EEEE//////////////222222222255555555555522222222222222!!! FFF ", - "666 ?? BGCCCHHH II!!! ///EEEEEEEE//////////22222222222555555555522222222222222!!! FFF ", - "JJJ 6 ??? KCLHHM MM III!! NENNEEEEE//EOOOOOO222222222222222225522222222222222PPP F ", - "J ? ???? KLQQQM MMMMMMMMMMMRSSS NNNNNNEEEEEEEEEOO22222222222222222222222222222222222PPP F ", - " JJ ? ? ?QQQ QMMMMMMMMMMMMMRSTS NNNNNNNEEEEUUOO222222222222222222222222222222222 22PP F ", - "JJ QQQQMMMMMMMMMMMMMTTT NNNNNNNEEEUUUU2222222222222222222222222222222 2 PPV F ", - " ?? QQQQQMMMMMMMMMMMMTTTT NTTNNNNNNEUWUUU2222222222222222222222222222222 2 PVV V FF ", - " XXXXXYY Q Q QM MMMMZZZ[[[TTTTTTTTTTTNNWWWWW]]]]2222222222222222222222222222222 VVV FFFF ", - "XXXXXXYY QQQ ^ ZZZZ[[[TTTTTTTTTTTNWWWWWW]]]]]222222222222222222222222222222 VVV FFFFFF ", - "XXXXXXYY ZZZ[[[[TTTTTTTTTTTWWWWWW]]]____22222222222222222222222222222 V FFFFF F ", - "XXXXXXYYY` ` aZZ[[[[[TTTTTTTTTTTWWWWWW]]]____22222222222222222222222222222 FF ", - "XXXXXXXY```` ``` bcddd[[[[[TTTTTTTTTWWWW]]]]]]__2222222222222222222222222222222 FF ", - "XXXXXXXY``````````eeeeeeeccdddd[[[[TTTTTTTTTWWW]]]]]]_____22222222222222222222222222222 F ", - "XXXXXXX```````````eeeeeeeddddddd[ff TTTTTTTT]]]]]]]]_____ggg2222222__222222222222222222 ", - "XXXXXXX```````````eeeeeeedddddddddd TTTTTTTT]]]]]]]______gggg2_h2____22222222222222222 F ", - "XXXXXXX```````````eeeeeee dddddddddd TTTTTTT]]]]]___________gg______i2222222222222222 F F ", - "XXXXXXX```````````eeeeeee ddddddddddj kTTT]]]]]]]_________________ii2222222222222222 ", - "XXXXXXXX``````````eeeeeeee dddddddddd kkl ]]]_____________m___ii22222222222222n n F ", - "XXXXXXXXoo````````eeeeeeee dddddddddkkklll _______________m__iiii2222p22222222 n ", - "qXXXXXooooorrr````sssssssss ddddddddddddlll ______________m iiiii22pppp2222 ", - "qqXXXooooooorrrr``sssssssss dddddddddddll __________ iiiiituupp 2 v ", - "qqqooooooooorrrrrssssssssss dddddddddllll _________ iiittuupp 22 w ", - "qqqooooooooorrrrrsssssssssss dddddxxxlll ________ iiitttttp w ", - "qqqoooooooorrrrrrssssssssssy xxdxxxx _______ iiitttttup ww ", - "zoooooooooorrrrrssssssssssyyy xxxxxx ____ ttttttup w ", - "zooo{ooooorrrrrrssssssssss||||yxxxx _____ _ ittt}}}p www ~ ", - "zzo{{{{{{{{rrrrrssssssssss||||| xx ___ _ it t}}pp wwww ", - "z\u007f\u007f{{{{{{{\u0080rrrrrsssssssss||||||\u0081 \u0081\u0081\u0081\u0081 ___ i }ppp wwwww ", - "\u0082\u007f\u007f{{{{{{{rrrrr\u0083\u0083ssssssss||||||\u0081\u0081\u0081\u0081\u0081\u0081 ___\u0084 tt p w www \u0085 \u0086 ", - "\u0087\u0082{{{{{{{\u0080\u0080rr\u0083\u0083\u0083\u0083sssssss|||||||||\u0081\u0081\u0081 _ \u0084 _ tt w www ", - "\u0087\u0082{{{{{{{\u0080\u0080\u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083ssssss||||||||\u0081\u0081\u0081 \u0088 \u0084\u0084 tt \u0089w ww \u0085 ", - " {{{\u0080\u0080\u0080\u0080\u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083ssssss||||||\u0081\u0081\u0081 \u0088 \u008a \u0089\u0089\u0089 \u0089\u0089\u0089 w \u008b ", - " \u0080\u0080\u0080\u0080\u0083\u0083\u0083\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008css\u008d\u008e\u008e||\u008e\u0081\u0081\u0081\u0081 \u0088 \u008a\u008a \u0089\u0089 \u008a \u0089\u008a\u008a \u008a ", - " \u0080\u0080\u0080\u0080\u0080\u008f\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008d\u008d\u008d\u008e\u008e\u008e\u008e\u0081\u0081\u0081\u0081 \u0088 \u008a \u008a\u008a\u0089\u0089\u0089 \u0089\u0089\u0089\u008a\u008a \u008a ", - " \u0090\u0091\u0091\u0091\u008f\u008f\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008d\u008d\u008d\u008e\u008e\u008e\u008e\u0081\u0081\u0081 \u008a \u008a\u008a \u008a \u008a\u0089\u008a\u008a\u008a\u008a\u008a \u008a\u008a \u008a \u008a \u0092 " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/style-level-compositing-tiled-1,0-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/style-level-compositing-tiled-1,0-512-512-2.0-grid-reference.json deleted file mode 100644 index 2ded48389..000000000 --- a/tests/visual_tests/grids/style-level-compositing-tiled-1,0-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "keys": [ - "", - "245", - "238", - "154", - "60", - "189", - "142", - "53", - "101", - "45", - "103", - "102", - "72", - "163", - "98", - "205", - "153", - "30", - "207", - "206", - "110", - "65", - "129", - "58", - "136", - "105", - "191", - "57", - "81", - "171", - "86", - "170", - "182", - "80", - "236", - "16", - "210", - "89", - "140", - "22", - "68", - "186", - "4", - "112", - "200", - "202", - "93", - "94", - "74", - "5", - "3", - "84", - "194", - "96", - "31", - "2", - "199", - "190", - "88", - "162", - "44", - "83", - "107", - "100", - "139", - "91", - "175", - "50", - "97", - "155", - "32", - "18", - "168", - "226", - "118", - "14", - "244", - "126", - "214", - "113", - "36", - "188", - "193", - "99", - "131", - "172", - "220", - "54", - "208", - "152", - "56", - "25", - "73", - "19", - "35", - "185", - "197", - "40", - "26", - "63", - "230", - "69", - "119", - "121", - "223", - "229", - "28", - "204", - "92", - "27", - "52", - "67", - "95" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ! !! ", - " ! ", - " !!!! ", - " ! !!! ! ! !! ", - " !!! !! ! !!!! ", - " !! !! !!! !!!! ", - " # ## ! !!!! !!!! ", - " ##### # # !! !! !!!! ", - " # ####### ! !!!!!! ", - " ########### ! ! !!!!! ", - " ########## !!!!!! ", - " ###### !!! !! ", - " ######## ## !! !!! ", - " ######## !!!! ", - " ## ## # !!! ", - " #### ## ", - " #### ### ", - " ### # !!!! ", - " ## !! !!! ! ", - " ## !! !!!!! ", - " !!! !!!!!!!!!! ", - " !!!!! !!!!!!!!!!!! ! ", - " !!!! !!!!!!!!!!!!!!! !! !! ", - " !!!! !!!!!!!!!!!!!!!!! !!!!!!! ", - " !!!! !!!!!!!!!!!!!!!!!!! !!!!! !!!! ", - " !!! !!!!!!!!!!!!!!!!!!! ! ", - " !!! ! !!!!!!!!!!!!!!!!! ! ", - " !!! ! !!!!!!!!!!!!!!!!!!! ! ", - " !! ! !!!!!!!!!!!!!!!!!!!! !!! !!! !! !! ", - " !!! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! ", - " !!! !!! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! ", - " !! !!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!! ", - " !!! !!! !!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!! ", - " !!! !!!!!! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!! ", - " $$ $ !!! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!! !", - " $$$$$$ ! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " $ $$$$$ ! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ", - " $$$$$$%%!!! !!! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!! ", - " $$$$%$$$%%!!!!! ! !!!!! !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!", - " $$$$&%%%%!!!!!!!! !! !! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$&&&&%%%%!!!!!!!! !! !!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $&&&&&%%%%!!!!!!!!! !! !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$&&&&&%%%%!!!!!!!!! ! !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$&&&&&&%%%%!!! !!! ! !!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$&&&&&&&%%%%!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $&&&&&& %%%!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$&&&&&& %%%!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$&&&&&&& %%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " $$$&&&&& %%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$$$&&&&& %%%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " $$$$$&&&& %%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ", - " $$$$$&&&& %%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!! ", - " $$$$$&&&& %%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!! ", - " $$$$$&&&&&'%%%% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! ! ", - " $$$$$&&&&& ((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! !!! ", - " $$$ &&&&& (((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! ", - " &&&& )(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! ", - " ** &&&&& )))))!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! ", - " ** &&& )+)))!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!! ", - " ***&& ++++,,,!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!! ", - " --* .!!!++,,,!!!!!!!!!!!!!!!!!!!!!!!!!!///!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!! !! ", - " ----.......++,,,,!!!!!!!!!!!!!!!!!!!!!!//////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! ", - "0 11----.......,,,,,,!!!!!!!!!!!!!!!!!!!!!////////////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2!!!!!!!!!!!!!! !!! ", - "00 111-----......,,,,,,!!!!!!!!!!!!!!!!!!!!!////////////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2222!!!!!!!!!!!! !! 3 ", - "0 11------......4444,444!!!!!!!!!!!//!!!!!!/////////////!!!!!!!!!!!!!55!!!!!!!!!!!!!!2222!!!!!!!!!!!! ! 3", - " 6677-----8......44444444!!!!!!!!!!///////!/////////////////!!!!!!!!!!555!!!!!!!!!!!!222222!!!!!!!!! !! ! ", - "66669----8888...444444444444!!!!!!///////////////////////////!!!55555!5555555!!!!55!!222222!!!!!!!!! !! ! ", - "666666----88::::4444444444444!!!!!////////////////////////////2555555555555555555552222222222!!!!!!! ! ", - "666666;---<<=:==444>>4444444!!!!!!///////////////////////////22255555555555555555552522222222!!2!!!! ! ", - "66666;;;?<<<====@@@@>444444 !!!!!!!////////////////////////2/22225555555555555555555552222222222!!! !! ! ", - "66666;????AAB=C@@@@@>4 4 !!!!!!!! /////////////////////222222555555555555555555222222222222!!! ! ", - "66666???? BBDBCC@@@@@@ 44!!!!!!!! ////EEE///////////////22222222555555555555555522222222222!!!!! F ! ", - "666666 ??? BDDCCC@@@@ !!!!!! ////EEEE//////////////222222222255555555555522222222222222!!! FFF ", - "666 ?? BGCCCHHH II!!! ///EEEEEEEE//////////22222222222555555555522222222222222!!! FFF ", - "JJJ 6 ??? KCLHHM MM III!! NENNEEEEE//EOOOOOO222222222222222225522222222222222PPP F ", - "J ? ???? KLQQQM MMMMMMMMMMMRSSS NNNNNNEEEEEEEEEOO22222222222222222222222222222222222PPP F ", - " JJ ? ? ?QQQ QMMMMMMMMMMMMMRSTS NNNNNNNEEEEUUOO222222222222222222222222222222222 22PP F ", - "JJ QQQQMMMMMMMMMMMMMTTT NNNNNNNEEEUUUU2222222222222222222222222222222 2 PPV F ", - " ?? QQQQQMMMMMMMMMMMMTTTT NTTNNNNNNEUWUUU2222222222222222222222222222222 2 PVV V FF ", - " XXXXXYY Q Q QM MMMMZZZ[[[TTTTTTTTTTTNNWWWWW]]]]2222222222222222222222222222222 VVV FFFF ", - "XXXXXXYY QQQ ^ ZZZZ[[[TTTTTTTTTTTNWWWWWW]]]]]222222222222222222222222222222 VVV FFFFFF ", - "XXXXXXYY ZZZ[[[[TTTTTTTTTTTWWWWWW]]]____22222222222222222222222222222 V FFFFF F ", - "XXXXXXYYY` ` aZZ[[[[[TTTTTTTTTTTWWWWWW]]]____22222222222222222222222222222 FF ", - "XXXXXXXY```` ``` bcddd[[[[[TTTTTTTTTWWWW]]]]]]__2222222222222222222222222222222 FF ", - "XXXXXXXY``````````eeeeeeeccdddd[[[[TTTTTTTTTWWW]]]]]]_____22222222222222222222222222222 F ", - "XXXXXXX```````````eeeeeeeddddddd[ff TTTTTTTT]]]]]]]]_____ggg2222222__222222222222222222 ", - "XXXXXXX```````````eeeeeeedddddddddd TTTTTTTT]]]]]]]______gggg2_h2____22222222222222222 F ", - "XXXXXXX```````````eeeeeee dddddddddd TTTTTTT]]]]]___________gg______i2222222222222222 F F ", - "XXXXXXX```````````eeeeeee ddddddddddj kTTT]]]]]]]_________________ii2222222222222222 ", - "XXXXXXXX``````````eeeeeeee dddddddddd kkl ]]]_____________m___ii22222222222222n n F ", - "XXXXXXXXoo````````eeeeeeee dddddddddkkklll _______________m__iiii2222p22222222 n ", - "qXXXXXooooorrr````sssssssss ddddddddddddlll ______________m iiiii22pppp2222 ", - "qqXXXooooooorrrr``sssssssss dddddddddddll __________ iiiiituupp 2 v ", - "qqqooooooooorrrrrssssssssss dddddddddllll _________ iiittuupp 22 w ", - "qqqooooooooorrrrrsssssssssss dddddxxxlll ________ iiitttttp w ", - "qqqoooooooorrrrrrssssssssssy xxdxxxx _______ iiitttttup ww ", - "zoooooooooorrrrrssssssssssyyy xxxxxx ____ ttttttup w ", - "zooo{ooooorrrrrrssssssssss||||yxxxx _____ _ ittt}}}p www ~ ", - "zzo{{{{{{{{rrrrrssssssssss||||| xx ___ _ it t}}pp wwww ", - "z\u007f\u007f{{{{{{{\u0080rrrrrsssssssss||||||\u0081 \u0081\u0081\u0081\u0081 ___ i }ppp wwwww ", - "\u0082\u007f\u007f{{{{{{{rrrrr\u0083\u0083ssssssss||||||\u0081\u0081\u0081\u0081\u0081\u0081 ___\u0084 tt p w www \u0085 \u0086 ", - "\u0087\u0082{{{{{{{\u0080\u0080rr\u0083\u0083\u0083\u0083sssssss|||||||||\u0081\u0081\u0081 _ \u0084 _ tt w www ", - "\u0087\u0082{{{{{{{\u0080\u0080\u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083ssssss||||||||\u0081\u0081\u0081 \u0088 \u0084\u0084 tt \u0089w ww \u0085 ", - " {{{\u0080\u0080\u0080\u0080\u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083ssssss||||||\u0081\u0081\u0081 \u0088 \u008a \u0089\u0089\u0089 \u0089\u0089\u0089 w \u008b ", - " \u0080\u0080\u0080\u0080\u0083\u0083\u0083\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008css\u008d\u008e\u008e||\u008e\u0081\u0081\u0081\u0081 \u0088 \u008a\u008a \u0089\u0089 \u008a \u0089\u008a\u008a \u008a ", - " \u0080\u0080\u0080\u0080\u0080\u008f\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008d\u008d\u008d\u008e\u008e\u008e\u008e\u0081\u0081\u0081\u0081 \u0088 \u008a \u008a\u008a\u0089\u0089\u0089 \u0089\u0089\u0089\u008a\u008a \u008a ", - " \u0090\u0091\u0091\u0091\u008f\u008f\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008d\u008d\u008d\u008e\u008e\u008e\u008e\u0081\u0081\u0081 \u008a \u008a\u008a \u008a \u008a\u0089\u008a\u008a\u008a\u008a\u008a \u008a\u008a \u008a \u008a \u0092 " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/style-level-compositing-tiled-1,1-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/style-level-compositing-tiled-1,1-512-512-1.0-grid-reference.json deleted file mode 100644 index 97fda9272..000000000 --- a/tests/visual_tests/grids/style-level-compositing-tiled-1,1-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,170 +0,0 @@ -{ - "keys": [ - "", - "67", - "27", - "28", - "204", - "92", - "185", - "119", - "223", - "52", - "203", - "29", - "166", - "201", - "6", - "177", - "221", - "227", - "20", - "123", - "9", - "122", - "141", - "108", - "151", - "222", - "61", - "216", - "180", - "124", - "178", - "219", - "179", - "159", - "146" - ], - "data": {}, - "grid": [ - " !!!!##$$$$$$$$%%%%&&&&'' ( ))))) )))))) ) ) ))) ", - " * !!!!#$$$$$$$$$%++++&&&& )))) ))))) )) ) )))))) ", - " !!###$$$$$$$$$,+++++&& )))))) )))) ))) ))) )) ))))- -- ", - " ##$$$$$$$$$$$+++++++& ))) ) ) ))))))--- - ", - " $$$$$$$$$$$$+++++++ )) ) )) )))------- - . ", - " ///$$/$$$$$$$+++++++ 0 ))))) ) ))---- ", - " //////$$$$$11+++++ ))))))))22 ) )-- -- 3 3 ", - " //////$$$$$1114++++ ) ) 5 --- 33 ", - " ///////11$11114+++6 55 5 5 - ", - " ////////111111146666 7 8 55555 55 ", - " ///////1111111144666 88 5 555555 55 9 ", - " ///////1111116664666 888 555555555 555 9 ", - " ///////1111::::64666 8888 55555555555555555 ;;", - " <<<<<<<<<::::::666 8888 555555555555555555 ;;", - " <<<<<<====:::::66 888 55555555555555555555 9 ", - " <<<<<=====::::6 8888 5555555555555555555555555 > ", - " <<<<<======::666 8888 555555555555555555555555555 > ", - " <<<<=====???666 888 555555555555555555555555555 ", - " <<<<====????66 888 5555555555555555555555555555 ", - " <<<<==?????@6 5555555555555555555555555555 ", - " <<< ", - " <<<<<======::666 8888 555555555555555555555555555 > ", - " <<<<=====???666 888 555555555555555555555555555 ", - " <<<<====????66 888 5555555555555555555555555555 ", - " <<<<==?????@6 5555555555555555555555555555 ", - " <<<>>> 8 8 ??? 99 999999 :: ; ; < < ", - " ====== 111 11 2222222 333333333 4444444 5 55 666 7 >>>> 8888888888 ?? ::: ;;;;;; <<<<<<<<< ", - " ==== 1 111 11 2222222 333333333 4444444 555 55 5 6666 7 >>>> 8888888888 ????? 99 999999 ::: ;;;; ;; <<<< <<<< ", - " ==== 1 111111 2222222 333333333 4444444 555555 5 66666 7 >>>> 8 8 ????? 99 999999 :: ;;;; ; ; <<< << ", - " ====== 1 11 1 2222222 3333333 3 4444444 55 55 55 6666 7 >>>>>> 8 8 ??? 9 : ;;;; ;;;; <<<< <<<< ", - " == == 11 11 222 222 333333 4444444 55 55 66 7 >>>>>> 88 88 8 ??? 99 999999 ;;;; ; <<<< <<<< ", - " 11111 22 22 4444444 55555 6 777 > 8888888888 ??? 9 ;;;; ; <<<<<<<<< ", - " 777 ?? ; ; ", - " 6666666 7 ;;;;; ", - " ", - " ", - " ", - " ", - " ", - " ", - " @@ AAAAA BBBBBB CCCCCCCCC DDD DDD EEEE FFF GGGG HHHHHHHH III JJJJ KKKKKKKK L M NNNNNNN ", - " @@@ AA AA B BB DDD DDD EE EE FFFFFFF GGGGGGGG HHHHHHHH II I J JJJ LL MMMMMM NNN NNN ", - " @@ @@@ A A BBBBBB B CC CCCCCC DDD DDD EE EEEEE FFFFFFFF GGGGGGGG HHHHHHHH I I JJ JJJ KKKKKKKK LLL MMMMMMMM NNNN NN ", - " @@@@@@ AAA AAA BBBBBBB CC CCCCC DDD DDD EE EEE E FF FFFFF GGG GGGGGG H H H HH IIIIII I JJ JJJ KKKKKKKK LL MMMMMMMM NN NNN NNN ", - " @@@@ AAAAAAAA BBBBBBB C CCCCCC DDD DDD EEEEEE E F FFFFF GGGGGGGGGG H H HH H IIIIII JJJ JJJJ L M MM NNNNNNNNNN ", - " @@ AAAAAAAA BBBBBB B CCCCCCCCC DDD DDD EE E EE FFFFFFF GGGGGGGGG H H HH H IIIIII JJJJJJJ KKKKKKKK M NNNNNNNNNN ", - " AAAAAAA BBBBBBB CCCCCCCCC DDD DDD EEEEEE F F GGGGGGG HHHHHHHH IIIIII JJJJ J KKKKKKKK M M NN NNNNNNN ", - " BBBBBBB DDD DDD EEEE HHHHHH JJJJ MM NNN NN ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " OOO OOOOOO PPPPPPPPP Q Q RRRR ", - " OOO OOOOOO SSSSS TTTTTTT PPPPPPPPP UU VV Q QQ RRRR W WW XXXXX YYYYY ZZZZZZZZ [ ]]] ^^ ", - " SS S SS TTTTTTTT PPPPPP UUUU VVVV QQQQQ RRRRRRRRR W WWWWW XXXXX X YYY YYY ZZZZZZZZ [[[ ]]] ^^^^ ^^ ", - " OOO OOOOOO S SSS S TTTTTTTTT P PPPPPP UUUUU V V QQQ QQQQ RRRRRRRRR W WWWWWW XX X YYYY YYY ZZZZZZZZ [[[[[ ] ^ ^^^ ", - " OOO OOOOOO S SSSSSS TTTTTTTTT P PPPPPP UUUUUUU VVV VVV QQQ QQQQ RRRRRRRRR W WWWWW X XX YY Y Y ZZZZZZZZ ]]]]]]] ^^ ^^^ ", - " OO OOOOO S S SS TTTTTT T PPPPPP UUUUUU V V QQQ QQQ RRRRRRRRR W WW XX X YYY YY ZZZZZZZZ ] ] ] ^ ", - " OOO OOOOOO SS S SS TTTT T PPPPPPPPP UUUU VVVV QQQQQQQ RRRRRRRRR WWW W XXX XXX YYY YYY ZZZZZZZZ ]] ]]]]]] ^^ ^^^ ", - " OO OOOOO SSSSS TT T PPPPPPPPP UU VV RRRRRRR XX XX YYYYY ZZZZZZZZ ]] ]]]]]] ^^ ^ ", - " U ^ ^^ ", - " ^^^^^^^ ", - " ", - " ", - " ", - " ", - " ", - " ", - " ___ __ ___ ``` aaaa bbbbbbbbb c c dddd eee ff ggg ggg hhh iii jjjjjj kkkkk ll mmmmmmm ", - " ___ __ ___ `````` aaaaa cc cc ddd dd eeeeee ffffffff g gg g hh iiiiii jjj j j kkkkk ll mm mmm ", - " __ __ __ `` ` ` aaaaaa bbbbbbbbb ccc ccc dddddddd eee eee fffffff g g h ii iii jjj j j kkk lll m ", - " ___ __ ___ ` ` `` aaaaaaa cccccccc ddd ddd eee eeee fffffff g g hhhhh ii ii jjjjj j llll mm mmm ", - " __ __ __ ` ``` `` aaaaaaa bbbbbbbbb cccccccc dddd ddd eee eeee fffffff g g hhhhh ii i iii j j llll mm mmm ", - " ___ __ ___ ` `` ` aaaaaa ccc ccc dddd ddd eeeeeeee f g g h iiii iii jjjjjjjj l mm mmm ", - " ___ __ ___ ``` `` aaaa bbbbbbbbb cc cc dd dd eee eee ffffff g g h iii iii jj jj l m ", - " ````` aa c c dddd eeee f f gg h iiii jjjjjjjj l m mm ", - " l m mm ", - " ", - " ", - " ", - " ", - " ", - " ", - " nnn nnn oo ppppppppp qqqqqqqqq ", - " nnnnnnnn oo ppppppppp qqqqqqqqq r r r ssss tt u uuuuu v w www xxxxx yyy zzzzzzzzz {{{ |||||| ", - " nnnnnnnn oo ppppppppp qqqqqqqqq r rr rr ss ss tt tttt uuuuuuuu v ww wwww xxxxxxx y y z zzz z {{ { | | | ", - " nnnnnnnn ooooo ppppppppp qqqqqqqqq r rrr rrr sssss ss ttttttt uuuuu u vvvv wwwwwww xxxx xxx yyyyyy z z { {{ | |||| ", - " nnnnnnnn ooo ppppppppp qqqqqqqqq rrrrrrrrr ssss ss ttttt u uuuu vvvv wwwwwww xx xx yyyyyy z z { {{{ | | ", - " nnnnnnnn ooooo ooo ppppppppp qqqqqqqqq rrrrrrrrr ssss sss ttttttt u uuu vvv wwwww xxxxx xx yyyyy z zzz z {{ {{ {{ | |||| | ", - " nnnnnnnn ooooooooo ppppppppp qqqqqqqqq r rrr rrr sss sss ttttttt uuuuuuu vvv wwwww xxx xxx yy y zz zz {{{{ {{{ | |||| | ", - " nnnnnnnn ooooooooo ppppppppp qqqqqqqqq r rr rr ssssss tt vvv xxxxxx yyy {{{{{ | |||| | ", - " r r r sss tt v xxx y { | | ", - " |||||||| ", - " ", - " ", - " ", - " ", - " ", - " ", - " }} }} ~~~~~~~ \u007f\u007f\u007f\u007f\u007f\u007f \u0080\u0080 \u0081\u0081\u0081\u0081\u0081\u0081\u0081 \u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083 \u0084\u0084\u0084 \u0085\u0085\u0085\u0085 \u0086\u0086 \u0086\u0086 ", - " \u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087 }} }} ~~~ ~~ \u007f\u007f\u007f\u007f\u007f\u007f \u0088 \u0088 \u0080\u0080\u0080\u0080\u0080\u0080 \u0081\u0081\u0081\u0081\u0081\u0081\u0081 \u0089 \u0089 \u008a\u008a\u008a\u008a\u008a\u008a\u008a \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083\u0083\u0083\u0083 \u0084\u0084 \u0084 \u0085 \u0085 \u008b\u008b\u008b\u008b\u008b \u0086\u0086 \u0086\u0086\u0086\u0086 ", - " \u0087 \u0087 \u0087 \u0087 }}}}}}} ~~ ~ \u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f \u0088 \u0088\u0088 \u0080\u0080\u0080\u0080\u0080\u0080\u0080 \u0089\u0089\u0089 \u0089\u0089\u0089 \u008a\u008a \u008a \u0082 \u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083 \u0083\u0083\u0083 \u0084 \u0084 \u0084\u0084\u0084\u0084 \u0085 \u0085 \u008b\u008b \u008b\u008b \u0086\u0086 \u0086\u0086\u0086\u0086 ", - " \u0087\u0087\u0087 \u0087\u0087\u0087 }}} }}} ~~~~~~~ \u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f \u0088 \u0088\u0088\u0088 \u0080\u0080\u0080\u0080\u0080 \u0080 \u0089\u0089\u0089 \u0089\u0089\u0089 \u008a\u008a \u008a \u0082 \u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083 \u0083\u0083\u0083\u0083 \u0084\u0084\u0084\u0084 \u0084\u0084 \u0085\u0085 \u0085 \u008b \u008b \u0086\u0086\u0086\u0086\u0086\u0086\u0086 ", - " \u0087 \u0087 \u0087 \u0087 }}}}}}}} ~~~~~~~ \u007f\u007f\u007f\u007f\u007f\u007f\u007f \u0088\u0088\u0088\u0088\u0088 \u0080\u0080 \u0080 \u0080\u0080 \u0089\u0089\u0089\u0089\u0089 \u008a\u008a \u008a \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083 \u0083 \u0084 \u0084 \u0084 \u0085 \u008b \u0086\u0086\u0086\u0086\u0086\u0086\u0086 ", - " \u0087 \u0087 \u0087 \u0087 }}}} }}}} ~~~ ~~ \u0088 \u0088\u0088\u0088 \u0080\u0080\u0080 \u0080\u0080\u0080 \u0089\u0089\u0089 \u008a\u008a\u008a \u008a \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083 \u0083\u0083\u0083\u0083 \u0084 \u0084\u0084\u0084\u0084 \u0085\u0085\u0085\u0085 \u008b \u008b\u008b \u0086\u0086 \u0086\u0086\u0086 ", - " \u0087 \u0087 \u0087 \u0087 }}}} }}}} ~~ \u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f \u0088 \u0088\u0088 \u0080\u0080\u0080\u0080\u0080\u0080\u0080 \u0089 \u008a\u008a \u008a\u008a \u0082\u0082\u0082\u0082 \u0082\u0082 \u0083\u0083\u0083 \u0083\u0083\u0083 \u0084 \u0084 \u0085\u0085 \u0085 \u008b\u008b \u008b\u008b \u0086\u0086 \u0086\u0086 ", - " \u0087 \u0087 \u0087 \u0087 \u0088 \u0088 \u0080\u0080\u0080\u0080\u0080 \u008a \u008a \u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083\u0083\u0083 \u0084\u0084\u0084\u0084 \u0085\u0085 \u0085 \u008b\u008b\u008b\u008b\u008b \u0086\u0086 \u0086\u0086 ", - " \u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087 \u0088 \u008a\u008a \u0084 \u0085\u0085\u0085 \u008b\u008b \u0086\u0086 \u0086\u0086 ", - " \u0084\u0084\u0084\u0084\u0084 \u0086\u0086 \u0086\u0086 ", - " ", - " ", - " ", - " ", - " ", - " ", - " \u008c\u008c \u008d\u008d\u008d\u008d \u008e \u008f\u008f\u008f\u008f \u0090 \u0091\u0091\u0091\u0091 \u0092\u0092 \u0093\u0093 \u0094\u0094\u0094\u0094\u0094\u0094\u0094 \u0095\u0095\u0095\u0095\u0095 \u0096\u0096 \u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u0098\u0098 \u0099\u0099\u0099\u0099\u0099\u0099\u0099 ", - " \u008c\u008c\u008c\u008c \u008d\u008d\u008d \u008d\u008d\u008d \u008e \u008e\u008e\u008e \u0090\u0090\u0090 \u0091\u0091\u0091\u0091\u0091\u0091 \u0092\u0092 \u009a\u009a\u009a \u0093 \u0093 \u0094 \u0094 \u0095\u0095\u0095\u0095\u0095 \u0096\u0096\u0096\u0096 \u0096\u0096 \u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u0098\u0098\u0098\u0098\u0098\u0098 \u0099\u0099\u0099\u0099\u0099\u0099\u0099\u0099 ", - " \u008c\u008c\u008c\u008c \u008d\u008d \u008d \u008e\u008e\u008e\u008e \u008e\u008e \u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f \u0090 \u0091\u0091\u0091\u0091\u0091 \u0091\u0091 \u0092\u0092\u0092\u0092\u0092\u0092\u0092 \u009a\u009a\u009a\u009a\u009a \u0093\u0093 \u0093\u0093 \u0094 \u0094 \u0095 \u0095 \u0096\u0096 \u0096 \u0096 \u0096 \u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u0098 \u0098\u0098\u0098\u0098 \u0098 \u0099\u0099\u0099\u0099\u0099\u0099 \u0099 ", - " \u008c\u008c\u008c\u008c \u008d \u008d\u008d \u008e\u008e\u008e\u008e \u008e\u008e \u008e \u0090 \u0090 \u0090 \u0091\u0091\u0091 \u0091\u0091\u0091 \u0092\u0092\u0092\u0092\u0092\u0092\u0092 \u009a\u009a\u009a \u009a\u009a\u009a \u0093\u0093\u0093 \u0093 \u0094 \u0094 \u0095\u0095 \u0095 \u0096\u0096\u0096\u0096 \u0096 \u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098 \u0099\u0099\u0099\u0099\u0099\u0099\u0099\u0099 ", - " \u008c\u008c\u008c\u008c\u008c\u008c \u008d \u008d\u008d \u008d\u008d \u008e\u008e\u008e\u008e \u008e\u008e \u008e \u008f\u008f\u008f\u008f\u008f\u008f \u0090\u0090\u0090\u0090\u0090\u0090\u0090\u0090\u0090 \u0091\u0091\u0091 \u0091\u0091\u0091 \u0092\u0092 \u009a\u009a\u009a \u009a\u009a\u009a \u0093\u0093 \u0093 \u0094 \u0094 \u0094 \u0095\u0095 \u0095 \u0096\u0096\u0096 \u0096 \u0096 \u0097\u0097\u0097 \u0097\u0097\u0097 \u0098\u0098\u0098\u0098 \u0098\u0098\u0098\u0098 \u0099\u0099\u0099\u0099\u0099\u0099 ", - " \u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c \u008d\u008d \u008d \u008e\u008e \u008e\u008e\u008e \u0090\u0090 \u0090 \u0090\u0090 \u0091\u0091\u0091\u0091\u0091 \u0091\u0091 \u0092\u0092 \u009a \u009a \u0093\u0093 \u0093 \u0094 \u0094\u0094\u0094 \u0094 \u0095\u0095\u0095 \u0095 \u0096\u0096 \u0096 \u0096\u0096 \u0096 \u0097 \u0097\u0097\u0097\u0097\u0097 \u0098\u0098\u0098 \u0098\u0098\u0098\u0098 \u0099\u0099\u0099\u0099\u0099 ", - " \u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c \u008d\u008d\u008d \u008d\u008d\u008d \u008e \u008e\u008e \u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f \u0090 \u0091\u0091\u0091\u0091\u0091\u0091 \u0092\u0092 \u0093\u0093 \u0093 \u0094\u0094\u0094 \u0094\u0094\u0094 \u0095 \u0095\u0095\u0095\u0095 \u0096\u0096\u0096\u0096 \u0096\u0096 \u0097\u0097 \u0097\u0097\u0097\u0097 \u0098\u0098\u0098\u0098 \u0098\u0098\u0098\u0098 \u0099\u0099\u0099\u0099\u0099\u0099\u0099\u0099\u0099 ", - " \u008c\u008c\u008c\u008c\u008c\u008c \u008d\u008d\u008d\u008d \u0090\u0090\u0090 \u0091\u0091\u0091\u0091 \u0093\u0093\u0093\u0093\u0093\u0093\u0093 \u0094\u0094 \u0094\u0094 \u0095 \u0095 \u0096\u0096 \u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098 \u0099\u0099\u0099\u0099\u0099\u0099\u0099\u0099 ", - " \u0090\u0090\u0090 \u0095\u0095\u0095 ", - " ", - " ", - " ", - " ", - " ", - " ", - " \u009b\u009b\u009b\u009b\u009b\u009b\u009b \u009c\u009c\u009c\u009c\u009c\u009c \u009d\u009d\u009d\u009d\u009d ", - " \u009e\u009e \u009f\u009f\u009f\u009f\u009f\u009f \u00a0 \u009b\u009b\u009b\u009b\u009b\u009b\u009b \u009c \u009c\u009c \u00a1\u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2 \u00a3\u00a3\u00a3 \u00a3\u00a3 \u00a4\u00a4\u00a4\u00a4 \u009d \u009d \u00a5\u00a5\u00a5 \u00a6\u00a6\u00a6 \u00a7\u00a7\u00a7\u00a7\u00a7\u00a7\u00a7 \u00a8\u00a8 \u00a9\u00a9 ", - " \u009e\u009e \u009f \u009f \u009f \u00a0\u00a0\u00a0\u00a0 \u009b\u009b\u009b\u009b\u009b\u009b\u009b\u009b\u009b \u009c \u009c\u009c \u00a1\u00a1\u00a1\u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2 \u00a3\u00a3\u00a3 \u00a3\u00a3 \u00a4\u00a4\u00a4\u00a4\u00a4\u00a4 \u009d \u009d \u00a5 \u00a5 \u00a6\u00a6 \u00a7\u00a7 \u00a7\u00a7 \u00a8\u00a8\u00a8\u00a8 \u00a9\u00a9 \u00a9 ", - " \u009e\u009e\u009e \u009e\u009e\u009e \u009f \u009f\u009f\u009f\u009f \u00a0\u00a0\u00a0\u00a0 \u00a0 \u009b\u009b\u009b\u009b\u009b\u009b\u009b\u009b\u009b \u009c \u009c\u009c \u009c\u009c \u00a1\u00a1\u00a1\u00a1\u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2 \u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4 \u009d \u009d \u00a5 \u00a5\u00a5\u00a5\u00a5 \u00a6\u00a6 \u00a7 \u00a7\u00a7\u00a7 \u00a7 \u00a8\u00a8\u00a8\u00a8\u00a8 \u00a9 \u00a9 ", - " \u009e\u009e \u009e\u009e \u009f \u009f \u00a0\u00a0\u00a0\u00a0 \u00a0 \u009b\u009b\u009b\u009b\u009b\u009b\u009b\u009b \u009c \u009c\u009c\u009c\u009c \u009c \u00a1\u00a1 \u00a1\u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2\u00a2 \u00a3\u00a3\u00a3 \u00a3\u00a3 \u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4 \u009d \u009d \u00a5\u00a5\u00a5 \u00a5 \u00a6 \u00a6 \u00a7 \u00a7\u00a7\u00a7 \u00a7 \u00a8\u00a8\u00a8\u00a8\u00a8 \u00a9 ", - " \u009e\u009e \u009e\u009e \u009f \u009f \u00a0\u00a0 \u009b\u009b\u009b\u009b\u009b\u009b\u009b\u009b \u009c \u009c\u009c \u009c \u00a1\u00a1\u00a1\u00a1\u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2 \u00a3\u00a3\u00a3\u00a3 \u00a3\u00a3\u00a3 \u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4 \u009d \u009d \u00a5\u00a5 \u00a5 \u00a6\u00a6 \u00a6 \u00a7 \u00a7\u00a7\u00a7 \u00a7 \u00a8\u00a8\u00a8\u00a8\u00a8 \u00a9 \u00a9 ", - " \u009e \u009e \u009f \u009f \u00a0 \u009b\u009b\u009b\u009b\u009b\u009b\u009b\u009b\u009b \u009c \u009c \u00a1\u00a1\u00a1\u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2 \u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3 \u00a4\u00a4 \u00a4 \u00a4\u00a4\u00a4 \u009d \u009d \u00a5\u00a5 \u00a5 \u00a6\u00a6\u00a6\u00a6\u00a6\u00a6 \u00a7\u00a7 \u00a7\u00a7 \u00a8\u00a8 \u00a8\u00a8 \u00a9 \u00a9 ", - " \u009e\u009e\u009e\u009e\u009e\u009e \u009f \u009f \u009b\u009b\u009b\u009b\u009b\u009b\u009b\u009b\u009b \u009c\u009c\u009c\u009c\u009c\u009c \u00a1\u00a1\u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2 \u00a3\u00a3\u00a3\u00a3\u00a3\u00a3 \u00a4\u00a4\u00a4\u00a4\u00a4 \u009d\u009d\u009d\u009d\u009d \u00a5 \u00a5 \u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6 \u00a7\u00a7 \u00a7\u00a7\u00a7\u00a7 \u00a8\u00a8\u00a8 \u00a9 \u00a9 ", - " \u009e \u009e \u009f \u009f \u00a1\u00a1 \u00a3\u00a3\u00a3 \u00a5\u00a5\u00a5\u00a5\u00a5 \u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6 \u00a7\u00a7\u00a7\u00a7\u00a7\u00a7\u00a7 \u00a8\u00a8\u00a8 \u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9 ", - " \u009f\u009f\u009f\u009f\u009f\u009f\u009f\u009f \u00a5\u00a5\u00a5\u00a5\u00a5 \u00a8 \u00a9\u00a9 ", - " ", - " ", - " ", - " ", - " ", - " ", - " \u00aa\u00aa \u00ab \u00ab\u00ab \u00ac \u00ad\u00ad \u00ad\u00ad \u00ae\u00ae \u00af\u00af\u00af \u00b0\u00b0 \u00b1\u00b1 \u00b2\u00b2 \u00b3\u00b3\u00b3\u00b3 \u00b4\u00b4\u00b4 \u00b5\u00b5 \u00b6\u00b6\u00b6\u00b6 ", - " \u00aa\u00aa \u00ab\u00ab\u00ab\u00ab\u00ab \u00ac\u00ac \u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7 \u00ad \u00ad\u00ad\u00ad\u00ad\u00ad\u00ad \u00ae\u00ae\u00ae\u00ae\u00ae\u00ae \u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8 \u00b0 \u00b0\u00b0 \u00b1\u00b1\u00b1 \u00b2\u00b2 \u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3 \u00b4\u00b4\u00b4\u00b4\u00b4 \u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b6 \u00b6 ", - " \u00aa\u00aa\u00aa\u00aa \u00ab\u00ab\u00ab\u00ab\u00ab\u00ab \u00ac\u00ac\u00ac\u00ac \u00b7 \u00b7\u00b7 \u00b7 \u00ad \u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad \u00ae\u00ae\u00ae \u00ae\u00ae\u00ae \u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8 \u00b0\u00b0\u00b0\u00b0\u00b0\u00b0\u00b0\u00b0\u00b0 \u00b1\u00b1 \u00b2\u00b2\u00b2\u00b2 \u00b2 \u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3 \u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4 \u00b5\u00b5\u00b5 \u00b5\u00b5 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00b6 ", - " \u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa \u00ab\u00ab\u00ab\u00ab\u00ab\u00ab\u00ab\u00ab\u00ab \u00ac\u00ac\u00ac\u00ac \u00b7\u00b7 \u00ad\u00ad\u00ad\u00ad \u00ad\u00ad \u00ae\u00ae\u00ae\u00ae \u00ae\u00ae\u00ae \u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8 \u00b0\u00b0\u00b0\u00b0\u00b0\u00b0\u00b0\u00b0 \u00b1\u00b1 \u00b2 \u00b2\u00b2\u00b2 \u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3 \u00b4 \u00b4\u00b4\u00b4 \u00b4 \u00b5\u00b5\u00b5 \u00b5\u00b5 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00b6 ", - " \u00aa\u00aa\u00aa\u00aa\u00aa\u00aa \u00ab\u00ab\u00ab\u00ab\u00ab\u00ab \u00ac\u00ac\u00ac\u00ac \u00b7\u00b7 \u00ad \u00ad \u00ae\u00ae \u00ae\u00ae \u00af \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8 \u00b0\u00b0 \u00b0\u00b0\u00b0 \u00b1\u00b1 \u00b1 \u00b2\u00b2\u00b2 \u00b2\u00b2 \u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3 \u00b4 \u00b4\u00b4\u00b4 \u00b4 \u00b5 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00b6 ", - " \u00aa\u00aa\u00aa\u00aa \u00ab\u00ab \u00ab\u00ab\u00ab \u00ac\u00ac \u00b7\u00b7 \u00ad \u00ad \u00ad \u00ae\u00ae\u00ae\u00ae \u00ae\u00ae\u00ae \u00af\u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8 \u00b0\u00b0\u00b0 \u00b0\u00b0\u00b0\u00b0\u00b0 \u00b1\u00b1\u00b1\u00b1\u00b1 \u00b2 \u00b2\u00b2 \u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3 \u00b4\u00b4\u00b4\u00b4\u00b4 \u00b4 \u00b5\u00b5 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00b6 ", - " \u00aa\u00aa\u00aa\u00aa\u00aa\u00aa \u00ab\u00ab \u00ab\u00ab\u00ab \u00ac \u00b7\u00b7\u00b7 \u00ad \u00ad \u00ae\u00ae\u00ae\u00ae\u00ae\u00ae \u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8 \u00b0\u00b0\u00b0\u00b0\u00b0 \u00b0\u00b0 \u00b1\u00b1\u00b1\u00b1 \u00b2 \u00b2\u00b2 \u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3 \u00b4\u00b4 \u00b4\u00b4\u00b4\u00b4 \u00b5\u00b5 \u00b5\u00b5 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00b6 ", - " \u00aa\u00aa \u00aa\u00aa \u00b7 \u00b7 \u00ad\u00ad\u00ad\u00ad\u00ad\u00ad \u00ae\u00ae\u00ae\u00ae\u00ae \u00af\u00af\u00af \u00b8\u00b8\u00b8\u00b8\u00b8 \u00b0 \u00b0 \u00b0 \u00b0\u00b0 \u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2 \u00b4\u00b4\u00b4\u00b4\u00b4 \u00b5\u00b5\u00b5\u00b5\u00b5 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00b6 ", - " \u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7 \u00b8\u00b8\u00b8 \u00b0\u00b0 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " \u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9 \u00ba\u00ba\u00ba \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc \u00bc \u00bd \u00bd\u00bd \u00be\u00be\u00be \u00bf \u00c0 \u00c1\u00c1\u00c1 \u00c2\u00c2\u00c2\u00c2\u00c2 \u00c3\u00c3\u00c3 \u00c4\u00c4\u00c4\u00c4 \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5 \u00c6\u00c6 \u00c7\u00c7 \u00c7\u00c7 ", - " \u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9 \u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba \u00bb \u00bb\u00bb \u00bc \u00bc \u00bc\u00bc\u00bc \u00bd \u00bd\u00bd\u00bd \u00be\u00be\u00be \u00bf\u00bf\u00bf\u00bf\u00bf \u00c0\u00c0\u00c0 \u00c0\u00c0\u00c0\u00c0\u00c0 \u00c1\u00c1 \u00c1\u00c1 \u00c2 \u00c2 \u00c3 \u00c3 \u00c4 \u00c4 \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5 \u00c6\u00c6 \u00c7 \u00c7 ", - " \u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9 \u00ba \u00bb \u00bb \u00bc \u00bc \u00bc \u00bd \u00bd\u00bd\u00bd \u00be\u00be\u00be \u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf \u00c0\u00c0\u00c0 \u00c0 \u00c1\u00c1 \u00c1\u00c1 \u00c2 \u00c2 \u00c3\u00c3\u00c3 \u00c3\u00c3\u00c3\u00c3\u00c3 \u00c4 \u00c4\u00c4\u00c4 \u00c5 \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5 \u00c6\u00c6 \u00c6\u00c6\u00c6\u00c6 \u00c7 \u00c7\u00c7\u00c7 ", - " \u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9 \u00ba\u00ba\u00ba \u00ba \u00bb \u00bb \u00bb\u00bb \u00bc \u00bc \u00bd \u00bd\u00bd\u00bd \u00be\u00be\u00be \u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf \u00c0 \u00c1\u00c1 \u00c1\u00c1 \u00c2 \u00c2 \u00c3\u00c3 \u00c3 \u00c4\u00c4\u00c4\u00c4\u00c4\u00c4 \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5 \u00c6\u00c6 \u00c6\u00c6\u00c6\u00c6\u00c6 \u00c7 \u00c7\u00c7\u00c7 ", - " \u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9 \u00ba\u00ba\u00ba \u00ba \u00bb\u00bb\u00bb \u00bb\u00bb\u00bb \u00bc \u00bc \u00bd \u00bd \u00bd\u00bd \u00be\u00be\u00be \u00bf\u00bf\u00bf \u00bf\u00bf \u00c0\u00c0\u00c0 \u00c0 \u00c1\u00c1\u00c1\u00c1\u00c1 \u00c1 \u00c2 \u00c3\u00c3 \u00c3\u00c3 \u00c4\u00c4\u00c4\u00c4\u00c4 \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5 \u00c6\u00c6 \u00c6\u00c6 \u00c6\u00c6 \u00c7\u00c7\u00c7 \u00c7 ", - " \u00b9\u00b9\u00b9\u00b9\u00b9\u00b9 \u00ba\u00ba\u00ba \u00ba \u00bb\u00bb \u00bb\u00bb\u00bb \u00bc \u00bc \u00bd \u00bd\u00bd \u00bd \u00be\u00be\u00be \u00bf\u00bf \u00bf \u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0 \u00c1\u00c1\u00c1\u00c1 \u00c2 \u00c2 \u00c3\u00c3 \u00c3 \u00c4 \u00c4 \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5 \u00c6\u00c6 \u00c6\u00c6 \u00c6\u00c6 \u00c7 \u00c7 ", - " \u00b9\u00b9\u00b9\u00b9 \u00ba \u00bb \u00bb \u00bc \u00bc \u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd \u00be\u00be\u00be \u00bf \u00c0\u00c0 \u00c0\u00c0\u00c0\u00c0\u00c0 \u00c1\u00c1 \u00c2 \u00c2 \u00c3\u00c3\u00c3 \u00c3 \u00c4 \u00c4\u00c4 \u00c5 \u00c5 \u00c5\u00c5 \u00c6\u00c6 \u00c6\u00c6 \u00c6\u00c6 \u00c7 \u00c7\u00c7 ", - " \u00b9\u00b9 \u00ba\u00ba\u00ba\u00ba\u00ba \u00bc\u00bc\u00bc\u00bc \u00bc \u00be \u00c0 \u00c1\u00c1 \u00c2\u00c2\u00c2\u00c2\u00c2 \u00c3\u00c3\u00c3 \u00c4\u00c4 \u00c5 \u00c7\u00c7\u00c7 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " \u00c8 \u00c9 \u00ca \u00cb \u00cb ", - " \u00cc\u00cc\u00cc\u00cc\u00cc\u00cc\u00cc\u00cc\u00cc\u00cc \u00cd \u00cd\u00cd\u00cd \u00ce \u00ce\u00ce\u00ce\u00ce \u00ce \u00cf\u00cf \u00c8\u00c8\u00c8 \u00c9\u00c9\u00c9 \u00d0\u00d0 \u00d1 \u00d1 \u00d1\u00d1 \u00d2\u00d2 \u00d2 \u00d2 \u00ca\u00ca\u00ca \u00d3\u00d3\u00d3 \u00d4\u00d4 \u00d4\u00d4\u00d4 \u00cb \u00cb \u00cb\u00cb\u00cb \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5 \u00d6\u00d6\u00d6\u00d6 ", - " \u00cc \u00cc \u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd \u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce \u00cf\u00cf \u00c8\u00c8\u00c8 \u00c9\u00c9\u00c9 \u00d0\u00d0 \u00d1\u00d1 \u00d1\u00d1\u00d1 \u00d1\u00d1 \u00d2\u00d2\u00d2\u00d2\u00d2\u00d2\u00d2\u00d2\u00d2\u00d2 \u00ca\u00ca\u00ca\u00ca\u00ca \u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 \u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4 \u00cb \u00cb \u00cb \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5 \u00d6\u00d6\u00d6\u00d6 ", - " \u00cc\u00cc\u00cc \u00cc\u00cc\u00cc \u00cd\u00cd \u00cd\u00cd\u00cd \u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce \u00cf\u00cf \u00c8\u00c8\u00c8\u00c8\u00c8 \u00c9\u00c9\u00c9 \u00d0\u00d0 \u00d0\u00d0 \u00d0 \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d2\u00d2\u00d2\u00d2 \u00d2\u00d2\u00d2\u00d2 \u00ca\u00ca\u00ca\u00ca\u00ca \u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 \u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4 \u00cb\u00cb\u00cb \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5 \u00d6\u00d6\u00d6\u00d6 ", - " \u00cc \u00cc\u00cc \u00cc\u00cc \u00cc \u00cd\u00cd \u00cd\u00cd\u00cd \u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce \u00cf\u00cf \u00c8\u00c8\u00c8\u00c8\u00c8 \u00c9\u00c9\u00c9 \u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0 \u00d1 \u00d1 \u00d1 \u00d1 \u00d1 \u00d2\u00d2\u00d2 \u00d2\u00d2 \u00d2\u00d2\u00d2 \u00ca\u00ca \u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 \u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4 \u00cb\u00cb\u00cb \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5 \u00d5\u00d5 \u00d6\u00d6\u00d6\u00d6 \u00d6 ", - " \u00cc \u00cc\u00cc\u00cc\u00cc \u00cc \u00cd\u00cd \u00cd\u00cd\u00cd \u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce \u00cf\u00cf \u00c8 \u00c8\u00c8\u00c8 \u00c9\u00c9\u00c9\u00c9 \u00d0\u00d0\u00d0\u00d0\u00d0\u00d0 \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d2\u00d2\u00d2 \u00d2\u00d2 \u00d2\u00d2\u00d2 \u00ca\u00ca \u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 \u00d4\u00d4\u00d4 \u00d4\u00d4\u00d4\u00d4\u00d4\u00d4 \u00cb\u00cb\u00cb \u00d5\u00d5\u00d5 \u00d5\u00d5\u00d5\u00d5\u00d5 \u00d6\u00d6\u00d6\u00d6\u00d6 \u00d6 ", - " \u00cc \u00cc \u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd \u00ce\u00ce \u00cf \u00c8\u00c8\u00c8\u00c8\u00c8 \u00c9\u00c9\u00c9\u00c9 \u00d0\u00d0\u00d0\u00d0 \u00d1 \u00d1 \u00d1 \u00d1 \u00d1 \u00d2\u00d2\u00d2\u00d2 \u00d2\u00d2\u00d2\u00d2 \u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca \u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 \u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4 \u00cb\u00cb\u00cb \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5 \u00d6\u00d6 \u00d6 \u00d6 ", - " \u00cc\u00cc\u00cc\u00cc\u00cc\u00cc\u00cc\u00cc\u00cc\u00cc \u00cd \u00cd\u00cd\u00cd \u00ce \u00cf\u00cf \u00c8\u00c8\u00c8 \u00c9\u00c9\u00c9 \u00d0\u00d0 \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d2 \u00d2 \u00ca\u00ca\u00ca\u00ca\u00ca\u00ca \u00ca\u00ca \u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 \u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4 \u00cb\u00cb\u00cb \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5 \u00d6\u00d6\u00d6\u00d6 \u00d6\u00d6 ", - " \u00d1 \u00d1 \u00d1 \u00d1 \u00d1 \u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca \u00d3 \u00d3 \u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4 \u00cb ", - " \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d4\u00d4\u00d4\u00d4\u00d4\u00d4 ", - " ", - " ", - " ", - " ", - " \u00d7\u00d7 ", - " \u00d7\u00d7\u00d7\u00d7 ", - " \u00d8 \u00d9 \u00da\u00da\u00da \u00db\u00db\u00db\u00db\u00db\u00db \u00dc\u00dc\u00dc \u00dd \u00de \u00df\u00df \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1 \u00e2 \u00e3\u00e3\u00e3 \u00e3\u00e3\u00e3 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 \u00d7\u00d7\u00d7\u00d7\u00d7\u00d7 \u00e5\u00e5\u00e5\u00e5 ", - " \u00d8\u00d8\u00d8\u00d8\u00d8 \u00d9 \u00da \u00da\u00da \u00db\u00db \u00db\u00db \u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd \u00de\u00de\u00de \u00df\u00df\u00df\u00df\u00df\u00df\u00df \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3 \u00e3\u00e3\u00e3 \u00e4 \u00e4 \u00e4 \u00e4 \u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5 ", - " \u00d8\u00d8 \u00d8\u00d8 \u00d9 \u00da \u00da\u00da \u00db\u00db \u00db\u00db \u00dc\u00dc \u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd\u00dd\u00dd \u00de\u00de\u00de\u00de\u00de \u00df\u00df\u00df\u00df \u00e0\u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0 \u00e1\u00e1 \u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3 \u00e3\u00e3\u00e3\u00e3 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 \u00e5\u00e5\u00e5 \u00e5\u00e5\u00e5 ", - " \u00d8 \u00d8\u00d8 \u00d9 \u00d9 \u00da\u00da\u00da\u00da\u00da\u00da \u00db\u00db \u00db\u00db\u00db \u00dc \u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd \u00de\u00de\u00de\u00de\u00de\u00de\u00de \u00df\u00df\u00df\u00df \u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0 \u00e1 \u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3\u00e3 \u00e4 \u00e4 \u00e4 \u00e4 \u00e5\u00e5\u00e5 \u00e5\u00e5\u00e5 ", - " \u00d8 \u00d8\u00d8 \u00d9 \u00d9 \u00da\u00da\u00da\u00da\u00da\u00da \u00db\u00db \u00db\u00db \u00dc \u00dc\u00dc\u00dc\u00dc \u00de\u00de \u00de\u00de\u00de\u00de\u00de \u00df\u00df\u00df\u00df\u00df\u00df \u00e0\u00e0\u00e0 \u00e0\u00e0 \u00e1 \u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 \u00e5\u00e5\u00e5\u00e5 \u00e5\u00e5\u00e5\u00e5\u00e5 ", - " \u00d8\u00d8 \u00d8\u00d8 \u00d9 \u00d9 \u00d9 \u00da\u00da\u00da\u00da\u00da\u00da \u00db\u00db \u00db\u00db \u00dc \u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd \u00de\u00de \u00df\u00df \u00df \u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0 \u00e1\u00e1 \u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3\u00e3\u00e3\u00e3 \u00e3 \u00e4 \u00e4 \u00e4 \u00e4 \u00e5\u00e5\u00e5\u00e5 \u00e5\u00e5\u00e5\u00e5\u00e5 ", - " \u00d8\u00d8\u00d8\u00d8\u00d8\u00d8 \u00d9 \u00d9 \u00d9 \u00d9 \u00da\u00da\u00da\u00da\u00da\u00da \u00db\u00db \u00db\u00db \u00dc\u00dc \u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd \u00de\u00de \u00df \u00df \u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0 \u00e1\u00e1\u00e1 \u00e1\u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3 \u00e3\u00e3\u00e3 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 \u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5 ", - " \u00d8\u00d8\u00d8 \u00d8\u00d8 \u00d9\u00d9\u00d9 \u00d9 \u00d9 \u00d9 \u00db\u00db\u00db\u00db\u00db\u00db \u00dc\u00dc\u00dc\u00dc\u00dc \u00de\u00de \u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0 \u00e1\u00e1\u00e1 \u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3 \u00e3\u00e3\u00e3 ", - " \u00d8 \u00e2\u00e2\u00e2 ", - " ", - " ", - " ", - " ", - " ", - " ", - " \u00e6 \u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00e8 \u00e9\u00e9\u00e9\u00e9 \u00ea ", - " \u00eb\u00eb \u00e6 \u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00ec\u00ec \u00ed\u00ed\u00ed \u00ee \u00ee\u00ee \u00ef \u00e8\u00e8 \u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0 \u00f1\u00f1\u00f1\u00f1\u00f1 \u00f2 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 \u00f3\u00f3\u00f3 \u00f3\u00f3 \u00ea\u00ea\u00ea\u00ea ", - " \u00eb\u00eb\u00eb\u00eb\u00eb \u00e6 \u00e6 \u00e6\u00e6 \u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00ec\u00ec \u00ed\u00ed \u00ed\u00ed \u00ee\u00ee \u00ee\u00ee \u00ef\u00ef\u00ef \u00e8\u00e8\u00e8 \u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0 \u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1 \u00f2\u00f2\u00f2 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 \u00f3 \u00f3 \u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea ", - " \u00eb\u00eb\u00eb\u00eb\u00eb \u00e6\u00e6 \u00e6 \u00e6\u00e6 \u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00ec\u00ec\u00ec \u00ed \u00ed \u00ee\u00ee\u00ee \u00ee\u00ee \u00ef\u00ef\u00ef \u00e8\u00e8 \u00e8\u00e8 \u00f0\u00f0\u00f0\u00f0 \u00f0\u00f0 \u00f1 \u00f1\u00f1\u00f1\u00f1\u00f1 \u00f1 \u00f2\u00f2\u00f2\u00f2\u00f2 \u00f2 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 \u00f3 \u00f3 \u00f4\u00f4\u00f4\u00f4\u00f4\u00f4 \u00ea\u00ea\u00ea \u00ea\u00ea\u00ea ", - " \u00eb\u00eb\u00eb \u00eb \u00e6 \u00e6 \u00e6\u00e6 \u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00ec \u00ec\u00ec \u00ed\u00ed \u00ed\u00ed \u00ee\u00ee\u00ee\u00ee\u00ee\u00ee \u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef \u00e8\u00e8 \u00e8\u00e8 \u00f0\u00f0 \u00f0\u00f0 \u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1 \u00f2\u00f2\u00f2\u00f2 \u00f2\u00f2 \u00f3 \u00f3 \u00f4\u00f4\u00f4\u00f4 \u00ea\u00ea\u00ea\u00ea \u00ea\u00ea\u00ea\u00ea ", - " \u00eb \u00e6 \u00e6\u00e6 \u00e7 \u00e7 \u00ec\u00ec\u00ec\u00ec \u00ed\u00ed\u00ed\u00ed\u00ed \u00ee\u00ee\u00ee\u00ee\u00ee\u00ee \u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef \u00e8\u00e8\u00e8 \u00e8\u00e8\u00e8 \u00f0\u00f0 \u00f0\u00f0\u00f0 \u00f1\u00f1\u00f1 \u00f2\u00f2\u00f2\u00f2\u00f2\u00f2 \u00f2 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 \u00f3 \u00f3 \u00f4\u00f4 \u00ea\u00ea\u00ea\u00ea \u00ea\u00ea\u00ea\u00ea\u00ea ", - " \u00eb\u00eb\u00eb \u00e6\u00e6 \u00e6 \u00e7 \u00e7 \u00ec \u00ec\u00ec \u00ed\u00ed\u00ed \u00ee\u00ee\u00ee \u00ee\u00ee \u00ef\u00ef\u00ef\u00ef \u00e8\u00e8\u00e8 \u00e8\u00e8\u00e8 \u00f0\u00f0\u00f0 \u00f0\u00f0\u00f0\u00f0 \u00f1 \u00f2\u00f2 \u00f2\u00f2 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 \u00f3\u00f3 \u00f3 \u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea ", - " \u00eb\u00eb\u00eb \u00e6\u00e6\u00e6 \u00e6\u00e6\u00e6 \u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00ec \u00ec\u00ec \u00ed\u00ed\u00ed \u00ee\u00ee \u00ee\u00ee \u00ef\u00ef\u00ef\u00ef \u00e8\u00e8\u00e8\u00e8 \u00e8\u00e8\u00e8\u00e8 \u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0 \u00f1\u00f1\u00f1\u00f1\u00f1 \u00f2\u00f2 \u00f2 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 \u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea ", - " \u00eb\u00eb\u00eb \u00e6\u00e6\u00e6\u00e6 \u00ec\u00ec\u00ec \u00ec\u00ec\u00ec\u00ec \u00ed \u00ee \u00ee\u00ee \u00ef\u00ef\u00ef \u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8 \u00f0\u00f0\u00f0\u00f0\u00f0\u00f0 \u00f1\u00f1\u00f1\u00f1\u00f1 \u00f2\u00f2\u00f2 \u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3 ", - " \u00eb\u00eb ", - " ", - " ", - " ", - " ", - " ", - " ", - " \u00f5\u00f5 \u00f6\u00f6\u00f6\u00f6 \u00f7 \u00f8 \u00f9\u00f9\u00f9 \u00fa\u00fa\u00fa\u00fa\u00fa \u00fb ", - " \u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc \u00fd\u00fd\u00fd\u00fd \u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f7\u00f7\u00f7 \u00fe \u00fe\u00fe \u00fe\u00fe \u00ff\u00ff \u0100\u0100\u0100\u0100 \u00f8 \u00f8\u00f8 \u00f9\u00f9 \u00f9\u00f9 \u00fa \u00fa \u0101\u0101\u0101\u0101\u0101\u0101\u0101 \u00fb\u00fb \u00fb\u00fb \u0102\u0102 \u0103 ", - " \u00fc\u00fc\u00fc\u00fc\u00fc\u00fc \u00fd\u00fd \u00fd\u00fd \u00f5\u00f5 \u00f5\u00f5 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f7\u00f7\u00f7\u00f7 \u00fe\u00fe \u00fe\u00fe\u00fe \u00fe\u00fe \u00ff\u00ff\u00ff \u0100\u0100\u0100\u0100\u0100 \u0100 \u00f8 \u00f8 \u00f8\u00f8 \u00f9\u00f9\u00f9\u00f9\u00f9 \u00f9 \u00fa \u00fa \u0101\u0101\u0101\u0101\u0101 \u00fb \u00fb \u0102\u0102\u0102\u0102 \u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103 ", - " \u00fc\u00fc\u00fc\u00fc \u00fd\u00fd \u00fd\u00fd \u00f5\u00f5 \u00f5\u00f5\u00f5 \u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6 \u00f7\u00f7\u00f7\u00f7\u00f7 \u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe \u00ff\u00ff\u00ff \u0100 \u0100\u0100\u0100 \u0100\u0100\u0100 \u00f8 \u00f8 \u00f8\u00f8\u00f8 \u00f9\u00f9\u00f9\u00f9\u00f9\u00f9 \u00f9 \u00fa \u00fa \u0101\u0101\u0101 \u00fb\u00fb\u00fb \u0102\u0102\u0102\u0102\u0102 \u0103\u0103 ", - " \u00fc\u00fc \u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6 \u00f7\u00f7\u00f7\u00f7\u00f7 \u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe \u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff \u0100 \u0100\u0100\u0100 \u0100 \u0100 \u00f8 \u00f8 \u00f8 \u00f8\u00f8\u00f8 \u00f9\u00f9\u00f9\u00f9\u00f9 \u00f9 \u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa \u0101\u0101 \u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb \u0103 \u0103 ", - " \u00fc\u00fc \u00fd\u00fd \u00fd \u00f5\u00f5\u00f5 \u00f5\u00f5 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6 \u00f7\u00f7\u00f7\u00f7\u00f7 \u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe \u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff \u0100\u0100 \u0100 \u0100 \u0100 \u00f8 \u00f8 \u00f8 \u00f8\u00f8\u00f8 \u00f9\u00f9 \u00f9 \u00fa \u00fa\u00fa\u00fa \u0101\u0101 \u00fb\u00fb \u0102\u0102\u0102\u0102\u0102 \u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103 ", - " \u00fc\u00fc \u00fd\u00fd\u00fd\u00fd\u00fd\u00fd \u00f5\u00f5\u00f5 \u00f5\u00f5\u00f5 \u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f7\u00f7\u00f7 \u00fe\u00fe \u00fe\u00fe\u00fe \u00fe\u00fe \u00ff\u00ff\u00ff \u0100\u0100 \u0100\u0100 \u00f8 \u00f8 \u00f8 \u00f8\u00f8\u00f8 \u00f9 \u00f9\u00f9\u00f9 \u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa \u0101\u0101 \u00fb \u00fb \u0102\u0102\u0102 \u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103 ", - " \u00fc\u00fc \u00fd\u00fd\u00fd\u00fd\u00fd\u00fd \u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f7\u00f7\u00f7 \u00fe \u00fe\u00fe \u00fe\u00fe \u00ff\u00ff\u00ff \u0100 \u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \u0101 \u00fb\u00fb \u00fb\u00fb \u0102 ", - " \u00fc\u00fc\u00fc\u00fc\u00fc\u00fc \u00fd\u00fd \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00fe \u00fe\u00fe \u00ff\u00ff ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-iconic-font-1000-1000-2.0-grid-reference.json b/tests/visual_tests/grids/text-iconic-font-1000-1000-2.0-grid-reference.json deleted file mode 100644 index 955e20359..000000000 --- a/tests/visual_tests/grids/text-iconic-font-1000-1000-2.0-grid-reference.json +++ /dev/null @@ -1,483 +0,0 @@ -{ - "keys": [ - "", - "135", - "30", - "45", - "60", - "90", - "120", - "150", - "165", - "180", - "195", - "210", - "15", - "75", - "105", - "225", - "29", - "44", - "59", - "74", - "89", - "104", - "119", - "149", - "179", - "194", - "209", - "224", - "14", - "134", - "164", - "58", - "103", - "118", - "208", - "13", - "28", - "43", - "73", - "88", - "133", - "148", - "163", - "178", - "193", - "223", - "12", - "27", - "42", - "57", - "87", - "102", - "117", - "132", - "147", - "162", - "177", - "207", - "222", - "72", - "192", - "11", - "56", - "146", - "26", - "41", - "71", - "86", - "101", - "131", - "161", - "176", - "191", - "221", - "116", - "206", - "10", - "25", - "40", - "55", - "130", - "70", - "85", - "100", - "115", - "145", - "160", - "175", - "190", - "220", - "205", - "24", - "39", - "54", - "84", - "99", - "144", - "159", - "174", - "189", - "219", - "9", - "69", - "129", - "204", - "114", - "53", - "98", - "128", - "23", - "38", - "68", - "83", - "143", - "158", - "173", - "188", - "203", - "218", - "113", - "8", - "7", - "22", - "37", - "52", - "67", - "82", - "97", - "112", - "142", - "157", - "172", - "187", - "217", - "127", - "202", - "66", - "141", - "6", - "21", - "36", - "81", - "96", - "126", - "171", - "186", - "201", - "216", - "51", - "156", - "111", - "35", - "65", - "80", - "95", - "110", - "170", - "5", - "20", - "50", - "125", - "140", - "155", - "185", - "200", - "215", - "64", - "19", - "34", - "49", - "79", - "94", - "109", - "124", - "139", - "169", - "184", - "214", - "4", - "154", - "199", - "33", - "108", - "183", - "198", - "18", - "48", - "63", - "78", - "93", - "123", - "138", - "153", - "168", - "213", - "3", - "167", - "32", - "107", - "212", - "17", - "47", - "62", - "77", - "122", - "137", - "152", - "182", - "2", - "92", - "197", - "31", - "46", - "61", - "121", - "136", - "151", - "181", - "196", - "1", - "16", - "76", - "91", - "106", - "166", - "211" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!!! ", - " ## $$$$$$$$ %%%%%%%%%%%%%%%%% && ' ' !!!!!!!! !!!!!((((( )))))))))))))))))** +++++++++++++++ ,, ", - " ----- ######## # $$$$$$$$$$ %%%%%%%%%%%%%%%%%.%% . &&&&&&&& ////// '' '''!!!!!!!!! !!!!((((((( ))))))))))))) *** +++++++++++++++++ ,,,,,,, 00000 ", - " --------- ############# $$ $$$ %% ..% .. &&&&&&&&&&& ////////// '''''''''''''''!! !!!!!(((((((( )))))))))))))))))** +++++++++++++++++ ,, ,,, 000 ", - " ----------- ##### ###### $$ $$$$%% %%% ... ... &&&& &&&& ///// //////''''''''''''''''!' !!!!!! (((((( )))))))))))))))))** ***********++ + ++ ,, , ,, 00 0000 ", - " ---- ---- ### #### $$ $$$%% %%%% .... .... &&& &&&&& ///// ////// //'''''''''''''''!' !!!! !! ((((( **** ***********++ + ++ , , , 000 00000 ", - " --- - --- #### ##### $$ $%% %%%% %% ..... ..... &&& &&&&&&// // ////// //'' ''! !!!! (((( (((( ))))))))))))))))**** ***********++ + ++ , , 0000 00000000 ", - " --- - --- ### ###### $$ $%% %%% %%%% ...... ...... &&& &&&& &&// ///////// //' ''! !!!! (((((( (((( ))))))) ) ++ + ++ ,, ,, 0000000000000000000 ", - " -- - --- ### $$$$ $%% %%%%%% ....... ....... &&& &&&& &&// ///////// // ! !!!! (((((( ((( ))))))) **** ++ + ++ ,, ,,, 0000000000000000000 ", - " -- ------- --- ### $$$$$$$$$$$$$$%%$ %%%%%%%%................&&& &&&& &&// /////// // ! !!!! ! ((((( (((())))))))))))))))))** ***********++ + ++ ,, ,, 0000 00000000 ", - " --- - --- ### $$$$$$$$$$$$$$%%$ %% %%%%%%%%%............... &&& &&&& &&&/// ///// // ! !!! ! (((( ((( ** ***********++ + ++ ,, ,, 000 00000 ", - " --- - ---- ### $$$$$$$$$$$$$$%%$ %%%%%%%%%%%%%....... ...... && &&&& &&& /// /// ! ! ! ((( ((( ((())))))))))))))))** * ***********++ + ++ ,,,,, 00 0000 ", - " ---- - --- #### ## $$$$$$$$$$$$$$%%$%%%%%%%%%%%%%%...... ..... &&&&&& &&& ////////// ! ! ((( ((( (())))))))))))))))**** ++ + ++ ,,,,,, 000 ", - " ----- ----- #### #### $$$$ $%%$%%%%%%%%%%%%%%..... .... &&&&& &&&& ////// !! !! ((((( ((( (())))))))))) ) ++ + ++ ,,,,,, 00000 ", - " ------------ ############ $$$$ $%%$%%%%%%%%%%%%%%.... ... &&&&& &&&&& !!!!!!!!!!!!!! ((( ((( (())))))))))))))))**** ***********++ + ++ ,,,,,, ", - " ------- ---- ######### $$ $%% ... .. &&&&&&&&&& !!!!!!!!!!!! * * ***********++ + ++ ,,,,,, ", - " ---- ####### $$$$$$$$$$$$%%%%%%%%%%%%%%%%%.. . &&&&&& *** ***********+++++++++++++++++ ,,, ", - " --- 11111 2222222222222 3333333333 444444444444444 555555 6 7 8888888888888888888 99** :: ;;;;;;;;;;;;; <<<<<<<< ", - " === === -- 111111111 2222222222222333333333333 3444444444444444 555555555 666 777 >>>>>>>>>> 8888888888888888888 ??????**** 9999999999999 ::: ;;;;;;;;;;;;; <<<<<<<< ", - " ===== ===== 11111111111 22222222222223333333333333 33444444444444444 555555555555 666 77777 >>>>>>>>>> 8 8 ?????? 9999 9999999999999 :::: ;;; ;;; < << ", - " ============ 1111 111 22222222222223333333333333 333444444444444444 555 5555 66666 7777777 >>>>>>>> 8 8 ???? 999 9999999999999 ::::: ;;;;;;;;;;;;; << <<<<<<<<<<< << ", - " ========== 111 11 111 222222222222233333333333333333444444444444444 555 555 666666 777 >>>>>> 8888888888888888888 ???? :::::: ;;;;;;;;;;;;; << <<<<<<<<<<< <<< ", - " ======== 111 1111 111 222222222222233333333333333333444444444444444 55 55 555 6666666 777 >>>>>> 8888888888888888888 ????? 99 :::::: ;;;;;;;; ;; << <<<<< <<<< <<< ", - " ====== 111 11111 11 222222222222233333333333333333444444444444444555 5 555 555 66666666 777 >>>>>> 8888888888888888888 ????? ?9999 9999999999999 ::::: ;;;;;;;; ;;; << <<<<< <<<< <<< ", - " ======== 11 1111111 11 222222222222233333333333333333444444444444444555 555 5555 555 666666666 777 >>>>>> 8888888888888888888 ????????9999 9999999999999 :::: ;;;;;;;; ; ;;<< <<<<< <<<< <<< ", - " ========== 11 1111111 11 222222222222233333333333333333444444444444444555 5555555 555 666666666 777 >>>>>>>> 8 8 ?? ??????9999 9999999999999 ::: ;;;;;;;; ; ;<< << << <<< ", - " ============ 111 11111 11 222222222222233333333333333333444444444444444555 55555 555 66666666 777 >>>>>>>>>> 8 8 ???? ???? :: ;;;;;;;; ;;;;<< << << <<< ", - " ===== ===== 111 111 111 22222222222223333333333333 333444444444444444 555 555 555 6666666 777 >>>>>>>>>>>>8 8 ?????? 99 : ;;;;;;;; ;;;;<< <<<<< <<<< <<< ", - " ==== ==== 111 11 1111 222222 2222223333333333333 33444444444444444 555 5 555 66666 777 >>>>>>>>>>>>8 8 ?????? 9999 9999999999999 ;;;;;;;; << <<<<< <<<< <<< ", - " == == 1111 1111 22222 22222 33333333333 3444444444444444 5555 5555 6666 777 >>>>>>>>>> 8 888 8888 8?????? 9999 9999999999999 ;;;;;;;; << <<<<< <<<< <<< ", - " 11111111111 2222 2222 444444444444444 55555555555 666 777 >> 8 ?????? 9999 9999999999999 ;;;;;;;; << <<<<<<<<<<< <<< ", - " 111111111 222 222 444444444444444 55555555 66 7777777 >> 88888888888888888??? ?? ;;;;;;;; << <<<<<<<<<<< <<< ", - " 1111 2 @@@@@@@@@@@@@@@@@444444444444444 5555 6 ABBBBB7777777 >> 8888888888888888????? ;;;;;;;; C < <<<<<<<<<<< << ", - " DDD EEEEEEEEEEE FFFFFFFFFFF@@@@@@@@@@@@@@@@@GGGGGG GGGGGG HHHHHHH ABBBBBBB77777 IIIIII>>IIIIII JJJJJJJ ??? KKKKKKK LLLLLLLLLLLLLLLL MM ;;CC ; NNNNNNNNNNNNNN ", - " DDDDD EEEEEEEEEEE FFFFFFFFFFFF@@@@@@@@@@@@@@@@@GGGGGG GGGGGG HHHHHHHHHH 6666666666666BBBBBBBB777 IIIIIIIIIIIIIIII JJJ JJJJ KKKKKKKKKK LLLLLLLLLLLLLLLL MMM ;;;;;;;;;;;; NNNNNN NNNNNN ", - " DDDDDD EEE EEE FFFFFFFFFFFF GGGGGG GGGGGG HHHHH HHHH AAAAAAAAAAABBBBBBBBBBBBBBB IIIIIIIIIIIIIIII JJ JJ KKK KKKKKK LLLLLLLLLLLLLL MMMM CCCCCCCCCC NNNNNN NNNNNN ", - " D DDDDDD EEE EE FFF FFF@F @@@@@@@@@@@GGGGGG GGGGGG HHHH HHH AAAAAAAAAAAABBBBBBBBBBBBBBB III IIIIIIIIIII JJ JJKK KKK KKKK MMMMM CCCCCCCCCCCC NNNNNN NNNNNN ", - " DDD DDDDDD EE EEE FFFFFFFFFFFF @@ @@@@@@@@@@@GGGGGG GGGGGG HHH H H HHH AAAAAAAAA AAABBBBBBBBBBBBBBB III IIIIIIIIIIII JJ JJKK K KKKK MMMMMM CCCCCCCCCCCCCC NNNNNN NNN ", - " DDDDD DDDDDD EEE EE FFF FF @@@ @@@@@@@@@@@GGGGGG GGGGGG HH HHHHHH HHH AAAAAA AAAABBBBBBBBBBBBBBB IIIIIIIIIIIIIIIIJJJJJJJJJJ JJKKK KKKKKLLLLLLLLLLLLLLLL MMMMMM CCCCCCCCCCCCCCCCNNN NNN NNN ", - " DDDDDDDDDDDD EE EE FFFFFFFFFFFF @@@ GGGGGG GGGGGGHHH HHHHHH HHHAAAAA AAAAAAABBBB III I I IIIJJJJJJJJJJJJ JKKKK KKKKKKLLLLLLLLLLLLLLLL MMMMM CCCCCCCCCCCCCCCNNN NNNNNN NNNNNN ", - " DDDDDDDDDD EEEEEE EEEEE FFFFFFFFFFFF F@@@ @@@@@@@@@@@GGGGGG GGGGGGHHH HHHH HHHAAAA AAAAAAAAABBB BBBBBBBBBBBBIII I II IIJJJJJJJJJJJJ KKKKK KKKKKKKLLLLLLLLLLLLLLL MMMM C CCCCC CC NNNNNNNNNNN NNNNNN ", - " DDDDDDDD EEEEEE EEEEEE FFFFFFFFFFFF F@@ @@@@@@@@@@@GGGGGG GGGGGGHHH HHHHHH HHHAAA AAAAAAAAAABB BBBBBBBBBBBBBIII I III IIJJJJJJJJJJJJ KKKKKK KKKKKKKKK MMM C CC CC NNNNNNNNNNN NNNNNN ", - " DDDDDD EEEEEEEEEEEEEEE FFFFFFFFFFFF F@ @@@@@@@@@@@GGGGGG GGGGGG HH HHHHHHH HHH AAAAAAAAAAAAABB BBBBBBBBBBBBBBIII I III IIJJJJJJJJJJJJ KKKKK KKKKKKKKK MM CC NNNNNNNNNNNNNNNNNNN ", - " DDDD EEEEEEEEEEEEEEEFFFFFFFFFFFF FF GGGGGG GGGGGG HHH H HH HH AAAAAAAAAAAAA B BBBBBBBBBBBBBBBIII I III IIJJJJJJJJJJJJ KKKKKKK KKKKKKKLLLLLLLLLLLLLLLL CC NNNNNNNNNNNNNNNNNNN ", - " DD EEEEEEEEEEEEEEEFFFFFFFFFFFF FF@@@@@@@@@@@@@@@@@GGGGGG GGGGGG HHHH HHHAAAAAAAAAAAA BBBBBBBBBBBBBBB III I III IIJJJJJJJJJJJJ KKKKKKKKK KKKK LLLLLLLLLLLLLLLL CC NNNNNNNNNNNNNNNNNNN ", - " EEEEEEEEEEEEEEEFFFFFFFFFFFF F @@@@@@@@@@@@@@@@@GGGGGG GGGGGG HHHH HHHH AA AAA BBBBBBBBBBBBBBB III I III IIJJJJJJJJJJJJ KKKKKKKK KK LLLLLLLLLLLLLLLL C CC NNN NNNNNNN NNNN ", - " F FF GGGGGG GGGGGG HHHHHHHHHH IIIIIIIIIIIIIIII KKKKKKKKKK C CC NN NN NN NN ", - " FFFFFFFFFFFFF GGGGGG GGGGGG HHHHHHHH IIIIIIIIIIIIII KKKKKKK CCCC NNNN NNNN ", - " OOOOO OOOOOOOOOOOO PPP QQQQQQ QQQ RRRRRRRRRRRRRRRRRR SS TTT TTT UUUUUUU VVVVV WWW XXXX YYYYYYYYYYYY CCZZZ [[[[[[ ", - " OOOOO OOOOOOOOOOOO PPPPPPPPP QQQQQQQQ QQQ RRRRRRRRRRRRRRRRR]]] SSS TTTT TTTTT UUUUUUUU VVVVVV VV WWWWWWWWW XXXXXXXX YYYYYYYYYYYYYY ^ ZZZZZZ [[[[[[[ ", - " OOOOO OOOOOOOOOOOO PPPPPPPPPPPQQQQQQQQQQ QQQ ]]]] SSSS TT TTTT T UUUUUUUUUUUUUUUUV VVV WWWWWWWWWWW XXXXXXXXXXX YYYYYYYYYYYYYYYY ^^^ ZZZZZZ [[ [[ [ ", - " OOOOO OOOOOOOOOOOPPPP PPPQQQ QQQQQQ QQQ ]]]]]] SSSSSSSS TTTTTTTTTT UUUUUUUUUUUUUUUUV VVVV WWWWWWWWWWWWW XXXXX XXXXXX YYYYYYYYYYYYYYYY ^^^^^ ZZZZZZ [[ [ ", - " PPP P PPQQQ QQQQQQQ QQQ RR RRRRRRRRRRR]]]]]]]] SSS SSSSSS TTTTTTTT UUUUUUUUUUUUUUUUV VVVVVVVVVVV WW W W WWW XXXXXX XXXXXX YYYYYYYYYYYYYYYY ^^^^^^^ ZZZZZZ [[[[[ [[ [[[[[ ", - " OOOOO OOOOOOOOOOOPPP PPP PQQQQQQQQQQQQQ QQQ RRR RRRRRRRRRRR]]]]]]]]]] SS SS S TTTTTT TTTTTTUUUUUUUUUUUUUUUUV VVVVVVVVVVVV WWWW WWW XXXXXX XXXXXXXYYYYYYYYYYYYYYYY ^^^^^^^^^ ZZZZ [[[[[[[[[[[[[[ ", - " OOOOO OOOOOOOOOOOPPP PPPPP PQQQQQQQQQQQQQ QQRRRR ]]]]]]]]]]]] SS SS TTTTTT TTTTTTUUUUUUUUUUUUUUUUV VVVVVVVVVVVV WWW WWW XXXXXX XXXXXXXYYYYYYYYYYYYYYYY ^^^^^^^^^^^ ZZ [ [[[[[[ [[ ", - " OOOOO OOOOOOOOOOOPP PPPPPPP PQQQQQQQQQQQQQQ QRRRR RRRRRRRRRRR]]]]]]]]]]]]] SSSSSS SSSSSTTTTTT TTTTTTUUUUUUUUUUUUUUUUV VVVVVVVVVVVV WWW WWWXXXX X XX XXXYYYYYYYYYYYYYYYY ZZZZZZZZZZZZZ [ [[ ", - " OOOOO OOOOOOOOOOOPP PPP PPQQQQQQQQQQQQQQ QRRR RRRRRRRRRRR]]]]]]]]]]]]]]]SSSSSS SSSSSTTTTTT TTTTTTUUUUUUUUUUUUUUUUV VVVVVVVVVVV WWW WWWXXX X XXXYYYYYYYYYYYYYYYY ZZZZZZZZZZZZZZ [ [[ [ [[ [ [[ ", - " PPP PPP PP QQQQQQQQQQQQQ QQRR RRRRRRRRRRR]]]]]]]]]]]]] SSSS SSSSS TTTTT TTTTT UUUUUUUUUUUUUUUUV VVVVVVVVV WWW WWW XXX XXXXYYYYYYYYYYYYYYYY Z ZZ Z [ [[ [ [[ [ [[ ", - " OOOOO OOOOOOOOOOOPPP PPP PPP QQQQQQQQQQQQ QQ ]]]]]]]]]]]] SS SS TTTTT TTTTT UUUUUUUUUUUUUUUUV VVV WWWW WWWW XXXX XXXXXYYYYYYYYYYYYYYYY Z ZZ Z [ [[ ", - " OOOOO OOOOOOOOOOOPPPP PPP PPP QQQQQQQQQQ QRRRRRRRRRRRRRRRRR]]]]]]]]]] SS SSS SS TTTTT TTTTT UUUUUUUUUUUUUUUUVV VV W WWW WWWWWW XXXXX XXXXX YYYYYYYYYYYYYYYY ZZZZZ ZZZZZZ ZZZZZ[ [[ [ [[ [ [[ ", - " OOOOO OOOOOOOOOOOOPPPP PPP QQQQQQQQ QQRRRRRRRRRRRRRRRRR]]]]]]]] SSSSSSSS TTTTTTTTTTTTT UUUUUUUUUUUUUUUUVVVVVV V WW WW WWWWW XXXXX XXXXXX YYYYYYYYYYYYYYYY ZZZZZ ZZZZZZ ZZZZZ[ [[ ", - " OOOOO OOOOOOOOOOOO PPPPPPPPPPP QQQQQQ QQ RRRRRRRRRRRRRRRRR]]]]]] SSSSS TTTTTTTTTTTT UUUUUUUUUUUUUUU WW WWWW XXXXXXXXXXXX YYYYYYYYYYYYYYYY ZZZZZ ZZZZZZ ZZZZZ[ [[ [ [[ ", - " PPPPPPPPP QQQQ QQ ]]]] SSS WWW WWW XXXXXXXXX YYYYYYYYYYYYYYY ZZZZZ ZZZZZZ ZZZZZ[ [[ [[[[ [ [[ ", - " _____ ____ _____ PPPPP QQ Q ``` `````````````]]] SSS W aaaa XXXXXX YYYYYYYYYYYYY ZZZZZ ZZZZZ ZZZZZ[ [[[[ [[ ", - " _____ ______ _____ bbbbbb ccccccc ``` `````````````` d d eeeeee ffffff ggggg ggggg aaaaa hhhhhh iiiiiiiiiiii jjjjjjjjjjj [kkkk[[[[kkk[[ ", - " _____ ______ _____ bbbbbbbbb ccccccccc ``` `````````````` dd dd eeeeeeeeee ffffffffff llll ggggggg ggggggg aaaaaa hhhhhhhhhh ii iiii iiii jjjjjjjjjjj mmmmm [[[[[[[[[[[[[[ ", - " _____ ______ _____ bbbbb bbbbb ccc ccccc ddd ddd eeeee eeeee ffffffffffff llllllllllllgg gggg gg aaaa hhhhhhhhhhhh ii iiii ii ii jjjjjjjjj mmmmm [[[[[[[[[[[[[[ ", - " bbbb bbb ccc cccccc ``` `````````````` dddd dddd eeeee eeeeee fffff fffff llllllllllllgg gg gg aaa hhhhh hhhhhh ii iiii ii ii jjjjjjj mmmm k kk k kk k kk ", - " ____ ____ ____bbbb bbb bbbcccccccccccc ``` `````````````` ddddd dddddeeeeeeeeeeeeee fffff ffffff llllllllllllgl g aaa hhhhh hhhhh ii iiii ii ii jjjjj mmmm k kk ", - " _____ ______ ____bbb bbb bbbccccccccccccc ``` `````````````` dddddd ddddddeeeee eeeeeeefffffff ffffff llllllllllllgg gg aaaaaaaaa hhhh hhhhhii iiiiiiii ii jjj mmmm mmmm k kk k kk k kk ", - " _____ ______ ____bb bbb bb ccccccccccccc ddddddd ddddddeeeeee eeeeeeefffffff ffffff lllllllllllgg gg aaaaaaaaa hhh hhhhii iiiiiii ii mmmmmmmm k kk k kk k kk ", - " _____ ______ ____bb bbb bb cccccccccccccc``` `````````````dddddddddddddddeeeeeee eeeeeeefffffff fffffff llllllllllllgg gg aaaaaaaaa hhh h h hhhii ii mmmmmmmm k kk ", - " ____ ____ ____bb bbbbbbb bb ccccccccccccc``` `````````````dddddddddddddddeeeeeee eeeeeeefffffff fffffff llllllllllllggg ggg aaaaaaaaa hhhh hh hh hhhii ii mmmmmmm k kk k kk k kk ", - " bbb bbbbb bb cccccccccccc``` ``````````````ddddddd ddddddeeeeeee eeeeeeefffffffffffffff llll ggg ggg aaa hhhhhh hhhhhhhii iiiiiiiiii ii mm mmm k kk ", - " _____ ______ ____bbb bbb bbb ccccccccccc dddddd ddddddeeeeee eeeeeeefffffff ffffff ll ggg ggg aaa hhhhhh hhhhhhhii i i ii mm k kk k kk k kk ", - " _____ ______ _____bbb b bbbb ccccccccc ``` `````````````` ddddd dddddeeeee eeee ffffff ffffff llllllllllll ggg ggg aaa hhhhhh hhhhhh ii i i ii mmm k kk k kk k kk ", - " _____ ______ _____bbbb bbbb ccccccc ``` `````````````` dddd dddd eeee eee ffffff fffff ll ll ggg ggg aaa hhhhh hhhhhh ii i i ii mmm k kk ", - " _____ ____ _____ bbbbbbbbbbb ccccc ``` `````````````` ddd ddd eeeeeeeeeee fffffffffff lll lll gggggg aaa hhhhhhhhhhh ii i i ii mm k kk k kk ", - " bbbbbbbb ccc dd dd eeeeeeee ffffffff ll ll gggg aaa hhhhhhhh iiiiiiiiiiiiiiii mm k kkkk kk ", - " nnnnnnn nnnnnnn bbbo ppp ppp p ppp qqqqqqqqqqqqqqqqqq d d eee fff r aaa hhh iiiiiiiiiiiiii mm k kkkk kk ", - " nnnnnnn nnnnnnn oooo ppp ppp p ppp qqqqqqqqqqqqqqqsss s ss tttttttt uuuu v vvvvvvvvvvv r wwwwwww xxxxxxxx yyyyyy zzzzzzzzzzzzzzzzzzz mm {k{{{{kkkk{{ kk ", - " nnnnnnn nnnnnnn oooo ppp ppp p ppp qqqqqqqqqqqqqqqsss ss sss tttttttttt uuuu vvv vvvvvvvvvv rr ww wwwwwwww xxxxxxxxxx yy yyy zzzz zzzz||||m||| {kkkkkkkkkkkkkk ", - " nnnnnnn nnnnnnn oooo ppp ppp p ppp pp sss sss ssssttttt ttttt u uuuu uu vvvvv vvvvvvvvvv rr wwww wwwwwwww xxxxxx xxxxx y yyy zzz zzz zz||| ||| { { {{ ", - " nnnnnnn nnnnnnn ooooooooo ppp ppp p ppp qqqqqqqqqqqqqqqsss ssss ssssttttt tttt uuuu uuuuuuuuvvvvvvv vvv rrr wwwwwwwwwwwww xxxxxx xxxxx y yyyyyy zz zz zz || ||| { { {{ ", - " nnnnnnn nnnnnnn ooooooooooo ppp ppp p ppp qqqqqqqqqqqqqqqsss sssss ssssstttt ttt uuuuuuuuuuuuuuvvvvvvvv vvv rrrrrrr wwwwwwwwwwwwww xxxxxx xxxxx yy yyyyyyy z zz zzz ||z || | { { {{ ", - " nnnnnnn nnnnnnn ooooooooo ppp ppp p ppp qqqqqqqqqqqqqqqsss ssssss ssssssttttttttt tttt uuuuuuuuuuuuuvvvvvvv vvv rrrrrrrrr wwwwwwwwwwwwww xxxxxxx xxxx yyy y yyyyy z zzz zzz ||z | ||{ {{{{{{{ ", - " ooooooo ppp ppp p ppp pp sss sssssssssssssttttttttt tttt uuuuuuuuuuuu vvv vvv rrrrrrrr wwwwwwwwwwwww xxx xxx yyyyy yyyyyz zzz zzz ||z | ||{ {{ ", - " nnnnnnn nnnnnnn ooooo ppp ppp p ppp qqqqqqqqqqqqqqqssssssssssssssssstttttttt ttttt uuuuuuuuu vvv vvvvvvvv rrrrrrr wwwwwwwwwwww xxx xxx yyyyy yyy z zzz zzz ||z || ||{ {{{{{{{{ {{ ", - " nnnnnnn nnnnnnn ooo ppp ppp p ppp qqqqqqqqqqqqqqqsssssssssssssssssttttttt ttttttt uuuuuuuuuuuu vvv vvvvvvv rrrrrr wwwwwwwwwww xxxx xxxx yyyyy yy z z z || || ||{ {{{{{{{{ {{ ", - " nnnnnnn nnnnnnooooooo oooooppp ppp p ppp pp sss sssssss ssssssttttttttttttttt uuuuuuuuuuuuuu vvvvvvvvv vvvvv rrrrr wwwwwwwww xxxxxxx xxxxx yyyyy yyzzz zzzzz zz|| || |||| |||{ {{ ", - " nnnnnnn nnnnnnoooooooooooooooppp ppp p ppp pp sss ssssss ssssstttttt tttttt uuuuuuuuuuuuuu vvvvvvvvvv vvvv rrrrr wwwwwwww xxxxxx xxxxx yyyy yzzzz zzz|||||||| ||||{ {{{{{{{{ {{ ", - " nnnnnnn nnnnnnoooooooooooo ooppp ppp p ppp qqqqqqqqqqqqqqqsss sssss sssstttttt tttttt uuuu uuuu uuu vvvvvvvvvvv vv rrrrr wwwwwwwww xxxxx xxxxxx yyy yzzzzzzzzzzzzzzzzz|||| ||||||{ {{ ", - " nnnnnnn nnnnnnoooooooooooooooppp ppp p ppp qqqqqqqqqqqqqqqsss ssss sssstttttttttttt u uuuu uu rrrrr wwww xxxxxxxxxxxx yyy yzzzzzzzzzzzzzzzzzzz ||||||||| { {{{{{{{{ {{ ", - " ooooooooooooooooo sss sss sss tttttttttt uuuu rrr xxxxxxxxxx yyyyyy ||||||| { {{{{{{{{ {{ ", - " sss ss ss ttttttt uuuu rr xxxxxxx yyy ||{ {{ ", - " }}}} }}}} ~~~~~~~ ~~~~~~ \u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007fss s s \u0080\u0080\u0080\u0080 \u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081 \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083\u0083\u0083 \u0084\u0084\u0084\u0084\u0084\u0084 \u0085\u0085\u0085\u0085\u0085\u0085\u0085 {\u0086 \u0086\u0086 \u0086 \u0086\u0086\u0086\u0086{{ ", - " \u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087 }}}}} }}}} ~~ ~~ ~ ~ \u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f \u0088\u0088\u0088 \u0088\u0088 \u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080 \u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081 \u0089\u0089\u0089\u0089\u0089\u0089\u0089 \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083 \u0084\u0084\u0084\u0084\u0084\u0084\u0084\u0084 \u0085\u0085 \u0085\u0085 \u008a\u008a {{{{{{{{{{{{{{{{ ", - " \u0087\u0087 \u0087\u0087 \u0087\u0087 \u0087\u0087}}}}} }}}} ~~ ~ ~~ ~ ~~ ~ \u0088\u0088\u0088 \u0088\u0088\u0088 \u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080 \u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081 \u008b\u008b\u008b \u008b\u008b \u0089\u0089\u0089\u0089\u0089\u0089\u0089\u0089 \u0089\u0089 \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083 \u0084\u0084\u0084 \u0084\u0084 \u0085\u0085 \u0085\u0085\u0085 \u008a\u008a\u008a\u008a\u008a\u008a\u008a\u008a\u008a\u008a {{{{{{{{{{{{{{{ ", - " \u0087\u0087 \u0087\u0087 \u0087\u0087 \u0087\u0087}}}}}}}}}}}} ~~ ~ ~~ ~ ~~ ~ \u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f \u0088\u0088\u0088 \u0088\u0088\u0088\u0088 \u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080 \u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081\u0081 \u008b\u008b\u008b\u008b\u008b \u008b\u008b\u008b\u008b\u0089\u0089\u0089\u0089\u0089 \u0089 \u0082\u0082\u0082 \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083\u0083\u0083\u0083 \u0083\u0083\u0083\u0083\u0083\u0083 \u0084\u0084 \u0084 \u0084\u0084 \u0085\u0085\u0085 \u0085\u0085 \u008a\u008a\u008a\u008a \u008a\u008a\u008a\u008a \u0086 \u0086\u0086 \u0086 \u0086\u0086\u0086\u0086\u0086\u0086\u0086 ", - " \u0087\u0087 \u0087\u0087 \u0087\u0087 \u0087}}}}}} }}}}} ~~ ~~ ~ ~ \u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f \u0088\u0088\u0088 \u0088\u0088\u0088\u0088\u0088 \u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080 \u008b\u008b\u008b\u008b\u008b\u008b \u008b\u008b\u008b\u008b\u008b\u0089\u0089 \u0089 \u0089\u0089 \u0082\u0082\u0082 \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083\u0083\u0083\u0083 \u0083\u0083\u0083\u0083\u0083 \u0084\u0084 \u0084 \u0084\u0084\u0084\u0084\u0084\u0084\u0084\u0085\u0085\u0085 \u0085\u0085 \u0085 \u008a\u008a\u008a \u008a\u008a\u008a \u0086 \u0086\u0086 \u0086 \u0086\u0086\u0086\u0086\u0086\u0086\u0086 ", - " \u0087\u0087\u0087\u0087\u0087\u0087 \u0087\u0087\u0087\u0087\u0087}}}}} }}}}} ~~~~~~~ ~~~~~~ \u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f \u0088\u0088\u0088 \u0088\u0088\u0088\u0088\u0088\u0088 \u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080 \u0080\u0080\u0080\u0080 \u008b\u008b\u008b\u008b\u008b\u008b \u008b\u008b\u008b\u008b\u008b\u008b\u0089\u0089\u0089\u0089 \u0089 \u0082\u0082\u0082 \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083\u0083\u0083 \u0083\u0083\u0083\u0083\u0083\u0083\u0084\u0084\u0084\u0084\u0084\u0084 \u0084\u0084\u0084\u0084\u0084\u0084\u0084\u0084\u0085\u0085 \u0085 \u0085 \u008a\u008a \u008a\u008a\u0086 \u0086\u0086\u0086\u0086 \u0086\u0086\u0086\u0086\u0086\u0086\u0086 ", - " \u0087\u0087 \u0087\u0087 \u0087\u0087 }}}}}} }}}}}} \u0088\u0088\u0088 \u0088\u0088\u0088\u0088\u0088\u0088\u0088 \u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080 \u0080\u0080\u0080 \u008b\u008b\u008b\u008b\u008b\u008b \u008b\u008b\u008b\u008b\u008b\u008b \u0089\u0089\u0089\u0089 \u0089\u0089 \u0082\u0082\u0082 \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083\u0083 \u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0084\u0084\u0084\u0084\u0084\u0084 \u0084\u0084\u0084\u0084 \u0084\u0084\u0085\u0085\u0085\u0085\u0085\u0085\u0085 \u0085 \u008a\u008a \u008a\u008a\u0086\u0086\u0086\u0086\u0086\u0086 \u0086\u0086\u0086\u0086\u0086\u0086\u0086 ", - " \u0087\u0087 \u0087\u0087 \u0087\u0087 }}}}}} }}}}}} ~~~~~~~ ~~~~ ~ \u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f \u0088\u0088\u0088\u0088\u0088\u0088\u0088\u0088\u0088\u0088\u0088 \u0080\u0080\u0080\u0080 \u0080\u0080\u0080\u0080 \u0080\u0080\u0080\u0080 \u008b\u008b\u008b\u008b\u008b\u008b\u008b\u008b\u008b\u008b\u008b \u0089\u0089\u0089\u0089 \u0089 \u0082\u0082\u0082 \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0083\u0083\u0083\u0083 \u0083\u0083\u0084 \u0084\u0084\u0084\u0084\u0084 \u0084\u0084 \u0085\u0085\u0085 \u0085\u0085\u0085\u0085\u008a\u008a \u008a\u0086\u0086\u0086\u0086\u0086\u0086 \u0086\u0086\u0086\u0086\u0086\u0086\u0086 ", - " \u0087\u0087 \u0087\u0087 \u0087\u0087 }}}}}}}}}}}}}}}}~~~~~~~ ~~~~ ~ \u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f \u0088\u0088\u0088\u0088\u0088\u0088\u0088\u0088\u0088\u0088\u0088 \u0080\u0080\u0080 \u0080\u0080 \u0080\u0080\u0080\u0080\u0080 \u008b\u008b\u008b\u008b\u008b\u008b\u008b\u008b\u008b \u0089\u0089\u0089\u0089 \u0089 \u0082\u0082\u0082\u0082 \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0083\u0083\u0083\u0083 \u0083\u0083\u0084 \u0084\u0084\u0084 \u0084\u0084 \u0084\u0084 \u0085\u0085\u0085 \u0085 \u008a\u008a \u008a\u0086\u0086\u0086\u0086\u0086\u0086 \u0086\u0086\u0086\u0086\u0086\u0086\u0086 ", - " \u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087}}}}}}}}}}}}}}}}}~~ ~~ ~~~~~~ \u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f \u0088\u0088\u0088 \u0088\u0088\u0088\u0088\u0088\u0088\u0088 \u0080\u0080\u0080\u0080 \u0080\u0080\u0080\u0080\u0080\u0080 \u008b\u008b\u008b\u008b\u008b\u008b\u008b \u0089\u0089\u0089\u0089 \u0089\u0089\u0082\u0082\u0082\u0082\u0082 \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083\u0083 \u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0084 \u0084\u0084\u0084\u0084\u0084\u0084\u0084 \u0084\u0084 \u0085\u0085\u0085 \u0085 \u008a\u008a \u008a\u008a \u0086\u0086\u0086\u0086 \u0086\u0086\u0086\u0086\u0086\u0086\u0086 ", - " \u0087\u0087 \u0087\u0087 \u0087\u0087 }}}}}}} }}}}}}}~~ ~ ~~ ~ ~~~~ \u0088\u0088\u0088 \u0088\u0088\u0088\u0088\u0088\u0088 \u0080\u0080\u0080\u0080 \u0080\u0080\u0080\u0080\u0080\u0080\u0080 \u008b\u008b\u008b\u008b\u008b \u0089\u0089\u0089\u0089\u0089\u0089 \u0089\u0089\u0082\u0082\u0082\u0082\u0082 \u0082 \u0082\u0082\u0082 \u0083\u0083\u0083\u0083\u0083 \u0083\u0083\u0083\u0083\u0083\u0083\u0084 \u0084\u0084\u0084\u0084\u0084\u0084 \u0084\u0084\u0085\u0085\u0085 \u0085\u0085\u0085 \u008a\u008a \u008a\u008a \u0086\u0086\u0086\u0086 \u0086\u0086\u0086\u0086\u0086\u0086\u0086 ", - " \u0087\u0087 \u0087\u0087 \u0087\u0087 }}}}}}} }}}}}}}~~ ~~ ~ \u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f \u0088\u0088\u0088 \u0088\u0088\u0088\u0088\u0088 \u0080\u0080\u0080\u0080\u0080 \u0080\u0080\u0080\u0080\u0080\u0080\u0080 \u008b\u008b\u008b \u0089\u0089\u0089 \u0089\u0089\u0089\u0089\u0089\u0089 \u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0082\u0082 \u0083\u0083\u0083\u0083\u0083\u0083 \u0083\u0083\u0083\u0083\u0083\u0084 \u0084\u0084 \u0084\u0085\u0085 \u0085\u0085\u0085 \u008a\u008a\u008a \u008a\u008a\u008a \u0086\u0086\u0086\u0086 \u0086\u0086\u0086\u0086\u0086\u0086\u0086 ", - " \u0087\u0087\u0087\u0087\u0087\u0087 \u0087\u0087}}}}}}}} }}}}}}}~~~~~~~ ~ ~~ ~\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f \u0088\u0088\u0088 \u0088\u0088\u0088\u0088 \u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080 \u0089\u0089 \u0089\u0089\u0089\u0089 \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0082\u0082\u0082 \u0083\u0083\u0083\u0083\u0083\u0083 \u0083\u0083\u0083\u0083\u0083\u0083\u0084 \u0084\u0084 \u0085\u0085\u0085 \u0085\u0085 \u008a\u008a\u008a \u008a\u008a\u008a\u008a \u0086\u0086\u0086\u0086 \u0086\u0086\u0086\u0086 ", - " \u0087\u0087\u0087\u0087\u0087\u0087 \u0087\u0087\u0087\u0087\u0087\u0087 ~~~~~~~ ~ ~~ ~\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f\u007f \u0088\u0088\u0088 \u0088\u0088\u0088 \u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080 \u0089\u0089 \u0089\u0089 \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083 \u0084\u0084\u0084\u0084\u0084\u0084\u0084\u0084 \u0085\u0085\u0085 \u0085\u0085 \u008a\u008a \u008a\u008a\u008a\u008a\u008a\u008a\u008a\u008a \u0086\u0086\u0086\u0086 \u0086\u0086\u0086\u0086 ", - " \u0087\u0087 \u0087\u0087 \u0087\u0087 \u0087\u0087 \u0088\u0088\u0088 \u0088\u0088 \u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080\u0080 \u0089 \u0089\u0089 \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083\u0083 \u0084\u0084\u0084\u0084\u0084\u0084\u0084\u0084 \u0084\u0085\u0085 \u0085\u0085 \u008a\u008a\u008a\u008a\u008a\u008a\u008a\u008a \u0086\u0086\u0086\u0086 \u0086\u0086\u0086\u0086 ", - " \u0087\u0087 \u0087\u0087 \u0087\u0087 \u0087\u0087 \u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c \u0088\u0088\u0088 \u0088 \u0080\u0080\u0080\u0080\u0080 \u008d\u008d\u008d\u008d \u0089\u0089\u008e\u0089\u0089 \u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082\u0082 \u0083\u0083\u0083\u0083\u0083 \u0084\u0084 \u0084\u0085\u0085\u0085\u0085\u0085\u0085\u0085\u0085 \u008a\u008a\u008a\u008a \u0086\u0086\u0086\u0086 \u0086\u0086\u0086\u0086 ", - " \u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087 \u008f\u008f\u008f\u008f\u008f\u008f\u008f \u0090\u0090 \u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c \u0091\u0091\u0091 \u0092\u0092\u0092\u0092\u0092\u0092 \u008d\u008d\u008d\u008d \u0089\u0089\u0089\u0089\u0089 \u0093\u0093\u0093\u0093\u0093\u0093\u0093\u0093\u0093\u0093\u0093\u0093\u0093 \u0094\u0094\u0094\u0094\u0094\u0094\u0094\u0094\u0094 \u0095 \u0084\u0084 \u0084\u0084\u0096\u0096\u0096\u0085\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096 \u008a\u008a\u008a\u008a \u0097\u0097 \u0098\u0086\u0086\u0086\u0086\u0098\u0098\u0098\u0098\u0098\u0086\u0086\u0086\u0086 ", - " \u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087\u0087 \u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f \u0090\u0090 \u0090\u0090\u0090 \u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c \u0091\u0091\u0091\u0091\u0091 \u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092 \u008d\u008d\u008d\u008d \u0099\u0099 \u008e\u0089\u0089\u0089\u008e \u0093\u0093 \u0093 \u0094\u0094\u0094\u0094\u0094\u0094 \u0094\u0094\u0095\u0095\u0095\u0095\u0095\u0095\u0084\u0084\u0084\u0084\u0084\u0084\u0084\u0084\u0084\u0084\u0084\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096 \u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u0098\u0086\u0086\u0086\u0086\u0098\u0098\u0098\u0098\u0098\u0086\u0086\u0086\u0086\u0098 ", - " \u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a \u008f\u008f\u008f\u008f \u008f\u008f\u008f\u008f\u008f \u0090\u0090\u0090 \u0090 \u0090\u0090 \u0091\u0091\u0091\u0091\u0091\u0091\u0091 \u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092 \u008d\u008d\u008d\u008d \u0099\u0099\u0099\u0099 \u008e \u008e\u008e \u0093\u0093 \u0093 \u0094\u0094\u0094\u0094\u0094\u0094\u0094\u0094\u0094\u0095\u0095 \u0095\u0095\u0095 \u0095\u0095\u0095\u0096\u0096\u0096\u0096\u0096\u0096 \u0096\u0096\u0096\u0096\u0096\u0096 \u0097\u0097\u0097\u0097\u0097 \u0097\u0097\u0097\u0097\u0097 \u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098 ", - " \u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a \u008f\u008f\u008f \u008f\u008f\u008f \u0090\u0090\u0090\u0090 \u0090\u0090\u0090 \u0090\u0090\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c \u0091\u0091\u0091\u0091\u0091\u0091\u0091 \u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092 \u008d\u008d\u008d\u008d \u0099\u0099\u0099\u0099\u0099\u0099 \u008e\u008e \u008e\u008e \u0093\u0093 \u0093 \u0094\u0094\u0094\u0094\u0094\u0094\u0094\u0094\u0094\u0095\u0095 \u0095\u0095\u0095 \u0095\u0095 \u0096\u0096\u0096\u0096\u0096\u0096\u0096 \u0096\u0096\u0096\u0096\u0096\u0096\u0096 \u0097\u0097\u0097\u0097\u0097\u0097 \u0097\u0097\u0097\u0097\u0097\u0097 \u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098 \u0098\u0098\u0098 ", - " \u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a \u008f\u008f\u008f \u008f \u008f\u008f\u008f \u0090\u0090\u0090\u0090\u0090 \u0090\u0090 \u0090\u0090\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c \u0091\u0091\u0091 \u0092\u0092\u0092\u0092 \u0092\u0092\u0092 \u0092\u0092\u0092\u0092 \u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d \u0099\u0099\u0099\u0099\u0099\u0099\u0099\u0099 \u008e\u008e \u008e\u008e\u008e\u008e \u0093\u0093 \u0093 \u0094\u0094 \u0094\u0094\u0095\u0095 \u0095\u0095 \u0095\u0095 \u0095\u0095\u0096\u0096\u0096 \u0096\u0096\u0096 \u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0097\u0097\u0097 \u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u0097\u0097 \u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098 \u0098\u0098 ", - " \u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a \u008f\u008f\u008f \u008f \u008f\u008f\u008f\u0090\u0090\u0090\u0090\u0090\u0090\u0090\u0090 \u0090\u0090 \u0090\u0090 \u0090\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c \u0091\u0091\u0091 \u0092\u0092\u0092 \u0092 \u0092\u0092\u0092\u0092 \u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d \u0099\u0099\u0099\u0099\u0099\u0099\u0099\u0099\u0099\u0099 \u008e\u008e\u008e \u008e\u008e\u008e\u008e\u008e\u008e \u0093\u0093 \u0093 \u0094\u0094\u0094 \u0094\u0094 \u0095\u0095\u0095\u0095\u0095\u0095\u0095 \u0095\u0095 \u0095\u0095 \u0096\u0096\u0096 \u0096\u0096\u0096 \u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0097\u0097\u0097 \u0097\u0097\u0097\u0097 \u0097\u0097 \u0097\u0097 \u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098 \u0098\u0098\u0098 ", - " \u009a\u009a\u009a\u009a\u009a\u009a \u008f\u008f \u008f \u008f\u008f\u0090\u0090\u0090\u0090\u0090\u0090\u0090\u0090 \u0090 \u0090\u0090 \u0090\u0090 \u0091\u0091 \u0091\u0091\u0091 \u0091\u0091\u0092\u0092\u0092\u0092\u0092 \u0092\u0092\u0092\u0092\u0092 \u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d \u0099\u0099\u0099\u0099\u0099\u0099 \u0099\u0099\u0099\u0099\u0099 \u008e\u008e\u008e\u008e\u008e\u008e \u008e\u008e \u0093\u0093 \u0093 \u0094\u0094\u0094 \u0094 \u0095\u0095\u0095\u0095\u0095 \u0095 \u0095 \u0096\u0096\u0096\u0096 \u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098 ", - " \u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a \u008f\u008f \u008f \u008f\u008f\u0090\u0090\u0090\u0090\u0090\u0090\u0090\u0090 \u0090\u0090 \u0090 \u0090\u0090 \u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c \u0091\u0091\u0091 \u0091\u0091\u0091 \u0091\u0091\u0092\u0092\u0092\u0092\u0092\u0092 \u0092\u0092\u0092\u0092\u0092\u0092 \u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d\u008d \u0099\u0099\u0099\u0099\u0099\u0099 \u0099\u0099\u0099\u0099\u0099 \u008e\u008e\u008e\u008e \u008e\u008e \u0093\u0093 \u0093 \u0094\u0094\u0094 \u0094\u0094 \u0095 \u0095 \u0095\u0095 \u0096\u0096\u0096\u0096\u0096\u0096 \u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098 ", - " \u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a \u008f\u008f \u008f\u008f\u008f\u008f \u008f\u008f\u0090\u0090\u0090\u0090\u0090\u0090\u0090\u0090 \u0090\u0090 \u0090\u0090 \u0090\u0090 \u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c \u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0092\u0092\u0092\u0092\u0092\u0092 \u0092\u0092\u0092\u0092\u0092 \u008d\u008d\u008d\u008d \u0099\u0099\u0099\u0099\u0099\u0099 \u0099\u0099\u0099\u0099\u0099\u008e\u008e\u008e\u008e \u008e \u0093\u0093 \u0093 \u0094\u0094\u0094 \u0094\u0094 \u0095\u0095\u0095\u0095\u0095 \u0095\u0095\u0095\u0095 \u0096\u0096\u0096\u0096\u0096\u0096 \u0096\u0096\u0096\u0096\u0096\u0096\u0097\u0097 \u0097\u0097\u0097\u0097\u0097\u0097 \u0097\u0097\u0097\u0097\u0097 \u0097\u0097\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098 ", - " \u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a \u008f\u008f\u008f \u008f\u008f\u0090\u0090\u0090\u0090\u0090\u0090\u0090\u0090 \u0090\u0090 \u0090\u0090 \u0090 \u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c \u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0091\u0092\u0092\u0092\u0092\u0092 \u0092\u0092\u0092\u0092 \u008d\u008d\u008d\u008d \u0099\u0099\u0099\u0099\u0099 \u0099\u0099\u0099\u0099\u008e\u008e\u008e\u008e \u008e \u0093\u0093 \u0093\u0093 \u0093 \u0094\u0094 \u0094 \u0094\u0095\u0095\u0095\u0095\u0095\u0095\u0095\u0095\u0095 \u0095 \u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096 \u0096\u0096\u0096\u0096\u0096\u0097\u0097 \u0097\u0097\u0097\u0097\u0097 \u0097\u0097\u0097\u0097 \u0097\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098 ", - " \u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a \u008f\u008f\u008f \u008f\u008f\u008f \u0090\u0090\u0090\u0090 \u0090\u0090 \u0090\u0090 \u0091\u0091 \u0091\u0091\u0091 \u0091\u0091 \u0092\u0092\u0092\u0092 \u0092\u0092 \u0092\u0092\u0092\u0092 \u008d\u008d\u008d\u008d \u0099\u0099\u0099 \u0099\u0099 \u008e\u008e\u008e\u008e \u008e\u008e \u0093\u0093 \u0093\u0093\u0093\u0093 \u0093 \u0094\u0094\u0094\u0094\u0094 \u0094\u0095\u0095\u0095 \u0095\u0095 \u0095\u0095 \u0095 \u0096\u0096\u0096 \u0096\u0096\u0096\u0096 \u0096\u0096\u0096\u0096\u0096\u0097\u0097 \u0097\u0097\u0097\u0097\u0097 \u0097\u0097\u0097\u0097 \u0097\u0097\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098 ", - " \u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a \u008f\u008f\u008f \u008f\u008f\u008f\u008f \u0090\u0090\u0090 \u0090\u0090 \u0090\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u0091 \u0091\u0091\u0091 \u0091 \u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092 \u008d\u008d\u008d\u008d \u008e\u008e\u008e\u008e \u008e\u008e \u0093\u0093 \u0093\u0093 \u0093\u0093\u0093 \u0093 \u0094\u0094\u0094\u0094\u0094 \u0094\u0094\u0094\u0095\u0095 \u0095\u0095 \u0095\u0095 \u0095\u0096\u0096\u0096 \u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u0097\u0097\u0097\u0097\u0097\u0097\u0097 ", - " \u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a \u008f\u008f\u008f\u008f\u008f \u008f\u008f\u008f\u008f \u0090\u0090 \u0090\u0090\u0090\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c \u0091\u0091\u0091 \u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092 \u008d\u008d\u008d\u008d \u008e\u008e \u008e \u008e\u008e \u0093\u0093\u0093\u0093\u0093 \u0093\u0093\u0093 \u0093 \u0094\u0094 \u0094\u0094\u0094\u0094\u0094\u0094\u0094\u0095\u0095 \u0095\u0095 \u0095\u0095\u0095\u0096\u0096\u0096\u0096 \u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097 \u0097\u0097\u0097\u0097\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098 ", - " \u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a \u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f \u0090\u0090\u0090 \u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c\u008c \u0091\u0091\u0091 \u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092 \u008d\u008d\u008d \u008e\u008e\u008e\u008e\u008e\u008e \u008e \u0093\u0093\u0093\u0093 \u0093\u0093\u0093\u0093 \u0094\u0094 \u0094\u0094\u0094 \u0095\u0095\u0095\u0095\u0095\u0095 \u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098 ", - " \u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a\u009a \u008f\u008f\u008f\u008f\u008f\u008f\u008f\u008f \u0090 \u0091\u0091\u0091\u0091\u0091\u0091\u0091 \u0092\u0092\u0092\u0092\u0092\u0092\u0092\u0092 \u008e\u008e\u008e\u008e\u008e\u008e\u008e\u008e \u008e\u008e \u0093\u0093\u0093 \u0093\u0093\u0093 \u0094\u0094 \u0094\u0094 \u0095\u0095\u0095\u0095 \u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0096\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0097\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098\u0098 ", - " \u009b\u009b \u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c \u009d \u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e \u009f\u009f\u009f\u009f\u009f\u0091\u0091\u0091\u0091\u0091\u009f\u009f \u00a0\u00a0 \u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2 \u00a2\u00a2\u00a2\u00a2\u00a2 \u008e\u008e\u008e\u008e\u008e\u008e \u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3 \u0094\u0094\u00a4\u00a4\u0094\u0094 \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5 \u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6 \u00a7 ", - " \u009b\u009b \u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c \u009d\u009d \u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e \u009f\u009f \u0091\u0091\u0091 \u009f\u009f\u009f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2 \u00a2\u00a2\u00a2\u00a2\u00a2 \u00a8\u00a8 \u00a3\u00a3 \u00a3\u00a3\u00a3 \u0094\u0094\u0094\u0094\u0094 \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5 \u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6 \u00a9\u00a9\u00a9 \u00a7\u00a7 ", - " \u009b\u009b\u009b\u009b \u009c \u009c \u009c\u009c \u009d\u009d\u009d \u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e \u009f\u009f \u0091 \u009f\u009f\u009f\u009f\u009f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a1 \u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2 \u00a2\u00a2\u00a2\u00a2\u00a2 \u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8 \u00a3\u00a3 \u00a3\u00a3 \u00a4\u0094\u0094\u0094\u0094\u00a4 \u00a5 \u00a5\u00a5 \u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6 \u00a9\u00a9\u00a9\u00a9 \u00a7\u00a7\u00a7\u00a7\u00a7\u00a7 ", - " \u009b\u009b\u009b\u009b \u009c \u009c \u009c\u009c \u009d\u009d\u009d\u009d \u009f\u009f \u009f\u009f\u009f\u009f\u009f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a1\u00a1\u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2 \u00a2\u00a2\u00a2\u00a2\u00a2\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8 \u00a3\u00a3 \u00a3\u00a3 \u00a4\u00a4 \u00a4\u00a4 \u00a5 \u00a5\u00a5 \u00a6\u00a6\u00a6\u00a6\u00a6\u00a6 \u00a6\u00a6\u00a6\u00a6\u00a6\u00a6 \u00a9\u00a9\u00a9\u00a9\u00a9\u00a9 \u00a7\u00a7 \u00a7\u00a7\u00a7 ", - " \u009b\u009b \u009b\u009b \u009c \u009c \u009c\u009c \u009d\u009d\u009d\u009d\u009d\u009d\u009d\u009d \u009d \u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009f\u009f \u009f \u009f\u009f\u009f\u009f\u009f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a1\u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2 \u00a2\u00a2\u00a2\u00a2\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8 \u00a3\u00a3 \u00a3\u00a3 \u00a4\u00a4 \u00a4\u00a4 \u00a5 \u00a5\u00a5 \u00a6\u00a6\u00a6\u00a6 \u00a6\u00a6\u00a6 \u00a6\u00a6\u00a6\u00a6 \u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9 \u00a7\u00a7 \u00a7\u00a7 ", - " \u009b\u009b\u009b\u009b\u009b\u009b\u009b \u009b\u009b\u009b\u009b\u009b\u009b\u009b\u009c \u009c \u009c \u009d\u009d\u009d\u009d\u009d\u009d\u009d\u009d \u009d\u009d \u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009f\u009f \u009f\u009f\u009f \u009f\u009f\u009f\u009f\u009f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2 \u00a2\u00a2\u00a2\u00a2\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8 \u00a8 \u00a3\u00a3 \u00a3\u00a3 \u00a4\u00a4 \u00a4\u00a4\u00a4\u00a4\u00a4 \u00a5 \u00a5\u00a5 \u00a6\u00a6\u00a6 \u00a6\u00a6\u00a6\u00a6\u00a6 \u00a6\u00a6\u00a6 \u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9 \u00a7 \u00a7\u00a7 ", - " \u009b\u009b\u009b\u009b \u009b\u009b\u009b\u009b\u009c \u009c\u009c\u009c\u009c\u009c\u009c \u009d\u009d\u009d\u009d\u009d\u009d\u009d\u009d \u009d \u009f\u009f \u009f\u009f\u009f\u009f \u009f\u009f\u009f\u009f\u009f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a1\u00a1\u00a1\u00a1\u00a1 \u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8 \u00a8\u00a8\u00a3\u00a3 \u00a3\u00a3 \u00a4\u00a4 \u00a4 \u00a4\u00a4\u00a4\u00a4\u00a4 \u00a5\u00a5 \u00a5\u00a5 \u00a6\u00a6\u00a6 \u00a6\u00a6 \u00a6\u00a6\u00a6\u00a6 \u00a6\u00a6\u00a6 \u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9 \u00a7\u00a7 \u00a7\u00a7 ", - " \u009b\u009b \u009b\u009b \u009c \u009c \u009d\u009d\u009d\u009d\u009d\u009d\u009d\u009d \u009d\u009d \u009f\u009f \u009f\u009f\u009f\u009f\u009f\u009f\u009f\u009f\u009f \u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 \u00a1\u00a1\u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2 \u00a2\u00a2\u00a2\u00a2\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8 \u00a8\u00a8\u00a3\u00a3 \u00a3\u00a3 \u00a4\u00a4\u00a4\u00a4\u00a4 \u00a4\u00a4 \u00a5\u00a5 \u00a5\u00a5 \u00a6\u00a6\u00a6 \u00a6\u00a6 \u00a6\u00a6\u00a6 \u00a6\u00a6\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9 \u00a7\u00a7 \u00a7 ", - " \u009b\u009b \u009b\u009b \u009c \u009c \u009d\u009d\u009d\u009d\u009d\u009d\u009d\u009d \u009d\u009d \u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e \u009f\u009f \u009f\u009f\u009f\u009f\u009f\u009f\u009f \u009f \u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a1\u00a1\u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2 \u00a2\u00a2\u00a2\u00a2\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8 \u00a8\u00a8\u00a3\u00a3 \u00a3\u00a3 \u00a4 \u00a4\u00a4 \u00a4\u00a4 \u00a5\u00a5 \u00a5\u00a5 \u00a6\u00a6\u00a6 \u00a6\u00a6 \u00a6\u00a6\u00a6\u00a6 \u00a6\u00a6\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9 \u00a7\u00a7 \u00a7 ", - " \u009b\u009b \u009b\u009b \u009c \u009c \u009d\u009d\u009d\u009d \u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e \u009f\u009f \u009f\u009f\u009f\u009f\u009f \u009f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a1\u00a1\u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2 \u00a2\u00a2\u00a2\u00a2\u00a2\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8 \u00a8\u00a8\u00a8\u00a3\u00a3 \u00a3\u00a3\u00a4\u00a4 \u00a4 \u00a5\u00a5 \u00a5\u00a5 \u00a6\u00a6\u00a6 \u00a6\u00a6 \u00a6\u00a6\u00a6\u00a6 \u00a6\u00a6\u00a6\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a9 \u00a7\u00a7 \u00a7 ", - " \u009b\u009b \u009b\u009b \u009c \u009c \u009d\u009d\u009d \u009f\u009f \u009f\u009f\u009f \u009f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a1\u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2\u00a2 \u00a2\u00a2\u00a2\u00a2\u00a2\u00a2 \u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8 \u00a8\u00a8\u00a8\u00a3\u00a3 \u00a3\u00a3 \u00a4\u00a4\u00a4 \u00a4\u00a4 \u00a5\u00a5 \u00a5\u00a5 \u00a6\u00a6\u00a6\u00a6\u00a6 \u00a6\u00a6\u00a6 \u00a6\u00a6\u00a6 \u00a9\u00a9\u00a9\u00a9\u00a9\u00a9 \u00a9\u00a9\u00a9 \u00a7\u00a7 \u00a7\u00a7 ", - " \u009b\u009b \u009b\u009b \u009c \u009c \u009d\u009d \u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009f\u009f \u009f \u009f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a1\u00a1\u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2 \u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8 \u00a8\u00a8\u00a8\u00a8\u00a8\u00a3\u00a3 \u00a3\u00a3 \u00a4\u00a4\u00a4 \u00a4\u00a4 \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5 \u00a6\u00a6\u00a6\u00a6\u00a6 \u00a6 \u00a6\u00a6\u00a6\u00a6 \u00a9\u00a9\u00a9\u00a9 \u00a9\u00a9\u00a9\u00a9\u00a9 \u00a7 \u00a7\u00a7 ", - " \u009b\u009b \u009b\u009b \u009b\u009b \u009c \u009c \u009d \u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009f\u009f \u009f\u009f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a1\u00a1\u00a1\u00a1\u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2 \u00a8\u00a8\u00a8 \u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8 \u00a3\u00a3 \u00a3\u00a3\u00a3 \u00a4\u00a4 \u00a4 \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5 \u00a6\u00a6\u00a6\u00a6\u00a6 \u00a6\u00a6 \u00a6\u00a6\u00a6\u00a6\u00a6\u00a6 \u00a9\u00a9\u00a9 \u00a9\u00a9\u00a9\u00a9\u00a9 \u00a7\u00a7 \u00a7 ", - " \u009b \u009b\u009b\u009b\u009b\u009b\u009b \u009b \u009c \u009c \u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009e\u009f\u009f\u009f\u009f\u009f\u009f\u009f\u009f\u009f\u009f\u009f\u009f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a1\u00a1\u00a1\u00a1 \u00a1\u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2 \u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8\u00a8 \u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3\u00a3 \u00a4\u00a4 \u00a4\u00a4 \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5 \u00a6\u00a6\u00a6\u00a6\u00a6 \u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6 \u00a9\u00a9\u00a9\u00a9\u00a9\u00a9\u00a7\u00a7 \u00a7\u00a7 ", - " \u009b\u009b\u009b \u009b\u009b\u009b \u009c \u009c \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a1\u00a1\u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2 \u00a8\u00a8\u00a8 \u00a4 \u00a4\u00a4 \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5 \u00a6\u00a6\u00a6\u00a6\u00a6 \u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6 \u00a9\u00a9\u00a9\u00a9\u00a9\u00a7\u00a7\u00a7 \u00a7\u00a7 ", - " \u009b \u009b \u009c \u009c \u00aa \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a1 \u00a2\u00a2\u00a2\u00a2\u00a2\u00a2\u00a2 \u00a8\u00a8 \u00ab \u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4 \u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5\u00a5 \u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6\u00a6 \u00a9\u00a9\u00a9\u00a9\u00a7\u00a7\u00a7\u00a7\u00a7\u00a7\u00a7\u00a7\u00a7\u00a7\u00a7\u00a7\u00a7\u00a7\u00a7\u00a7\u00a7 ", - " \u00ac\u00ac \u009c \u00ad\u00ad \u00ad\u00ad\u00ad\u009c \u00ae \u00aa\u00aa\u00aa\u00aa\u00aa \u00aa\u00aa \u00af\u00af\u00af\u00af\u00af\u00af \u00b0\u00b0\u00b0\u00b0\u00b0\u00b0 \u00b1\u00b1 \u00b1\u00b1 \u00ab\u00ab\u00ab\u00ab \u00a4\u00a4\u00a4\u00a4\u00a4\u00a4 \u00a4\u00a4 \u00b2\u00b2\u00b2\u00b2\u00b2\u00b2 \u00b3\u00b3\u00b3\u00b3\u00b3 \u00b4\u00b4\u00b4\u00b4\u00b4 \u00a9\u00a9\u00a9\u00a9\u00a9 \u00b5\u00a7\u00a7\u00a7\u00a7\u00a7\u00b5\u00b5 ", - " \u00ac\u00ac \u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c \u00ae\u00ae \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00aa\u00aa\u00aa\u00aa\u00aa \u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b0\u00b0\u00b0\u00b0\u00b0\u00b0 \u00b1\u00b1\u00b1\u00b1\u00b1 \u00ab\u00ab\u00ab\u00ab \u00b7\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4 \u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2 \u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3 \u00b4\u00b4 \u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00a9\u00a9\u00a9 \u00b5\u00a7\u00a7\u00a7\u00a7\u00a7\u00b5\u00b5 ", - " \u00ac\u00ac\u00ac\u00ac \u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c\u009c \u00ae\u00ae\u00ae \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00aa\u00aa \u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b0\u00b0\u00b0\u00b0\u00b0 \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8 \u00b1\u00b1\u00b1 \u00b1\u00b1\u00b1\u00b1\u00b1\u00ab\u00ab\u00ab\u00ab\u00ab\u00ab \u00b7\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4\u00a4 \u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2 \u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3 \u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4 \u00b5 \u00a7\u00a7 \u00b5\u00b5 ", - " \u00ac\u00ac\u00ac\u00ac \u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad \u00ae\u00ae\u00ae\u00ae \u00b6\u00b6 \u00b6\u00b6\u00b6 \u00b6\u00aa\u00aa \u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b0\u00b0\u00b0\u00b0\u00b0\u00b0 \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8 \u00b1\u00b1\u00b1 \u00b1 \u00b1\u00b1\u00b1 \u00b1\u00ab\u00ab\u00ab\u00ab\u00ab\u00ab \u00b7\u00b7 \u00b7\u00b7 \u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2 \u00b3\u00b3\u00b3\u00b3 \u00b3\u00b3\u00b3\u00b3 \u00b4\u00b4\u00b4\u00b4\u00b4\u00b4 \u00b4\u00b4\u00b4\u00b4\u00b4\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b5\u00b5 ", - " \u00ac\u00ac\u00ac\u00ac\u00ac\u00ac \u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad \u00ae\u00ae\u00ae\u00ae\u00ae\u00ae\u00ae\u00ae \u00b6 \u00b6\u00b6\u00b6 \u00b6\u00aa\u00aa \u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa \u00af\u00af\u00af\u00af\u00af\u00af \u00af\u00af\u00af\u00af\u00af\u00af \u00b0\u00b0\u00b0\u00b0\u00b0\u00b0\u00b0\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1 \u00b1\u00b1\u00ab\u00ab\u00ab \u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7 \u00b7\u00b7 \u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2 \u00b3\u00b3\u00b3\u00b3 \u00b3\u00b3\u00b3\u00b3\u00b3 \u00b3\u00b3\u00b3\u00b3\u00b4\u00b4\u00b4\u00b4\u00b4 \u00b4\u00b4\u00b4\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b5\u00b5\u00b5 ", - " \u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad \u00ad\u00ad\u00ad \u00ae\u00ae\u00ae\u00ae\u00ae\u00ae\u00ae\u00ae \u00b6\u00b6\u00b6 \u00aa\u00aa \u00aa\u00aa\u00aa\u00aa\u00aa\u00aa \u00aa\u00aa\u00aa \u00af\u00af\u00af\u00af\u00af\u00af \u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b0\u00b0\u00b0\u00b0 \u00b0\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1 \u00b1\u00b1\u00b1\u00b1\u00b1 \u00ab\u00ab\u00ab \u00b7\u00b7\u00b7 \u00b7\u00b7\u00b7\u00b7\u00b7\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2 \u00b3\u00b3\u00b3 \u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3 \u00b3\u00b3\u00b3\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4 \u00b4\u00b4\u00b4\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b5\u00b5\u00b5 ", - " \u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ad\u00ad\u00ad \u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad \u00ad\u00ad\u00ad \u00ae\u00ae\u00ae\u00ae\u00ae\u00ae\u00ae\u00ae \u00b6\u00b6\u00b6 \u00aa\u00aa \u00aa\u00aa\u00aa \u00aa\u00aa \u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b0\u00b0\u00b0 \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b1\u00b1\u00b1\u00b1 \u00b1\u00b1\u00b1\u00b1 \u00b1\u00b1\u00b1\u00b1\u00b1 \u00ab\u00ab\u00ab\u00ab \u00b7\u00b7 \u00b7\u00b7\u00b7\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b3\u00b3\u00b3 \u00b3\u00b3 \u00b3\u00b3\u00b3 \u00b3\u00b3\u00b3\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4 \u00b4\u00b4\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b5\u00b5\u00b5 ", - " \u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac \u00ad \u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad \u00ae\u00ae\u00ae\u00ae\u00ae\u00ae\u00ae\u00ae \u00b6\u00b6\u00b6 \u00aa\u00aa \u00aa\u00aa \u00aa \u00af\u00af\u00af\u00af \u00af\u00af\u00af \u00b0 \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b1\u00b1\u00b1\u00b1\u00b1 \u00b1\u00b1\u00b1\u00b1 \u00b1 \u00ab\u00ab\u00ab\u00ab \u00b7\u00b7 \u00b7\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b3\u00b3 \u00b3 \u00b3\u00b3\u00b3 \u00b3\u00b3 \u00b4\u00b4\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b5\u00b5\u00b5 ", - " \u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac \u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad \u00ae\u00ae\u00ae\u00ae\u00ae\u00ae\u00ae\u00ae \u00b6\u00b6\u00b6 \u00aa\u00aa \u00aa\u00aa \u00af\u00af\u00af\u00af \u00af\u00af\u00af\u00af \u00b0\u00b0 \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b1\u00b1\u00b1\u00b1 \u00b1\u00b1\u00b1\u00b1 \u00ab\u00ab\u00ab\u00ab \u00ab \u00b7\u00b7\u00b7\u00b7\u00b7 \u00b7\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b3\u00b3\u00b3 \u00b3\u00b3 \u00b3\u00b3\u00b3\u00b3 \u00b3\u00b3\u00b3 \u00b4\u00b4\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b5\u00b5\u00b5 ", - " \u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac \u00ad\u00ad\u00ad\u00ad \u00ad\u00ad\u00ad\u00ad\u00ad \u00ae\u00ae\u00ae\u00ae \u00b6\u00b6\u00b6 \u00aa\u00aa \u00aa\u00aa \u00aa \u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b0\u00b0\u00b0\u00b0 \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b1\u00b1\u00b1\u00b1 \u00b1\u00b1\u00b1\u00b1 \u00ab\u00ab\u00ab\u00ab \u00ab\u00ab\u00ab \u00b7\u00b7 \u00b7\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b3\u00b3\u00b3 \u00b3\u00b3 \u00b3\u00b3\u00b3\u00b3 \u00b3\u00b3\u00b3 \u00b4\u00b4\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b5\u00b5\u00b5 ", - " \u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac \u00ad\u00ad\u00ad\u00ad \u00ad\u00ad\u00ad\u00ad\u00ad \u00ae\u00ae\u00ae \u00b6\u00b6\u00b6 \u00aa\u00aa \u00aa \u00aa \u00af\u00af\u00af\u00af\u00af\u00af \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00b0\u00b0 \u00b0\u00b0\u00b0\u00b0 \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b1\u00b1\u00b1 \u00b1\u00b1\u00b1 \u00b1 \u00b1 \u00ab\u00ab\u00ab\u00ab\u00ab\u00ab\u00ab\u00ab\u00ab\u00ab \u00b7 \u00b7\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b3\u00b3\u00b3\u00b3\u00b3 \u00b3\u00b3\u00b3 \u00b3\u00b3\u00b3 \u00b4\u00b4\u00b4\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b5\u00b5\u00b5 ", - " \u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac \u00ad\u00ad\u00ad\u00ad \u00ad\u00ad\u00ad\u00ad\u00ad \u00ae\u00ae \u00b6\u00b6\u00b6 \u00aa\u00aa \u00aa \u00aa \u00af\u00af\u00af\u00af\u00af\u00af \u00af\u00af\u00af\u00af\u00af\u00af \u00b0\u00b0\u00b0\u00b0\u00b0\u00b0 \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1 \u00b1\u00b1\u00b1\u00b1\u00b1 \u00ab\u00ab\u00ab\u00ab\u00ab\u00ab\u00ab\u00ab\u00ab \u00b7 \u00b7\u00b7\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b3\u00b3\u00b3\u00b3\u00b3 \u00b3 \u00b3\u00b3\u00b3\u00b3 \u00b4\u00b4 \u00b4\u00b4\u00b4\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b5\u00b5\u00b5 ", - " \u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac\u00ac \u00ad\u00ad\u00ad\u00ad \u00ad\u00ad\u00ad\u00ad\u00ad \u00ae \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00aa\u00aa \u00aa\u00aa \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b0\u00b0\u00b0\u00b0\u00b0 \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1\u00b1 \u00b1\u00b1\u00b1\u00b1 \u00ab\u00ab\u00ab\u00ab\u00ab\u00ab\u00ab \u00b7\u00b7 \u00b7\u00b7\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b3\u00b3\u00b3\u00b3 \u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3 \u00b4\u00b4\u00b4\u00b4 \u00b4\u00b4\u00b4\u00b4\u00b4\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b5\u00b5\u00b5 ", - " \u00ac\u00ac\u00ac\u00ac \u00ac\u00ac\u00ac\u00ac \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6 \u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa\u00aa \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b0\u00b0\u00b0\u00b0\u00b0 \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8 \u00b1\u00b1 \u00b1\u00b1\u00b1\u00b1\u00b1\u00b1 \u00b1\u00b1\u00b1 \u00b1\u00b1\u00b1 \u00ab\u00ab\u00ab \u00b7\u00b7 \u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2\u00b2 \u00b3\u00b3\u00b3 \u00b3\u00b3\u00b3\u00b3\u00b3\u00b3\u00b3 \u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4 \u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b5\u00b5\u00b5 ", - " \u00ac\u00ac\u00ac \u00ac\u00ac\u00ac \u00b6\u00b6 \u00b6\u00b6 \u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \u00b0\u00b0\u00b0\u00b0\u00b0\u00b0 \u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8\u00b8 \u00b1\u00b1\u00b1 \u00b1\u00b1\u00b1 \u00b1\u00b1\u00b1 \u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7 \u00b3\u00b3 \u00b3\u00b3\u00b3\u00b3\u00b3\u00b3 \u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4\u00b4 \u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b5\u00b5\u00b5 ", - " \u00ac \u00ac \u00b9\u00b9\u00b9\u00b9\u00b9\u00b9 \u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00b6\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba \u00ba\u00ba \u00bb\u00bb\u00af\u00af\u00af\u00af \u00b0\u00b0\u00b0\u00b0\u00b0\u00b0 \u00bc \u00b8\u00b8\u00b8\u00b8\u00b8 \u00bd\u00bd \u00b1\u00b1\u00b1\u00b1 \u00b7\u00b7\u00b7\u00b7 \u00be\u00be\u00be\u00be \u00b3\u00b3\u00b3\u00b3 \u00b4\u00b4\u00b4\u00b4 \u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5\u00b5 \u00b5\u00b5 ", - " \u00bf\u00bf\u00bf\u00bf\u00bf \u00bf\u00bf\u00bf\u00bf\u00bf \u00c0\u00c0\u00c0\u00c0\u00c0\u00c0 \u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9 \u00c1\u00c1\u00b6\u00b6\u00c1\u00c1\u00c1\u00c1\u00c1\u00c1\u00c1\u00c1\u00c1 \u00b6\u00b6\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba \u00ba\u00ba\u00ba\u00ba \u00bb\u00bb\u00bb\u00bb \u00bc\u00bc \u00b8\u00b8\u00b8 \u00bd\u00bd\u00bd \u00c2\u00c2\u00c2\u00c2\u00c2 \u00b1\u00b1\u00b1\u00b1\u00b1 \u00c3\u00c3\u00c3\u00c3\u00c3\u00c3\u00c3\u00c3\u00c3\u00c3 \u00c4\u00c4\u00c4\u00c4 \u00be\u00be\u00be\u00be\u00be\u00be \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c6\u00c6\u00c6\u00c6 \u00c7\u00c7\u00c7 \u00c7\u00c7\u00c7\u00c7 ", - " \u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf \u00c0\u00c0 \u00c0\u00c0 \u00b9\u00b9\u00b9\u00b9\u00b9 \u00b9\u00b9\u00b9\u00b9 \u00c1\u00c1\u00c1\u00b6\u00c1\u00c1\u00c1\u00c1\u00c1\u00c1\u00c1\u00c1\u00c1 \u00b6\u00ba\u00ba \u00ba \u00ba\u00ba\u00ba\u00ba\u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bc\u00bc\u00bc \u00bd\u00bd\u00bd\u00bd \u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd \u00c2\u00c2\u00c2\u00c2\u00c2\u00c2\u00c2 \u00b1 \u00b1 \u00c3\u00c3\u00c3\u00c3 \u00c3\u00c3\u00c3\u00c3\u00c3 \u00c4\u00c4 \u00c4\u00c4 \u00be\u00be\u00be \u00be\u00be\u00be \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c6\u00c6\u00c6\u00c6 \u00c7\u00c7\u00c7 \u00c7\u00c7\u00c7\u00c7 ", - " \u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0 \u00b9\u00b9\u00b9 \u00b9\u00b9\u00b9\u00c1 \u00c1\u00c1\u00c1 \u00c1\u00c1 \u00c1\u00ba\u00ba\u00c1 \u00ba\u00ba\u00ba \u00ba\u00ba \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bc\u00bc\u00bc\u00bc\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd \u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00c2\u00c2\u00c2\u00c2 \u00c2\u00c2\u00c2 \u00c3\u00c3\u00c3 \u00c3\u00c3 \u00c4\u00c4 \u00c4 \u00be\u00be \u00be\u00be\u00be \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c6\u00c6\u00c6 \u00c7\u00c7 \u00c7\u00c7 ", - " \u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0 \u00b9\u00b9 \u00b9\u00b9\u00c1 \u00c1\u00c1\u00c1 \u00c1\u00c1 \u00ba\u00ba \u00ba\u00ba\u00ba\u00ba\u00ba \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd \u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00c2\u00c2\u00c2\u00c2 \u00c2\u00c2 \u00c3\u00c3 \u00c3\u00c3 \u00c4\u00c4 \u00c4\u00c4 \u00be\u00be \u00be\u00be \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5 \u00c7 \u00c7\u00c7 ", - " \u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf \u00c0 \u00c0\u00c0 \u00b9\u00b9\u00b9 \u00b9\u00c1 \u00c1\u00c1\u00c1 \u00c1 \u00ba\u00ba \u00ba\u00ba\u00ba\u00ba\u00ba\u00ba \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc \u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd \u00bd\u00bd\u00c2\u00c2\u00c2\u00c2\u00c2 \u00c2\u00c2 \u00c3\u00c3 \u00c3 \u00c4\u00c4 \u00c4\u00c4\u00c4\u00c4\u00c4\u00c4\u00c4\u00be\u00be\u00be \u00be\u00be\u00be\u00be \u00c5\u00c5 \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c6\u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6\u00c6 \u00c7 \u00c7\u00c7 \u00c7\u00c7\u00c7\u00c7 ", - " \u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf \u00c0 \u00c0 \u00c0 \u00c0 \u00c0\u00c0 \u00b9\u00b9 \u00b9\u00b9\u00b9 \u00c1\u00c1\u00c1 \u00ba\u00ba \u00ba\u00ba\u00ba\u00ba\u00ba\u00ba \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc \u00bd \u00bd\u00bd\u00bd \u00bd\u00bd\u00c2\u00c2 \u00c2\u00c2\u00c2 \u00c3\u00c3 \u00c4\u00c4\u00c4\u00c4\u00c4\u00c4 \u00c4\u00be\u00be\u00be\u00be \u00be\u00be\u00be\u00be \u00c5\u00c5 \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c6\u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6\u00c6\u00c6\u00c6\u00c6\u00c6\u00c6 \u00c7 \u00c7\u00c7 \u00c7 \u00c7\u00c7 ", - " \u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf \u00c0 \u00c0\u00c0 \u00c0 \u00c0\u00c0 \u00c0\u00c0 \u00b9\u00b9 \u00b9\u00b9 \u00c1\u00c1\u00c1 \u00ba\u00ba \u00ba\u00ba\u00ba\u00ba\u00ba\u00ba \u00bb\u00bb\u00bb\u00bb\u00bb\u00bb \u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc \u00bd\u00bd\u00bd \u00c2\u00c2 \u00c2\u00c2\u00c2\u00c2 \u00c3\u00c3 \u00c4\u00c4\u00c4\u00c4 \u00c4\u00be\u00be\u00be\u00be\u00be\u00be\u00be\u00be\u00be\u00be\u00be\u00be \u00c5 \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c6\u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6\u00c6\u00c6\u00c6\u00c6\u00c6\u00c6\u00c6 \u00c7 \u00c7\u00c7 \u00c7\u00c7\u00c7\u00c7 ", - " \u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf \u00c0 \u00c0\u00c0 \u00c0 \u00c0\u00c0 \u00c0\u00c0 \u00b9\u00b9 \u00b9\u00b9 \u00b9\u00b9 \u00b9\u00b9\u00b9 \u00c1\u00c1\u00c1 \u00ba\u00ba \u00ba\u00ba\u00ba\u00ba\u00ba\u00ba \u00bb\u00bb\u00bb\u00bb\u00bb \u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc\u00bc \u00bd\u00bd\u00bd \u00c2\u00c2 \u00c2\u00c2\u00c2\u00c2 \u00c3\u00c3 \u00c4\u00c4\u00c4\u00c4 \u00c4\u00c4\u00c4\u00c4\u00c4\u00c4 \u00be\u00be\u00be\u00be\u00be\u00be\u00be\u00be\u00be\u00be\u00be\u00be \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c6\u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6\u00c6 \u00c7\u00c7 \u00c7\u00c7 \u00c7\u00c7 ", - " \u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf \u00c0 \u00c0\u00c0 \u00c0 \u00c0\u00c0 \u00c0\u00c0 \u00b9\u00b9 \u00b9\u00b9\u00b9 \u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9 \u00c1\u00c1\u00c1 \u00ba\u00ba \u00ba \u00ba\u00ba \u00ba \u00bb\u00bb\u00bb\u00bb\u00bb \u00bc\u00bc\u00bc\u00bc\u00bc \u00bc\u00bc\u00bc\u00bc \u00bd\u00bd\u00bd \u00bd \u00bd\u00bd\u00c2\u00c2\u00c2\u00c2\u00c2\u00c2\u00c2\u00c2\u00c2\u00c2 \u00c2\u00c2\u00c2 \u00c3 \u00c4\u00c4\u00c4\u00c4 \u00c4\u00c4\u00c4\u00c4 \u00be\u00be\u00be\u00be \u00be\u00be\u00be \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c6\u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6\u00c6 \u00c7\u00c7\u00c7 \u00c7\u00c7\u00c7 \u00c7\u00c7 ", - " \u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf \u00c0 \u00c0\u00c0 \u00c0 \u00c0\u00c0 \u00c0\u00c0 \u00b9\u00b9\u00b9\u00b9\u00b9\u00b9 \u00b9\u00b9\u00b9\u00b9\u00b9\u00b9 \u00c1\u00c1\u00c1 \u00ba\u00ba \u00ba\u00ba\u00ba\u00ba \u00ba\u00ba \u00bb\u00bb\u00bb\u00bb\u00bb \u00bc\u00bc\u00bc \u00bc\u00bc\u00bc \u00bd\u00bd\u00bd\u00bd\u00bd \u00bd\u00bd\u00bd\u00c2\u00c2\u00c2\u00c2\u00c2\u00c2 \u00c2\u00c2\u00c2 \u00c2\u00c2\u00c2 \u00c3 \u00c3\u00c4\u00c4\u00c4\u00c4 \u00c4\u00c4 \u00be\u00be\u00be\u00be \u00be\u00be\u00be\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c6\u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6\u00c6 \u00c7\u00c7\u00c7\u00c7\u00c7\u00c7 \u00c7\u00c7 ", - " \u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf \u00c0 \u00c0\u00c0 \u00c0 \u00c0\u00c0 \u00c0\u00c0 \u00b9\u00b9\u00b9\u00b9\u00b9 \u00b9\u00b9\u00b9\u00b9\u00b9\u00b9 \u00c1\u00c1\u00c1 \u00ba\u00ba \u00ba\u00ba\u00ba \u00ba\u00ba \u00bb\u00bb\u00bb\u00bb\u00bb \u00bc\u00bc\u00bc \u00bc\u00bc \u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd \u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd \u00c2 \u00c2\u00c2\u00c2 \u00c2\u00c2\u00c2\u00c2\u00c3 \u00c3\u00c4\u00c4\u00c4\u00c4 \u00c4\u00c4 \u00be\u00be \u00be \u00be\u00be\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c6\u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6\u00c6 \u00c7\u00c7 \u00c7\u00c7 ", - " \u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf\u00bf \u00c0 \u00c0\u00c0 \u00c0 \u00c0\u00c0 \u00c0\u00c0 \u00b9\u00b9\u00b9 \u00b9\u00b9\u00b9\u00b9 \u00c1\u00c1\u00c1 \u00c1\u00ba \u00ba\u00ba \u00bb\u00bb\u00bb\u00bb\u00bb \u00bc\u00bc \u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd \u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd \u00c2\u00c2\u00c2\u00c2 \u00c2\u00c2\u00c3\u00c3 \u00c3\u00c3\u00c4\u00c4\u00c4\u00c4 \u00c4\u00c4 \u00be\u00be\u00be \u00be\u00c5\u00c5\u00c5\u00c5 \u00c5\u00c5\u00c5\u00c5\u00c5\u00c5\u00c5 \u00c5\u00c6\u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6\u00c6 \u00c7\u00c7 \u00c7\u00c7 ", - " \u00bf\u00bf\u00bf\u00bf\u00bf\u00bf \u00c0 \u00c0\u00c0 \u00b9\u00b9 \u00b9\u00b9\u00b9 \u00c1\u00c1\u00c1 \u00c1\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba\u00ba \u00bb\u00bb\u00bb\u00bb\u00bb \u00bc\u00bc \u00bd\u00bd\u00bd\u00bd\u00bd \u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd\u00bd \u00c2\u00c2\u00c2 \u00c3\u00c3 \u00c3\u00c3 \u00c4\u00c4\u00c4\u00c4 \u00c4 \u00be\u00be\u00be\u00be \u00be\u00be\u00be \u00c5\u00c5 \u00c5 \u00c5\u00c5 \u00c5\u00c6\u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6\u00c6 \u00c7 \u00c7 ", - " \u00bf\u00bf\u00bf\u00bf \u00c0 \u00c0\u00c0 \u00c1\u00c1\u00c1 \u00c1\u00c1\u00c1\u00c1 \u00bb\u00bb\u00bb\u00bb \u00bc\u00bc \u00bd\u00bd\u00bd \u00c2\u00c2\u00c2 \u00c3 \u00c3\u00c3\u00c3 \u00c4\u00c4\u00c4\u00c4\u00c4\u00c4\u00c4\u00c4 \u00c4\u00c4 \u00be\u00be\u00be\u00be\u00be\u00be\u00be \u00c5\u00c5\u00c5\u00c5\u00c5 \u00c5\u00c5\u00c5\u00c5\u00c5\u00c6\u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6\u00c6 \u00c7\u00c7\u00c7 \u00c7\u00c7\u00c7 ", - " \u00bf\u00bf \u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0\u00c0 \u00c1\u00c1\u00c1\u00c1\u00c1\u00c1\u00c1 \u00c1\u00c1 \u00c8 \u00bb\u00bb \u00bc \u00bd\u00bd \u00c2\u00c2\u00c2 \u00c3\u00c3\u00c3\u00c3\u00c3\u00c3\u00c3\u00c3\u00c3\u00c3\u00c3 \u00c4\u00c4\u00c4\u00c4\u00c4\u00c4 \u00be\u00be\u00be\u00be\u00be \u00c5\u00c5\u00c5 \u00c5\u00c5\u00c5 \u00c6\u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6 \u00c6\u00c6\u00c6\u00c6 \u00c7\u00c7\u00c7\u00c7\u00c7\u00c7 ", - " \u00c9\u00c9\u00c9 \u00ca\u00ca \u00c1\u00c1\u00c1\u00c1\u00c1\u00c1\u00c1\u00c1\u00cb\u00cb\u00cb\u00cb \u00c1 \u00c8\u00c8\u00c8 \u00cc\u00cc\u00cc \u00bc \u00cd\u00cd\u00cd \u00ce\u00ce\u00ce \u00ce\u00ce \u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00c2\u00c2\u00cf \u00d0\u00d0 \u00d1\u00d1 \u00be \u00d1\u00d1 \u00d2 \u00d2 \u00d2\u00d2 \u00d3\u00d3 ", - " \u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4 \u00c9\u00c9\u00c9 \u00ca\u00ca\u00ca \u00cb\u00cb\u00cb\u00cb\u00cb\u00cb\u00cb \u00c8\u00c8\u00c8 \u00cc\u00cc\u00cc\u00cc\u00cc \u00cd\u00cd\u00cd\u00cd \u00ce\u00ce\u00ce\u00ce \u00ce\u00ce\u00ce\u00ce \u00cf\u00cf\u00cf \u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf \u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5 \u00d5\u00d5 \u00d1\u00d1\u00d1\u00d1 \u00d1\u00d1\u00d1\u00d1\u00d1 \u00d2 \u00d2 \u00d2 \u00d2\u00d2\u00d2\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6 \u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 ", - " \u00d4\u00d4 \u00d4\u00d4 \u00c9\u00c9\u00c9 \u00c9\u00c9\u00c9\u00c9 \u00c9\u00c9 \u00ca\u00ca \u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca \u00ca\u00ca \u00cb\u00cb\u00cb\u00cb \u00c8\u00c8\u00c8\u00c8\u00c8 \u00cc\u00cc\u00cc\u00cc\u00cc\u00cc \u00cd\u00cd\u00cd\u00cd \u00ce\u00ce \u00ce\u00ce \u00ce\u00ce \u00ce \u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf \u00cf \u00d0\u00d0\u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5 \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d1\u00d1\u00d1\u00d1\u00d1 \u00d2\u00d2 \u00d2\u00d2 \u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6 \u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 ", - " \u00d4\u00d4 \u00d4\u00d4\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9 \u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca \u00cb\u00cb\u00cb\u00cb \u00c8\u00c8\u00c8\u00c8\u00c8 \u00cc\u00cc\u00cc\u00cc\u00cc\u00cc \u00cd\u00cd\u00cd\u00cd \u00ce\u00ce\u00ce\u00ce \u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce \u00ce\u00ce\u00cf\u00ce \u00cf \u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5 \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d1\u00d1\u00d1\u00d1 \u00d1\u00d1\u00d1\u00d1\u00d1 \u00d2\u00d2\u00d2 \u00d2\u00d2 \u00d2\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6 \u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 ", - " \u00d4\u00d4 \u00d4\u00d4\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9 \u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca \u00cb\u00cb\u00cb \u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8 \u00cc\u00cc\u00cc\u00cc\u00cc\u00cc \u00cd\u00cd\u00cd\u00cd \u00ce\u00ce\u00ce\u00ce \u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce \u00ce\u00ce\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf \u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5 \u00d1\u00d1\u00d1\u00d1 \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d2 \u00d2\u00d2 \u00d2\u00d2 \u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6 \u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 ", - " \u00d4\u00d4\u00d4 \u00d4\u00d4\u00d4 \u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9 \u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca \u00cb\u00cb\u00cb \u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8 \u00cc\u00cc\u00cc\u00cc\u00cc\u00cc \u00cd\u00cd \u00cd\u00cd\u00cd\u00cd \u00cd \u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf \u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf \u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5 \u00d1 \u00d1\u00d1 \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d1\u00d1 \u00d1 \u00d2\u00d2\u00d2\u00d2\u00d2\u00d2 \u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6 \u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 ", - " \u00d4 \u00d4\u00d4 \u00d4\u00d4 \u00c9\u00c9\u00c9\u00c9\u00c9\u00c9 \u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca \u00cb\u00cb\u00cb \u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8 \u00cc\u00cc\u00cc\u00cc\u00cc\u00cc \u00cd\u00cd\u00cd\u00cd \u00cd\u00cd\u00cd\u00cd \u00cd\u00cd\u00cd\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf \u00cf\u00cf \u00cf\u00cf\u00cf\u00cf\u00cf\u00cf \u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d2\u00d2\u00d2\u00d2\u00d2\u00d2 \u00d6 \u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6 \u00d6 \u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 ", - " \u00d4 \u00d4\u00d4\u00d4 \u00d4\u00d4\u00d4 \u00c9\u00c9\u00c9\u00c9\u00c9 \u00c9\u00c9\u00c9\u00c9\u00c9\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca \u00cb\u00cb\u00cb\u00cb \u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8 \u00cc\u00cc\u00cc\u00cc\u00cc\u00cc \u00cd\u00cd\u00cd\u00cd\u00cd \u00cd\u00cd\u00cd\u00cd \u00cd\u00cd\u00cd\u00cd\u00ce \u00ce \u00ce \u00ce \u00cf\u00cf\u00cf\u00cf\u00cf\u00cf \u00cf \u00cf\u00cf \u00cf\u00cf\u00cf\u00cf\u00cf\u00cf \u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d2\u00d2\u00d2\u00d2\u00d2\u00d2 \u00d2\u00d6\u00d6\u00d6 \u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6 \u00d6\u00d6\u00d6 \u00d3 \u00d3\u00d3\u00d3\u00d3\u00d3 ", - " \u00d4 \u00d4\u00d4\u00d4 \u00d4\u00d4\u00d4 \u00c9\u00c9\u00c9\u00c9\u00c9 \u00c9\u00c9\u00c9\u00c9\u00c9\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca \u00cb\u00cb\u00cb \u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8 \u00cc\u00cc\u00cc\u00cc\u00cc\u00cc \u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00ce \u00ce \u00ce \u00ce \u00cf\u00cf\u00cf\u00cf\u00cf \u00cf\u00cf\u00cf\u00cf\u00cf\u00cf \u00cf\u00cf\u00cf\u00cf\u00cf \u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d2\u00d2\u00d2\u00d2\u00d2\u00d2 \u00d6\u00d6\u00d6\u00d6 \u00d6\u00d6\u00d6\u00d6\u00d6\u00d6 \u00d6\u00d6\u00d6\u00d6 \u00d3 \u00d3\u00d3 \u00d3\u00d3 \u00d3\u00d3 ", - " \u00d4 \u00d4\u00d4\u00d4 \u00d4\u00d4\u00d4 \u00c9\u00c9\u00c9\u00c9\u00c9\u00c9 \u00c9\u00c9\u00c9\u00c9\u00c9\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca \u00cb\u00cb\u00cb \u00c8\u00c8\u00c8 \u00c8\u00c8\u00c8\u00c8\u00c8\u00c8 \u00cc\u00cc\u00cc\u00cc\u00cc\u00cc \u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd \u00ce \u00ce \u00ce \u00ce \u00cf\u00cf\u00cf\u00cf\u00cf \u00cf\u00cf\u00cf\u00cf\u00cf\u00cf \u00cf\u00cf\u00cf\u00cf\u00cf \u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d2\u00d2\u00d2\u00d2\u00d2\u00d2 \u00d6\u00d6\u00d6\u00d6\u00d6\u00d6 \u00d6\u00d6\u00d6\u00d6 \u00d6\u00d6\u00d6\u00d6\u00d6\u00d3\u00d3 \u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 \u00d3\u00d3 ", - " \u00d4 \u00d4\u00d4\u00d4\u00d4 \u00d4 \u00c9\u00c9\u00c9\u00c9\u00c9 \u00c9\u00c9\u00c9\u00c9\u00c9 \u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca\u00ca \u00cb\u00cb\u00cb \u00c8\u00c8\u00c8 \u00c8\u00c8\u00c8\u00c8\u00c8\u00c8 \u00cc\u00cc\u00cc\u00cc\u00cc\u00cc \u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd \u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf \u00cf\u00cf\u00cf\u00cf \u00cf\u00cf\u00cf\u00cf\u00cf\u00cf \u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d1\u00d1\u00d1 \u00d2\u00d2\u00d2\u00d2\u00d2\u00d2 \u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6 \u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d3\u00d3 \u00d3\u00d3\u00d3\u00d3\u00d3 \u00d3\u00d3 ", - " \u00d4 \u00d4 \u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9 \u00ca\u00ca\u00ca\u00ca\u00ca \u00ca\u00ca\u00ca\u00ca \u00cb\u00cb\u00cb \u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8 \u00cc\u00cc\u00cc\u00cc\u00cc\u00cc \u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd \u00ce \u00ce \u00ce \u00ce \u00cf\u00cf\u00cf\u00cf\u00cf\u00cf \u00cf\u00cf\u00cf\u00cf\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0 \u00d0\u00d0\u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5 \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d2\u00d2\u00d2\u00d2\u00d2\u00d2 \u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d3\u00d3 \u00d3\u00d3\u00d3\u00d3 \u00d3\u00d3 \u00d3\u00d3 ", - " \u00d4 \u00d4\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9 \u00ca\u00ca \u00cb\u00cb\u00cb\u00cb \u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8 \u00cc\u00cc\u00cc\u00cc\u00cc\u00cc \u00cd\u00cd\u00cd\u00cd\u00cd\u00cd\u00cd \u00ce \u00ce \u00ce \u00ce \u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5 \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d2\u00d2\u00d2\u00d2\u00d2\u00d2 \u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d3 \u00d3\u00d3 \u00d3\u00d3\u00d3 \u00d3\u00d3 \u00d3\u00d3 ", - " \u00d4 \u00d4 \u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9\u00c9 \u00ca\u00ca \u00cb\u00cb\u00cb \u00c8\u00c8\u00c8\u00c8\u00c8\u00c8\u00c8 \u00cc\u00cc\u00cc\u00cc\u00cc\u00cc \u00cd\u00cd\u00cd\u00cd\u00cd \u00ce \u00ce \u00ce \u00ce \u00cf\u00ce \u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5\u00d5 \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d2\u00d2\u00d2\u00d2\u00d2\u00d2 \u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d3 \u00d3\u00d3\u00d3 \u00d3\u00d3 \u00d3 ", - " \u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4\u00d4 \u00c9 \u00c9\u00c9\u00c9 \u00ca\u00ca \u00cb\u00cb\u00cb\u00cb\u00cb \u00cc\u00cc\u00cc\u00cc \u00cd\u00cd\u00cd \u00ce \u00ce \u00ce \u00ce \u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0 \u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5\u00d5\u00d5\u00d5 \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d2\u00d2\u00d2\u00d2 \u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d6\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 ", - " \u00c9\u00c9\u00c9 \u00ca\u00ca \u00d7\u00d7\u00d7 \u00cb\u00cb\u00cb\u00cb\u00cb\u00cb\u00cb \u00cc\u00cc \u00ce \u00ce \u00ce \u00ce \u00d8\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00cf\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0\u00d0 \u00d5\u00d5\u00d5 \u00d5\u00d5 \u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1 \u00d9\u00d2\u00d2\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9 \u00da\u00da\u00da\u00da\u00da\u00da\u00da\u00da \u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3\u00d3 ", - " \u00db\u00db\u00db \u00d7\u00d7\u00d7\u00d7\u00d7\u00d7 \u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd\u00dd\u00dd \u00de\u00de \u00df\u00df \u00ce \u00ce \u00ce \u00ce\u00d8\u00d8\u00ce\u00ce\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1 \u00e2\u00e2 \u00e3\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9 \u00da\u00da\u00da\u00da\u00da\u00da\u00da\u00da\u00da\u00da \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 ", - " \u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5 \u00db\u00db\u00db \u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7 \u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd \u00de\u00de\u00de\u00de \u00df\u00df\u00df\u00df \u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2 \u00e3\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9 \u00da\u00da\u00da\u00da\u00da\u00da\u00da\u00da\u00da\u00da \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 ", - " \u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5 \u00db\u00db\u00db \u00d7\u00d7 \u00d7\u00d7\u00d7 \u00dc\u00dc\u00dc \u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd \u00de\u00de\u00de\u00de\u00de\u00de \u00df\u00df\u00df\u00df\u00df\u00df \u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00ce\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00d1\u00e3\u00e3\u00d9\u00d9 \u00d9\u00d9 \u00d9\u00d9 \u00d9\u00d9 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 ", - " \u00e5\u00e5\u00e5\u00e5\u00e5 \u00e5\u00e5\u00e5\u00e5\u00e5\u00e5 \u00db\u00db\u00db \u00d7\u00d7 \u00d7\u00d7 \u00dc\u00dc\u00dc \u00dc\u00dc\u00dc \u00dd\u00dd\u00dd \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd \u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de \u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df \u00d8\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1 \u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3\u00e3\u00e3 \u00e3\u00e3\u00e3\u00e3\u00e3\u00d9\u00d9 \u00d9\u00d9 \u00d9\u00d9 \u00d9\u00d9 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 ", - " \u00e5\u00e5\u00e5\u00e5 \u00e5\u00e5\u00e5\u00e5 \u00db\u00db\u00db \u00d7\u00d7 \u00d7\u00d7 \u00dc\u00dc\u00dc \u00dc\u00dc\u00dc \u00dd\u00dd\u00dd \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd \u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de \u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df \u00d8\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0\u00e0\u00e1\u00e1\u00e1 \u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3\u00e3\u00e3\u00e3 \u00e3\u00e3\u00e3\u00e3\u00e3\u00e3\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9 \u00e4\u00e4\u00e4\u00e4\u00e4 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 ", - " \u00e5\u00e5\u00e5 \u00e5\u00e5\u00e5\u00e5 \u00db\u00db\u00db \u00db\u00db\u00db \u00d7\u00d7 \u00d7\u00d7 \u00dc\u00dc\u00dc \u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd \u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de \u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df \u00d8\u00d8\u00d8\u00d8\u00d8\u00d8 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e1\u00e1\u00e1\u00e1 \u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3 \u00e3\u00e3\u00e3 \u00e3\u00e3\u00e3\u00e3 \u00e3\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9 \u00e4\u00e4\u00e4\u00e4\u00e4 \u00e4\u00e4\u00e4\u00e4\u00e4 ", - " \u00e5\u00e5\u00e5 \u00e5\u00e5\u00e5 \u00db\u00db\u00db \u00db\u00db\u00db\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7 \u00dc\u00dc\u00dc \u00dc\u00dc\u00dc\u00dc \u00dd\u00dd \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd \u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de \u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df \u00d8\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e1\u00e1\u00e1 \u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3\u00e3\u00e3\u00e3 \u00d9\u00d9 \u00d9\u00d9 \u00d9\u00d9 \u00d9\u00d9 \u00e4\u00e4\u00e4\u00e4\u00e4 \u00e4\u00e4\u00e4\u00e4\u00e4 ", - " \u00e5\u00e5 \u00e5\u00e5\u00e5 \u00db\u00db\u00db \u00db\u00db\u00db\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7 \u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc \u00dd\u00dd \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df\u00df \u00d8 \u00d8\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0\u00e1\u00e1\u00e1 \u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3\u00e3 \u00d9\u00d9 \u00d9\u00d9 \u00d9\u00d9 \u00d9\u00d9 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 ", - " \u00e5\u00e5 \u00e5\u00e5\u00e5 \u00db\u00db\u00db \u00db\u00db\u00db\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7 \u00dc\u00dc\u00dc \u00dc\u00dc\u00dc\u00dc \u00dd\u00dd \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd \u00df\u00df\u00df\u00df \u00df\u00df\u00df\u00df \u00df\u00df\u00df\u00df\u00df\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8 \u00d8\u00d8\u00d8\u00d8 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0\u00e1\u00e1\u00e1 \u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3\u00e3\u00e3 \u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 ", - " \u00e5\u00e5\u00e5 \u00e5\u00e5\u00e5 \u00db\u00db\u00db \u00db\u00db\u00db \u00db\u00db\u00db\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7 \u00dc\u00dc\u00dc \u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00df\u00df\u00df \u00df\u00df\u00df\u00df \u00df\u00df\u00df \u00d8\u00d8\u00d8\u00d8\u00d8\u00d8 \u00d8\u00d8\u00d8\u00d8 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e1\u00e1\u00e1 \u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3\u00e3\u00e3\u00e3\u00e3 \u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 ", - " \u00e5\u00e5\u00e5 \u00e5\u00e5\u00e5 \u00db\u00db\u00db \u00db\u00db\u00db \u00db\u00db\u00db\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7 \u00dc\u00dc\u00dc \u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de \u00df\u00df\u00df\u00df \u00d8\u00d8\u00d8\u00d8 \u00d8\u00d8\u00d8 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e1\u00e1\u00e1\u00e1 \u00e1\u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3 \u00e3\u00e3\u00e3\u00e3 \u00e3\u00e3\u00e3 \u00e3\u00d9\u00d9 \u00d9\u00d9 \u00d9\u00d9 \u00d9\u00d9 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 ", - " \u00e5\u00e5\u00e5\u00e5 \u00e5\u00e5\u00e5\u00e5 \u00db\u00db\u00db \u00db\u00db\u00db \u00db\u00db\u00db\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7 \u00dc\u00dc\u00dc \u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd \u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de \u00df\u00df\u00df\u00df \u00d8\u00d8\u00d8 \u00d8\u00d8\u00d8 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1 \u00e1\u00e1\u00e1\u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3\u00e3\u00e3\u00e3 \u00e3\u00e3\u00e3\u00e3\u00e3\u00d9\u00d9 \u00d9\u00d9 \u00d9\u00d9 \u00d9\u00d9 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 ", - " \u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5 \u00db\u00db\u00db \u00db\u00db\u00db \u00db\u00db\u00db \u00db\u00db\u00db\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7 \u00dc\u00dc\u00dc \u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd\u00dd \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd \u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de\u00de \u00df\u00df\u00df\u00df \u00d8\u00d8\u00d8 \u00d8\u00d8 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e1\u00e1\u00e1 \u00e1\u00e1 \u00e1\u00e1\u00e1\u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2 \u00e3\u00e3\u00e3\u00e3\u00e3 \u00e3\u00e3\u00e3\u00e3\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 ", - " \u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5\u00e5 \u00db\u00db \u00db\u00db\u00db \u00db\u00db\u00db \u00db\u00db\u00db \u00db\u00db\u00db \u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7 \u00dc\u00dc\u00dc \u00dc\u00dc\u00dc \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd \u00df\u00df\u00df\u00df \u00d8 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e1\u00e1\u00e1\u00e1\u00e1\u00e1 \u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e3\u00e3\u00e3\u00e3\u00e3 \u00e3\u00e3\u00e3\u00e3\u00e3\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9\u00d9 \u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4\u00e4 ", - " \u00e5\u00e5\u00e5\u00e5\u00e5 \u00e5\u00e5\u00e5\u00e5\u00db\u00db \u00db\u00db\u00db \u00db\u00db\u00db \u00db\u00db\u00db \u00db\u00db\u00db \u00dc\u00dc\u00dc\u00dc\u00dc \u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd\u00dd \u00df\u00df\u00df\u00df \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0\u00e0 \u00e1\u00e1\u00e1\u00e1\u00e1\u00e1 \u00e1\u00e1\u00e1\u00e1\u00e1\u00e1\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e3\u00e3\u00e3\u00e3\u00e3\u00e3\u00e6\u00e6\u00e6\u00e6\u00e3\u00e3\u00e3\u00e3\u00e3\u00e3 ", - " \u00e5\u00e5\u00e5\u00db\u00db \u00db\u00db\u00db \u00db\u00db\u00db \u00db\u00db\u00db \u00db\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc\u00dc \u00dd\u00dd\u00dd \u00e8\u00e8\u00e8 \u00e0\u00e0\u00e0\u00e0\u00e0\u00e0\u00e0 \u00e0\u00e0\u00e0 \u00e1\u00e1\u00e1\u00e1 \u00e1\u00e1\u00e1 \u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e2\u00e3\u00e3\u00e3\u00e3\u00e3\u00e3\u00e6\u00e6\u00e6\u00e6\u00e3\u00e3\u00e3\u00e3\u00e3 \u00e9\u00e9\u00e9\u00e9\u00e9 ", - " \u00e5\u00e5\u00e5 \u00ea\u00ea\u00ea \u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00eb\u00eb \u00ec\u00ec\u00ec\u00ec\u00ec\u00ec\u00ec \u00ed \u00ed\u00ed \u00e8\u00e8\u00e8 \u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee \u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef \u00e2\u00e2\u00e2\u00e2\u00e2 \u00f0\u00f0 \u00e6 \u00e6\u00e6 \u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1 \u00f1\u00f1\u00f1\u00f1\u00f1 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 ", - " \u00f2\u00f2\u00f2\u00f2\u00f2\u00f2 \u00ea\u00ea\u00ea \u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00eb\u00eb\u00eb \u00ec\u00ec\u00ec\u00ec\u00ec\u00ec\u00ec\u00ec\u00ec \u00ed\u00ed \u00ed\u00ed \u00f3\u00f3\u00f3\u00f3 \u00e8\u00e8\u00e8\u00e8\u00e8 \u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee \u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef \u00e2\u00e2\u00e2\u00e2 \u00f0\u00f0\u00f0\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00f1\u00f1\u00f1 \u00f1\u00f1 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 ", - " \u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2 \u00ea\u00ea\u00ea \u00ea\u00ea\u00ea \u00ea\u00ea\u00ea \u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00eb\u00eb\u00eb\u00eb \u00ec\u00ec\u00ec\u00ec \u00ec\u00ec\u00ec\u00ec \u00ed\u00ed\u00ed \u00ed\u00ed \u00f3\u00f3\u00f3\u00f3\u00f3 \u00e8\u00e8\u00e8\u00e8\u00e8 \u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef \u00f0\u00f0\u00f0 \u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00f1\u00f1\u00f1 \u00f1\u00f1 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 ", - " \u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2 \u00ea\u00ea\u00ea\u00ea \u00ea\u00ea\u00ea \u00ea\u00ea\u00ea\u00ea\u00e7\u00e7 \u00e7 \u00eb\u00eb\u00eb\u00eb\u00eb \u00ec\u00ec\u00ec\u00ec \u00ec\u00ec\u00ec\u00ec \u00ed\u00ed\u00ed\u00ed \u00ed\u00ed \u00f3\u00f3\u00f3\u00f3\u00f3\u00f3 \u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8 \u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef \u00f0\u00f0\u00f0\u00f0 \u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00f1\u00f1\u00f1 \u00f1\u00f1 \u00e9\u00e9\u00e9\u00e9\u00e9 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 ", - " \u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2 \u00ea\u00ea\u00ea \u00ea\u00ea\u00ea \u00ea\u00ea\u00ea\u00e7\u00e7 \u00e7 \u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00e7 \u00eb\u00eb\u00eb\u00eb\u00eb\u00eb \u00ec\u00ec\u00ec \u00ec\u00ec\u00ec \u00ed\u00ed\u00ed\u00ed\u00ed \u00ed\u00ed \u00f3\u00f3\u00f3\u00f3\u00f3\u00f3 \u00e8\u00e8\u00e8 \u00e8\u00e8 \u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee \u00ee\u00ee\u00ee\u00ef\u00ef \u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef \u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0 \u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00f1\u00f1\u00f1 \u00f1\u00f1 \u00f4\u00f4\u00f4\u00f4\u00f4\u00f4\u00f4\u00f4\u00f4\u00f4 \u00e9\u00e9\u00e9\u00e9\u00e9 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 ", - " \u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00ea\u00ea\u00ea \u00ea\u00ea\u00ea \u00ea\u00ea\u00e7\u00e7 \u00e7 \u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00e7 \u00eb \u00eb\u00eb\u00eb\u00eb \u00ec\u00ec\u00ec \u00ec\u00ec\u00ec \u00ed\u00ed\u00ed\u00ed\u00ed\u00ed \u00ed\u00ed \u00f3\u00f3\u00f3\u00f3\u00f3\u00f3 \u00e8\u00e8\u00e8 \u00e8\u00e8\u00e8 \u00ee\u00ee\u00ee \u00ee\u00ee\u00ee \u00ee\u00ee\u00ee\u00ef\u00ef \u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef \u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0 \u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00f1\u00f1\u00f1 \u00f1\u00f1 \u00f4\u00f4\u00f4\u00f4\u00f4\u00f4\u00f4\u00f4\u00f4\u00f4 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 ", - " \u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2 \u00f2\u00f2\u00ea\u00ea\u00ea \u00ea\u00ea\u00ea \u00ea\u00ea\u00e7\u00e7 \u00e7 \u00eb\u00eb \u00eb\u00eb\u00eb \u00ec\u00ec\u00ec\u00ec \u00ec\u00ec\u00ec\u00ec \u00ed\u00ed\u00ed\u00ed\u00ed\u00ed\u00ed \u00ed\u00ed \u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3 \u00e8\u00e8\u00e8\u00e8 \u00e8\u00e8\u00e8 \u00ee\u00ee\u00ee\u00ee \u00ee\u00ee\u00ee\u00ee\u00ef\u00ef \u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef \u00ef\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0 \u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00f1\u00f1\u00f1 \u00f1\u00f1 \u00f4\u00f4\u00f4\u00f4\u00f4\u00f4\u00f4\u00f4 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 ", - " \u00f2\u00f2\u00f2\u00f2 \u00f2\u00f2\u00ea\u00ea\u00ea \u00ea\u00ea\u00ea \u00ea\u00e7\u00e7 \u00e7 \u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00e7 \u00eb\u00eb \u00eb\u00eb\u00eb\u00eb \u00ec\u00ec\u00ec\u00ec\u00ec\u00ec\u00ec\u00ec\u00ec \u00ed\u00ed\u00ed\u00ed\u00ed\u00ed\u00ed\u00ed\u00ed\u00ed \u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3 \u00e8\u00e8\u00e8\u00e8 \u00e8\u00e8\u00e8\u00e8 \u00ee\u00ee\u00ee\u00ee \u00ee\u00ee\u00ee\u00ee \u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0 \u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00f1\u00f1\u00f1 \u00f1\u00f1 \u00f4\u00f4\u00f4\u00f4\u00f4\u00f4 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 ", - " \u00f2\u00f2 \u00f2\u00f2\u00ea\u00ea\u00ea \u00ea\u00e7\u00e7 \u00e7 \u00eb\u00eb\u00eb\u00eb\u00eb\u00eb\u00eb\u00eb \u00ec\u00ec\u00ec\u00ec\u00ec\u00ec\u00ec\u00ec\u00ec \u00ed\u00ed\u00ed\u00ed\u00ed\u00ed\u00ed \u00ed\u00ed \u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3 \u00e8\u00e8\u00e8\u00e8\u00e8 \u00e8\u00e8\u00e8\u00e8 \u00ee\u00ee\u00ee\u00ee\u00ee \u00ee\u00ee\u00ee\u00ee\u00ee \u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef \u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0\u00f0 \u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00f1\u00f1\u00f1 \u00f1\u00f1 \u00f4\u00f4\u00f4\u00f4 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 ", - " \u00f2\u00f2 \u00f2\u00f2\u00ea\u00ea\u00ea \u00ea\u00ea\u00e7\u00e7 \u00e7 \u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00e7 \u00eb\u00eb\u00eb\u00eb\u00eb\u00eb\u00eb\u00eb\u00eb\u00eb \u00ec\u00ec\u00ec\u00ec\u00ec\u00ec\u00ec \u00ed\u00ed\u00ed\u00ed\u00ed\u00ed \u00ed\u00ed \u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3\u00f3 \u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8 \u00ee\u00ee\u00ee\u00ee\u00ee \u00ee\u00ee\u00ee\u00ee\u00ee \u00ef\u00ef\u00ef\u00ef\u00ef \u00f0\u00f0\u00f0\u00f0 \u00f0\u00f0\u00f0\u00f0 \u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00f1\u00f1\u00f1 \u00f1 \u00f4\u00f4 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 ", - " \u00f2\u00f2 \u00f2\u00f2\u00ea\u00ea\u00ea \u00ea\u00ea\u00e7\u00e7 \u00e7 \u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00e7 \u00eb\u00eb \u00eb\u00eb\u00eb\u00eb \u00ec\u00ec\u00ec\u00ec\u00ec\u00ec\u00ec \u00ed\u00ed\u00ed\u00ed\u00ed\u00ed \u00ed\u00ed \u00f3\u00f3\u00f3\u00f3\u00f3 \u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee \u00ee\u00ee\u00ee\u00ee\u00ee\u00ee \u00ef\u00ef\u00ef \u00f0\u00f0\u00f0 \u00f0\u00f0\u00f0 \u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00f1\u00f1\u00f1\u00f1 \u00f1\u00f1 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 ", - " \u00f2\u00f2 \u00f2\u00f2\u00f2\u00f2\u00f2\u00f2 \u00ea\u00ea\u00ea \u00ea\u00ea\u00ea\u00e7\u00e7 \u00e7 \u00eb\u00eb \u00eb\u00eb\u00eb\u00eb \u00ec\u00ec\u00ec\u00ec\u00ec \u00ed\u00ed\u00ed\u00ed\u00ed \u00ed\u00ed \u00f3\u00f3\u00f3\u00f3\u00f3 \u00e8\u00e8\u00e8\u00e8\u00e8\u00e8 \u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00ee\u00ee\u00ee\u00ee \u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee \u00ef\u00ef\u00ef \u00f0\u00f0\u00f0\u00f0 \u00f0\u00f0\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 ", - " \u00f2\u00f2 \u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2 \u00ea\u00ea\u00ea\u00ea \u00ea\u00ea\u00ea\u00ea\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7\u00e7 \u00eb\u00eb \u00eb\u00eb\u00eb\u00eb \u00ec\u00ec\u00ec\u00ec\u00ec \u00ed\u00ed\u00ed\u00ed \u00ed\u00ed \u00f3\u00f3\u00f3\u00f3\u00f3 \u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8 \u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee \u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef \u00f0\u00f0\u00f0\u00f0 \u00f0\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 \u00f1\u00f1\u00f1\u00f1 \u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9 ", - " \u00f2\u00f2\u00f2\u00f2\u00f2\u00f2 \u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2 \u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea \u00eb\u00eb \u00eb\u00eb\u00eb\u00eb \u00ec\u00ec\u00ec \u00ed\u00ed\u00ed \u00ed\u00ed \u00f3\u00f3\u00f3\u00f3\u00f3 \u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee \u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef \u00f0\u00f0\u00f0\u00f0 \u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6\u00e6 ", - " \u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2 \u00f2\u00f2\u00f2 \u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea\u00ea \u00eb\u00eb\u00eb\u00eb\u00eb\u00eb\u00eb \u00eb\u00eb\u00eb\u00eb\u00eb\u00eb\u00eb\u00eb \u00ec\u00ec\u00ec \u00ed\u00ed \u00ed\u00ed \u00f3\u00f3\u00f3\u00f3 \u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee\u00ee \u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef\u00ef \u00f0\u00f0\u00f0\u00f0 \u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1\u00f1 ", - " \u00f2\u00f2\u00f2\u00f2\u00f2\u00f2\u00f2 \u00ea\u00ea\u00ea\u00ea\u00ea \u00f5\u00f5\u00f5\u00f5 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f7\u00f7 \u00ed\u00ed \u00f3\u00f3 \u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00e8\u00f8\u00e8\u00e8 \u00f9\u00f9\u00f9\u00f9\u00f9 \u00fa\u00f0\u00f0\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa \u00fb\u00fb\u00fb\u00fb\u00fb \u00fc\u00fc ", - " \u00fd\u00f2\u00f2\u00f2\u00f2\u00f2\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd \u00fe\u00fe\u00fe\u00fe\u00fe\u00fe \u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5 \u00f5\u00f5 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f7\u00f7\u00f7\u00f7 \u00ff\u00ff \u00ff \u00ff\u00ff\u00ff \u0100\u0100\u0100 \u0101\u0101 \u00f8 \u00f8\u00f8\u00f8 \u00f9\u00f9 \u00f9\u00f9\u00f9\u00f9\u00f9\u00f9 \u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa \u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102 \u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb \u00fc\u00fc\u00fc\u00fc \u0103 ", - " \u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd \u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe \u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f7\u00f7\u00f7\u00f7\u00f7\u00ff\u00ff\u00ff \u00ff\u00ff \u00ff\u00ff\u00ff \u0100\u0100\u0100\u0100\u0100 \u0101\u0101\u0101\u0101\u0101\u0101\u0101 \u00f8 \u00f8\u00f8\u00f8 \u00f9\u00f9\u00f9 \u00f9 \u00fa\u00fa \u00fa \u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102 \u00fb\u00fb \u00fb\u00fb \u00fc\u00fc\u00fc\u00fc\u00fc\u00fc \u0103\u0103 ", - " \u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd \u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe \u00f5\u00f5\u00f5\u00f5 \u00f5\u00f5\u00f5\u00f5\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f7\u00f7 \u00f7\u00f7\u00f7\u00f7\u00ff\u00ff\u00ff\u00ff \u00ff\u00ff\u00ff \u00ff\u00ff\u00ff \u0100\u0100\u0100\u0100\u0100\u0100 \u0101\u0101\u0101\u0101\u0101\u0101\u0101\u0101\u0101 \u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f9\u00f9\u00f9\u00f9 \u00f9 \u00fa\u00fa \u00fa\u00fa \u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102 \u00fb\u00fb\u00fb \u00fb\u00fb \u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc \u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103 ", - " \u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd \u00fe\u00fe\u00fe\u00fe \u00fe\u00fe\u00fe\u00fe \u00f5\u00f5\u00f5\u00f5 \u00f5\u00f5\u00f5\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f7\u00f7\u00f7\u00f7 \u00f7\u00f7\u00f7\u00ff\u00ff\u00ff\u00ff\u00ff \u00ff\u00ff\u00ff\u00ff \u00ff\u00ff\u00ff \u0100\u0100\u0100\u0100\u0100\u0100 \u0101\u0101\u0101\u0101\u0101 \u0101\u0101\u0101\u0101 \u0101\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9 \u00f9 \u00fa \u00fa\u00fa \u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102 \u00fb\u00fb\u00fb \u00fb\u00fb \u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc \u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103 ", - " \u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd \u00fe\u00fe\u00fe \u00fe\u00fe\u00fe \u00f5\u00f5\u00f5 \u00f5\u00f5\u00f5\u00f5\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f7\u00f7\u00f7\u00f7\u00f7\u00f7 \u00f7\u00f7\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff \u00ff\u00ff\u00ff\u00ff\u00ff \u00ff\u00ff\u00ff \u0100\u0100\u0100\u0100\u0100\u0100 \u0101\u0101 \u0101\u0101\u0101\u0101\u0101\u0101\u0101 \u00f8\u0101 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9 \u00f9 \u00fa\u00fa \u00fa \u0102\u0102\u0102\u0102\u0102\u0102\u0102\u0102 \u00fb\u00fb\u00fb\u00fb\u00fb \u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc \u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103 ", - " \u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd \u00fe\u00fe\u00fe \u00fe\u00fe\u00fe \u00f5\u00f5\u00f5 \u00f5\u00f5\u00f5\u00f5\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7 \u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff \u00ff\u00ff\u00ff\u00ff\u00ff\u00ff \u00ff\u00ff\u00ff \u0100\u0100\u0100\u0100\u0100\u0100 \u0101\u0101 \u0101 \u0101\u0101\u0101\u0101 \u0101 \u00f8\u0101\u0101 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9 \u00f9 \u00fa\u00fa \u00fa\u00fa \u0102\u0102\u0102\u0102\u0102\u0102 \u00fb\u00fb\u00fb\u00fb\u00fb\u00fb \u0103\u0103 ", - " \u00fd\u00fd\u00fd\u00fd\u00fd\u00fd \u00fe\u00fe\u00fe \u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe \u00fe\u00fe\u00fe \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7 \u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0101\u0101 \u0101\u0101\u0101\u0101\u0101\u0101 \u0101 \u00f8 \u0101 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9 \u00f9 \u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa \u0102\u0102\u0102\u0102 \u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb \u0103 \u0103 ", - " \u00fd\u00fd\u00fd\u00fd \u00fe\u00fe\u00fe \u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe \u00fe\u00fe\u00fe \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7 \u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0101\u0101 \u0101\u0101\u0101\u0101\u0101 \u0101\u0101 \u00f8\u0101\u0101\u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9\u00f9 \u00f9\u00fa\u00fa \u00fa \u0102\u0102\u0102\u0102 \u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb\u00fb \u0103\u0103 ", - " \u00fd\u00fd \u00fe\u00fe\u00fe \u00fe\u00fe\u00fe \u00f5\u00f5\u00f5\u00f5\u00f5 \u00f5\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7 \u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff \u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0101\u0101 \u0101\u0101\u0101\u0101 \u0101\u0101 \u00f8\u0101\u0101\u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f9\u00f9\u00f9\u00f9\u00f9 \u00f9\u00fa\u00fa \u00fa\u00fa \u00fa\u00fa \u00fa \u0102\u0102\u0102\u0102 \u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc \u0103\u0103\u0103 ", - " \u00fd\u00fd \u00fe\u00fe\u00fe \u00fe\u00fe\u00fe \u00f5\u00f5\u00f5\u00f5\u00f5\u00f5 \u00f5\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7 \u00ff\u00ff\u00ff\u00ff\u00ff\u00ff \u00ff\u00ff\u00ff\u00ff\u00ff\u00ff \u00ff\u00ff\u00ff\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100 \u0101\u0101\u0101 \u0101\u0101\u0101 \u0101 \u0101\u00f8\u0101 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f9\u00f9\u00f9\u00f9 \u00f9\u00fa\u00fa \u00fa\u00fa \u00fa\u00fa \u00fa \u0102\u0102\u0102\u0102 \u00fb\u00fb\u00fb\u00fb \u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc \u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103 ", - " \u00fd\u00fd \u00fe\u00fe\u00fe\u00fe \u00fe\u00fe\u00fe\u00fe \u00f5\u00f5\u00f5\u00f5\u00f5 \u00f5\u00f5\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7\u00f7 \u00ff\u00ff\u00ff\u00ff\u00ff \u00ff\u00ff\u00ff\u00ff\u00ff \u00ff\u00ff\u00ff \u0100\u0100\u0100\u0100\u0100\u0100 \u0101\u0101\u0101\u0101\u0101 \u0101\u0101\u0101\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f9\u00f9\u00f9 \u00f9\u00f9\u00fa\u00fa \u00fa \u0102\u0102\u0102\u0102 \u00fb \u00fb\u00fb\u00fb \u00fc\u00fc\u00fc\u00fc\u00fc\u00fc\u00fc \u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103\u0103 ", - " \u00fd\u00fd \u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe \u00f5\u00f5\u00f5\u00f5\u00f5\u00f5 \u00f5\u00f5\u00f5\u00f5\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f7\u00f6 \u00f7\u00f7\u00f7\u00f7 \u00ff\u00ff\u00ff\u00ff \u00ff\u00ff\u00ff\u00ff \u00ff\u00ff\u00ff \u0100\u0100\u0100\u0100\u0100\u0100 \u0101\u0101\u0101 \u0101\u0101\u0101\u0101 \u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f8\u00f8\u00f8 \u00f9\u00f9 \u00f9\u00f9\u00f9\u00f9\u00f9\u00f9 \u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa\u00fa \u0102\u0102\u0102\u0102 \u00fb \u00fb\u00fb\u00fb \u00fc\u00fc\u00fc\u00fc\u00fc \u0103\u0103\u0103 ", - " \u00fd\u00fd \u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe \u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f7\u00f7 \u00f7\u00f7 \u00ff\u00ff\u00ff \u00ff\u00ff\u00ff \u00ff\u00ff\u00ff \u0100\u0100\u0100\u0100\u0100\u0100 \u0101\u0101 \u0101\u0101 \u00f8 \u0102\u0102\u0102 \u00fb\u00fb \u00fb\u00fb \u00fc\u00fc\u00fc \u0103\u0103 ", - " \u00fd\u00fd \u00fe\u00fe\u00fe\u00fe\u00fe\u00fe\u00fe \u00fe\u00fe\u00fe\u00fe\u00f5\u00f5 \u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5\u00f5 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f7\u00f7\u00f7\u00f7\u00f7 \u00ff\u00ff \u00ff\u00ff \u00ff\u00ff\u00ff \u0100\u0100\u0100\u0100\u0100\u0100 \u0101 \u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \u0102\u0102 \u00fb\u00fb\u00fb\u00fb \u00fb\u00fb\u00fb \u00fc \u0103 ", - " \u00fd\u00fd \u00fe\u00fe\u00fe\u00fe \u00f5\u00f5\u00f5\u00f5\u00f5 \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f7\u00f7\u00f7\u00f7 \u00ff \u00ff \u00ff\u00ff\u00ff \u0100\u0100\u0100\u0100\u0100 \u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \u00fb\u00fb\u00fb\u00fb\u00fb ", - " \u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd \u00fe\u00fe\u00fe \u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6\u00f6 \u0100\u0100\u0100 ", - " \u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd\u00fd \u00fe\u00fe ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-line-wrap-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/text-line-wrap-512-512-1.0-grid-reference.json deleted file mode 100644 index 6c277bb58..000000000 --- a/tests/visual_tests/grids/text-line-wrap-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "keys": [ - "", - "2", - "1" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !! ! ", - " !!!!!!! ", - " !!!!!!!! ", - " ! ", - " !! ! ", - " !!!!!!!! ", - " !!!!!!!!! ", - " !!!!!!! ", - " ! ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ####### ", - " # ##### ", - " ######## ", - " # ", - " # # # ", - " ######## ", - " ######### ", - " # ## ", - " # ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-line-wrap-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/text-line-wrap-512-512-2.0-grid-reference.json deleted file mode 100644 index fd18c2559..000000000 --- a/tests/visual_tests/grids/text-line-wrap-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "keys": [ - "", - "2", - "1" - ], - "data": {}, - "grid": [ - " ", - " !! !! ", - " ! !! !! ", - " !!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!! ", - " ! !! !!!!!!!!!!! ", - " !!!! !!!!!!!! ", - " !!!! !!!!!!!! ", - " ", - " ", - " !! !! !! ", - " !!!!!!! !!!!!!! ", - " !!!!!!!!!!!!!!!! ", - " !!!!! !!!!!!!!!!!! ", - " !!!!! !! !!!!!!!!! ", - " !!!!! !!!!!!!!!! ", - " !!!! !!!!!!!!!! ", - " ", - " ! ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ## ## ## ", - " ####### ## ### ", - " ############## ", - " ## ########### ", - " ## ## ######## ", - " ##### ########## ", - " #### ########## ", - " ## ", - " ", - " ## ## ## ", - " ####### ######## ", - " ################ ", - " ## ## ######## ", - " #### ## ######## ", - " ####### ########## ", - " ## ### ", - " ", - " # ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-malayalam-800-100-1.0-grid-reference.json b/tests/visual_tests/grids/text-malayalam-800-100-1.0-grid-reference.json deleted file mode 100644 index c736769ce..000000000 --- a/tests/visual_tests/grids/text-malayalam-800-100-1.0-grid-reference.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "keys": [ - "", - "5" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!!!! !!!!!! ! ", - " !!! ! ! ! ! ", - " !!! ! ! ! ! ", - " !!!! ! !!! ! ", - " !!!!! ! ! ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-malayalam-800-100-2.0-grid-reference.json b/tests/visual_tests/grids/text-malayalam-800-100-2.0-grid-reference.json deleted file mode 100644 index 27504216e..000000000 --- a/tests/visual_tests/grids/text-malayalam-800-100-2.0-grid-reference.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "keys": [ - "", - "5" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!! !!! !!! !!!!!! ! ", - " ! !!! !! !! !!! !! ! ! ", - " !!! ! !! ! ! ! !! !! ! ", - " ! ! ! !! ! ! ! !! ! ! ", - " ! ! ! !! ! ! ! ! ! ! ", - " !!! ! !! ! ! ! !! ! !! ", - " !!!!!!!!! ! ! !!! ! ! ", - " ! ! !! ", - " !!!!!!!!!!! !!! ! ", - " !!!!!!!!!! ! !! ", - " !!!! ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-multi-layout-1-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/text-multi-layout-1-512-512-1.0-grid-reference.json deleted file mode 100644 index 5bdb416b7..000000000 --- a/tests/visual_tests/grids/text-multi-layout-1-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "keys": [ - "", - "2", - "3", - "5", - "6", - "4", - "1" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ! # ", - " !! ## ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " $ ", - " $ ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " % ", - " %% ", - " % ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " & ' ", - " && '' ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-multi-layout-1-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/text-multi-layout-1-512-512-2.0-grid-reference.json deleted file mode 100644 index 354d80181..000000000 --- a/tests/visual_tests/grids/text-multi-layout-1-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "keys": [ - "", - "2", - "3", - "5", - "6", - "4", - "1" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ! # ", - " ! # ", - " !!!! #### ", - " ! # ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " $ ", - " $ ", - " $$$$ ", - " $ ", - " ", - " ", - " ", - " ", - " ", - " ", - " % ", - " % ", - " %%%% ", - " % ", - " % ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " & ' ", - " & ' ", - " &&&& '''' ", - " & ' ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-multi-layout-2-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/text-multi-layout-2-512-512-1.0-grid-reference.json deleted file mode 100644 index 7386a8b19..000000000 --- a/tests/visual_tests/grids/text-multi-layout-2-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "keys": [ - "", - "1" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ! ", - " ! ", - " ! ", - " ! !!! ", - " !! !!! ", - " ! !!! ", - " !!! !! ", - " ! ! !! ", - " ! !! !!! ! ", - " !! !! !! ", - " !!! ! ! ", - " !!!! !! ! ", - " !!! ! !!! ! ! ", - " !! ! ! ! ! !! ", - " ! !! !! ! ! ", - " ! !!! !! !!! !! ", - " !! ! ! !! !! ! ", - " !! ! ! !! ", - " !! ! !! !! !!! ! !!! ", - " !! ! !!!!!!!!!! !!!! !!!! ! !!! ! ! ! ", - " ! ! ! !! !! !!! !!!! ! ! !!! !! ", - " ! !!! !!! ! ", - " ! !!!! !! ", - " !!! !!! ! !!! !! ! ", - " !!!!!!!!!!! !!!! ! ! ! ! !!! !! ", - " !!!!!!!!!!! ! !!!!!!! !! ! ! ", - " !! !! !! ", - " !! ! ! ! ", - " ! !! ! ", - " !! !! ", - " ! !! ", - " ! ", - " ", - " ", - " ", - " ! !!! ! !! ! ", - " !!!!!!!!!!!!!!!!!!! !!!!!!!!! !!!!!!!!! !!!! !!!! ", - " !!!!!!!!!!!!!!!!!!! !!!!!!!!! !!!!!!!! !!!!!!!!!! ", - " !!! ! ! ! ! ! !! ! ! ! ! ! ! ", - " ! ! ! !!! ! ! !! ! ", - " ! !!!!!! !! !!!!!!! !!!!!!! !! !!!!!!!!! ", - " !!!!!!!!!!! !!!!!!! !!!!!!!!!!! !!!!!!!!! ", - " ! ! ! ! !! ! ", - " !!!!!!!!!!!!!! !!!!!!!! ", - " !!!!!!!!!!!!!! !!!!!!!! ", - " ", - " !!! ! ! ", - " !!!!!!!!! ", - " !!!!!!!!!! ", - " ! ! ! ", - " !!!!!!!! ", - " !!!!!!!! ", - " !! ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-multi-layout-2-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/text-multi-layout-2-512-512-2.0-grid-reference.json deleted file mode 100644 index de57d8b0f..000000000 --- a/tests/visual_tests/grids/text-multi-layout-2-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "keys": [ - "", - "1" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !! ", - " ! ", - " !! !! ", - " ! ! ", - " ! ! ", - " !! ! ! ! ", - " ! !! !! ! ", - " ! ! ! !!!!! ", - " ! ! !! ! !! ", - " ! ! !!! ! ", - " ! ! !! !! ", - " ! !! ! !! ", - " ! ! ! ! ! ", - " ! ! !! ! ", - " ! ! !! ", - " ! !!! !! ! ! ", - " ! ! ! ! !!! ", - " !!! !! ! ! ! ", - " ! !! ! ! ! ! ! ", - " !!!!! ! !! ! !! ", - " ! ! ! ! !! ! ", - " !!! ! !!! ! ! ", - " ! !! ! !!! ! ! ! ! ! ", - " ! ! !! ! ! ! !! ", - " !!! ! ! !! ! ! !!! !! ", - " ! ! ! !! ! ! ! !! ", - " !! !! ! ! ! !! ! ! !! ! !! ", - " !! ! ! ! !! !!! !! ! ! ", - " !!!!! !! !! ! ! ! ! !! !!! ", - " ! ! !!!!! !!! !!! ! !! ! ", - " !! ! ! ! !! ! ! ! ! ", - " ! !! ! !! ! ! ! !!!! !! ! ", - " !! ! ! !! !!! ! !!! ! !! ! ", - " ! !! ! !! !!!! ! ! ", - " ! !! ! ! ! ! !!! ! ", - " !!!! !! !! !! ! ! ! !!! ! ! !! ! ! ! ", - " ! ! !! !! ! ! ! ! !!! ! !! ! !!!! ", - " !!! !! !! !!!!!!! !!!!! !!!! !! !!!!!! !!!!! !!! ! !! !! !! ! !! !! ", - " !!!! !! ! ! !! !! !! !!!! ! !! !! !! !!!!! ! ! ! ! ! ", - " ! !!! ! !! !! !! !!!! ! !! !! !! !! ! !! !! ! ! ! ", - " !!!! !!! ! !! !! !!!! !!!! !! !!!!!! !!!!! ! ! ! ! !! !!! ", - " ! ! ! ! !!!!!! !! ", - " !!! ! !! ! ! ! ! ! ! ", - " ! ! !! ! ! ! ! !! ! ", - " !!!! !!!!!! ! ! ! ! ! !! !! ", - " !!!!! !!!!!! ! ! !!! !! !! ! ! ", - " !! !! !!!! !!! !!! !! !!!! !! !!!!!! !!! !! !! ! ! ", - " !!!!! !!!!!!! !! !! !! ! !! !!! ! ! !! ! !! ! !!!!! ", - " !! !! !!!!! !!!!!!!!! !! !!!!! !!! ! ! !! ! ! ! ! ", - " !!!!! !!!!!!!!!!!!!!! !! !!!! !! ! !!! ! !! ! ! ! ", - " ! !! !! !! !!! !! ! ", - " ! ! !!!! ! !!! ", - " ! ! !!! !! ! ! ", - " ! !!! !! !! ! ! ", - " ! ! ! ! !! ", - " ! ! ! !! ! ! ", - " ! ! ! ! ! ", - " !!! ! ! ! ", - " ! !!! ! ! ", - " !! ! !! ! ", - " ! ! ! ", - " ! ! ", - " ! ! ", - " ! ! ", - " ! ! ", - " ", - " ", - " ", - " ", - " !! !!!!! !! !!!! !! ", - " !!!!! !!!! !!!!!!!!!! !!! !!!! !!!!! !!!!! !! !!!!! !!!!! ", - " !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!! !!! !!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!! ", - " !! !!!! !!! !! !!!!! ", - " !!! !! !! !!!! !!! !! !!! !!!!!! !!! ", - " !!! !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!! !!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!! ", - " !!! !!! !! !! !!!! !! ", - " !! !! !! !!!!! !! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! ", - " !! ", - " !!!!! !! !!! ", - " !!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!! !!!!!!!!!!! ", - " !!! !! !!! ", - " !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!! ", - " !!!! ", - " !!! ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-overlap-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/text-overlap-512-512-1.0-grid-reference.json deleted file mode 100644 index baa36a1a6..000000000 --- a/tests/visual_tests/grids/text-overlap-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "keys": [ - "1", - "", - "8", - "4", - "6", - "2", - "7", - "3", - "19", - "20", - "16", - "15", - "18", - "17", - "5", - "9", - "13", - "10", - "14", - "11", - "12" - ], - "data": {}, - "grid": [ - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "&&&&&&&&&&&&&&&&&&&&$$$&&&&&&&&&&&&&&&&&&%%%%&&&&&&&&&&&&&&&&&&&!!!!!!!!!!!''''''''''''''''''''###''''''''''''''''''''!!!!!!!!!!", - "&&&&&&&&&&&&&&&&&&&&$$$&&&&&&&&&&&&&&&&&&%%%%&&&&&&&&&&&&&&&&&&&!!!!!!!!!!!''''''''''''''''''''###''''''''''''''''''''!!!!!!!!!!", - "&&&&&&&&&&&&&&&&&&&&$$$&&&&&&&&&&&&&&&&&&%%%%&&&&&&&&&&&&&&&&&&(((!!!!!!!!!''''''''''''''''''''###''''''''''''''''''''!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!*********************", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!*********************", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!*********************", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)))!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!++++!!!!!,,,!!!!!!!!!!!!!!!!!!!!----!!!!!!!!!...!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!++++!!!!!,,,!!!!!!!!!!!!!!!!!!!!----!!!!!!!!!...!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!++++!!!!!,,,!!!!!!!!!!!!!!!!!!!!----!!!!!!!!!...!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!++++!!!!!,,,!!!!!!!!!!!!!!!!!!!!----!!!!!!!!!...!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!++++!!!!!,,,!!!!!!!!!!!!!!!!!!!!----!!!!!!!!!...!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!++++!!!!!,,,!!!!!!!!!!!!!!!!!!!!----!!!!!!!!!...!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!++++!!!!!,,,!!!!!!!!!!!!!!!!!!!!----!!!!!!!!!...!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!++++!!!!!,,,!!!!!!!!!!!!!!!!!!!!----!!!!!!!!!...!!!!!!!", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!(((!!!!!!!++++!!!!!,,,!!!!!!!!!!!!!!!!!!!!----!!!!!!!!!...!!!!!!!", - "/////////////////////////////////////////%%%%///////////////////((!!!!!!!+++++++++++++++++++++++++!!!!!!!-----------------------", - "/////////////////////////////////////////%%%%///////////////////!!!!!!!!!+++++++++++++++++++++++++!!!!!!!-----------------------", - "/////////////////////////////////////////%%%%///////////////////!!!!!!!!!+++++++++++++++++++++++++!!!!!!!-----------------------", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,!!!!!!!!!!+++!!!!!!!!!!!!!!!!!!!!...!!!!!!-", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,!!!!!!!!!!+++!!!!!!!!!!!!!!!!!!!!...!!!!!!-", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,!!!!!!!!!!+++!!!!!!!!!!!!!!!!!!!!...!!!!!!-", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,!!!!!!!!!!+++!!!!!!!!!!!!!!!!!!!!...!!!!!!-", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,!!!!!!!!!!+++!!!!!!!!!!!!!!!!!!!!...!!!!!!-", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,!!!!!!!!!!+++!!!!!!!!!!!!!!!!!!!!...!!!!!!-", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,!!!!!!!!!!+++!!!!!!!!!!!!!!!!!!!!...!!!!!!-", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,!!!!!!!!!!+++!!!!!!!!!!!!!!!!!!!!...!!!!!!-", - " !!!!!!!!!!!!!!!!!!$$$!!!!!!!!!!!!!!!!!!%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,!!!!!!!!!!+++!!!!!!!!!!!!!!!!!!!!...!!!!!!-", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!00000000000000000000000000000000", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!00000000000000000000000000000000", - " !!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!00000000000000000000000000000000", - " !!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - " !!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - " !!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - " !!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - " !!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - " !!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - " !!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - " !!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - " !!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!0000!!!!!!!!!!!!!!!!!!0", - "55555555511115555555555555555555555555555555555555553335555555555555555555555555555555!!!!!!!!!!!!!!!!!!!00000000000000000000000", - "55555555511115555555555555555555555555555555555555553335555555555555555555555555555555!!!!!!!!!!!!!!!!!!!00000000000000000000000", - "55555555511115555555555555555555555555555555555555553335555555555555555555555555555555!!!!!!!!!!!!!!!!!!!00000000000000000000000", - "55555555511115555555555555555555555555555555555555553335555555555555555555555555555555!!!!!!!!!!!!!!!!!!!00000000000000000000000", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!1111!!!!!!!!!!!!!!!!!!222!!!!!!!!!!!!!!!!!!333!!!!!!!!!!!!!!!!!!4444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-overlap-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/text-overlap-512-512-2.0-grid-reference.json deleted file mode 100644 index 952c0a167..000000000 --- a/tests/visual_tests/grids/text-overlap-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "keys": [ - "1", - "", - "8", - "4", - "6", - "2", - "7", - "3", - "19", - "20", - "16", - "15", - "18", - "17", - "5", - "9", - "13", - "10", - "14", - "11", - "12" - ], - "data": {}, - "grid": [ - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "&&&&&&&&&&&&&&&&&&&$$$$$$&&&&&&&&&&&&&&&%%%%%%&&&&&&&&&&&&&&&&&&!!!!!!!!!!!''''''''''''''''''######'''''''''''''''''''!!!!!!!!!!", - "&&&&&&&&&&&&&&&&&&&$$$$$$&&&&&&&&&&&&&&&%%%%%%&&&&&&&&&&&&&&&&&&!!!!!!!!!!!''''''''''''''''''######'''''''''''''''''''!!!!!!!!!!", - "&&&&&&&&&&&&&&&&&&&$$$$$$&&&&&&&&&&&&&&&%%%%%%&&&&&&&&&&&&&&&&&&!!!!!!!!!!!''''''''''''''''''######'''''''''''''''''''!!!!!!!!!!", - "&&&&&&&&&&&&&&&&&&&$$$$$$&&&&&&&&&&&&&&&%%%%%%&&&&&&&&&&&&&&&((((((!!!!!!!!''''''''''''''''''######'''''''''''''''''''!!!!!!!!!!", - "&&&&&&&&&&&&&&&&&&&$$$$$$&&&&&&&&&&&&&&&%%%%%%&&&&&&&&&&&&&&&((((((!!!!!!!!''''''''''''''''''######'''''''''''''''''''!!!!!!!!!!", - "&&&&&&&&&&&&&&&&&&&$$$$$$&&&&&&&&&&&&&&&%%%%%%&&&&&&&&&&&&&&&((((((!!!!!!!!''''''''''''''''''######'''''''''''''''''''!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!*********************", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!*********************", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!*********************", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!*********************", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!*********************", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!*********************", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!))))))!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!++++++!!,,,,,,,!!!!!!!!!!!!!!!!!------!!!!!!!......!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!++++++!!,,,,,,,!!!!!!!!!!!!!!!!!------!!!!!!!......!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!++++++!!,,,,,,,!!!!!!!!!!!!!!!!!------!!!!!!!......!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!++++++!!,,,,,,,!!!!!!!!!!!!!!!!!------!!!!!!!......!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!++++++!!,,,,,,,!!!!!!!!!!!!!!!!!------!!!!!!!......!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!++++++!!,,,,,,,!!!!!!!!!!!!!!!!!------!!!!!!!......!!!!!", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!((((((!!!!!++++++!!,,,,,,,!!!!!!!!!!!!!!!!!------!!!!!!!......!!!!!", - "////////////////////////////////////////%%%%%%//////////////////(((!!!!!+++++++++++++++++++++++++++!!!!!------------------------", - "////////////////////////////////////////%%%%%%//////////////////(((!!!!!+++++++++++++++++++++++++++!!!!!------------------------", - "////////////////////////////////////////%%%%%%//////////////////(((!!!!!+++++++++++++++++++++++++++!!!!!------------------------", - "////////////////////////////////////////%%%%%%//////////////////!!!!!!!!+++++++++++++++++++++++++++!!!!!------------------------", - "////////////////////////////////////////%%%%%%//////////////////!!!!!!!!+++++++++++++++++++++++++++!!!!!------------------------", - "////////////////////////////////////////%%%%%%//////////////////!!!!!!!!+++++++++++++++++++++++++++!!!!!------------------------", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,,,,,!!!!!!++++++!!!!!!!!!!!!!!!!!!......!!---", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,,,,,!!!!!!++++++!!!!!!!!!!!!!!!!!!......!!---", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,,,,,!!!!!!++++++!!!!!!!!!!!!!!!!!!......!!---", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,,,,,!!!!!!++++++!!!!!!!!!!!!!!!!!!......!!---", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,,,,,!!!!!!++++++!!!!!!!!!!!!!!!!!!......!!---", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,,,,,!!!!!!++++++!!!!!!!!!!!!!!!!!!......!!---", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,,,,,!!!!!!++++++!!!!!!!!!!!!!!!!!!......!!---", - " !!!!!!!!!!!!!!!!$$$$$$!!!!!!!!!!!!!!!%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,,,,,,,!!!!!!++++++!!!!!!!!!!!!!!!!!!......!!---", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!00000000000000000000000000000000", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!00000000000000000000000000000000", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!00000000000000000000000000000000", - " !!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!00000000000000000000000000000000", - " !!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!00000000000000000000000000000000", - " !!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!00000000000000000000000000000000", - " !!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - " !!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - " !!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - " !!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - " !!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - " !!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - " !!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!000000!!!!!!!!!!!!!!!000", - "55555555111111555555555555555555555555555555555555533333355555555555555555555555555555!!!!!!!!!!!!!!!!!!000000000000000000000000", - "55555555111111555555555555555555555555555555555555533333355555555555555555555555555555!!!!!!!!!!!!!!!!!!000000000000000000000000", - "55555555111111555555555555555555555555555555555555533333355555555555555555555555555555!!!!!!!!!!!!!!!!!!000000000000000000000000", - "55555555111111555555555555555555555555555555555555533333355555555555555555555555555555!!!!!!!!!!!!!!!!!!000000000000000000000000", - "55555555111111555555555555555555555555555555555555533333355555555555555555555555555555!!!!!!!!!!!!!!!!!!000000000000000000000000", - "55555555111111555555555555555555555555555555555555533333355555555555555555555555555555!!!!!!!!!!!!!!!!!!000000000000000000000000", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!111111!!!!!!!!!!!!!!!222222!!!!!!!!!!!!!!!!333333!!!!!!!!!!!!!!!444444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-spacing-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/text-spacing-512-512-1.0-grid-reference.json deleted file mode 100644 index 6c7be17f9..000000000 --- a/tests/visual_tests/grids/text-spacing-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "keys": [ - "", - "1", - "2", - "10", - "11", - "14", - "16", - "12", - "13", - "15", - "3", - "4", - "5", - "6", - "17", - "7", - "8", - "9" - ], - "data": {}, - "grid": [ - " !!!! #### $$$ %%% &&&&&&&&&&&& ", - " !!! #### $$$$ %%%% &&&&&&&&&&&&&& ", - " !!!! #### $$$$ %%% &&&&&&&&&&& ", - " !!! #### $$$$ %%%% &&&&&&&&& ", - " !!!! #### $$$$ %%% &&&&&&&& ", - " !!! #### $$$$ %%%% &&&&&& ", - " !!!! #### $$$$ %%% &&&&&& ", - " !!! #### $$$$ %%%% &&&&& ", - " !!!! #### $$$$ %%% &&&&& ", - " !!! #### $$$$ %%%% ' &&&&& ", - " !!!! #### $$$$ %%% ''''''''' &&&& ", - " !!! #### $$$$ %%%% '''''''''''' &&&& ", - " !!!! #### $$$$ %%% '''''''''''''' &&&& ", - " !!! #### $$$$ %%%% '''''''''' &&&& ", - " !!!! #### $$$$ %%% '''''''' &&&& ", - " !!! #### $$$$ %%%% ''''''' &&& ", - " !!!! #### $$$$ %%% ''''''' &&&& ", - " !!! #### $$$$ %%%% '''''' &&& ", - "!!!! #### $$$$ %%% ''''' &&&& ", - "!!! #### $$$$ %%%% ''''' &&& ", - "!!! #### $$$$ %%% ''''' &&&&", - "!! #### $$$$ %%%% ''''' &&&&", - "!!! #### $$$$ %%%% '''' &&&", - "!!! ### $$$$ %%%% '''' &&&", - "!!!! #### $$$$ %%%% '''' &&&", - "!!!! ### $$$$ %%%% '''' &&", - " !!!! #### $$$$ %%%% '''' &&", - " !!!! ### $$$$ %%%% ''' &&", - " !!!! #### $$$$ %%%% '''' &&", - " !!!! ### $$$$ %%%% ''' &&", - " !!!! #### $$$$ %%%% '''' &&", - " !!!! ### $$$$ %%%% ''' &&", - " !!!! #### $$$$ %%%% ''' &", - " !!!! ### $$$$ %%%% '''' ", - " !!!! #### $$$$ %%%% '''' ", - " !!!! ### $$$$ %%%% ''' ", - " !!!! #### $$$$ %%%% ''' ", - " !!!! ### $$$$ %%%% ''' ", - " !!!! #### $$$$ %%%% ''' ", - " !!!! ### $$$$ %%%% ''' ", - " !!!! #### $$$$ %%%% '''' ", - " !!!! ### $$$$ %%%% '''' ", - " !!!! #### $$$$ %%%% '''' ", - " !!!! ### $$$$ %%%% '''' ", - " !! # $$ %% ''' ", - " ''' ", - " ''' ", - " ''' ", - " ''' ", - " ''' ", - " '''' ", - " '''' ", - " (( )) ''' **", - " (((( )))) '''' **", - " (((( )))) '''' **", - " (((( )))) '''' **", - " (((( )))) '''' **", - " (((( )))) '''' **", - " (((( )))) '''' **", - " (((( )))) '''' **", - " (((( )))) ''''' ***", - " (((( )))) '''' ***", - " (((( )))) '''' ***", - "++++++++++++ (((( )))) '''' ****", - "+++++++++++++ (((( )))) ''''' *** ", - "++++++++++++ (((( )))) ''''' **** ", - " (((( )))) ''''' **** ", - " (((( )))) '''''' **** ", - " (((( )))) '''''' **** ", - " (((( )))) ''''''' **** ", - " (((( )))) '''''''' **** ", - " (((( )))) ''''''''''' **** ", - " (((( )))) ''''''''''''''' **** ", - ",,,,,,,,,,,,,,,,,,,,,, (((( )))) ''''''''''' ***** ", - ",,,,,,,,,,,,,,,,,,,,,,, (((( )))) '''''''' ***** ", - ",,,,,,,,,,,,,,,,,,,,,,, (((( )))) ***** ", - ",,,,,,,,,,,,,,,,,,,,,, (((( )))) ***** ", - " (((( )))) ***** ", - " (((( )))) ****** ", - " (((( )))) ******* ", - " (((( )))) ******* ", - " (((( )))) ********* ", - " (((( )))) ************* ", - " (((( )))) ************* ", - "---------------------------------- (((( )))) *********** ", - "---------------------------------- (((( )))) ***** ", - "---------------------------------- (((( )))) ", - " (((( )))) ", - " (((( )))) ", - " (((( )))) ", - " (((( )))) ", - " (((( )))) ", - " (((( )))) ", - " (((( )))) ", - " (((( )))) ", - "............................................ (((( )))) ", - "............................................. ((( ))) //////// ", - "............................................ ((( ))) ///////////// ", - " //////////////// ", - " /////// //////// /", - " ///// ////// //", - " ///// ////// ///", - " //// ////// ////", - " // ////// //// ", - " ///////// /////// ", - "00000000000000000000000000000000000000000000000000000000000000000 //////////////// ", - "000000000000000000000000000000000000000000000000000000000000000000 ////////////// ", - "000000000000000000000000000000000000000000000000000000000000000000 /////// ", - "00000000000000000000000000000000000000000000000000000000000000000 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222" - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-spacing-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/text-spacing-512-512-2.0-grid-reference.json deleted file mode 100644 index d6ad24460..000000000 --- a/tests/visual_tests/grids/text-spacing-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "keys": [ - "", - "1", - "2", - "10", - "11", - "14", - "16", - "12", - "13", - "15", - "3", - "4", - "5", - "6", - "17", - "7", - "8", - "9" - ], - "data": {}, - "grid": [ - " !!!!!!! ###### $$$$$$$ %%%%%%% &&&&&&&&&&&&&&&&&& ", - " !!!!!!! ####### $$$$$$$ %%%%%%% &&&&&&&&&&&&&&&&&&& ", - " !!!!!!!! ####### $$$$$$$ %%%%%%% &&&&&&&&&&&&&&&&&&&& ", - " !!!!!!! ####### $$$$$$$ %%%%%%% &&&&&&&&&&&&&&&&&&&& ", - " !!!!!!!! ####### $$$$$$$ %%%%%%% &&&&&&&&&&&&&&& ", - " !!!!!!! ####### $$$$$$$ %%%%%%% &&&&&&&&&&&& ", - " !!!!!!!! ####### $$$$$$$ %%%%%%% &&&&&&&&&&& ", - " !!!!!!! ####### $$$$$$$ %%%%%%% &&&&&&&&&& ", - " !!!!!!!! ####### $$$$$$$ %%%%%%% ''''''' &&&&&&&&& ", - " !!!!!!! ####### $$$$$$$ %%%%%%% '''''''''''' &&&&&&&&& ", - " !!!!!!!! ####### $$$$$$$ %%%%%%% '''''''''''''''' &&&&&&&&& ", - " !!!!!!! ####### $$$$$$$ %%%%%%% '''''''''''''''''' &&&&&&&&& ", - " !!!!!!!! ####### $$$$$$$ %%%%%%% ''''''''''''''''''' &&&&&&&& ", - " !!!!!!! ####### $$$$$$$ %%%%%%% ''''''''''''''''''''' &&&&&&&& ", - "!!!!!!!! ####### $$$$$$$ %%%%%%% '''''''''''''''''' &&&&&&&& ", - "!!!!!!! ####### $$$$$$$ %%%%%%% '''''''''''''' &&&&&&& ", - "!!!!!!! ####### $$$$$$$ %%%%%%% '''''''''''' &&&&&&& ", - "!!!!!! ####### $$$$$$$ %%%%%%% ''''''''''' &&&&&&&", - "!!!!!! ####### $$$$$$$ %%%%%%% '''''''''' &&&&&&&", - "!!!!! ####### $$$$$$$ %%%%%%% ''''''''' &&&&&&", - "!!!!! ####### $$$$$$$ %%%%%%% ''''''''' &&&&&&", - "!!!! ###### $$$$$$$ %%%%%%% '''''''' &&&&&", - "!!!! ####### $$$$$$ %%%%%% '''''''' &&&&&", - "!!!!! ####### $$$$$$ %%%%%% '''''''' &&&&&", - "!!!!! ######## $$$$$$ %%%%%% '''''''' &&&&", - "!!!!!! ####### $$$$$$ %%%%%% '''''''' &&&&", - "!!!!!! ######## $$$$$$ %%%%%% '''''''' &&&&", - "!!!!!!! ####### $$$$$$ %%%%%% ''''''' &&&&", - "!!!!!!! ######## $$$$$$ %%%%%% ''''''' &&&&", - " !!!!!!! ####### $$$$$$ %%%%%% ''''''' &&&&", - " !!!!!!! ######## $$$$$$ %%%%%% ''''''' &&&&", - " !!!!!!! ####### $$$$$$ %%%%%% ''''''' &&&", - " !!!!!!! ######## $$$$$$ %%%%%% ''''''' &&&", - " !!!!!!! ####### $$$$$$ %%%%%% '''''' &&", - " !!!!!!! ######## $$$$$$ %%%%%% '''''' ", - " !!!!!!! ####### $$$$$$ %%%%%% ''''''' ", - " !!!!!!! ######## $$$$$$ %%%%%% ''''''' ", - " !!!!!!! ####### $$$$$$ %%%%%% ''''''' ", - " !!!!!!! ######## $$$$$$ %%%%%% '''''' ", - " !!!!!!! ####### $$$$$$ %%%%%% '''''' ", - " !!!!!!! ######## $$$$$$ %%%%%% '''''' ", - " !!!!!!! ####### $$$$$$ %%%%%% '''''' ", - " !!!!!!! ####### $$$$$$ %%%%%% '''''' ", - " !!!!!! ###### $$$$$$ %%%%%% '''''' ", - " !!!!!! ###### $$$$$$ %%%%%% '''''' ", - " !!!! #### $$$$ %%%% '''''' ", - " '''''' ", - " ''''''' ", - " ''''''' ", - " ''''''' ", - " '''''' ", - " (((( )))) ''''''' ***", - " (((((( )))))) ''''''' ***", - " (((((( )))))) '''''' ***", - " (((((( )))))) ''''''' ****", - " (((((( )))))) ''''''' ****", - " (((((( )))))) ''''''' ****", - " (((((( )))))) ''''''' ****", - " (((((( )))))) ''''''' ****", - " (((((( )))))) '''''''' ****", - " (((((( )))))) ''''''' ****", - "++++++++++++ (((((( )))))) '''''''' *****", - "++++++++++++++ (((((( )))))) '''''''' *****", - "++++++++++++++ (((((( )))))) '''''''' *****", - "++++++++++++++ (((((( )))))) ''''''''' ******", - "++++++++++++++ (((((( )))))) '''''''''' ******", - "+++++++++++++ (((((( )))))) '''''''''' *******", - " (((((( )))))) ''''''''''' *******", - " (((((( )))))) ''''''''''''' ******* ", - " (((((( )))))) ''''''''''''''' ******** ", - " (((((( )))))) ''''''''''''''''''' ******* ", - " (((((( )))))) ''''''''''''''''''''' ******** ", - ",,,,,,,,,,,,,,,,,,,,,,,, (((((( )))))) '''''''''''''''''''' ******** ", - ",,,,,,,,,,,,,,,,,,,,,,,, (((((( )))))) '''''''''''''''''' ******** ", - ",,,,,,,,,,,,,,,,,,,,,,,,, (((((( )))))) ''''''''''''''' ********* ", - ",,,,,,,,,,,,,,,,,,,,,,,,, ((((((( ))))))) ''''''''''' ********* ", - ",,,,,,,,,,,,,,,,,,,,,,,,, ((((((( ))))))) '''' ********** ", - ",,,,,,,,,,,,,,,,,,,,,,,, ((((((( ))))))) ********** ", - " ((((((( ))))))) *********** ", - " ((((((( ))))))) ************* ", - " ((((((( ))))))) *************** ", - " ((((((( ))))))) ******************** ", - " ((((((( ))))))) ********************* ", - "----------------------------------- ((((((( ))))))) ******************* ", - "----------------------------------- ((((((( ))))))) ***************** ", - "----------------------------------- ((((((( ))))))) ************** ", - "----------------------------------- ((((((( ))))))) ********** ", - "----------------------------------- ((((((( ))))))) ", - "---------------------------------- ((((((( ))))))) ", - " ((((((( ))))))) ", - " ((((((( ))))))) ", - " ((((((( ))))))) ", - " ((((((( ))))))) ", - "............................................ ((((((( ))))))) ", - ".............................................. ((((((( ))))))) //// ", - ".............................................. ((((((( ))))))) ////////// ", - ".............................................. ((((((( ))))))) /////////////// ", - ".............................................. (((((( )))))) /////////////////// ", - "............................................. ((((( ))))) ///////////////////// //", - " //////////////////////// ///", - " ////////////////////////// ////", - " ////////// ///////////// /////", - " //////// //////////// ///////", - " /////// /////////////////////////", - "000000000000000000000000000000000000000000000000000000000000000000 ///// ///////////////////////", - "0000000000000000000000000000000000000000000000000000000000000000000 //////////////////////", - "0000000000000000000000000000000000000000000000000000000000000000000 /////////////////// ", - "0000000000000000000000000000000000000000000000000000000000000000000 //////////////// ", - "0000000000000000000000000000000000000000000000000000000000000000000 /////////// ", - "000000000000000000000000000000000000000000000000000000000000000000 /// ", - " ", - " ", - " ", - " ", - " ", - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", - " ", - " ", - " ", - " ", - "22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222", - "22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222", - "22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222" - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-ttc-font-600-400-1.0-grid-reference.json b/tests/visual_tests/grids/text-ttc-font-600-400-1.0-grid-reference.json deleted file mode 100644 index 85e04d5ee..000000000 --- a/tests/visual_tests/grids/text-ttc-font-600-400-1.0-grid-reference.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "keys": [ - "", - "1", - "9", - "2", - "10", - "3", - "11", - "4", - "12", - "5", - "13", - "6", - "14", - "7", - "15", - "8", - "16" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !!! !!! # # ### ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " $$ $ %% % ", - " $ $ $ $$$$ %% % %%%% ", - " $$ $$ $ $$$$ %% %% % %%%% ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " & & & ' ' ' ", - " & && & & &&& & ' '' ' ' ''''' ", - " & &&& && & && & ' ''' '' ''' '' ' ", - " ", - " ", - " ", - " ", - " ", - " ", - " ( (( ) )) ", - " ( ( (( (( ( (( (( ( ) ) )) )) ) )) ) ) ", - " (( ( ( ( (( ( ( (( )) ) ) ) )) ) ) )) ", - " (( (( ( ( ( ( ( )) ) ) ) ) ) ) ) ", - " ( (( (( ( (( ( ( ((( ) )) )) ) )) ) ) ))) ", - " ", - " ", - " ", - " ", - " ", - " ** * * *** ++ + + +++ ", - " ** * ****** ** * *** *** *** ++ + ++ +++ ++ + +++ +++ +++ ", - " * * ** * * * * ** * * * * + + ++ + + + + ++ + + + + ", - " * *** * * * * * * * * * ** + +++ + + + + + + + + + ++ ", - " * ** *** ***** *** *** * * *** + ++ +++ +++++ +++ +++ + + +++ ", - " ", - " ", - " ", - " ", - " ,, , ,,, -- - - ---- ", - " ,, , ,, ,,,, --- - - - - -- -- - - - ", - " ,,, , ,,,, ,,,,,,, ,, ,,,,,,,,,,,,---- - -------- ---- -- --------- ---- ", - " , ,,, ,, ,,,, ,, ,, ,,, ,,,, ,,,,,---- - -- -- - -- -- --- ---- - -- ", - " , ,,, ,, ,,,, , ,, ,, ,,,,,, ,, ,,-- --- - -- - -- -- --------- - ---- ", - " , ,, ,, ,,,, ,, ,, ,,,, , ,,,, ,,,,,-- -- -- -- - - -- - ---- ---- - -- ", - " , , ,,, ,, ,,, ,,,, ,,,,,, ,,,,,-- -- ---- ------- ------------ - ---- ", - " ", - " ", - " ", - " .. . .. .... // / // //// ", - " ... . ... ... .. .. ... .....///../ /// /// /// // /// ///// /// ", - " ... . .............. ... ..........///../ ////////////// /// //// ///// //// ", - " . .. . .. .. .. .. .. .... .... ./.// / // // // // // //// //// / // ", - " . ... . . .. .. .. .. ....... ./ //// / / // // // // /////// / /// ", - " . ... .. .. .. .. .. ... .... ./ /// // // // // // / / //// / / ", - " . .. ..... ... .... ..... ....... ./...// ///// /// //// ///// /////// / //// ", - " ", - " ", - " 00 00 0000 11 11 1111 ", - " 00 00 0 00000 11 11 1 11111 ", - " 000 00 000 0000 000 00 000 111001100111 1111 111 11 111 11111 1111 ", - " 0000 00 00000 0000 00000 000 00000 1111011011111 1111 11111 11 11111 111111 1111 ", - " 0 00 00 00 00 0 00 00 00000 00 1011011011 11 1 11 11 11111 11 11 11 11 ", - " 0 0000 0 00 0 00 0 000 00000 10 11110100 11 1 11 1 111 11111 11 11 1111 ", - " 0 0000 00 00 0 00 00 0 00 00 10 1111 110011 1 11 11 1 11 11 11 11 111 ", - " 0 000 00000 000 00000 00000 00000 10 111011111 111111111 11111 11111 11 11 11111 ", - " 0 00 0000 000 0000 00000 00000 10 111001111 111 1111 1111 11111 11 11 1111 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-ttc-font-600-400-2.0-grid-reference.json b/tests/visual_tests/grids/text-ttc-font-600-400-2.0-grid-reference.json deleted file mode 100644 index 84058b5ac..000000000 --- a/tests/visual_tests/grids/text-ttc-font-600-400-2.0-grid-reference.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "keys": [ - "", - "1", - "9", - "2", - "10", - "3", - "11", - "4", - "12", - "5", - "13", - "14", - "6", - "7", - "15", - "8", - "16" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " !! ! ## # ", - " ! ! ! !!!! # # #### ", - " !! !! ! !!!! ## ## # #### ", - " ", - " ", - " ", - " ", - " ", - " ", - " $ $$ % %% ", - " $ $ $$ $$ $ $$ $$ $ % % %% %% % %% % % ", - " $$ $$ $ $ $$ $ $$ %% % % % %% % % %% ", - " $$ $$ $ $ $ $ $ %% % % % % % % ", - " $ $$ $$ $ $$ $ $ $$$ % %% %% % %% % % %%% ", - " ", - " ", - " ", - " ", - " && & &&& '' ' ''' ", - " && & && &&&& '' ' '' '''' ", - " &&& & &&&& &&&&&&& && &&&&&&&&&&&&& ''' ' '''' ''''''' '' ''''''''''''' ", - " & &&& && &&&& && && &&& &&&& &&&&& ' ''' '' '''' '' '' '''' '''' ''''' ", - " & &&& && &&&& & && && &&&&&& && &&& ' ''' ' '''' ' '' '' '''''' '' ''' ", - " & && && &&&& && && &&&& & &&&& &&&&&& ' '' '' '''' '' '' '''''' '''' '''''' ", - " & & &&& &&& &&& &&&& &&&&&& &&&&&& ' ' ''' ''' ''' '''' '''''' '''''' ", - " ", - " ", - " (( (( (((( )) )) )))) ", - " (( (( ( ((((( )) )) ) ))))) ", - " ((( (( ((( (((( ((( (( ((( )))(())(())) )))) ))) )) ))) ))))) )))) ", - " (((( (( ((((( (((( ((((( (( ((((( ))))())())))) )))) ))))) )) ))))) )))))) )))) ", - " ( (( (( (( (( ( (( (( ((((( (( )())())()) )) ) )) )) ))))) )) )) )) )) ", - " ( (((( ( (( ( (( ( ((( ((((( )( ))))()(( )) ) )) ) ))) ))))) )) )) )))) ", - " ( (((( (( (( ( (( (( ( (( (( )( )))) ))(()) ) )) )) ) )) )) )) )) ))) ", - " ( ((( ((((( ((( ((((( ((((( ((((( )( )))())))) ))))))))) ))))) ))))) )) )) ))))) ", - " ( (( (((( ((( (((( ((((( ((((( )( )))(()))) ))) )))) )))) ))))) )) )) )))) ", - " *** ** ***+++ ++ ++++ ", - " *** ** ** ****+++ ++ ++ ++++++ ", - " **** ** ** ** ++++ ++ ++ +++ + ", - " ***** ** ****** ***** ***** *** ++++***++ ++++++ +++++**+++++ +++ +++++ ++++++ +++++ ", - " ** ** ** ****** ***** ******* *** ++ ++* ++ ++++++*+++++*+++++++ +++ ++ ++ +++++++ ++++++ ", - " ** *** ** *** *** ** ** ** ****++ +++ ++*+++ +++ ++* ++ ++ +++++ ++ ++ ++ +++ ", - " ** ** ** ** ** ** ** ** **++ ++*++*++* ++ ++**+++ ++ ++++ ++++++ ++ ++ +++++ ", - " ** **** ** ** ** ** ** ++ *+++++*++* ++ ++**+++ ++ ++ +++ ++ ++ ++ ++++ ", - " ** **** *** *** ** ** ** ++ **++++*+++ +++ ++ *++ ++ ,, ++ +++ ++ ++ ++ ", - " --- **-- *** ****** **** *******,,, ***-,,,--**+++* ++++++* ++++*+++++++ ++,,,,,,,,+++++ ++ ++ ++++++ ", - " ---- **-- *** **** -- *** ***** ,,,,*---,,,--**+++* *+++,,, *+++* +++++ +,,,,,,,,,+++++ ++ ++ +++++ ", - " ---- -- --- ,,,,,---,,,-- ,,, ,,,, ,, ", - " ----- -- ----- ------ ----- ,,,,,---,,, ,,,,,,, ,,,,,,,-,,,,,,,-- ,,, ,,,,,,, ,,,,,,,, ,,,,,,, ", - " ------ -- -------- ------ -------- ,,,,,,--,,, ,,,,,,,,, ,,,,,,,,,,,,,,,,-- ,,,, ,,,,,,,, ,,,,,,,,, ,,,,,,,, ", - " ------ -- --------------- ---------,, ,,,--,,, ,,,,-,,,, ,,,---,,,,-,,,,, ,,,,, ,,, ,,,, ,,,, ,,,, ,,, ,, ", - " -- ---- -- --- --- --- --- ---,, ,,,,-,,,- ,,, ,,, ,,, ,,,---,,,, ,,,,,,, ,,, ,,, ,,, ,,,, ", - " -- --- -- --- --- --- -- ---,, ,,,,,,,-,,,-----,,, ,,, ,,,----,,, ,,,,,, ,,,,,,,, ,, ,,, ,,,,,, ", - " -- ------ -- --- --- -- ---,, ,,,,,,-,,,-----,,, ,,, ,,, ---,,,- ,,,, ,,,,,,,,, ,, ,,, ,,,,,,, ", - " .... -- ...---- --- --- --- --- ////,, ,///,,.,,,,- ,,,, ,,, ,,, ,,,- ////// ,,,, ,,, ,, ,,, ,,,,, ", - " .... -- ...---- --- ---...-- --- ////,, -///,,..,,,- ,,, ///, ,,,-- ,,,,- /////////,,, ,,,, ,, ,,, ,,, ", - " ..... -- ...---- --------...----------/////, -///,,..,,,,,,,,, ///,,,,,,,,,,,,,-- ,/////////,,,,,,,,, ,, ,,, ,,,,,,,, ", - " ...... -- ... --- .-------...----- --.-////// -///,,- .,/,,,,,- ///,,,,-,,,/,,,,- . ,///,,,,/ ,,,,,,,,, ,, //, ,,,,,,,, ", - " ...... ... ....... ........ .....////// ///,, ///////,.////////,./////// .......///,,, ,//////// ,/////////,,,//////// ", - " ....... ... ......... ........ ....../////// ///. /////////.////////./////////.......//// //////// ////////// //////// ", - " ... .... ... .... .... ... .... ./// //// ///..//// ///// ./// ..//// .////... .////// /// /// ///// /// /// // ", - " ... .... ... .... ... ... ... ///.//// ///.//// //// /// ../// ..///.... /////// /// //// /// //// ", - " ... .... ... ... ... ... ... ///. //// ///.///.. ///../// ../// ..////..... /////// /////// /// /// ////// ", - " 0000 ... 000..... ... ... ... .1111 ///. 111/////0///00 ..///../// ../// ...///....... 111111 ///////// /// /// /////// ", - " 0000 ... 000..... ... ... ... .1111 ///. 111/////0///0000./// /// ../// ..//// .....1111111111//// // /// /// ///// ", - " 00000 ... 000..... .... ....00... .11111 ///. 111/////0////000////11/// ../// ../// ...1111111111// /// /// /// /// ", - " 000000... 000..... .... ....000... .111111/// 111/////00////0////111/// ..//// .////.. ./11111///11/// //// /// /// // /// ", - " 000000... 000.....000000....00000000.. 111111/// 111/////111111////11111111//.111111///00..../1111///// /////111111/// 111/111111/////1111111 ", - " 0000000.. 000 ...00000000..000000000..01111111// 111 //111111111//111111111//1111111110000.../1111//// //111111111// 11111111111///11111111 ", - " 00000000 000 0000000000 000000000 0011111111 111 01111111111 111111111011111111110000 001111100 1111111111 11111111111 111111111 ", - " 000 0000 000 00000 00000 000 00111 11110 111 111100011111 111 00011110001111000 000111111 11 1111 11111 111 111 11 ", - " 000 0000 000 0000 0000 000 000111 1111 111 111100001111 111 0111100001111000 00001111111 111 1111 111 1111 ", - " 000 00000 000 000 000 000 000111 11111 111 111000000111 111000011110000 111000 0000011111111 11111111 1111 111 1111111 ", - " 000 0000 000 000 000 000 000111 1111 111 111 000111 01110000111 000 111000 000000011111 1111111111 111 111 11111111 ", - " 000 0000000 000 000 000 000111 01111111 111 00111001110000111 000 111000 0000001111 11111111111 111 111 111111 ", - " 000 0000000 0000 0000 000 000111 01111111 111 111100111 01111000 111000 00000111 1111 111 111 111 11111 ", - " 000 000000 0000 0000 000 000111 000111111 1111 111100111 001111000 1111000 000111 111 1111 111 111 1111 ", - " 000 00000 00000 0000 0000 00 00111 0000111111 01111011111 001111011011111011111000 0011111111111 1111 11111 111 111 111 11111 ", - " 000 00000 0000000000 0000000 0011100000 11111 01111111111 00111111101111111111 000 001111111111 11111111111 111 111 111111111 ", - " 000 0000 00000000 000000 01110000 1111 0011111111 001111110011111111 000 00111111111 1111111111 111 111 111111111 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-typographic-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/text-typographic-512-512-1.0-grid-reference.json deleted file mode 100644 index cd1fdc816..000000000 --- a/tests/visual_tests/grids/text-typographic-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "keys": [ - "2", - "", - "1" - ], - "data": {}, - "grid": [ - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###########!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!############!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##########!!!!", - " ! ! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!!!!!!!!!!", - " ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!#########", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##!!#!!!!!!!!", - " !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!", - "!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!", - "!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!#!!!!!!!!", - "!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!", - "!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!", - "!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!", - "!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##!#######!!!!!!!", - "!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!############!!!!!!!", - "!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!########!###!!!!!!!", - "!!!!!!!! !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###############!!####!!!!!!", - "!!!!!!!! !!!! !!! !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!!####!##!!######!!!!!!", - "!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!###############!!!!!!!", - "!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##!!###############!!!!!!!", - "!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#############!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##!!##!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##!###!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##################!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###############!###!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!! !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###############!###!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#############!!!####!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!###############!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!###############!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!###############!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##!####!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !! !!!!!!!!!!!!!!!!!!!!!!!!!!#############!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!#############!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!##############!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! !! !!!!!!!!!!!!!!!!!!!!!!!##############!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!###!!##############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!###!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!###!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!###!##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!####!##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!###!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!###!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!##!!!!!!!####!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!##########!!!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! ###########!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! ###########!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! !!!!!! !!!!###!##!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!#############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!##############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !##############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ####!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##!! ####!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######### !# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!########## !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!!#### # # # !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!######## ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!############# ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!#!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##!!!!!!!########!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#####!##!#########!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!##!#####!###!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!########!!!###!!!####!!!!!!!!!!!!!! !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!!####!##!!######!!!!!!!!!!!!!! !!!! !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!###############!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!###############!!!!!!!!!!!!!!!!! !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!#############!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!##!##!!#######!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!#######!!#######!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! !!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!#####!!!!######!!####!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!####!!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!###!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!###!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! ! !!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!###!##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!####!##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!####!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!###!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!##!####!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!##########!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!", - "!!!!!!!!!!!!!###############!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!", - "!!!!!!!!!!!!####!##########!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!", - "!!!!!!!!!!!!###!!###!####!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!", - "!!!!!!!!!!!####!!##############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!! !!!!!!!!!!!", - "!!!!!!!!!!!####!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!", - "!!!!!!!!!!!!###!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!! !! !!!!!!!!!!!", - "!!!!!!!!!!!!###!#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!", - "!!!!!!!!!!!!###!#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!", - "!!!!!!!!!!!!###!#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!", - "!!!!!!!!!!!!###!#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!", - "!!!!!!!!!!!!###!#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!", - "!!!!!!##!!!!###!#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! !!!!!!!!!!!!", - "!!!############!#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! !!!!!!!!!!!!" - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-typographic-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/text-typographic-512-512-2.0-grid-reference.json deleted file mode 100644 index 83c913e42..000000000 --- a/tests/visual_tests/grids/text-typographic-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "keys": [ - "2", - "", - "1" - ], - "data": {}, - "grid": [ - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#####!####!!!", - " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!################", - "! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#############!!!", - "! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#########!###!!!", - "! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#########!!!!!!!", - "!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!!!", - " !!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!!!!!", - " ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!!####", - " ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!######", - " ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!######", - " ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!#######", - " ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!###########!!######!", - "!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!!###########!!######!", - "!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#####!!###########!!######!", - "!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!################!!!#######!", - "!! !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!################!!!#######!", - "!! !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#################!!!#######!", - "!! !!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!########!!!!#######!", - "!! !!!!!! !!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!#####!!!!!######!", - "!! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!################!", - "!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!###############!!", - "!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!#################!!", - "!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!##################!!", - "!!!!!!! ! !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!########!###############!!!!!", - "!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!#########!###############!!!!!", - "!!!!!!!!!!!!!!! !!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!!##################!!!!###!!!!!!!", - "!!!!!!!!!!!!!!! !!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!########################!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!########!##################!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##################!!!#######!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##########!!######!!!#######!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!########!!!!!####!!!!#######!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!! !!! !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!########!!!!!!!!!!##########!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!! ! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!################!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!################!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##########################!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!! !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##########################!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#########################!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!##!!!###########!!###############!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!####!!############!#########!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!##################!!!#####!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!##################!!!#####!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!! !!!!!!!!!!!!!!!!!!!!!###############!!!!!!#####!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!! !!!!!!!!!!!!!!!!!!!!################!!!!!!#####!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!! !!!!!!!!!!!!!!!!!!!!#######!!!!!!!!!!!!!#######!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!! !!!! !!!!!!!!!!!!!!!!!!!!#######!!!!!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! !!!!!!!!!!!!!!!!!!!!#######!!!!!#############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!#######!!!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!#######!!################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!#######!!################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!#######!!################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!##########!!!############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!###########!!!##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! ##############!!!##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!###########!!#####!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!########!!!!!#####!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!! !!!########!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!! !!!!!!!!!!!!!!#######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!! !!!!!!!!!!!!!!#######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!! !!!!################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!###################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!###################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!! !# !#################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##### ###########!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######### !###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!############ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#### ##### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#### ####! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#### ####! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#### !!! ###### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##### ### ###### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##### ### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##### ## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######! # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####!!!!# # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##!!!###########!!!!# # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###!!###########!!!!####!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!################!!!!!##!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#################!!!######!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!################!!!######!!! !!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!##################!!!######!!! !!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!###############!!!!!!######!!! !!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!!!!!!!#######!!! !!!! !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!!!###########!!!!! !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!######!!!!################!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#!!!!###################!!!! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#!!!!###################!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#!!!!#################!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!###!!!!!!!!!#!!!!##############!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!####!!###!!!#!!!!#########!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!!!!#############!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!########!####!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! !!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!##############!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! !!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!##########!!!!!!!!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! !!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!########!!!!!!!!!!!!!#######!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! !!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!########!!!!!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!#######!!!!!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! !!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!#######!!!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!#######!!!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!#######!#################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!!!!!!!!!!!!#######!#################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!!!!!!!", - "!!!!!!!!!!!!##!!!###########!!!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!", - "!!!!!!!!!!!####!!############!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!", - "!!!!!!!!!!!##################!!#######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!", - "!!!!!!!!!!!##################!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!", - "!!!!!!!!!!!###############!!!!!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!", - "!!!!!!!!!!################!!!!#######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!! !!!!!!!!!!", - "!!!!!!!!!!#######!!!!!!!!!!!!!#######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!! ! !!!!!!!!!!!", - "!!!!!!!!!!#######!!!!!!!!####!#######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!! !!!!!!!!!!!!", - "!!!!!!!!!!#######!###!!##############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!! !!!!!!!!!!!", - "!!!!!!!!!!#######!###################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! !!!!!!!!!!!", - "!!!!!!!!!!#######!################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! !!!!!!!!!!!", - "!!!!!!!!!!#######!!##############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! !!!!!!!!!!!", - "!!!!!!!!!!#######!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!! !!!!!!!!!!!!", - "!!!!!!##########!!###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!! !!!!!!!!!!!!", - "!!!!!!###########!######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!! !!!!!!!!!!!!" - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-upright-800-800-1.0-grid-reference.json b/tests/visual_tests/grids/text-upright-800-800-1.0-grid-reference.json deleted file mode 100644 index f6af257f3..000000000 --- a/tests/visual_tests/grids/text-upright-800-800-1.0-grid-reference.json +++ /dev/null @@ -1,215 +0,0 @@ -{ - "keys": [ - "", - "1", - "2", - "3", - "4", - "5", - "6", - "7" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ! ", - " !!! ", - " !!!!! ", - " !!!!!!! ", - " !!!!!!!!! ", - " !!!! !!!!! ", - " !!!! !!!!! ", - " !!!! !!!!! ", - " !!!! !!!!! ", - " !!!! # !!!!! ", - " !!!! ### !!!!! ", - " !!!! ##### !!!!! ", - " !!!! ####### !!!!! ", - " !!!!! ######### !!!!! ", - " !!!!!! ##### ##### !!!!! ", - " !!!! ##### ##### !!!!! ", - " !!!!! ##### ##### !!!!! ", - " !!!!! ##### ##### !!!!! ", - " !!!!! ##### ##### !!!!! ", - " !!!! ##### $ ##### !!!!! ", - " !!!!! ##### $$$ ##### !!!!! ", - " !!!!! ##### $$$$$ ##### !!!!! ", - " !!!! ##### $$$$$$$ ##### !!!!! ", - " !!!!! ##### $$$$$$$$$ ##### !!!!! ", - " !!!! ##### $$$$ $$$$$ ##### !!!!! ", - " !!!! ! ##### $$$$ $$$$$ ##### !!!!!! ", - " !!!! ##### $$$$ $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ % $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%%%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% & %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&&&&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& &&&&& %%%%% $$$$$ ##### !!!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& & '' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& '''''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& '''''''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& ''''' '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& ''''' '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& ''''' '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& ''''' '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((((( '''' &&&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& & ''''' (((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( (((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& ''''' (((((( (((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& ''''' (((((( (((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& ''''' (((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& ''''' ((((( (((((( '''' &&&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%%% $$$$$ ##### !!!!! ", - " !!!! ##### $$$$ %%%%% &&&& ''''' ((((( ((((( '''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((( ''' &&& %% $$$ ## !!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( '''''' &&&&& %%%% $$$$$ #### !!!!!! ", - " !!!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!!! ##### $$$$$ %%%%% &&&&& ' '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& ' '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' ' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' ' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!!! ##### $$$$$ %%%%% &&&&& ' '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((((((( ''''' &&&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ((( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ( ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!!! ##### $$$$$ %%%%% &&&&& '''' ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& '''' ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& ''''''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& ''''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!!! ##### $$$$$ %%%%% &&&&& ''''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!!! ##### $$$$$ %%%%% &&&&& ' ''' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!!! ##### $$$$$ %%%%% &&&&& ' ' &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&&& &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!!! ##### $$$$$ %%%%% &&&&& &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&&&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&&&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% &&& %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% & %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%% %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%%%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %%%% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ %% $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$ $$$$$ #### !!!!! ", - " !!!!! ##### $$$$$$$$$ #### !!!!! ", - " !!!!!! ##### $$$$$$$ #### !!!!!! ", - " !!!!! ##### $$$$$ #### !!!!! ", - " !!!!!! ##### $$$ #### !!!!! ", - " !!!!! ##### $ #### !!!!! ", - " !!!!! ##### #### !!!!! ", - " !!!!! ##### #### !!!!! ", - " !!!!!! ##### #### !!!!! ", - " !!!!! ##### #### !!!!! ", - " !!!!! ##### #### !!!!! ", - " !!!!!! ######## !!!!! ", - " !!!!! ###### !!!!! ", - " !!!!!! #### !!!!!! ", - " !!!!! ## !!!!! ", - " !!!!! !!!!! ", - " !!!!! !!!!! ", - " !!!!! !!!!! ", - " !!!!! !!!!! ", - " !!!!! !!!!! ", - " !!!!!!!!! ", - " !!!!!!! ", - " !!!!! ", - " !!! ", - " ! ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-upright-800-800-2.0-grid-reference.json b/tests/visual_tests/grids/text-upright-800-800-2.0-grid-reference.json deleted file mode 100644 index a17da3306..000000000 --- a/tests/visual_tests/grids/text-upright-800-800-2.0-grid-reference.json +++ /dev/null @@ -1,215 +0,0 @@ -{ - "keys": [ - "", - "1", - "2", - "3", - "4", - "5", - "6", - "7" - ], - "data": {}, - "grid": [ - " ", - " ! ", - " !!! ", - " !!!!! ", - " !!!!!!! ", - " !!!!!!!!! ", - " !!!!!!!!!!! ", - " !!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!!!! ", - " !!!!!!!!!###!!!!!!!!! ", - " !!!!!!!!!####!!!!!!!!!! ", - " !!!!!!!!!#######!!!!!!!!! ", - " !!!!!!!!!#########!!!!!!!!! ", - " !!!!!!!!!##########!!!!!!!!!! ", - " !!!!!!!!!#############!!!!!!!!! ", - " !!!!!!!!!##############!!!!!!!!!! ", - " !!!!!!!!!#################!!!!!!!!! ", - " !!!!!!!!!!!####### #######!#!!!!!!!!! ", - " !!!!!!!!!######### $ #######!#!!!!!!!!! ", - " !!!!!!!!!######### $$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%%%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% & %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''''''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''''''''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''''''''''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ ########!!!!!!!!!! ", - " !!!!!!!!!#!####### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #######!#!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ ########!!!!!!!!!! ", - " !!!!!!!!!#########$$$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!#########$$$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ ########!!!!!!!!!! ", - " !!!!!!!!!#########$$$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ ########!!!!!!!!!! ", - " !!!!!!!!!#########$$$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ ########!!!!!!!!!! ", - " !!!!!!!!!#########$$$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ ########!!!!!!!!!! ", - " !!!!!!!!!#########$$$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' (((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!#########$$$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&&'''''''' ((((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'&''''''' ((((((((( ((((((((( '''''''&'&&&&&&&&& %%%%%%%%%$$$$$$$$$ ########!!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&&&''''''' ((((((((( ((((((((( '''''''&&&&&&&&&&& %%%%%%%%%$$$$$$$$$ ########!!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!#########$$$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ ########!!!!!!!!!! ", - " !!!!!!!!!#########$$$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ ########!!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!!!#######$$$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #######!!!!!!!!!!! ", - " !!!!!!!!!#!####### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #######!#!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!#########$$$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!#########$$$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!#########$$$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!#########$$$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''''&&&&&&&&& %%%%%%%%%$$$$$$$$$ #########!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((((( '''''''' &&&&&&&&& %%%%%%%% $$$$$$$$$ ######## !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((( '''''' &&&&&&& %%%%%% $$$$$$$ ###### !!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((( ''''' &&&&& %%%%% $$$$$ ###### !!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( ((((((( ''''''' &&&&&&& %%%%%%% $$$$$$$ ######## !!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&'''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&''''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%%%$$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " ! !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!!!! ", - " !! !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''& &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ! ", - " !!!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''& &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!!! ", - " !!!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&&&''''''' ((((((((( ((((((((('''''''''&&&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'&''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!!! ", - " !!!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' ((((((((( (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!!! ", - " !!!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' (((((((((((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!!! ", - " !!!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' (((((((((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' (((((((((((((''''''''' '&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' (((((((((((''''''''' ''&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' (((((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!!! ", - " !!!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' (((((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' (((((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' (((''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&''''''''' (''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!!! ", - " !!!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''''''''''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''''''''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " ! !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''''''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !! !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''''''''''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''''''''' &'&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''''''' &'&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''''' &'&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'''' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&'' &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&& &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &&&%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%% &%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%%%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%%%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$%% $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$ $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$$$######### !!!!!!!!! ", - " !!!!!!!!!######### $$$######### !!!!!!!!! ", - " !!!!!!!!!######### $######### !!!!!!!!! ", - " !!!!!!!!!################## !!!!!!!!! ", - " !!!!!!!!!################ !!!!!!!!! ", - " !!!!!!!!!############## !!!!!!!!! ", - " !!!!!!!!!############ !!!!!!!!! ", - " !!!!!!!!!########## !!!!!!!!! ", - " !!!!!!!!!!######## !!!!!!!!! ! ", - " !! !!!!!!!!!###### !!!!!!!!!! ", - " ! !!!!!!!!!#### !!!!!!!!!! ", - " !!!!!!!!!!## !!!!!!!!! ", - " !!!!!!!!!! !!!!!!!!!! ", - " !!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!! ", - " !!!!!!!!! ", - " !!!!!!! ", - " !!!!! ", - " !!! ", - " ! " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-vertical-alignment-800-800-1.0-grid-reference.json b/tests/visual_tests/grids/text-vertical-alignment-800-800-1.0-grid-reference.json deleted file mode 100644 index dd3bd2a2a..000000000 --- a/tests/visual_tests/grids/text-vertical-alignment-800-800-1.0-grid-reference.json +++ /dev/null @@ -1,224 +0,0 @@ -{ - "keys": [ - "", - "9", - "8", - "4", - "5", - "7", - "16", - "6", - "12", - "2", - "10", - "13", - "14", - "11", - "3", - "15", - "1" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ! ", - " !!!! ", - " !!!!!!! !!!!! ", - " !!!!!!!!! !!!!!!! !!! ", - " !!!!!! !!!!! ! !!!!!!!! !!!!! ", - " !!!!!! !!!!!! ! !!!!!!!!!!!! !!!!!!!! ! ", - " !!!!!! !!!!! !!!!!!!!!!!!!!!! !!!!!!!!!! !!!! ", - " !!!!!! !!!!! !!!!!!! ! !!!!!!! !!!!! !!!!!! !!!!!! ", - " !!!!!! !!!!!! !!!!!!! ! !!!!!!!!! !!!!!! !!!!! !!!!! ", - " !!!!!!! !!!!!! !!!!!!! ! !!!!!!!! !!!!!! !!!!! !!!!!! ", - " !!!!!! !!!!! !!!!!!! ! ! !!!!!! !!!!! !!!!! !!!!!! ", - " !!!!!!! !!!!! !!!!!!! !!!!!!!!! !!!!!! !!!!!! !!!!! ", - " !!!!!! !!!!!! !!!!!!! !! !!!!!!! !!!!!! !!!!! !!!!!! ", - " !!!!! !!!!!! !!!!!!! !!!!!!! ! !!!!! !!!!! !!!!!! ", - " !!!! !!!!! !!!!! ! ! !!!!!!! !!!!!!! !!!!!! !!!!! ", - " !! ! !!!!! !!!!!! !!!!!!! !!!!!! !!!!!! !!!!!! ", - " !! !!!!!! !!!!! !!!!!!! !!!!!!! !!!!! !!!!! ", - " !!!!!! !!!!!! ! !!!!!!! !!!!!!! !!!!! !!!!!! ", - " !!!!! !!!!!! !!!!!!!!!!!!! !!!!!!!!!!! ", - " !!!!!!!!!!! !!!!!!!!!! !!!!!!!! ", - " !!!!!!!!! ! !!!!!!! !!!!! ", - " !!!!!! !!!!! !!! ", - " ### !!! # ! !!!! $$$ ", - " ##### ! # ##### ! $$$ ", - " ######## # ####### ## # $$$ ", - " ########### ############ ##### # ## $$$ ", - " ###### ###### ############### ######## #### $$$ ", - " ####### ##### ###### ## ##### ########## ##### $$$ ", - " ###### ##### ###### ######### ##### ##### ##### $$$ ", - " ###### ###### ######## ######### ###### ###### ###### $$$ ", - " ###### ###### ##### ## ### ##### ###### ###### ###### $$$ ", - " % ###### ##### ####### # ##### ##### ##### ##### $$$ ", - " % ####### ##### ##### # # ####### ##### ###### ###### $$$ ", - " % ###### ###### ###### ## # ###### ###### ###### ##### $$$ ", - " % #### ##### ###### # ######### ##### ##### ###### $$$ ", - " %%% ## ##### ###### # ######### # ##### ###### ###### $$$ ", - " %%% ###### ###### # ####### ###### ##### ##### $$$ ", - " %%% ###### ###### ## ###### ###### ###### ###### $$$ ", - " %%% ##### ###### # ####### ###### ########### $$$ ", - " %%% ##### ###### ############### ####### $$$ ", - " %%% ###### ##### # ########### ##### $$$ ", - " %%% ########### ########### # ## $$$ ", - " %%% ######## # ###### # $$$ ", - " %%% ##### ##### # $$$ ", - " %%% ### ## # # $$$ ", - " %%% & # $$$ ", - " %%% && &&&&& &&&&&&& $$$ ", - " %%% &&&&&&& &&&&&&&&& &&&&&&&&&& $$$ ", - " %%% &&&&&&&& &&&&&&&&&&& &&&&&&&&&&&&&&& &&&&&&&&&&&&& $$$ ", - " %%% &&&&&&&&&&& &&&&&&&&&&&&&& &&&&&&&&&&&&&&&&& &&&&&&&& &&&&& $$$ ", - " %%% &&&&&&&&&&&&&& &&&&&&& &&&&&&& &&&&&&& &&&&&&&&& &&&&&& &&&&& $$$$ ", - " %%% &&&&&&& &&&&& &&&&&&& &&&&&& &&&&&&&& && &&&&& &&&&& &&&&& $$$$ ", - " %%% &&&&&& &&&& &&&&&& &&&&&& &&&&&&& & &&&&& &&&&& &&&& $$$$ ", - " %%% &&&&&& &&&&& &&&&& &&&&&& &&&&&&& & &&&& &&&&&& &&&& $$$$ ", - " %%% &&&&& &&&& &&&&& &&&&&& &&&&&& && &&&& &&&&& &&&& && $$$$ ", - " %%% &&&&& &&&& &&&&& &&&&&& &&&&&&& &&&&&& &&&&& &&&&& &&&&& $$$$ ", - " %%% &&&& &&&& &&&&&& &&&&&& & &&&&&&&& &&&&& &&&&&& &&&&&&&&&&&&&& $$$$ ", - " %%% && & &&&&& &&&&&&& &&&&&& &&&&&& &&&&&&&&&&&&& &&&&&&&&&&& $$$$$ ", - " %%% && &&&&&&&&&&&&& &&&&&&&&&&&&&&& &&&&&&&&&& &&&&&&&&& $$$$ ", - " %%% &&&&&&&&&&& &&&&&&&&&&& & &&&&&& &&&& $$$$ ", - " %%%% &&&&&&& & &&&&&& & $$$$$$ ", - " %%%% && && & $$$$$ ", - " %%%% $$$$ ", - " %%%% $$$$ ", - " %%%% '''''''' $$$$$ ", - " %%%%%% ''''''''''' $$$$$ ", - " %%% '''''''' $$$$$ ", - " %%%% ''' $$$$ ", - " %%%% ''''''''''''''''''''''''' $$$$ ", - " %%%%% ''''''''''''''''''''''''' $$$$ ", - " %%%% (( (( ''''''''''''''''''''''''' $$$$$ ", - " %%%% ((((((((( (((((((( ''''''''''''''''''''''''' $$$$ ", - " %%% % (((((( ((((((((( (((((((((((( (((((((((((( $$$$ ", - " %%% (((((((((( (((((((((((( ((((((((((((((( (((((((((((((( $$$$$ ", - " %%%% (((((((((((((( (((((((((((((((( (((((((((( (((((( ((((((( (((( $$$$ ", - " %%%% ((((((( (((((( ((((((( (((((( ( ((((((( ((((( ((((( (((((( (((( $$$$$ ", - " %%%%% ((((((( (((( (((((( (((((((( (((((((( (( (((( ((((( (((( ( $$$$ ", - " %%% % (((((( (((( (((((( (((( (((((( ( ((((((( ((((( ((((( (( $$$$ ", - " %%% ((((( (((( ((((( ( ((((( (((((((( (((((( (((((( (((( ((( $$$$ ", - " %%%% ((((( (((( ((((( (((((( ( (((((((( (((((( ((((( (((( (((( $$$$$ ", - " %%%% (((( (((( (((((( (((((( ( ((((((( ((((( (((((( ((((( (((((( $$$$$$ ", - " %%%%% (( ((((( (((((( (((((( (((((((( (((((((((((((( ((((((((((((( $$$$ $ ", - " %%%% (((((( (((((( ) ((((((((((((( ( (((((((((((( ((((((((( $$$$ ", - " %%% ((((((((((( * ) ((((((((((((( ( (((((((( (((((( $$$$ ", - " %%% (((((((( **** ) (( ((((((( ( ((( $$$$$ ", - " %%%%%% (((( ***** ))) ( (((( (( $$$$$ ", - " %%%%% ***** ))) (( ( ++++++++++++ + + $$$$ ", - " %%%% ****** ))) +++++++++++++++++++++++++++++++++++++ ++ $$$$ ", - " %%%% ******* )))) ,,, +++++++++++++++++++++++++++++++++++++ ++ $$$$$ ", - " %%%% ****** )))) ,,, +++++++++++++++++++++++++++++++++ + $$$$$ ", - " %%%%% ****** ))) ,,, ------ +++++++++++++++++ $$$$$ ", - " %%%% ******* ))) ,,,, --------------------------------- + +++++++ $$$$ ", - " %%%% ****** ))) ,,,, ----------------------------- ++++++ + $$$$ ", - " %%%% ******* ))) ,,, ----------------------------- +++++ + $$$$$ ", - " %%%%% ****** )))) ,,, +++++ $$$$ ", - " %%%%% ****** )))) ,,, ++++++ $$$$ ", - " %%%% ******* ))) ,,, +++++ $$$$$ ", - " %%%% ******* ))) ,,, .. . ++++ $$$$ ", - " %%%% ****** ))) ,,,, . ... ................................. ++++ $$$$$ ", - " %%%% ******* ))) ,,,, ............................................ ++++ $$$$ ", - " %%%% ******** )))) ,,, ........................................... ++++ $$$$$$ ", - " %%%% ***** )))) ,,, . ................. ++++++ $$$$ ", - " %%%% ******* ))) ,,, ....... . . ++++++ $$$$$ ", - " %%%% * ****** ))) ,,, ..... . . ++++++ $$$$ ", - " %%%%% ***** ))) ,,,, .... . ++++ $$$$ ", - " %%%%%% ******* //////// ))) ,,,, . ... . ++++ $$$$ ", - " %%%% ******* /////////////// ))) ,,,, ..... +++++ $$$$ ", - " %%%%% ****** ////////////////////// )))) ,,, ...... ++++ $$$$ ", - " %%%%% ******* ////// ////////////// )))) ,,, ...... ++++ $$$$ ", - " %%%% ******* //////// ///////// ))) ,,, ..... +++++ $$$$ ", - " %%%% ****** // ///// //// ))) ,,, ..... ++++++ $$$$ ", - " %%%% ****** //////// ///// ))) ,,,, .. ..... 00000000000000000000000000000 +++++ $$$$ ", - " %%%% ******* / ////// //// ))) ,,,, .... 000000000000000000000000000000000 ++++ ++ $$$$ ", - " %%%% ***** / /////// //// ,,, .... 00000000000000000000000000000 +++ $$$$ ", - " %%%% ***** /////// //// ,,, ..... +++ $$$$ ", - " %%%% *** ////// ///// ,,, ...... +++++ + $$$$ ", - " %%% * ///// //// ,,, ..... +++++ $$$$ ", - " %%% /////// //// ,,, ... ++++++ $$$$ ", - " %%% ///// //// ,,, ..... +++++ $$$$ ", - " %%% ////// ///// ..... +++++++ $$$$ ", - " %%% /// //// ..... ++++++++++++++++ + ++++++ ++++ + $$$$ ", - " %%% //// /// ... . ++++++++++++++++++++++++++++++++++++++++++++++ $$$$ ", - " %%% //// /// . ..... +++++++++++++++++++++++++++++++++++++++++++++ $$$$ ", - " %%% /////// //// ...... +++++++++++++++++++++++++++++++++ + $$$$ ", - " %%% ///// //// .... ++ +++ + $$$$ ", - " %%% ///// //// ..... + +++ $$$$ ", - " %%% /////// /// ...... $$$$ ", - " %%% / //// /// ..... . $$$$ ", - " %%% ////// /// ....... $$$$ ", - " %%% ////// /// ...... $$$$ ", - " %%% ////// //// ....... ... . $$$$ ", - " %%% //// //// . .......... $$$$ ", - " %%% /// /// . .......................................... $$$$ ", - " %%% ////// /// ........................................... $$$$ ", - " %%% ////// /// ......................................... $$$$ ", - " %%% ///// /// . .. $$$$ ", - " %%% /////// /// .. $$$$ ", - " ////// //// $$$$ ", - " ///// ///// $$$$ ", - " / ///// ///// $ ", - " / ///// ////// $ ", - " /////// ////// $ ", - " ///// ///// ", - " ////// / ////// ", - " / /////// / ////// 1 ", - " ///////////// ///// 1 1 1 11 11 1 111 1111 1 11 11 11 ", - " /////////////////////// 11111111111111111111111111111111111111111111111111 ", - " ///////////////////// 111111111111111111111111111111111111111111111111111111 ", - " / / ///////////// 11111111111111111111111111111111111111111111111111 ", - " / / //// 1111111111 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/text-vertical-alignment-800-800-2.0-grid-reference.json b/tests/visual_tests/grids/text-vertical-alignment-800-800-2.0-grid-reference.json deleted file mode 100644 index eb84e71a3..000000000 --- a/tests/visual_tests/grids/text-vertical-alignment-800-800-2.0-grid-reference.json +++ /dev/null @@ -1,224 +0,0 @@ -{ - "keys": [ - "", - "9", - "8", - "4", - "5", - "7", - "16", - "6", - "2", - "10", - "12", - "13", - "14", - "11", - "3", - "15", - "1" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ! ", - " !!!! ! ! ", - " !!!!!! ! !!!! ! ", - " !!!!!!!!! !!!!!! ! !!!!!! ", - " !!!!!!!!!!! !!!!!!!!!!! !!! !!!!!! ", - " !!!!!!!!!!!!!!! !!!!!!!!!!!!!! !! !!!!!!! ", - " !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!! ! ! !!!!!!!!!!!!! !! ", - " !!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!! !!!! ", - " !!!!!!!!!!!! !!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!! !!!!!! ", - " !!!!!!!!!!!! !!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!! ! ! ! !!!!!!!!!!!!!!!!!! ! !!!!!!!! ", - " !!!!!!!!!!!! !!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! !!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!! ", - " !!!!!!!!!!! !!!!!!!!!! ! !!!!!!!!!!!!!! !!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!! ", - " !!!!!!!!!!!! !!!!!!!!!! ! ! !!!!!!!!!!!! !!! !!!!!!!!!!! !!!!!!!!!!! ! !!!!!!!!!! !!!!!!!!!!! ", - " !!!!!!!!!!! !!!!!!!!!!! ! !!!!!!!!!!!! !!! ! ! !!!!!!!!!!!! !!!!!!!!!!! ! ! !!!!!!!!!! !!!!!!!!!!! ", - " !!!!!!!!!!! !!!!!!!!!!! ! !!!!!!!!!!!!!! ! !!!!!!!!!!! ! !!!!!!!!!!!!!! !! !!!!!!!!!! !!!!!!!!!! ", - " !!!!!!!!! !!!!!!!!!! ! !!!!!!!!!!!! ! !!!!! !!!!!!!!!!! !!!!!!!!!!!! ! !! !!!!!!!!!!! !!!!!!!!!!! ", - " !!!!!!!! !!!!!!!!!! !! !!! !!!!!!!!!!!! !! ! ! !!!!!!!!!!!!!!! !! !!!!!!!!!! ! ! ! !!!!!!!!!! !!!!!!!!!!! ", - " !!!!!!! !!!!!!!!!!! !!! !!!!!!!!!!!!!! ! !! ! !!!!!!!!!!! ! !!!!!!!!!!!! !! !!!!!!!!!! !!!!!!!!!! ", - " !!! !!! !!!!!!!!!!!! !!!!!!!!!!! ! !! ! !!!!!!!!!!! !!!!!!!!!!! ! ! !!!!!!!!!!!!!!!!!!!!! ", - " !!! !!!!!!!!!! !!!!!!!!!!! !!! ! !!!!!!!!!!!!!!!!!!!!! ! !! !!!!!!!!!!!!!!!!!!! ", - " !! !!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!! ", - " !!!!!!!!!!!!!!!! !!!! ! !!!!!!!!!!!!!!! ! !!!!!!!!!!!!! ", - " ## !!!!!!!!!!!!! !! ## ! !!!!!!!!!!!!! !! !!!!!!!!!!! ", - " ##### !!!!!!!!!!!!! ! # ##### # ! !!!!!!!!!! !!!!!!! ", - " ######## !!!!!!!!!!! ! ! # ###### ## ! !!!!!!!!! ! ! ### !!!!! $$$$$$ ", - " ########## !!! !!!!!! ! ########## # ! !!!!! ! ! ######## !! $$$$$$ ", - " ############## !!!!! !! ############## # ! !! ! ######### # $$$$$$ ", - " ################ ! ! # ############## ! ! ### ########## #### $$$$$$ ", - " ################### !!! ###################### # ############ ##### $$$$$$ ", - " ##################### # # ###################### ################ ####### $$$$$$$ ", - " % ############ ########### # ############ ########## ################### ########## $$$$$$ ", - " % ############ ########## ############ ############### ##################### ########### $$$$$$$ ", - " % ############ ########## ## ############ ## ############ ########### ############ ########### $$$$$$$ ", - " % ############ ########### ############## ## ## ############ ### ############# ########### ########### $$$$$$ ", - " % ########### ########## # ########### # ## # # ############## ############ # # ########## ########## $$$$$$$ ", - " % ######### ########## ############ # # ## # # ########## # ########## # ## # ############ ########### $$$$$$ ", - " % ###### ########## ############# # ## # ############## ############# ### # # ########### ########### $$$$$$$$$ ", - " %%%%%%% ##### ########### # ############### # ########## # ############### # ## ########## ########### $$$$$$$ $ ", - " %%%%%%% ## ########## ########### # ## # ############ #### ########### ### ##################### $$$$$$ ", - " %%%%%%% ########## # ############ # ### # ############ ########### # ################## $$$$$$$$$$$$ ", - " %%%%%%% ############ ########### # # ### ####################### ## ############### $$$$$$ ", - " %%%%%%% ###################### # # #################### # ############# $$$$$$$$ ", - " %%%%%%%% # ##################### ## # ################# # # ########## $$$$$$$$$ $ ", - " %% %%%%%%% ## ################# ## # ## ################ ## ####### $$$$$$ ", - " %%%%%%%%% # ############### # ## # ############# # ##### $$$$$$ $ ", - " %%%%%%% # ############& ## & # ######### # # ## $$$$$$$$$$$ ", - " %%%%%%%%% # # ####### #& # && &&# # ###### ## $$$$$$ $ ", - " %%%%%%%%% ## ########&#### && &&&&&&# ##### &&&&&&&&&&& $$$$$$$$$ ", - " % %%%%%%%% &&&&&&& # ### &#&&&&&&&&& && &&&&&&&&&&# &&&&&&&&&&&&&&& $$$$$$$ ", - " % %%%%%%%% &&&&&&&&&& &&#&&&##&&&&&&&& & & &&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&& $$$$$$ ", - " %%%%%%%% &&&&&&&&&&&&& && &&###&&&&&&&&&&& && &&&&&&&&&&&&&&&&& && &&&&&&&&&&&&&&&&&& $$$$$$$ $ ", - " %%%%%%%%%% &&&&&&&&&&&&&&&& & &&&&&&&&&&&&&&&&&& & &&&&&&&&&&&&&&&&&&&&&&& & &&&&&&&&&&&&&&&&&&&& $$$$$$ $ ", - " %%%%%%% &&&&&&&&&&&&&&&&&&& & & &&&&&&&&&&&&&&&&&&&& & &&&&&&&&&&&&&&&&&&&&&&& & &&&&&&&&&&&&&&&&&&&&&& $$$$$$$ $ ", - " %%%%%%% &&&&&&&&&&&&&&&&&&&&& && &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&& &&&&&&&&&& &&&&&&&&&&&&&&& &&&&&&&&& $$$$$$$ $ ", - " %%%%%%% &&&&&&&&&&&& &&&&&&&&&&& &&&&&&&&&&&&& &&&&&&&&&&&&& &&&&&&&&&&&&&&& &&&&&&&&&&&& & &&&&&&&&&&&&& &&&&&&&& & $$$$$$ $ ", - " %%%%%%%%% &&&&&&&&&&& &&&&&&&&& && &&&&&&&&&& & && &&&&&&&& & && &&&&&&&&&&& & &&&&&&&&&&&&&& && &&&&&&&&&& &&&&&&&& && $$$$$$$$$ ", - " % %%%%%%% &&&&&&&&&& &&&&&&&& & && &&&&&&&&&&& & && &&&&&&&& &&& &&&&&&&&&&& & & & &&&&&&&&&& &&&&&&&&&&&&& &&&&&&&& &&&&& $$$$$$ $ ", - " %%%%%% &&&&&&& &&&&&&&& & &&&&&&&&&&& & & & &&&&&&&&& &&&&&&&&&&&& &&& & && &&&&&&&&&&&&&&&&&&&&&& & &&&&&&&&&&&&&&&& $$$$$$$$$ ", - " %%%%%%%%% &&&&&& &&&&&&&&&&&&&&&&&&&&&& & &&&&&&&&&&&&&&&&&&&&&&&& &&& & &&&&&&&&&&&&&&&&&&&& & &&&&&&&&&&&&&&&&& $$$$$$$ ", - " %%%%%% && &&& &&&&&&&&&&&&&&&&&&&& & & &&&&&&&&&&&&&&&&&&& && & &&&&&&&&&&&&&&&&& &&&& &&&&&&&&&&&&&&&& $$$$$$$$$$ ", - " %%%%%%%%% && & &&&&&&&&&&&&&&&&&&& & &&&&&&&&&&&&&&&&&&&&&& & &&&&&&&&&&&&&&&&& & && &&&&&&&&&&&&& $$$$$$$ ", - " % %%%%%%&& &&&&&&&&&&&&&&&& && & &&&&&&&&&&&&&&& && & &&&&&&&&&&&&&& & & &&&&&&&&&&& $$$$$$$ ", - " % %%%%&&& &&&&&&&&&&&&&&& & &&&&&&&&&&&&& && & &&&&&&&&&& && & &&&&&&& $$$$$$$$$$ ", - " % %%%%%& &&&&&&&&& &&& & &&&&&&&&&&& && & & &&&& & && & $$$$$$ ", - " %% %%%%%% &&&&& &&&& & & & & &&&&& && '''''''''' $$$$$$$ $ ", - " %% %%%%%% & & & & ''''''''''$$$$$$$$$ $ ", - " %%%%%%% &&& & ''''''''''''''''' $$$$$$$ $ ", - " %%%%%%%%% ''''''''''''''''' $$$$$$$$$$ ", - " %%%%%% '''''''''' $$$$$$$$$ ", - " %%%%%%%%% ''''''''''''''''''''''''''' $$$$$$$$$ ", - " %%%%%% ( (( ''''''''''''''''''''''''''' $$$$$$$ ", - " % %%%%%% (( (( (((( (( ((((((( ''''''''''''''''''''''''''' $$$$$$ ", - " % %%%%%% ( ( ( (((((((( (( (((((((((((( ((((((((((( ''''''''''''''''''''''''''' $$$$$$$$$$ ", - " %%%%%% ((((((((( ( (((((((((((( ( ((((((((((((((( (( ((((((((((((((( ''''''''''''''''''''''''''' $$$$$$$ ", - " %% %%%%%% ((((((((((((( ( ((((((((((((((( ((((((((((((((((((( (((((((((((((((((( '''''''''''''''''''''''''''$ $$$$$$ ", - " % %%%%%%% (((((((((((((((( ( ((((((((((((((((( ( (((((((((((((((((( ( ((((((((((((((((((( $$$$$$$$$$ ", - " %%%%%%% (((((((((((((((((( (((((((((((((((((((( ( ((((((((((((((((((((( ( ((((((((((((((((((((( ( $$$$$$ ", - " %%%%%%%%% ((((((((((((((((((((( ((((((((((((((((((((((( ( ( ((((((((((((((((((((((( ((((((((((((((((((((((((( ((( $$$$$$$$$$ ", - " %%%%%% (((((((((((((((((((((( ( (((((((((((( (((((((((( ( ( (((((((((((((( (((((((((( (((((((((( ( ( (((((((( ((( $$$$$$$ ", - " %%%%%%%%% ((((((((((( (((((((( (((((((((((( ((( ((((((((( ( ((((((((((((( ((( ( ((((((((( ( ( ((((((((((( ( ( (((((((( (( ((( $$$$$$ ", - " %%%%%% (((((((((( (((((((( ((((((((((( ( ((((((((((( (( ( (((((((((( (( ( ( ((((((((((((( ((((((((((( ( ( ( (((((((( ((((((( $$$$$$$$$$ ", - " %%%%%% ((((((((( ((((((( ( (((((((((( (( ((((( ((((((((( (((((((((((( ( (((( (( (((((((((( ((((((((((( ((( ( ((((((((((((((((( $ $$$$$$ ", - " %%%%%%%%% (((((( ((((((((( ((((((((((( ( ((( (((((((((((((((((((((( (( ( (((((((((((((((((((( (( (((((((((((((((( $$$$$$$$$$$ ", - " %%%%%% (((( (((((((((((((((((((( ( )) ( (((((((((((((((((( ( ( ( ( ((((((((((((((((( ( ( ((((((((((((((((( $$$$$$$ $$$ ", - " % %%%%%%%%% (( (((((((((((((((((((( (()) ((((((((((((((((((( (( ((((((((((((((((((( ( * * * ***(**(**((((((((( $$$$$$ $ $ ", - " % % %%%%%% ((((((((((((((((())((()) ( (((((((((((((((( ( (((((((((((((((( ( ( * * * * * (*((*(*(**(**** $$$$$$$ $$ $ ", - " % % %%%%%% ((((((((((((( ()))))) ( (((((((((((((( ( (( ((((((((((((((( * ( * * * * * *((*(*((* * * $ $$$$$$$ ", - " %%%%%%%%%% (((((((((((()(())) +++++( ((((((((((( ( ( ((((((( ( ( ********************** *(* ** * ** $$$$$$$$$ ", - " %%%%%% (((((((((()))())) +++++++ ( (((((( (( ( ((( ( (************************************* ** $$$$$$$ ", - " %%%%%%%%% ((( (())()))))) ++++++ ( ( (, ( ( (( (( ( ( *************************************** ** $$$$$$ ", - " %%%%%% ( ( )((()))))) ++++++ ( ,,,,,,, ((( (( ***************************************** * $$$$$$$$$$ ", - " %%%%%% ())))))))))) ++++++ ,,,,,,, ------------------------ ****************************************** * $$$$$$$ ", - " %%%%%%%%% ))))))))))) ++++++ ,,,,,, ----------------------------- ********************************************* $ $$$$$$$$$ ", - " %%%%%% )))))))))) +++++++ ,,,,,, ----------------------------- * ** * * **************************** * $$$$$$$$ $ ", - " %%%%%%%%% ))))))))))) +++++++ ,,,,,, ----------------------------- ** *** * * * ** ************* $$$$$$$ $ ", - " %%%%%% ))))))))))) ++++++ ,,,,,, -----------------------------... .. * * * * ********** $ $$$$$$$ $$ ", - " %%%%%% )))))))))) ++++++ ,,,,,,, ----------------------------- . .. * ******** ** $$$$$$$ ", - " %%%%%%%%% ))))))))))) ++++++ ,,,,,,, . . .--------------.... . . * ********* $$$$$$$ ", - " %%%%%% ))))))))))) ++++++ ,,,,,,, .. .. . ... . . . . . ............... * ******* $$$$$$$$$$ ", - " %%%%%% )))))))))) +++++++ ,,,,,, .. . ...................................... * ******** * $$$$$$ ", - " %%%%%%%%% ))))))))))) +++++++ ,,,,,, ............................................. * ****** * * $$$$$$$$$$ ", - " %%%%%% ))))))))))) ++++++ ,,,,,, . ............................................ ******** * * $ $$$$$$ ", - " %%%%%%%%% )))))))))) / // ++++++ ,,,,,, ............................................... ********* $ $$$$$$$$$ ", - " % %%%%%%% ))))))))))) / / /// ++++++ ,,,,,,, .............................................. ******** $$$$$$$ $ ", - " % %%%%%%% ))))))))))) /// / / / // / ++++++ ,,,,,,, .. ............................................ *********** $$$$$$$ $ ", - " % %%%%%%% )))))))))) / / //// ////// / / +++++++ ,,,,,, ............. . . . . ...... ... . . ******** $$$$$$ $$ ", - " %%%%%% ))))))))))) / //////////// / / / +++++++ ,,,,,, ......... . .. ******** $$$$$$ ", - " %%%%%%%%% )))))))))) / / //////////////////// +++++++ ,,,,,, . . ........ . . . ********** $$$$$$ $ ", - " %%%%%% )))))))))) / / //////////////////////// ++++++ ,,,,,, . . ......... . ******* $$$$$$$$$ $ ", - " %%%%%% ))))))))))) / ////////////////////////////// ++++++ ,,,,,, ... ........ ******* $$$$$$$$$ ", - " %%%%%%%%% )))))))))) / ///////////////////////////// ++++++ ,,,,,,, ........ ********** $$$$$$$ ", - " %%%%%% )))))))))) ////////////////////////////////++++++ ,,,,,,, ......... 00000000000000000000000000000 ******* $ $$$$$$$$$ ", - " %%%%%%%%% ))))))))))) / ///////////// / //////////////+++++++,,,,,, .......... 00000000000000000000000000000 ********* $ $$$$$$ ", - " % %%%%%% )))))))))) /// ////////// / ///// / ////////+++++++,,,,,, ........ . 000000000000000000000000000000000000 ********* $$$$$$ $ ", - " %%%%%% )))))))))) //////////// // / / ///////////++++ ,,,,,, ....... 000000000000000000000000000000000000 ****** $$$$$$$$$$ ", - " % %%%%%% )))))))))) /////////////// //////// ,,,,,, ........... 00000000000000000000000000000 ************* $ $$$$$$ ", - " % %%%%%% ))))))) ////////////// ///////// ,,,,,,, ...... . 00000000000000000000000000000 ******* $ $$$$$$ ", - " % %%%%%% ))))) ///////// /////// /,,,,,,, ......... . 000000000000000000 ********** $$$$$$$ ", - " % %%%%%% )))) /// ////////// /////////,,,,,,, ........ * * ******** *** $$$$$$$$$ ", - " % %%%%%% ) /////// / ////////,,,,,, ...... * ** ** * * * ******* * *$ $$$$$$$ ", - " %%%%%% // /////// //////// ,,,, ........... *** * * * * ****** * *** *** * ********** * $$$$$$$ $ ", - " %%%%%% ///////// //////// ...... . ***************************** *************** $ $$$$$$$ $ ", - " %%%%%%%%% / / ////// / //////// ...... . ************************************************ $$$$$$$$$$ $ ", - " % %%%%%% / / /////// / ///// ........... ********************************************** ** $ $$$$$$$$ ", - " %%%%%%% // /////// ////// ....... ********************************************** $ $$$$$$ ", - " %%%%%%%%% /// ////// ////// .......... ******************************************** * $$$$$$$$$ ", - " % %%%%%% /////////// ////// . . ...... . ******************************************** $$$$$$$$ $ ", - " % %%%%%% /////// ////// . ...... . * * * *** **************** * * $$$$$$$$ ", - " %%%%%%%% //////////// ////// . .......... * * * * * * * *** *** * ** $$$$$$$ ", - " %%%%%% ////// /////// ........ . * * * * * * * * * * $ $$$$$$ ", - " %%%%%%%%%%% / /////// /////// ........... . . . ** * ** * *** *** * $$$$$$$ ", - " % %%%%%% //////// / ////// . .......... .. ... ... ... ... ... $$$$$$ ", - " % %%%%%% /////// / ////// ........... .................................. $$$$$$$$ ", - " %%%%%%%% ////////// ////// .. ............................................ $$$$$$$ ", - " %%%%%% / /////// /////// ............................................. ..... $$$$$$ ", - " %%%%%% ///////// //////// . .................................................. $$$$$$$ ", - " %%%%%% //////////// //////// . .......................................... $ $$$$$$ ", - " %%%%%% ///////// /////// . ........................................ $$$$$$ ", - " %%%%%% //////// / ////// .. ..................................... $$$$$$ ", - " // ///////// / /////// . . . . . . . . . . . . $$$$$$ ", - " /////////// / ////////// . . . . . . . . . . . $$$$$$ ", - " // ///////// // ////////// .... ... ... .. ... . . . $$ ", - " / ///////// / //////////// $$ ", - " / ////////// //////////// $$ ", - " / ///////// /// / //////////// $$ ", - " / //////////// / / /// //////////// / $$ ", - " / ///////////////// / ///////////// // 11111111111111111111111111 $$ ", - " //////////////////////////////// / 11111111111111111111111111111111111111111111111111 $$ ", - " / //////////////////////////// / // 111111111111111111111111111111111111111111111111111111111 ", - " ////////////////////////////// / 111111111111111111111111111111111111111111111111111111111 ", - " //////////////////////// / / 11111111111111111111111111111111111111111111111111 ", - " / / ///////////////// / / 11111111111111111111111111111111111111111111111111 ", - " //// / / ///////// /// 11111111111111111111111111111111111111 ", - " / / / / / / / ", - " //// / / / /// ", - " /// / ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-alpha-broken-assoc-alpha-gdal-600-400-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-alpha-broken-assoc-alpha-gdal-600-400-1.0-grid-reference.json deleted file mode 100644 index 1a15981c2..000000000 --- a/tests/visual_tests/grids/tiff-alpha-broken-assoc-alpha-gdal-600-400-1.0-grid-reference.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-alpha-broken-assoc-alpha-gdal-600-400-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-alpha-broken-assoc-alpha-gdal-600-400-2.0-grid-reference.json deleted file mode 100644 index 1a15981c2..000000000 --- a/tests/visual_tests/grids/tiff-alpha-broken-assoc-alpha-gdal-600-400-2.0-grid-reference.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-alpha-gdal-600-400-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-alpha-gdal-600-400-1.0-grid-reference.json deleted file mode 100644 index 1a15981c2..000000000 --- a/tests/visual_tests/grids/tiff-alpha-gdal-600-400-1.0-grid-reference.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-alpha-gdal-600-400-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-alpha-gdal-600-400-2.0-grid-reference.json deleted file mode 100644 index 1a15981c2..000000000 --- a/tests/visual_tests/grids/tiff-alpha-gdal-600-400-2.0-grid-reference.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-alpha-gradient-gdal-600-400-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-alpha-gradient-gdal-600-400-1.0-grid-reference.json deleted file mode 100644 index 1a15981c2..000000000 --- a/tests/visual_tests/grids/tiff-alpha-gradient-gdal-600-400-1.0-grid-reference.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-alpha-gradient-gdal-600-400-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-alpha-gradient-gdal-600-400-2.0-grid-reference.json deleted file mode 100644 index 1a15981c2..000000000 --- a/tests/visual_tests/grids/tiff-alpha-gradient-gdal-600-400-2.0-grid-reference.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-edge-alignment-gdal1-255-257-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-edge-alignment-gdal1-255-257-1.0-grid-reference.json deleted file mode 100644 index a9b8956b3..000000000 --- a/tests/visual_tests/grids/tiff-edge-alignment-gdal1-255-257-1.0-grid-reference.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-edge-alignment-gdal1-255-257-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-edge-alignment-gdal1-255-257-2.0-grid-reference.json deleted file mode 100644 index a9b8956b3..000000000 --- a/tests/visual_tests/grids/tiff-edge-alignment-gdal1-255-257-2.0-grid-reference.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-edge-alignment-gdal1-256-256-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-edge-alignment-gdal1-256-256-1.0-grid-reference.json deleted file mode 100644 index e023c5e7e..000000000 --- a/tests/visual_tests/grids/tiff-edge-alignment-gdal1-256-256-1.0-grid-reference.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-edge-alignment-gdal1-256-256-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-edge-alignment-gdal1-256-256-2.0-grid-reference.json deleted file mode 100644 index e023c5e7e..000000000 --- a/tests/visual_tests/grids/tiff-edge-alignment-gdal1-256-256-2.0-grid-reference.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-edge-alignment-gdal2-255-257-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-edge-alignment-gdal2-255-257-1.0-grid-reference.json deleted file mode 100644 index a9b8956b3..000000000 --- a/tests/visual_tests/grids/tiff-edge-alignment-gdal2-255-257-1.0-grid-reference.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-edge-alignment-gdal2-255-257-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-edge-alignment-gdal2-255-257-2.0-grid-reference.json deleted file mode 100644 index a9b8956b3..000000000 --- a/tests/visual_tests/grids/tiff-edge-alignment-gdal2-255-257-2.0-grid-reference.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-edge-alignment-gdal2-256-256-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-edge-alignment-gdal2-256-256-1.0-grid-reference.json deleted file mode 100644 index e023c5e7e..000000000 --- a/tests/visual_tests/grids/tiff-edge-alignment-gdal2-256-256-1.0-grid-reference.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-edge-alignment-gdal2-256-256-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-edge-alignment-gdal2-256-256-2.0-grid-reference.json deleted file mode 100644 index e023c5e7e..000000000 --- a/tests/visual_tests/grids/tiff-edge-alignment-gdal2-256-256-2.0-grid-reference.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-nodata-edge-gdal-600-400-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-nodata-edge-gdal-600-400-1.0-grid-reference.json deleted file mode 100644 index 1a15981c2..000000000 --- a/tests/visual_tests/grids/tiff-nodata-edge-gdal-600-400-1.0-grid-reference.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-nodata-edge-gdal-600-400-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-nodata-edge-gdal-600-400-2.0-grid-reference.json deleted file mode 100644 index 1a15981c2..000000000 --- a/tests/visual_tests/grids/tiff-nodata-edge-gdal-600-400-2.0-grid-reference.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-nodata-edge-gdal-969-793-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-nodata-edge-gdal-969-793-1.0-grid-reference.json deleted file mode 100644 index 924d7413b..000000000 --- a/tests/visual_tests/grids/tiff-nodata-edge-gdal-969-793-1.0-grid-reference.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-nodata-edge-gdal-969-793-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-nodata-edge-gdal-969-793-2.0-grid-reference.json deleted file mode 100644 index 924d7413b..000000000 --- a/tests/visual_tests/grids/tiff-nodata-edge-gdal-969-793-2.0-grid-reference.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-nodata-edge-rgba-500-100-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-nodata-edge-rgba-500-100-1.0-grid-reference.json deleted file mode 100644 index dcf3d346b..000000000 --- a/tests/visual_tests/grids/tiff-nodata-edge-rgba-500-100-1.0-grid-reference.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-nodata-edge-rgba-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-nodata-edge-rgba-512-512-1.0-grid-reference.json deleted file mode 100644 index 53162f357..000000000 --- a/tests/visual_tests/grids/tiff-nodata-edge-rgba-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-nodata-edge-rgba-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-nodata-edge-rgba-512-512-2.0-grid-reference.json deleted file mode 100644 index 53162f357..000000000 --- a/tests/visual_tests/grids/tiff-nodata-edge-rgba-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-nodata-rgb-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-nodata-rgb-512-512-1.0-grid-reference.json deleted file mode 100644 index 53162f357..000000000 --- a/tests/visual_tests/grids/tiff-nodata-rgb-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-nodata-rgb-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-nodata-rgb-512-512-2.0-grid-reference.json deleted file mode 100644 index 53162f357..000000000 --- a/tests/visual_tests/grids/tiff-nodata-rgb-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-nodata-rgba-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-nodata-rgba-512-512-1.0-grid-reference.json deleted file mode 100644 index 53162f357..000000000 --- a/tests/visual_tests/grids/tiff-nodata-rgba-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-nodata-rgba-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-nodata-rgba-512-512-2.0-grid-reference.json deleted file mode 100644 index 53162f357..000000000 --- a/tests/visual_tests/grids/tiff-nodata-rgba-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-nodata-tolerance-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-nodata-tolerance-512-512-1.0-grid-reference.json deleted file mode 100644 index 53162f357..000000000 --- a/tests/visual_tests/grids/tiff-nodata-tolerance-512-512-1.0-grid-reference.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-nodata-tolerance-512-512-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-nodata-tolerance-512-512-2.0-grid-reference.json deleted file mode 100644 index 53162f357..000000000 --- a/tests/visual_tests/grids/tiff-nodata-tolerance-512-512-2.0-grid-reference.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-opaque-edge-gdal-256-256-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-opaque-edge-gdal-256-256-1.0-grid-reference.json deleted file mode 100644 index e023c5e7e..000000000 --- a/tests/visual_tests/grids/tiff-opaque-edge-gdal-256-256-1.0-grid-reference.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-opaque-edge-gdal-256-256-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-opaque-edge-gdal-256-256-2.0-grid-reference.json deleted file mode 100644 index e023c5e7e..000000000 --- a/tests/visual_tests/grids/tiff-opaque-edge-gdal-256-256-2.0-grid-reference.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-opaque-edge-gdal-969-793-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-opaque-edge-gdal-969-793-1.0-grid-reference.json deleted file mode 100644 index 924d7413b..000000000 --- a/tests/visual_tests/grids/tiff-opaque-edge-gdal-969-793-1.0-grid-reference.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-opaque-edge-gdal-969-793-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-opaque-edge-gdal-969-793-2.0-grid-reference.json deleted file mode 100644 index 924d7413b..000000000 --- a/tests/visual_tests/grids/tiff-opaque-edge-gdal-969-793-2.0-grid-reference.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-opaque-edge-gdal2-600-400-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-opaque-edge-gdal2-600-400-1.0-grid-reference.json deleted file mode 100644 index 1a15981c2..000000000 --- a/tests/visual_tests/grids/tiff-opaque-edge-gdal2-600-400-1.0-grid-reference.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-opaque-edge-gdal2-600-400-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-opaque-edge-gdal2-600-400-2.0-grid-reference.json deleted file mode 100644 index 1a15981c2..000000000 --- a/tests/visual_tests/grids/tiff-opaque-edge-gdal2-600-400-2.0-grid-reference.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-opaque-edge-gdal2-969-793-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-opaque-edge-gdal2-969-793-1.0-grid-reference.json deleted file mode 100644 index 924d7413b..000000000 --- a/tests/visual_tests/grids/tiff-opaque-edge-gdal2-969-793-1.0-grid-reference.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-opaque-edge-gdal2-969-793-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-opaque-edge-gdal2-969-793-2.0-grid-reference.json deleted file mode 100644 index 924d7413b..000000000 --- a/tests/visual_tests/grids/tiff-opaque-edge-gdal2-969-793-2.0-grid-reference.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-opaque-edge-raster2-600-400-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-opaque-edge-raster2-600-400-1.0-grid-reference.json deleted file mode 100644 index 1a15981c2..000000000 --- a/tests/visual_tests/grids/tiff-opaque-edge-raster2-600-400-1.0-grid-reference.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-opaque-edge-raster2-600-400-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-opaque-edge-raster2-600-400-2.0-grid-reference.json deleted file mode 100644 index 1a15981c2..000000000 --- a/tests/visual_tests/grids/tiff-opaque-edge-raster2-600-400-2.0-grid-reference.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-opaque-edge-raster2-969-793-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-opaque-edge-raster2-969-793-1.0-grid-reference.json deleted file mode 100644 index 924d7413b..000000000 --- a/tests/visual_tests/grids/tiff-opaque-edge-raster2-969-793-1.0-grid-reference.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-opaque-edge-raster2-969-793-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-opaque-edge-raster2-969-793-2.0-grid-reference.json deleted file mode 100644 index 924d7413b..000000000 --- a/tests/visual_tests/grids/tiff-opaque-edge-raster2-969-793-2.0-grid-reference.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-reprojection-1-250-250-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-reprojection-1-250-250-1.0-grid-reference.json deleted file mode 100644 index 4f1f36aa4..000000000 --- a/tests/visual_tests/grids/tiff-reprojection-1-250-250-1.0-grid-reference.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-reprojection-1-250-250-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-reprojection-1-250-250-2.0-grid-reference.json deleted file mode 100644 index 4f1f36aa4..000000000 --- a/tests/visual_tests/grids/tiff-reprojection-1-250-250-2.0-grid-reference.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-reprojection-2-250-250-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-reprojection-2-250-250-1.0-grid-reference.json deleted file mode 100644 index 4f1f36aa4..000000000 --- a/tests/visual_tests/grids/tiff-reprojection-2-250-250-1.0-grid-reference.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-reprojection-2-250-250-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-reprojection-2-250-250-2.0-grid-reference.json deleted file mode 100644 index 4f1f36aa4..000000000 --- a/tests/visual_tests/grids/tiff-reprojection-2-250-250-2.0-grid-reference.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-resampling-600-400-1.0-grid-reference.json b/tests/visual_tests/grids/tiff-resampling-600-400-1.0-grid-reference.json deleted file mode 100644 index 1a15981c2..000000000 --- a/tests/visual_tests/grids/tiff-resampling-600-400-1.0-grid-reference.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff-resampling-600-400-2.0-grid-reference.json b/tests/visual_tests/grids/tiff-resampling-600-400-2.0-grid-reference.json deleted file mode 100644 index 1a15981c2..000000000 --- a/tests/visual_tests/grids/tiff-resampling-600-400-2.0-grid-reference.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff_colortable-256-256-1.0-grid-reference.json b/tests/visual_tests/grids/tiff_colortable-256-256-1.0-grid-reference.json deleted file mode 100644 index e023c5e7e..000000000 --- a/tests/visual_tests/grids/tiff_colortable-256-256-1.0-grid-reference.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff_colortable-256-256-2.0-grid-reference.json b/tests/visual_tests/grids/tiff_colortable-256-256-2.0-grid-reference.json deleted file mode 100644 index e023c5e7e..000000000 --- a/tests/visual_tests/grids/tiff_colortable-256-256-2.0-grid-reference.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff_colortable_custom_nodata-256-256-1.0-grid-reference.json b/tests/visual_tests/grids/tiff_colortable_custom_nodata-256-256-1.0-grid-reference.json deleted file mode 100644 index e023c5e7e..000000000 --- a/tests/visual_tests/grids/tiff_colortable_custom_nodata-256-256-1.0-grid-reference.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/tiff_colortable_custom_nodata-256-256-2.0-grid-reference.json b/tests/visual_tests/grids/tiff_colortable_custom_nodata-256-256-2.0-grid-reference.json deleted file mode 100644 index e023c5e7e..000000000 --- a/tests/visual_tests/grids/tiff_colortable_custom_nodata-256-256-2.0-grid-reference.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/vrt_colortable-256-256-1.0-grid-reference.json b/tests/visual_tests/grids/vrt_colortable-256-256-1.0-grid-reference.json deleted file mode 100644 index e023c5e7e..000000000 --- a/tests/visual_tests/grids/vrt_colortable-256-256-1.0-grid-reference.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/vrt_colortable-256-256-2.0-grid-reference.json b/tests/visual_tests/grids/vrt_colortable-256-256-2.0-grid-reference.json deleted file mode 100644 index e023c5e7e..000000000 --- a/tests/visual_tests/grids/vrt_colortable-256-256-2.0-grid-reference.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "keys": [ - "" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/whole-centroid-600-400-1.0-grid-reference.json b/tests/visual_tests/grids/whole-centroid-600-400-1.0-grid-reference.json deleted file mode 100644 index 0d3a34041..000000000 --- a/tests/visual_tests/grids/whole-centroid-600-400-1.0-grid-reference.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "keys": [ - "", - "1" - ], - "data": {}, - "grid": [ - " !!!! ", - " !!!!! ", - " ! ! ", - " ! ! ", - " ! !!! ", - " ! ! ", - " ! ! ! ! ! ", - " ! ! ! !!! ! ", - " ! ! ! ", - " ! ! ", - " ! ! ! ", - " !!!!!!! !! ! ", - " ! ! ", - " ! !!! ! ", - " ! !! ! ! ", - " !! ", - " ! ! ", - " ! ", - " !! ! ", - " !! ! ", - " ! ! ", - " ! ", - " ! ! ", - " ! ! ", - " ! ", - " ! ! ", - " ! ! ", - " ! ! ! ! ", - " !!! ! !! ", - " ! ! !! ! ", - " ! ! ! ", - " ! ! ! ! ", - " !! ! ! ! ", - " ! ", - " ! ! ", - " ! ! ", - " ! ! ", - " ! ! ", - " !!! ", - " ! !!!!! ! ", - " ! !!!!! ! ", - " ! !!!!! ", - " ! !!!!! ! ", - " !! ! ! ", - " ! ! ", - " ! ! ", - " ! ! ", - " ! ! ! ! ", - " ! ! ", - " ! ! ", - " ! !!! ", - " ! ! !! ", - " !! ! ", - " ! ! ", - " ! ", - " ! ! ", - " ! !! ", - " ! ! ", - " ! ! ", - " ! !! ! ! ! ", - " !!! ! ! ", - " ! ! ! ", - " ! ! ! ! ", - " ! ! !! !! ", - " ! ! ! ", - " ! ! !! ! ", - " ! ! ! !! ! ", - " ! ! ! ! ! ! ", - " ! ! ", - " ! ! ! ! ! ", - " ! ! ", - " ! ! ! ! ! ", - " ! ! ! ! ", - " ! ! ! ", - " ! ! ! ", - " ! ", - " ! ! ! ", - " ! ! !! ! ! ", - " ! ! ! ", - " !! ! !! ", - " ! !! ", - " ! ! ", - " ! ! ", - " ! ! ", - " ! ! ! ", - " ! ", - " !! ! ! ", - " ! ! !!!! !! ", - " ! ! !! ! !!! ", - " ! ! ", - " ! ! ", - " !! ! ", - " ! ! ", - " ! ! ", - " ! ", - " ! ! ", - " ! ", - " !! ", - " ! !! ! ", - " ! ! " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/grids/whole-centroid-600-400-2.0-grid-reference.json b/tests/visual_tests/grids/whole-centroid-600-400-2.0-grid-reference.json deleted file mode 100644 index 69a444714..000000000 --- a/tests/visual_tests/grids/whole-centroid-600-400-2.0-grid-reference.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "keys": [ - "", - "1" - ], - "data": {}, - "grid": [ - " !!!!! ", - " !!!!!! !! ", - " ! ! ", - " ! !! ", - " ! !!!! ", - " ! !!!! !! ", - " !! ! !! ! ! ", - " ! ! ! !!! ! ", - " ! ! ! ! ! ", - " ! ! ! ! ", - " ! ! ! ! ", - " !!!!!!! !! ! ", - " ! ! ", - " ! !!!! ! ", - " ! !! !!!! ", - " ! !! ", - " ! !! ", - " !! ", - " !! ! ", - " !! ! ", - " ! ! ", - " ! ! ", - " ! ! ", - " ! ! ", - " ! ! ", - " ! ! ", - " ! ! ", - " ! !! !! ! ", - " !!! ! !! ", - " !! ! !! !! ", - " !! !!! ! ", - " ! ! ! ! ! ", - " !! ! ! !! ", - " ! ! ! ", - " ! ! ", - " ! ! ", - " ! !!!!!!! ! ", - " ! !!!!!!!!! ! ", - " ! !!!!!!!!! ! ", - " ! !!!!!!!!!!! ! ", - " ! !!!!!!!!!!! ! ", - " ! ! !!!!!!!!!!! ! ", - " !! ! !!!!!!!!!! ! ", - " !!! ! !!!!!!!!! ! ", - " ! ! !!!!!!! !! ", - " ! ! !!!!! !! ", - " !! ! ", - " ! ! ! ! ", - " !! ! ", - " ! ! ", - " !! !!!!! ", - " ! ! !!! ", - " !! ! ", - " ! ! ", - " !! ", - " ! ! ", - " !! !! ", - " ! !! ", - " ! ! !! ", - " ! !!!!! !! ! ", - " !!!! ! ! ! ! ", - " ! ! ! !! !! ", - " ! ! !! ! !! ", - " ! ! ! !! !! ", - " ! ! !! ! ! ", - " ! ! !! !! ! ", - " ! ! ! ! !!!! ! ", - " ! ! !! ! ! ! ", - " ! !! ! ! ", - " ! ! ! ! ! ", - " ! ! ! ! ", - " ! ! ! ! ! ", - " ! ! ! ! ", - " ! ! ! ! ", - " ! ! ! !! ", - " ! ! ! ", - " ! ! ! ", - " !! ! !! ! ! ", - " !! ! ! ! ", - " !!! ! !! ", - " ! ! !! ", - " !! ! ! ", - " ! ! ", - " !! ! ", - " ! ! ! ", - " ! ! ", - " !!! ! ! ", - " ! ! !!!!!! !! ! ", - " !!! !! !!!! ! !!!! ", - " ! !! ! ", - " !! ! ", - " !! ! ", - " !! ! ", - " !! ! ", - " ! ! ", - " ! ! ", - " !! ! ", - " !! ! ", - " ! !! ! ", - " ! !!! " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/html_report_template.html b/tests/visual_tests/html_report_template.html deleted file mode 100644 index 759b8fe40..000000000 --- a/tests/visual_tests/html_report_template.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - -
-
expected
-
% difference
-
actual
-{{RESULTS}} -
- - diff --git a/tests/visual_tests/images/antimeridian-bbox-1000-1000-1.0-agg-reference.png b/tests/visual_tests/images/antimeridian-bbox-1000-1000-1.0-agg-reference.png deleted file mode 100644 index b6b609827..000000000 Binary files a/tests/visual_tests/images/antimeridian-bbox-1000-1000-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/antimeridian-bbox-1000-1000-1.0-cairo-reference.png b/tests/visual_tests/images/antimeridian-bbox-1000-1000-1.0-cairo-reference.png deleted file mode 100644 index dac432bc9..000000000 Binary files a/tests/visual_tests/images/antimeridian-bbox-1000-1000-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/antimeridian-bbox-1000-1000-2.0-agg-reference.png b/tests/visual_tests/images/antimeridian-bbox-1000-1000-2.0-agg-reference.png deleted file mode 100644 index 6d2727053..000000000 Binary files a/tests/visual_tests/images/antimeridian-bbox-1000-1000-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/antimeridian-bbox-1000-1000-2.0-cairo-reference.png b/tests/visual_tests/images/antimeridian-bbox-1000-1000-2.0-cairo-reference.png deleted file mode 100644 index 855cf05d9..000000000 Binary files a/tests/visual_tests/images/antimeridian-bbox-1000-1000-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/building-symbolizer-opacity-512-512-1.0-agg-reference.png b/tests/visual_tests/images/building-symbolizer-opacity-512-512-1.0-agg-reference.png deleted file mode 100644 index 38d834ad0..000000000 Binary files a/tests/visual_tests/images/building-symbolizer-opacity-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/building-symbolizer-opacity-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/building-symbolizer-opacity-512-512-1.0-cairo-reference.png deleted file mode 100644 index 80429554a..000000000 Binary files a/tests/visual_tests/images/building-symbolizer-opacity-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/building-symbolizer-opacity-512-512-2.0-agg-reference.png b/tests/visual_tests/images/building-symbolizer-opacity-512-512-2.0-agg-reference.png deleted file mode 100644 index afee6e09c..000000000 Binary files a/tests/visual_tests/images/building-symbolizer-opacity-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/building-symbolizer-opacity-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/building-symbolizer-opacity-512-512-2.0-cairo-reference.png deleted file mode 100644 index 6b3504584..000000000 Binary files a/tests/visual_tests/images/building-symbolizer-opacity-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/charspacing-200-400-1.0-agg-reference.png b/tests/visual_tests/images/charspacing-200-400-1.0-agg-reference.png deleted file mode 100644 index c6976c363..000000000 Binary files a/tests/visual_tests/images/charspacing-200-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/charspacing-200-400-1.0-cairo-reference.png b/tests/visual_tests/images/charspacing-200-400-1.0-cairo-reference.png deleted file mode 100644 index 38c6d76da..000000000 Binary files a/tests/visual_tests/images/charspacing-200-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/charspacing-200-400-2.0-agg-reference.png b/tests/visual_tests/images/charspacing-200-400-2.0-agg-reference.png deleted file mode 100644 index 918f2414f..000000000 Binary files a/tests/visual_tests/images/charspacing-200-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/charspacing-200-400-2.0-cairo-reference.png b/tests/visual_tests/images/charspacing-200-400-2.0-cairo-reference.png deleted file mode 100644 index 09ae1130d..000000000 Binary files a/tests/visual_tests/images/charspacing-200-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/charspacing-lines-300-300-1.0-agg-reference.png b/tests/visual_tests/images/charspacing-lines-300-300-1.0-agg-reference.png deleted file mode 100644 index 5068e9079..000000000 Binary files a/tests/visual_tests/images/charspacing-lines-300-300-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/charspacing-lines-300-300-1.0-cairo-reference.png b/tests/visual_tests/images/charspacing-lines-300-300-1.0-cairo-reference.png deleted file mode 100644 index 229f0bf40..000000000 Binary files a/tests/visual_tests/images/charspacing-lines-300-300-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/charspacing-lines-300-300-2.0-agg-reference.png b/tests/visual_tests/images/charspacing-lines-300-300-2.0-agg-reference.png deleted file mode 100644 index 8083f0b66..000000000 Binary files a/tests/visual_tests/images/charspacing-lines-300-300-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/charspacing-lines-300-300-2.0-cairo-reference.png b/tests/visual_tests/images/charspacing-lines-300-300-2.0-cairo-reference.png deleted file mode 100644 index 64373f432..000000000 Binary files a/tests/visual_tests/images/charspacing-lines-300-300-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/collision-600-400-1.0-agg-reference.png b/tests/visual_tests/images/collision-600-400-1.0-agg-reference.png deleted file mode 100644 index c4793d70e..000000000 Binary files a/tests/visual_tests/images/collision-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/collision-600-400-1.0-agg.png b/tests/visual_tests/images/collision-600-400-1.0-agg.png deleted file mode 100644 index 808c0bdca..000000000 Binary files a/tests/visual_tests/images/collision-600-400-1.0-agg.png and /dev/null differ diff --git a/tests/visual_tests/images/collision-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/collision-600-400-1.0-cairo-reference.png deleted file mode 100644 index 7f4ae4995..000000000 Binary files a/tests/visual_tests/images/collision-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/collision-600-400-1.0-cairo.png b/tests/visual_tests/images/collision-600-400-1.0-cairo.png deleted file mode 100644 index c8a3eba8d..000000000 Binary files a/tests/visual_tests/images/collision-600-400-1.0-cairo.png and /dev/null differ diff --git a/tests/visual_tests/images/collision-600-400-1.0-grid.json b/tests/visual_tests/images/collision-600-400-1.0-grid.json deleted file mode 100644 index 25daa99fc..000000000 --- a/tests/visual_tests/images/collision-600-400-1.0-grid.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "keys": [ - "", - "1" - ], - "data": {}, - "grid": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ! ", - " !! ", - " !!!! ", - " !!!!! ", - " !!!!! ", - " !!!!! ", - " !!!! ", - " !!! ", - " !!! ", - " !!!! ", - " !!!!! ", - " !!!!!!! ", - " !!!!!! ", - " !!!! ", - " ! !!! ", - " !!!! ", - " !!!!! ", - " !!!!!! ", - " !!!! ", - " !! ", - " !! ", - " !!!! ", - " !!!!! ", - " !!!!! ", - " !!!!! ", - " !!!! ", - " !! ", - " ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!! ", - " !!! ", - " !!!! ", - " ! ! ", - " ", - " ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!! ", - " !!! ", - " !!!! ", - " !!!! ", - " ! ", - " !! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!! ", - " ! ", - " !!! ", - " !!!! ", - " !!!! ", - " !!! ", - " !!!! ", - " !!!! ", - " !!!! ", - " !!! ", - " ", - " !! ", - " !!! ", - " !!!! ", - " !!!! ", - " !!! ", - " !!!! ", - " !!! ", - " ! ! ! ", - " !! ", - " !!!! ", - " !!!!! ", - " !!!!!! ", - " !!!! ", - " !! ! !! ", - " !!!! ", - " !!!!! ", - " !!!!!!!! ", - " !!!!!! ", - " !! !!! ", - " !!!!!! ", - " !!!!!!!! ", - " !!!!!! !! ", - " !!! !!!! ", - " !!!!! !! ", - " !!!!!!!! ", - " !!!!!! ", - " !!! " - ] -} \ No newline at end of file diff --git a/tests/visual_tests/images/collision-600-400-2.0-agg-reference.png b/tests/visual_tests/images/collision-600-400-2.0-agg-reference.png deleted file mode 100644 index 72fd64809..000000000 Binary files a/tests/visual_tests/images/collision-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/collision-600-400-2.0-agg.png b/tests/visual_tests/images/collision-600-400-2.0-agg.png deleted file mode 100644 index d0e7a446f..000000000 Binary files a/tests/visual_tests/images/collision-600-400-2.0-agg.png and /dev/null differ diff --git a/tests/visual_tests/images/collision-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/collision-600-400-2.0-cairo-reference.png deleted file mode 100644 index b74dc5e79..000000000 Binary files a/tests/visual_tests/images/collision-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/collision-600-400-2.0-cairo.png b/tests/visual_tests/images/collision-600-400-2.0-cairo.png deleted file mode 100644 index d72f19440..000000000 Binary files a/tests/visual_tests/images/collision-600-400-2.0-cairo.png and /dev/null differ diff --git a/tests/visual_tests/images/colorize-alpha1-512-512-1.0-agg-reference.png b/tests/visual_tests/images/colorize-alpha1-512-512-1.0-agg-reference.png deleted file mode 100644 index 27b4496d5..000000000 Binary files a/tests/visual_tests/images/colorize-alpha1-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/colorize-alpha1-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/colorize-alpha1-512-512-1.0-cairo-reference.png deleted file mode 100644 index 24a8a1876..000000000 Binary files a/tests/visual_tests/images/colorize-alpha1-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/colorize-alpha1-512-512-2.0-agg-reference.png b/tests/visual_tests/images/colorize-alpha1-512-512-2.0-agg-reference.png deleted file mode 100644 index 7bf897af0..000000000 Binary files a/tests/visual_tests/images/colorize-alpha1-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/colorize-alpha1-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/colorize-alpha1-512-512-2.0-cairo-reference.png deleted file mode 100644 index f4266ef39..000000000 Binary files a/tests/visual_tests/images/colorize-alpha1-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/colorize-alpha2-512-512-1.0-agg-reference.png b/tests/visual_tests/images/colorize-alpha2-512-512-1.0-agg-reference.png deleted file mode 100644 index 975fe4907..000000000 Binary files a/tests/visual_tests/images/colorize-alpha2-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/colorize-alpha2-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/colorize-alpha2-512-512-1.0-cairo-reference.png deleted file mode 100644 index 24a8a1876..000000000 Binary files a/tests/visual_tests/images/colorize-alpha2-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/colorize-alpha2-512-512-2.0-agg-reference.png b/tests/visual_tests/images/colorize-alpha2-512-512-2.0-agg-reference.png deleted file mode 100644 index 661f67803..000000000 Binary files a/tests/visual_tests/images/colorize-alpha2-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/colorize-alpha2-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/colorize-alpha2-512-512-2.0-cairo-reference.png deleted file mode 100644 index f4266ef39..000000000 Binary files a/tests/visual_tests/images/colorize-alpha2-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/colorize-alpha3-512-512-1.0-agg-reference.png b/tests/visual_tests/images/colorize-alpha3-512-512-1.0-agg-reference.png deleted file mode 100644 index f39190293..000000000 Binary files a/tests/visual_tests/images/colorize-alpha3-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/colorize-alpha3-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/colorize-alpha3-512-512-1.0-cairo-reference.png deleted file mode 100644 index 24a8a1876..000000000 Binary files a/tests/visual_tests/images/colorize-alpha3-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/colorize-alpha3-512-512-2.0-agg-reference.png b/tests/visual_tests/images/colorize-alpha3-512-512-2.0-agg-reference.png deleted file mode 100644 index 30a571da3..000000000 Binary files a/tests/visual_tests/images/colorize-alpha3-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/colorize-alpha3-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/colorize-alpha3-512-512-2.0-cairo-reference.png deleted file mode 100644 index f4266ef39..000000000 Binary files a/tests/visual_tests/images/colorize-alpha3-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/dots-500-100-1.0-agg-reference.png b/tests/visual_tests/images/dots-500-100-1.0-agg-reference.png deleted file mode 100644 index e96ec4310..000000000 Binary files a/tests/visual_tests/images/dots-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/dots-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/dots-500-100-1.0-cairo-reference.png deleted file mode 100644 index e11b74acf..000000000 Binary files a/tests/visual_tests/images/dots-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/dots-500-100-2.0-agg-reference.png b/tests/visual_tests/images/dots-500-100-2.0-agg-reference.png deleted file mode 100644 index e96ec4310..000000000 Binary files a/tests/visual_tests/images/dots-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/dots-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/dots-500-100-2.0-cairo-reference.png deleted file mode 100644 index e11b74acf..000000000 Binary files a/tests/visual_tests/images/dots-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/dst-over-compositing-512-512-1.0-agg-reference.png b/tests/visual_tests/images/dst-over-compositing-512-512-1.0-agg-reference.png deleted file mode 100644 index cde23168f..000000000 Binary files a/tests/visual_tests/images/dst-over-compositing-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/dst-over-compositing-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/dst-over-compositing-512-512-1.0-cairo-reference.png deleted file mode 100644 index aa51da4ef..000000000 Binary files a/tests/visual_tests/images/dst-over-compositing-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/dst-over-compositing-512-512-2.0-agg-reference.png b/tests/visual_tests/images/dst-over-compositing-512-512-2.0-agg-reference.png deleted file mode 100644 index 685debbe7..000000000 Binary files a/tests/visual_tests/images/dst-over-compositing-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/dst-over-compositing-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/dst-over-compositing-512-512-2.0-cairo-reference.png deleted file mode 100644 index aa51da4ef..000000000 Binary files a/tests/visual_tests/images/dst-over-compositing-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/expressionformat-500-100-1.0-agg-reference.png b/tests/visual_tests/images/expressionformat-500-100-1.0-agg-reference.png deleted file mode 100644 index 0781f3836..000000000 Binary files a/tests/visual_tests/images/expressionformat-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/expressionformat-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/expressionformat-500-100-1.0-cairo-reference.png deleted file mode 100644 index 3f47f8529..000000000 Binary files a/tests/visual_tests/images/expressionformat-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/expressionformat-500-100-2.0-agg-reference.png b/tests/visual_tests/images/expressionformat-500-100-2.0-agg-reference.png deleted file mode 100644 index 3b7263de3..000000000 Binary files a/tests/visual_tests/images/expressionformat-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/expressionformat-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/expressionformat-500-100-2.0-cairo-reference.png deleted file mode 100644 index de1f80384..000000000 Binary files a/tests/visual_tests/images/expressionformat-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-1-500-100-1.0-agg-reference.png b/tests/visual_tests/images/formatting-1-500-100-1.0-agg-reference.png deleted file mode 100644 index 64be9c95e..000000000 Binary files a/tests/visual_tests/images/formatting-1-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-1-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/formatting-1-500-100-1.0-cairo-reference.png deleted file mode 100644 index 52d5d5cdb..000000000 Binary files a/tests/visual_tests/images/formatting-1-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-1-500-100-2.0-agg-reference.png b/tests/visual_tests/images/formatting-1-500-100-2.0-agg-reference.png deleted file mode 100644 index a43a8d760..000000000 Binary files a/tests/visual_tests/images/formatting-1-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-1-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/formatting-1-500-100-2.0-cairo-reference.png deleted file mode 100644 index 17d6caf32..000000000 Binary files a/tests/visual_tests/images/formatting-1-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-2-500-100-1.0-agg-reference.png b/tests/visual_tests/images/formatting-2-500-100-1.0-agg-reference.png deleted file mode 100644 index 64be9c95e..000000000 Binary files a/tests/visual_tests/images/formatting-2-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-2-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/formatting-2-500-100-1.0-cairo-reference.png deleted file mode 100644 index 52d5d5cdb..000000000 Binary files a/tests/visual_tests/images/formatting-2-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-2-500-100-2.0-agg-reference.png b/tests/visual_tests/images/formatting-2-500-100-2.0-agg-reference.png deleted file mode 100644 index a43a8d760..000000000 Binary files a/tests/visual_tests/images/formatting-2-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-2-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/formatting-2-500-100-2.0-cairo-reference.png deleted file mode 100644 index 17d6caf32..000000000 Binary files a/tests/visual_tests/images/formatting-2-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-3-500-100-1.0-agg-reference.png b/tests/visual_tests/images/formatting-3-500-100-1.0-agg-reference.png deleted file mode 100644 index cc9131041..000000000 Binary files a/tests/visual_tests/images/formatting-3-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-3-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/formatting-3-500-100-1.0-cairo-reference.png deleted file mode 100644 index ffabcb0e6..000000000 Binary files a/tests/visual_tests/images/formatting-3-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-3-500-100-2.0-agg-reference.png b/tests/visual_tests/images/formatting-3-500-100-2.0-agg-reference.png deleted file mode 100644 index d0ff1b474..000000000 Binary files a/tests/visual_tests/images/formatting-3-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-3-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/formatting-3-500-100-2.0-cairo-reference.png deleted file mode 100644 index ae70b9a36..000000000 Binary files a/tests/visual_tests/images/formatting-3-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-4-500-100-1.0-agg-reference.png b/tests/visual_tests/images/formatting-4-500-100-1.0-agg-reference.png deleted file mode 100644 index fa3ffc1c5..000000000 Binary files a/tests/visual_tests/images/formatting-4-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-4-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/formatting-4-500-100-1.0-cairo-reference.png deleted file mode 100644 index fa3ffc1c5..000000000 Binary files a/tests/visual_tests/images/formatting-4-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-4-500-100-2.0-agg-reference.png b/tests/visual_tests/images/formatting-4-500-100-2.0-agg-reference.png deleted file mode 100644 index 4c2ce1bef..000000000 Binary files a/tests/visual_tests/images/formatting-4-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-4-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/formatting-4-500-100-2.0-cairo-reference.png deleted file mode 100644 index 43f9fcf36..000000000 Binary files a/tests/visual_tests/images/formatting-4-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-5-500-100-1.0-agg-reference.png b/tests/visual_tests/images/formatting-5-500-100-1.0-agg-reference.png deleted file mode 100644 index 64be9c95e..000000000 Binary files a/tests/visual_tests/images/formatting-5-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-5-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/formatting-5-500-100-1.0-cairo-reference.png deleted file mode 100644 index 52d5d5cdb..000000000 Binary files a/tests/visual_tests/images/formatting-5-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-5-500-100-2.0-agg-reference.png b/tests/visual_tests/images/formatting-5-500-100-2.0-agg-reference.png deleted file mode 100644 index a43a8d760..000000000 Binary files a/tests/visual_tests/images/formatting-5-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-5-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/formatting-5-500-100-2.0-cairo-reference.png deleted file mode 100644 index 17d6caf32..000000000 Binary files a/tests/visual_tests/images/formatting-5-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-6-500-100-1.0-agg-reference.png b/tests/visual_tests/images/formatting-6-500-100-1.0-agg-reference.png deleted file mode 100644 index 64be9c95e..000000000 Binary files a/tests/visual_tests/images/formatting-6-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-6-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/formatting-6-500-100-1.0-cairo-reference.png deleted file mode 100644 index 52d5d5cdb..000000000 Binary files a/tests/visual_tests/images/formatting-6-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-6-500-100-2.0-agg-reference.png b/tests/visual_tests/images/formatting-6-500-100-2.0-agg-reference.png deleted file mode 100644 index a43a8d760..000000000 Binary files a/tests/visual_tests/images/formatting-6-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-6-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/formatting-6-500-100-2.0-cairo-reference.png deleted file mode 100644 index 17d6caf32..000000000 Binary files a/tests/visual_tests/images/formatting-6-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-7-500-100-1.0-agg-reference.png b/tests/visual_tests/images/formatting-7-500-100-1.0-agg-reference.png deleted file mode 100644 index 64be9c95e..000000000 Binary files a/tests/visual_tests/images/formatting-7-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-7-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/formatting-7-500-100-1.0-cairo-reference.png deleted file mode 100644 index 52d5d5cdb..000000000 Binary files a/tests/visual_tests/images/formatting-7-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-7-500-100-2.0-agg-reference.png b/tests/visual_tests/images/formatting-7-500-100-2.0-agg-reference.png deleted file mode 100644 index a43a8d760..000000000 Binary files a/tests/visual_tests/images/formatting-7-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-7-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/formatting-7-500-100-2.0-cairo-reference.png deleted file mode 100644 index 17d6caf32..000000000 Binary files a/tests/visual_tests/images/formatting-7-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-8-500-100-1.0-agg-reference.png b/tests/visual_tests/images/formatting-8-500-100-1.0-agg-reference.png deleted file mode 100644 index 64be9c95e..000000000 Binary files a/tests/visual_tests/images/formatting-8-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-8-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/formatting-8-500-100-1.0-cairo-reference.png deleted file mode 100644 index 52d5d5cdb..000000000 Binary files a/tests/visual_tests/images/formatting-8-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-8-500-100-2.0-agg-reference.png b/tests/visual_tests/images/formatting-8-500-100-2.0-agg-reference.png deleted file mode 100644 index a43a8d760..000000000 Binary files a/tests/visual_tests/images/formatting-8-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-8-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/formatting-8-500-100-2.0-cairo-reference.png deleted file mode 100644 index 17d6caf32..000000000 Binary files a/tests/visual_tests/images/formatting-8-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-expr-alignment-500-500-1.0-agg-reference.png b/tests/visual_tests/images/formatting-expr-alignment-500-500-1.0-agg-reference.png deleted file mode 100644 index 65d3d0811..000000000 Binary files a/tests/visual_tests/images/formatting-expr-alignment-500-500-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-expr-alignment-500-500-1.0-cairo-reference.png b/tests/visual_tests/images/formatting-expr-alignment-500-500-1.0-cairo-reference.png deleted file mode 100644 index 883a7d53e..000000000 Binary files a/tests/visual_tests/images/formatting-expr-alignment-500-500-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-expr-alignment-500-500-2.0-agg-reference.png b/tests/visual_tests/images/formatting-expr-alignment-500-500-2.0-agg-reference.png deleted file mode 100644 index d2a79b230..000000000 Binary files a/tests/visual_tests/images/formatting-expr-alignment-500-500-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/formatting-expr-alignment-500-500-2.0-cairo-reference.png b/tests/visual_tests/images/formatting-expr-alignment-500-500-2.0-cairo-reference.png deleted file mode 100644 index 2cf0264d9..000000000 Binary files a/tests/visual_tests/images/formatting-expr-alignment-500-500-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/functional-expressions-256-256-1.0-agg-reference.png b/tests/visual_tests/images/functional-expressions-256-256-1.0-agg-reference.png deleted file mode 100644 index 6f83711ad..000000000 Binary files a/tests/visual_tests/images/functional-expressions-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/functional-expressions-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/functional-expressions-256-256-1.0-cairo-reference.png deleted file mode 100644 index fca6441a4..000000000 Binary files a/tests/visual_tests/images/functional-expressions-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/functional-expressions-256-256-2.0-agg-reference.png b/tests/visual_tests/images/functional-expressions-256-256-2.0-agg-reference.png deleted file mode 100644 index 8041c1280..000000000 Binary files a/tests/visual_tests/images/functional-expressions-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/functional-expressions-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/functional-expressions-256-256-2.0-cairo-reference.png deleted file mode 100644 index 97b599874..000000000 Binary files a/tests/visual_tests/images/functional-expressions-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/functional-expressions-length-512-512-1.0-agg-reference.png b/tests/visual_tests/images/functional-expressions-length-512-512-1.0-agg-reference.png deleted file mode 100644 index 427b74ce1..000000000 Binary files a/tests/visual_tests/images/functional-expressions-length-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/functional-expressions-length-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/functional-expressions-length-512-512-1.0-cairo-reference.png deleted file mode 100644 index 731f9ddb3..000000000 Binary files a/tests/visual_tests/images/functional-expressions-length-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/functional-expressions-length-512-512-2.0-agg-reference.png b/tests/visual_tests/images/functional-expressions-length-512-512-2.0-agg-reference.png deleted file mode 100644 index 9fc93a556..000000000 Binary files a/tests/visual_tests/images/functional-expressions-length-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/functional-expressions-length-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/functional-expressions-length-512-512-2.0-cairo-reference.png deleted file mode 100644 index b24eb4776..000000000 Binary files a/tests/visual_tests/images/functional-expressions-length-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/gdal-filter-factor-600-400-1.0-agg-reference.png b/tests/visual_tests/images/gdal-filter-factor-600-400-1.0-agg-reference.png deleted file mode 100644 index d6130fd62..000000000 Binary files a/tests/visual_tests/images/gdal-filter-factor-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/gdal-filter-factor-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/gdal-filter-factor-600-400-1.0-cairo-reference.png deleted file mode 100644 index d6130fd62..000000000 Binary files a/tests/visual_tests/images/gdal-filter-factor-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/gdal-filter-factor-600-400-2.0-agg-reference.png b/tests/visual_tests/images/gdal-filter-factor-600-400-2.0-agg-reference.png deleted file mode 100644 index d6130fd62..000000000 Binary files a/tests/visual_tests/images/gdal-filter-factor-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/gdal-filter-factor-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/gdal-filter-factor-600-400-2.0-cairo-reference.png deleted file mode 100644 index d6130fd62..000000000 Binary files a/tests/visual_tests/images/gdal-filter-factor-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geojson-geometry-collection-256-256-1.0-agg-reference.png b/tests/visual_tests/images/geojson-geometry-collection-256-256-1.0-agg-reference.png deleted file mode 100644 index f53c79907..000000000 Binary files a/tests/visual_tests/images/geojson-geometry-collection-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geojson-geometry-collection-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/geojson-geometry-collection-256-256-1.0-cairo-reference.png deleted file mode 100644 index fe7a53ec6..000000000 Binary files a/tests/visual_tests/images/geojson-geometry-collection-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geojson-geometry-collection-256-256-2.0-agg-reference.png b/tests/visual_tests/images/geojson-geometry-collection-256-256-2.0-agg-reference.png deleted file mode 100644 index 206205586..000000000 Binary files a/tests/visual_tests/images/geojson-geometry-collection-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geojson-geometry-collection-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/geojson-geometry-collection-256-256-2.0-cairo-reference.png deleted file mode 100644 index 03d961875..000000000 Binary files a/tests/visual_tests/images/geojson-geometry-collection-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-scale-500-500-1.0-agg-reference.png b/tests/visual_tests/images/geometry-transform-scale-500-500-1.0-agg-reference.png deleted file mode 100644 index 820af7496..000000000 Binary files a/tests/visual_tests/images/geometry-transform-scale-500-500-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-scale-500-500-1.0-cairo-reference.png b/tests/visual_tests/images/geometry-transform-scale-500-500-1.0-cairo-reference.png deleted file mode 100644 index 23814149e..000000000 Binary files a/tests/visual_tests/images/geometry-transform-scale-500-500-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-scale-500-500-2.0-agg-reference.png b/tests/visual_tests/images/geometry-transform-scale-500-500-2.0-agg-reference.png deleted file mode 100644 index 518cb570e..000000000 Binary files a/tests/visual_tests/images/geometry-transform-scale-500-500-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-scale-500-500-2.0-cairo-reference.png b/tests/visual_tests/images/geometry-transform-scale-500-500-2.0-cairo-reference.png deleted file mode 100644 index 83b72c1f7..000000000 Binary files a/tests/visual_tests/images/geometry-transform-scale-500-500-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-scale-patterns-500-500-1.0-agg-reference.png b/tests/visual_tests/images/geometry-transform-scale-patterns-500-500-1.0-agg-reference.png deleted file mode 100644 index 76eaf0b5e..000000000 Binary files a/tests/visual_tests/images/geometry-transform-scale-patterns-500-500-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-scale-patterns-500-500-1.0-cairo-reference.png b/tests/visual_tests/images/geometry-transform-scale-patterns-500-500-1.0-cairo-reference.png deleted file mode 100644 index 27c93ac18..000000000 Binary files a/tests/visual_tests/images/geometry-transform-scale-patterns-500-500-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-scale-patterns-500-500-2.0-agg-reference.png b/tests/visual_tests/images/geometry-transform-scale-patterns-500-500-2.0-agg-reference.png deleted file mode 100644 index eee2ab7af..000000000 Binary files a/tests/visual_tests/images/geometry-transform-scale-patterns-500-500-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-scale-patterns-500-500-2.0-cairo-reference.png b/tests/visual_tests/images/geometry-transform-scale-patterns-500-500-2.0-cairo-reference.png deleted file mode 100644 index 6342816f6..000000000 Binary files a/tests/visual_tests/images/geometry-transform-scale-patterns-500-500-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-translate-200-200-1.0-agg-reference.png b/tests/visual_tests/images/geometry-transform-translate-200-200-1.0-agg-reference.png deleted file mode 100644 index 7c7086ed6..000000000 Binary files a/tests/visual_tests/images/geometry-transform-translate-200-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-translate-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/geometry-transform-translate-200-200-1.0-cairo-reference.png deleted file mode 100644 index d7929db08..000000000 Binary files a/tests/visual_tests/images/geometry-transform-translate-200-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-translate-200-200-2.0-agg-reference.png b/tests/visual_tests/images/geometry-transform-translate-200-200-2.0-agg-reference.png deleted file mode 100644 index 12e0a9adb..000000000 Binary files a/tests/visual_tests/images/geometry-transform-translate-200-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-translate-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/geometry-transform-translate-200-200-2.0-cairo-reference.png deleted file mode 100644 index c2078916b..000000000 Binary files a/tests/visual_tests/images/geometry-transform-translate-200-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-translate-patterns-200-200-1.0-agg-reference.png b/tests/visual_tests/images/geometry-transform-translate-patterns-200-200-1.0-agg-reference.png deleted file mode 100644 index 9a68f740a..000000000 Binary files a/tests/visual_tests/images/geometry-transform-translate-patterns-200-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-translate-patterns-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/geometry-transform-translate-patterns-200-200-1.0-cairo-reference.png deleted file mode 100644 index 03f7e4c97..000000000 Binary files a/tests/visual_tests/images/geometry-transform-translate-patterns-200-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-translate-patterns-200-200-2.0-agg-reference.png b/tests/visual_tests/images/geometry-transform-translate-patterns-200-200-2.0-agg-reference.png deleted file mode 100644 index 44786428f..000000000 Binary files a/tests/visual_tests/images/geometry-transform-translate-patterns-200-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-translate-patterns-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/geometry-transform-translate-patterns-200-200-2.0-cairo-reference.png deleted file mode 100644 index 9bdd6da17..000000000 Binary files a/tests/visual_tests/images/geometry-transform-translate-patterns-200-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-translate-patterns-svg-200-200-1.0-agg-reference.png b/tests/visual_tests/images/geometry-transform-translate-patterns-svg-200-200-1.0-agg-reference.png deleted file mode 100644 index 1204e2138..000000000 Binary files a/tests/visual_tests/images/geometry-transform-translate-patterns-svg-200-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-translate-patterns-svg-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/geometry-transform-translate-patterns-svg-200-200-1.0-cairo-reference.png deleted file mode 100644 index cd17dfe1e..000000000 Binary files a/tests/visual_tests/images/geometry-transform-translate-patterns-svg-200-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-translate-patterns-svg-200-200-2.0-agg-reference.png b/tests/visual_tests/images/geometry-transform-translate-patterns-svg-200-200-2.0-agg-reference.png deleted file mode 100644 index de366bb32..000000000 Binary files a/tests/visual_tests/images/geometry-transform-translate-patterns-svg-200-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/geometry-transform-translate-patterns-svg-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/geometry-transform-translate-patterns-svg-200-200-2.0-cairo-reference.png deleted file mode 100644 index 21bdb3eca..000000000 Binary files a/tests/visual_tests/images/geometry-transform-translate-patterns-svg-200-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-1-512-512-1.0-agg-reference.png b/tests/visual_tests/images/group-symbolizer-1-512-512-1.0-agg-reference.png deleted file mode 100644 index df24c35d3..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-1-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-1-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/group-symbolizer-1-512-512-1.0-cairo-reference.png deleted file mode 100644 index f35755b7c..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-1-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-1-512-512-2.0-agg-reference.png b/tests/visual_tests/images/group-symbolizer-1-512-512-2.0-agg-reference.png deleted file mode 100644 index 91711d969..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-1-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-1-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/group-symbolizer-1-512-512-2.0-cairo-reference.png deleted file mode 100644 index 2c109d2d2..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-1-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-2-512-512-1.0-agg-reference.png b/tests/visual_tests/images/group-symbolizer-2-512-512-1.0-agg-reference.png deleted file mode 100644 index bef874b71..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-2-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-2-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/group-symbolizer-2-512-512-1.0-cairo-reference.png deleted file mode 100644 index 0d43c451f..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-2-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-2-512-512-2.0-agg-reference.png b/tests/visual_tests/images/group-symbolizer-2-512-512-2.0-agg-reference.png deleted file mode 100644 index aebd66e83..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-2-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-2-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/group-symbolizer-2-512-512-2.0-cairo-reference.png deleted file mode 100644 index 56de27930..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-2-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-3-512-256-1.0-agg-reference.png b/tests/visual_tests/images/group-symbolizer-3-512-256-1.0-agg-reference.png deleted file mode 100644 index 33be04dc2..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-3-512-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-3-512-256-1.0-cairo-reference.png b/tests/visual_tests/images/group-symbolizer-3-512-256-1.0-cairo-reference.png deleted file mode 100644 index 567d77c04..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-3-512-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-3-512-256-2.0-agg-reference.png b/tests/visual_tests/images/group-symbolizer-3-512-256-2.0-agg-reference.png deleted file mode 100644 index 2ff84564e..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-3-512-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-3-512-256-2.0-cairo-reference.png b/tests/visual_tests/images/group-symbolizer-3-512-256-2.0-cairo-reference.png deleted file mode 100644 index 5a023e40c..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-3-512-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-4-500-100-1.0-agg-reference.png b/tests/visual_tests/images/group-symbolizer-4-500-100-1.0-agg-reference.png deleted file mode 100644 index 6d9467406..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-4-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-4-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/group-symbolizer-4-500-100-1.0-cairo-reference.png deleted file mode 100644 index 15ce645b3..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-4-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-4-500-100-2.0-agg-reference.png b/tests/visual_tests/images/group-symbolizer-4-500-100-2.0-agg-reference.png deleted file mode 100644 index ec7c0bb8d..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-4-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-4-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/group-symbolizer-4-500-100-2.0-cairo-reference.png deleted file mode 100644 index c844a95b7..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-4-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-4-512-256-1.0-agg-reference.png b/tests/visual_tests/images/group-symbolizer-4-512-256-1.0-agg-reference.png deleted file mode 100644 index 5c39f4591..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-4-512-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-4-512-256-1.0-cairo-reference.png b/tests/visual_tests/images/group-symbolizer-4-512-256-1.0-cairo-reference.png deleted file mode 100644 index 1d40bd89e..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-4-512-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-4-512-256-2.0-agg-reference.png b/tests/visual_tests/images/group-symbolizer-4-512-256-2.0-agg-reference.png deleted file mode 100644 index 56ed895dd..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-4-512-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-4-512-256-2.0-cairo-reference.png b/tests/visual_tests/images/group-symbolizer-4-512-256-2.0-cairo-reference.png deleted file mode 100644 index 9978139ff..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-4-512-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-line-1-512-512-1.0-agg-reference.png b/tests/visual_tests/images/group-symbolizer-line-1-512-512-1.0-agg-reference.png deleted file mode 100644 index 00df3fef3..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-line-1-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-line-1-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/group-symbolizer-line-1-512-512-1.0-cairo-reference.png deleted file mode 100644 index 07a3f932b..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-line-1-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-line-1-512-512-2.0-agg-reference.png b/tests/visual_tests/images/group-symbolizer-line-1-512-512-2.0-agg-reference.png deleted file mode 100644 index fa0c2c9ce..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-line-1-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-line-1-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/group-symbolizer-line-1-512-512-2.0-cairo-reference.png deleted file mode 100644 index f14e37c24..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-line-1-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-line-2-512-512-1.0-agg-reference.png b/tests/visual_tests/images/group-symbolizer-line-2-512-512-1.0-agg-reference.png deleted file mode 100644 index e5a0b8166..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-line-2-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-line-2-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/group-symbolizer-line-2-512-512-1.0-cairo-reference.png deleted file mode 100644 index d284916ef..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-line-2-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-line-2-512-512-2.0-agg-reference.png b/tests/visual_tests/images/group-symbolizer-line-2-512-512-2.0-agg-reference.png deleted file mode 100644 index f67cdd7ff..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-line-2-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/group-symbolizer-line-2-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/group-symbolizer-line-2-512-512-2.0-cairo-reference.png deleted file mode 100644 index 5e1f4992a..000000000 Binary files a/tests/visual_tests/images/group-symbolizer-line-2-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/halo-comp-op-on-satellite-450-450-1.0-agg-reference.png b/tests/visual_tests/images/halo-comp-op-on-satellite-450-450-1.0-agg-reference.png deleted file mode 100644 index 55b0559d3..000000000 Binary files a/tests/visual_tests/images/halo-comp-op-on-satellite-450-450-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/halo-comp-op-on-satellite-450-450-1.0-cairo-reference.png b/tests/visual_tests/images/halo-comp-op-on-satellite-450-450-1.0-cairo-reference.png deleted file mode 100644 index 1a33ced33..000000000 Binary files a/tests/visual_tests/images/halo-comp-op-on-satellite-450-450-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/halo-comp-op-on-satellite-450-450-2.0-agg-reference.png b/tests/visual_tests/images/halo-comp-op-on-satellite-450-450-2.0-agg-reference.png deleted file mode 100644 index 147e05657..000000000 Binary files a/tests/visual_tests/images/halo-comp-op-on-satellite-450-450-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/halo-comp-op-on-satellite-450-450-2.0-cairo-reference.png b/tests/visual_tests/images/halo-comp-op-on-satellite-450-450-2.0-cairo-reference.png deleted file mode 100644 index ba73af49f..000000000 Binary files a/tests/visual_tests/images/halo-comp-op-on-satellite-450-450-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/harfbuzz-800-200-1.0-agg-reference.png b/tests/visual_tests/images/harfbuzz-800-200-1.0-agg-reference.png deleted file mode 100644 index f11d26423..000000000 Binary files a/tests/visual_tests/images/harfbuzz-800-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/harfbuzz-800-200-1.0-cairo-reference.png b/tests/visual_tests/images/harfbuzz-800-200-1.0-cairo-reference.png deleted file mode 100644 index f83b2778a..000000000 Binary files a/tests/visual_tests/images/harfbuzz-800-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/harfbuzz-800-200-2.0-agg-reference.png b/tests/visual_tests/images/harfbuzz-800-200-2.0-agg-reference.png deleted file mode 100644 index adecccb54..000000000 Binary files a/tests/visual_tests/images/harfbuzz-800-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/harfbuzz-800-200-2.0-cairo-reference.png b/tests/visual_tests/images/harfbuzz-800-200-2.0-cairo-reference.png deleted file mode 100644 index b1fd3d835..000000000 Binary files a/tests/visual_tests/images/harfbuzz-800-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/hb-fontsets-800-200-1.0-agg-reference.png b/tests/visual_tests/images/hb-fontsets-800-200-1.0-agg-reference.png deleted file mode 100644 index ef8510f04..000000000 Binary files a/tests/visual_tests/images/hb-fontsets-800-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/hb-fontsets-800-200-1.0-cairo-reference.png b/tests/visual_tests/images/hb-fontsets-800-200-1.0-cairo-reference.png deleted file mode 100644 index a5219625b..000000000 Binary files a/tests/visual_tests/images/hb-fontsets-800-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/hb-fontsets-800-200-2.0-agg-reference.png b/tests/visual_tests/images/hb-fontsets-800-200-2.0-agg-reference.png deleted file mode 100644 index 18990f201..000000000 Binary files a/tests/visual_tests/images/hb-fontsets-800-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/hb-fontsets-800-200-2.0-cairo-reference.png b/tests/visual_tests/images/hb-fontsets-800-200-2.0-cairo-reference.png deleted file mode 100644 index b9e7aec73..000000000 Binary files a/tests/visual_tests/images/hb-fontsets-800-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/image-filters-galore-512-512-1.0-agg-reference.png b/tests/visual_tests/images/image-filters-galore-512-512-1.0-agg-reference.png deleted file mode 100644 index f2df50a8a..000000000 Binary files a/tests/visual_tests/images/image-filters-galore-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/image-filters-galore-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/image-filters-galore-512-512-1.0-cairo-reference.png deleted file mode 100644 index f6c9d11c4..000000000 Binary files a/tests/visual_tests/images/image-filters-galore-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/image-filters-galore-512-512-2.0-agg-reference.png b/tests/visual_tests/images/image-filters-galore-512-512-2.0-agg-reference.png deleted file mode 100644 index f2df50a8a..000000000 Binary files a/tests/visual_tests/images/image-filters-galore-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/image-filters-galore-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/image-filters-galore-512-512-2.0-cairo-reference.png deleted file mode 100644 index f6c9d11c4..000000000 Binary files a/tests/visual_tests/images/image-filters-galore-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/image-filters-multi-blur-512-512-1.0-agg-reference.png b/tests/visual_tests/images/image-filters-multi-blur-512-512-1.0-agg-reference.png deleted file mode 100644 index f482887dd..000000000 Binary files a/tests/visual_tests/images/image-filters-multi-blur-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/image-filters-multi-blur-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/image-filters-multi-blur-512-512-1.0-cairo-reference.png deleted file mode 100644 index caf6fc826..000000000 Binary files a/tests/visual_tests/images/image-filters-multi-blur-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/image-filters-multi-blur-512-512-2.0-agg-reference.png b/tests/visual_tests/images/image-filters-multi-blur-512-512-2.0-agg-reference.png deleted file mode 100644 index 1492c17e8..000000000 Binary files a/tests/visual_tests/images/image-filters-multi-blur-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/image-filters-multi-blur-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/image-filters-multi-blur-512-512-2.0-cairo-reference.png deleted file mode 100644 index 579c89b84..000000000 Binary files a/tests/visual_tests/images/image-filters-multi-blur-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/image-filters-multi-blur-inflate-512-512-1.0-agg-reference.png b/tests/visual_tests/images/image-filters-multi-blur-inflate-512-512-1.0-agg-reference.png deleted file mode 100644 index 7c977a10c..000000000 Binary files a/tests/visual_tests/images/image-filters-multi-blur-inflate-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/image-filters-multi-blur-inflate-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/image-filters-multi-blur-inflate-512-512-1.0-cairo-reference.png deleted file mode 100644 index caf6fc826..000000000 Binary files a/tests/visual_tests/images/image-filters-multi-blur-inflate-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/image-filters-multi-blur-inflate-512-512-2.0-agg-reference.png b/tests/visual_tests/images/image-filters-multi-blur-inflate-512-512-2.0-agg-reference.png deleted file mode 100644 index b4aeaaf71..000000000 Binary files a/tests/visual_tests/images/image-filters-multi-blur-inflate-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/image-filters-multi-blur-inflate-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/image-filters-multi-blur-inflate-512-512-2.0-cairo-reference.png deleted file mode 100644 index 579c89b84..000000000 Binary files a/tests/visual_tests/images/image-filters-multi-blur-inflate-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/jalign-auto-200-200-1.0-agg-reference.png b/tests/visual_tests/images/jalign-auto-200-200-1.0-agg-reference.png deleted file mode 100644 index 0fd4d818b..000000000 Binary files a/tests/visual_tests/images/jalign-auto-200-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/jalign-auto-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/jalign-auto-200-200-1.0-cairo-reference.png deleted file mode 100644 index a92df8755..000000000 Binary files a/tests/visual_tests/images/jalign-auto-200-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/jalign-auto-200-200-2.0-agg-reference.png b/tests/visual_tests/images/jalign-auto-200-200-2.0-agg-reference.png deleted file mode 100644 index fecedca3c..000000000 Binary files a/tests/visual_tests/images/jalign-auto-200-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/jalign-auto-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/jalign-auto-200-200-2.0-cairo-reference.png deleted file mode 100644 index 8d99da3c8..000000000 Binary files a/tests/visual_tests/images/jalign-auto-200-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/khmer-800-200-1.0-agg-reference.png b/tests/visual_tests/images/khmer-800-200-1.0-agg-reference.png deleted file mode 100644 index e462c19a5..000000000 Binary files a/tests/visual_tests/images/khmer-800-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/khmer-800-200-1.0-cairo-reference.png b/tests/visual_tests/images/khmer-800-200-1.0-cairo-reference.png deleted file mode 100644 index 9881bc0a2..000000000 Binary files a/tests/visual_tests/images/khmer-800-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/khmer-800-200-2.0-agg-reference.png b/tests/visual_tests/images/khmer-800-200-2.0-agg-reference.png deleted file mode 100644 index f54f69361..000000000 Binary files a/tests/visual_tests/images/khmer-800-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/khmer-800-200-2.0-cairo-reference.png b/tests/visual_tests/images/khmer-800-200-2.0-cairo-reference.png deleted file mode 100644 index 38c79e98d..000000000 Binary files a/tests/visual_tests/images/khmer-800-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/kurdish-text-512-512-1.0-agg-reference.png b/tests/visual_tests/images/kurdish-text-512-512-1.0-agg-reference.png deleted file mode 100644 index f0e08ec7b..000000000 Binary files a/tests/visual_tests/images/kurdish-text-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/kurdish-text-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/kurdish-text-512-512-1.0-cairo-reference.png deleted file mode 100644 index db5bac3b4..000000000 Binary files a/tests/visual_tests/images/kurdish-text-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/kurdish-text-512-512-2.0-agg-reference.png b/tests/visual_tests/images/kurdish-text-512-512-2.0-agg-reference.png deleted file mode 100644 index 3c48219d3..000000000 Binary files a/tests/visual_tests/images/kurdish-text-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/kurdish-text-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/kurdish-text-512-512-2.0-cairo-reference.png deleted file mode 100644 index d1abf463d..000000000 Binary files a/tests/visual_tests/images/kurdish-text-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/kurdish-text-ogr-512-512-1.0-agg-reference.png b/tests/visual_tests/images/kurdish-text-ogr-512-512-1.0-agg-reference.png deleted file mode 100644 index f0e08ec7b..000000000 Binary files a/tests/visual_tests/images/kurdish-text-ogr-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/kurdish-text-ogr-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/kurdish-text-ogr-512-512-1.0-cairo-reference.png deleted file mode 100644 index db5bac3b4..000000000 Binary files a/tests/visual_tests/images/kurdish-text-ogr-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/kurdish-text-ogr-512-512-2.0-agg-reference.png b/tests/visual_tests/images/kurdish-text-ogr-512-512-2.0-agg-reference.png deleted file mode 100644 index 3c48219d3..000000000 Binary files a/tests/visual_tests/images/kurdish-text-ogr-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/kurdish-text-ogr-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/kurdish-text-ogr-512-512-2.0-cairo-reference.png deleted file mode 100644 index d1abf463d..000000000 Binary files a/tests/visual_tests/images/kurdish-text-ogr-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-offset-900-250-1.0-agg-reference.png b/tests/visual_tests/images/line-offset-900-250-1.0-agg-reference.png deleted file mode 100644 index 644529e50..000000000 Binary files a/tests/visual_tests/images/line-offset-900-250-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-offset-900-250-1.0-cairo-reference.png b/tests/visual_tests/images/line-offset-900-250-1.0-cairo-reference.png deleted file mode 100644 index eb0db9546..000000000 Binary files a/tests/visual_tests/images/line-offset-900-250-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-offset-900-250-2.0-agg-reference.png b/tests/visual_tests/images/line-offset-900-250-2.0-agg-reference.png deleted file mode 100644 index 095d02b5f..000000000 Binary files a/tests/visual_tests/images/line-offset-900-250-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-offset-900-250-2.0-cairo-reference.png b/tests/visual_tests/images/line-offset-900-250-2.0-cairo-reference.png deleted file mode 100644 index 8b65591fa..000000000 Binary files a/tests/visual_tests/images/line-offset-900-250-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-opacity-multi-render-512-512-1.0-agg-reference.png b/tests/visual_tests/images/line-opacity-multi-render-512-512-1.0-agg-reference.png deleted file mode 100644 index 73a23b95a..000000000 Binary files a/tests/visual_tests/images/line-opacity-multi-render-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-opacity-multi-render-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/line-opacity-multi-render-512-512-1.0-cairo-reference.png deleted file mode 100644 index cadd94f8d..000000000 Binary files a/tests/visual_tests/images/line-opacity-multi-render-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-opacity-multi-render-512-512-2.0-agg-reference.png b/tests/visual_tests/images/line-opacity-multi-render-512-512-2.0-agg-reference.png deleted file mode 100644 index 300842542..000000000 Binary files a/tests/visual_tests/images/line-opacity-multi-render-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-opacity-multi-render-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/line-opacity-multi-render-512-512-2.0-cairo-reference.png deleted file mode 100644 index 94fe30c24..000000000 Binary files a/tests/visual_tests/images/line-opacity-multi-render-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-smooth-and-offset-500-100-1.0-agg-reference.png b/tests/visual_tests/images/line-pattern-smooth-and-offset-500-100-1.0-agg-reference.png deleted file mode 100644 index 6da936da1..000000000 Binary files a/tests/visual_tests/images/line-pattern-smooth-and-offset-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-smooth-and-offset-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/line-pattern-smooth-and-offset-500-100-1.0-cairo-reference.png deleted file mode 100644 index 9818100e1..000000000 Binary files a/tests/visual_tests/images/line-pattern-smooth-and-offset-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-smooth-and-offset-500-100-2.0-agg-reference.png b/tests/visual_tests/images/line-pattern-smooth-and-offset-500-100-2.0-agg-reference.png deleted file mode 100644 index a8b724ee6..000000000 Binary files a/tests/visual_tests/images/line-pattern-smooth-and-offset-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-smooth-and-offset-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/line-pattern-smooth-and-offset-500-100-2.0-cairo-reference.png deleted file mode 100644 index 41c6076cd..000000000 Binary files a/tests/visual_tests/images/line-pattern-smooth-and-offset-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-smooth-and-offset-512-512-1.0-agg-reference.png b/tests/visual_tests/images/line-pattern-smooth-and-offset-512-512-1.0-agg-reference.png deleted file mode 100644 index 1137a3fe1..000000000 Binary files a/tests/visual_tests/images/line-pattern-smooth-and-offset-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-smooth-and-offset-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/line-pattern-smooth-and-offset-512-512-1.0-cairo-reference.png deleted file mode 100644 index 9a2081b05..000000000 Binary files a/tests/visual_tests/images/line-pattern-smooth-and-offset-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-smooth-and-offset-512-512-2.0-agg-reference.png b/tests/visual_tests/images/line-pattern-smooth-and-offset-512-512-2.0-agg-reference.png deleted file mode 100644 index 37c727536..000000000 Binary files a/tests/visual_tests/images/line-pattern-smooth-and-offset-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-smooth-and-offset-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/line-pattern-smooth-and-offset-512-512-2.0-cairo-reference.png deleted file mode 100644 index 48e86f041..000000000 Binary files a/tests/visual_tests/images/line-pattern-smooth-and-offset-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-symbolizer-900-250-1.0-agg-reference.png b/tests/visual_tests/images/line-pattern-symbolizer-900-250-1.0-agg-reference.png deleted file mode 100644 index a91822638..000000000 Binary files a/tests/visual_tests/images/line-pattern-symbolizer-900-250-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-symbolizer-900-250-1.0-cairo-reference.png b/tests/visual_tests/images/line-pattern-symbolizer-900-250-1.0-cairo-reference.png deleted file mode 100644 index ab07426ca..000000000 Binary files a/tests/visual_tests/images/line-pattern-symbolizer-900-250-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-symbolizer-900-250-2.0-agg-reference.png b/tests/visual_tests/images/line-pattern-symbolizer-900-250-2.0-agg-reference.png deleted file mode 100644 index 49f01f54b..000000000 Binary files a/tests/visual_tests/images/line-pattern-symbolizer-900-250-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-symbolizer-900-250-2.0-cairo-reference.png b/tests/visual_tests/images/line-pattern-symbolizer-900-250-2.0-cairo-reference.png deleted file mode 100644 index 9ff788714..000000000 Binary files a/tests/visual_tests/images/line-pattern-symbolizer-900-250-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-symbolizer-opacity-512-512-1.0-agg-reference.png b/tests/visual_tests/images/line-pattern-symbolizer-opacity-512-512-1.0-agg-reference.png deleted file mode 100644 index 738f7ce18..000000000 Binary files a/tests/visual_tests/images/line-pattern-symbolizer-opacity-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-symbolizer-opacity-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/line-pattern-symbolizer-opacity-512-512-1.0-cairo-reference.png deleted file mode 100644 index ea54754e6..000000000 Binary files a/tests/visual_tests/images/line-pattern-symbolizer-opacity-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-symbolizer-opacity-512-512-2.0-agg-reference.png b/tests/visual_tests/images/line-pattern-symbolizer-opacity-512-512-2.0-agg-reference.png deleted file mode 100644 index 738f7ce18..000000000 Binary files a/tests/visual_tests/images/line-pattern-symbolizer-opacity-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-pattern-symbolizer-opacity-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/line-pattern-symbolizer-opacity-512-512-2.0-cairo-reference.png deleted file mode 100644 index ea54754e6..000000000 Binary files a/tests/visual_tests/images/line-pattern-symbolizer-opacity-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-smooth-and-offset-512-512-1.0-agg-reference.png b/tests/visual_tests/images/line-smooth-and-offset-512-512-1.0-agg-reference.png deleted file mode 100644 index d076d6582..000000000 Binary files a/tests/visual_tests/images/line-smooth-and-offset-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-smooth-and-offset-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/line-smooth-and-offset-512-512-1.0-cairo-reference.png deleted file mode 100644 index 5ef66cae7..000000000 Binary files a/tests/visual_tests/images/line-smooth-and-offset-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-smooth-and-offset-512-512-2.0-agg-reference.png b/tests/visual_tests/images/line-smooth-and-offset-512-512-2.0-agg-reference.png deleted file mode 100644 index 8fd9b3ddd..000000000 Binary files a/tests/visual_tests/images/line-smooth-and-offset-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-smooth-and-offset-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/line-smooth-and-offset-512-512-2.0-cairo-reference.png deleted file mode 100644 index 3d139ab1b..000000000 Binary files a/tests/visual_tests/images/line-smooth-and-offset-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-symbolizer-expressions-256-256-1.0-agg-reference.png b/tests/visual_tests/images/line-symbolizer-expressions-256-256-1.0-agg-reference.png deleted file mode 100644 index 3889e8f54..000000000 Binary files a/tests/visual_tests/images/line-symbolizer-expressions-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-symbolizer-expressions-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/line-symbolizer-expressions-256-256-1.0-cairo-reference.png deleted file mode 100644 index fddacfda6..000000000 Binary files a/tests/visual_tests/images/line-symbolizer-expressions-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-symbolizer-expressions-256-256-2.0-agg-reference.png b/tests/visual_tests/images/line-symbolizer-expressions-256-256-2.0-agg-reference.png deleted file mode 100644 index dcd491669..000000000 Binary files a/tests/visual_tests/images/line-symbolizer-expressions-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-symbolizer-expressions-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/line-symbolizer-expressions-256-256-2.0-cairo-reference.png deleted file mode 100644 index 7400f7687..000000000 Binary files a/tests/visual_tests/images/line-symbolizer-expressions-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-symbolizer-expressions-all-256-256-1.0-agg-reference.png b/tests/visual_tests/images/line-symbolizer-expressions-all-256-256-1.0-agg-reference.png deleted file mode 100644 index d804115b5..000000000 Binary files a/tests/visual_tests/images/line-symbolizer-expressions-all-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-symbolizer-expressions-all-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/line-symbolizer-expressions-all-256-256-1.0-cairo-reference.png deleted file mode 100644 index 310add4ac..000000000 Binary files a/tests/visual_tests/images/line-symbolizer-expressions-all-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-symbolizer-expressions-all-256-256-2.0-agg-reference.png b/tests/visual_tests/images/line-symbolizer-expressions-all-256-256-2.0-agg-reference.png deleted file mode 100644 index bac9f66e5..000000000 Binary files a/tests/visual_tests/images/line-symbolizer-expressions-all-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line-symbolizer-expressions-all-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/line-symbolizer-expressions-all-256-256-2.0-cairo-reference.png deleted file mode 100644 index 018385126..000000000 Binary files a/tests/visual_tests/images/line-symbolizer-expressions-all-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line_break-800-800-1.0-agg-reference.png b/tests/visual_tests/images/line_break-800-800-1.0-agg-reference.png deleted file mode 100644 index af83882a5..000000000 Binary files a/tests/visual_tests/images/line_break-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line_break-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/line_break-800-800-1.0-cairo-reference.png deleted file mode 100644 index dcfab57af..000000000 Binary files a/tests/visual_tests/images/line_break-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line_break-800-800-2.0-agg-reference.png b/tests/visual_tests/images/line_break-800-800-2.0-agg-reference.png deleted file mode 100644 index acf3b5566..000000000 Binary files a/tests/visual_tests/images/line_break-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/line_break-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/line_break-800-800-2.0-cairo-reference.png deleted file mode 100644 index c60f3b2c0..000000000 Binary files a/tests/visual_tests/images/line_break-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-200-200-1.0-agg-reference.png b/tests/visual_tests/images/lines-1-200-200-1.0-agg-reference.png deleted file mode 100644 index 40fb2c6ef..000000000 Binary files a/tests/visual_tests/images/lines-1-200-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/lines-1-200-200-1.0-cairo-reference.png deleted file mode 100644 index 675002fe1..000000000 Binary files a/tests/visual_tests/images/lines-1-200-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-200-200-2.0-agg-reference.png b/tests/visual_tests/images/lines-1-200-200-2.0-agg-reference.png deleted file mode 100644 index 5b48ee538..000000000 Binary files a/tests/visual_tests/images/lines-1-200-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/lines-1-200-200-2.0-cairo-reference.png deleted file mode 100644 index c46804b5d..000000000 Binary files a/tests/visual_tests/images/lines-1-200-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-400-400-1.0-agg-reference.png b/tests/visual_tests/images/lines-1-400-400-1.0-agg-reference.png deleted file mode 100644 index 8bac08273..000000000 Binary files a/tests/visual_tests/images/lines-1-400-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-400-400-1.0-cairo-reference.png b/tests/visual_tests/images/lines-1-400-400-1.0-cairo-reference.png deleted file mode 100644 index 31dec4591..000000000 Binary files a/tests/visual_tests/images/lines-1-400-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-400-400-2.0-agg-reference.png b/tests/visual_tests/images/lines-1-400-400-2.0-agg-reference.png deleted file mode 100644 index b6ef2dba6..000000000 Binary files a/tests/visual_tests/images/lines-1-400-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-400-400-2.0-cairo-reference.png b/tests/visual_tests/images/lines-1-400-400-2.0-cairo-reference.png deleted file mode 100644 index b3fa84eda..000000000 Binary files a/tests/visual_tests/images/lines-1-400-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-600-600-1.0-agg-reference.png b/tests/visual_tests/images/lines-1-600-600-1.0-agg-reference.png deleted file mode 100644 index 20208397e..000000000 Binary files a/tests/visual_tests/images/lines-1-600-600-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-600-600-1.0-cairo-reference.png b/tests/visual_tests/images/lines-1-600-600-1.0-cairo-reference.png deleted file mode 100644 index de8fbb265..000000000 Binary files a/tests/visual_tests/images/lines-1-600-600-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-600-600-2.0-agg-reference.png b/tests/visual_tests/images/lines-1-600-600-2.0-agg-reference.png deleted file mode 100644 index d36c9b845..000000000 Binary files a/tests/visual_tests/images/lines-1-600-600-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-600-600-2.0-cairo-reference.png b/tests/visual_tests/images/lines-1-600-600-2.0-cairo-reference.png deleted file mode 100644 index 0d454cf56..000000000 Binary files a/tests/visual_tests/images/lines-1-600-600-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-800-800-1.0-agg-reference.png b/tests/visual_tests/images/lines-1-800-800-1.0-agg-reference.png deleted file mode 100644 index 51ffc04c9..000000000 Binary files a/tests/visual_tests/images/lines-1-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/lines-1-800-800-1.0-cairo-reference.png deleted file mode 100644 index 77ccce9bd..000000000 Binary files a/tests/visual_tests/images/lines-1-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-800-800-2.0-agg-reference.png b/tests/visual_tests/images/lines-1-800-800-2.0-agg-reference.png deleted file mode 100644 index bf3daee62..000000000 Binary files a/tests/visual_tests/images/lines-1-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-1-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/lines-1-800-800-2.0-cairo-reference.png deleted file mode 100644 index 1e919d92f..000000000 Binary files a/tests/visual_tests/images/lines-1-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-200-200-1.0-agg-reference.png b/tests/visual_tests/images/lines-2-200-200-1.0-agg-reference.png deleted file mode 100644 index a493a3777..000000000 Binary files a/tests/visual_tests/images/lines-2-200-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/lines-2-200-200-1.0-cairo-reference.png deleted file mode 100644 index bb670ccde..000000000 Binary files a/tests/visual_tests/images/lines-2-200-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-200-200-2.0-agg-reference.png b/tests/visual_tests/images/lines-2-200-200-2.0-agg-reference.png deleted file mode 100644 index 5b48ee538..000000000 Binary files a/tests/visual_tests/images/lines-2-200-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/lines-2-200-200-2.0-cairo-reference.png deleted file mode 100644 index c46804b5d..000000000 Binary files a/tests/visual_tests/images/lines-2-200-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-400-400-1.0-agg-reference.png b/tests/visual_tests/images/lines-2-400-400-1.0-agg-reference.png deleted file mode 100644 index e7f288dc8..000000000 Binary files a/tests/visual_tests/images/lines-2-400-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-400-400-1.0-cairo-reference.png b/tests/visual_tests/images/lines-2-400-400-1.0-cairo-reference.png deleted file mode 100644 index 24ab97117..000000000 Binary files a/tests/visual_tests/images/lines-2-400-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-400-400-2.0-agg-reference.png b/tests/visual_tests/images/lines-2-400-400-2.0-agg-reference.png deleted file mode 100644 index 0b1eb7ebc..000000000 Binary files a/tests/visual_tests/images/lines-2-400-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-400-400-2.0-cairo-reference.png b/tests/visual_tests/images/lines-2-400-400-2.0-cairo-reference.png deleted file mode 100644 index 82779ac9f..000000000 Binary files a/tests/visual_tests/images/lines-2-400-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-600-600-1.0-agg-reference.png b/tests/visual_tests/images/lines-2-600-600-1.0-agg-reference.png deleted file mode 100644 index 00783e00d..000000000 Binary files a/tests/visual_tests/images/lines-2-600-600-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-600-600-1.0-cairo-reference.png b/tests/visual_tests/images/lines-2-600-600-1.0-cairo-reference.png deleted file mode 100644 index 86a68520b..000000000 Binary files a/tests/visual_tests/images/lines-2-600-600-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-600-600-2.0-agg-reference.png b/tests/visual_tests/images/lines-2-600-600-2.0-agg-reference.png deleted file mode 100644 index 9120a92e1..000000000 Binary files a/tests/visual_tests/images/lines-2-600-600-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-600-600-2.0-cairo-reference.png b/tests/visual_tests/images/lines-2-600-600-2.0-cairo-reference.png deleted file mode 100644 index b5b8b9fd7..000000000 Binary files a/tests/visual_tests/images/lines-2-600-600-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-800-800-1.0-agg-reference.png b/tests/visual_tests/images/lines-2-800-800-1.0-agg-reference.png deleted file mode 100644 index 374bd8b58..000000000 Binary files a/tests/visual_tests/images/lines-2-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/lines-2-800-800-1.0-cairo-reference.png deleted file mode 100644 index 06cba6461..000000000 Binary files a/tests/visual_tests/images/lines-2-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-800-800-2.0-agg-reference.png b/tests/visual_tests/images/lines-2-800-800-2.0-agg-reference.png deleted file mode 100644 index 6ce2d680d..000000000 Binary files a/tests/visual_tests/images/lines-2-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-2-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/lines-2-800-800-2.0-cairo-reference.png deleted file mode 100644 index 8038bcc7b..000000000 Binary files a/tests/visual_tests/images/lines-2-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-200-200-1.0-agg-reference.png b/tests/visual_tests/images/lines-3-200-200-1.0-agg-reference.png deleted file mode 100644 index 40fb2c6ef..000000000 Binary files a/tests/visual_tests/images/lines-3-200-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/lines-3-200-200-1.0-cairo-reference.png deleted file mode 100644 index 675002fe1..000000000 Binary files a/tests/visual_tests/images/lines-3-200-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-200-200-2.0-agg-reference.png b/tests/visual_tests/images/lines-3-200-200-2.0-agg-reference.png deleted file mode 100644 index 5b48ee538..000000000 Binary files a/tests/visual_tests/images/lines-3-200-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/lines-3-200-200-2.0-cairo-reference.png deleted file mode 100644 index c46804b5d..000000000 Binary files a/tests/visual_tests/images/lines-3-200-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-400-400-1.0-agg-reference.png b/tests/visual_tests/images/lines-3-400-400-1.0-agg-reference.png deleted file mode 100644 index 771f4e511..000000000 Binary files a/tests/visual_tests/images/lines-3-400-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-400-400-1.0-cairo-reference.png b/tests/visual_tests/images/lines-3-400-400-1.0-cairo-reference.png deleted file mode 100644 index e2c9d3177..000000000 Binary files a/tests/visual_tests/images/lines-3-400-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-400-400-2.0-agg-reference.png b/tests/visual_tests/images/lines-3-400-400-2.0-agg-reference.png deleted file mode 100644 index b6ef2dba6..000000000 Binary files a/tests/visual_tests/images/lines-3-400-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-400-400-2.0-cairo-reference.png b/tests/visual_tests/images/lines-3-400-400-2.0-cairo-reference.png deleted file mode 100644 index b3fa84eda..000000000 Binary files a/tests/visual_tests/images/lines-3-400-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-600-600-1.0-agg-reference.png b/tests/visual_tests/images/lines-3-600-600-1.0-agg-reference.png deleted file mode 100644 index 4253a6611..000000000 Binary files a/tests/visual_tests/images/lines-3-600-600-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-600-600-1.0-cairo-reference.png b/tests/visual_tests/images/lines-3-600-600-1.0-cairo-reference.png deleted file mode 100644 index 9585bbbcc..000000000 Binary files a/tests/visual_tests/images/lines-3-600-600-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-600-600-2.0-agg-reference.png b/tests/visual_tests/images/lines-3-600-600-2.0-agg-reference.png deleted file mode 100644 index be1723eeb..000000000 Binary files a/tests/visual_tests/images/lines-3-600-600-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-600-600-2.0-cairo-reference.png b/tests/visual_tests/images/lines-3-600-600-2.0-cairo-reference.png deleted file mode 100644 index 68e25a28c..000000000 Binary files a/tests/visual_tests/images/lines-3-600-600-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-800-800-1.0-agg-reference.png b/tests/visual_tests/images/lines-3-800-800-1.0-agg-reference.png deleted file mode 100644 index 01568eaa4..000000000 Binary files a/tests/visual_tests/images/lines-3-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/lines-3-800-800-1.0-cairo-reference.png deleted file mode 100644 index 58c0abd05..000000000 Binary files a/tests/visual_tests/images/lines-3-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-800-800-2.0-agg-reference.png b/tests/visual_tests/images/lines-3-800-800-2.0-agg-reference.png deleted file mode 100644 index b436b3a8d..000000000 Binary files a/tests/visual_tests/images/lines-3-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-3-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/lines-3-800-800-2.0-cairo-reference.png deleted file mode 100644 index 039e1a029..000000000 Binary files a/tests/visual_tests/images/lines-3-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-200-200-1.0-agg-reference.png b/tests/visual_tests/images/lines-4-200-200-1.0-agg-reference.png deleted file mode 100644 index 746324777..000000000 Binary files a/tests/visual_tests/images/lines-4-200-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/lines-4-200-200-1.0-cairo-reference.png deleted file mode 100644 index eda6579b0..000000000 Binary files a/tests/visual_tests/images/lines-4-200-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-200-200-2.0-agg-reference.png b/tests/visual_tests/images/lines-4-200-200-2.0-agg-reference.png deleted file mode 100644 index 7dcd48893..000000000 Binary files a/tests/visual_tests/images/lines-4-200-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/lines-4-200-200-2.0-cairo-reference.png deleted file mode 100644 index c983d4fbe..000000000 Binary files a/tests/visual_tests/images/lines-4-200-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-400-400-1.0-agg-reference.png b/tests/visual_tests/images/lines-4-400-400-1.0-agg-reference.png deleted file mode 100644 index 35bdf0f4e..000000000 Binary files a/tests/visual_tests/images/lines-4-400-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-400-400-1.0-cairo-reference.png b/tests/visual_tests/images/lines-4-400-400-1.0-cairo-reference.png deleted file mode 100644 index 97e7dff32..000000000 Binary files a/tests/visual_tests/images/lines-4-400-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-400-400-2.0-agg-reference.png b/tests/visual_tests/images/lines-4-400-400-2.0-agg-reference.png deleted file mode 100644 index 64d63cef9..000000000 Binary files a/tests/visual_tests/images/lines-4-400-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-400-400-2.0-cairo-reference.png b/tests/visual_tests/images/lines-4-400-400-2.0-cairo-reference.png deleted file mode 100644 index 33433c1d8..000000000 Binary files a/tests/visual_tests/images/lines-4-400-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-600-600-1.0-agg-reference.png b/tests/visual_tests/images/lines-4-600-600-1.0-agg-reference.png deleted file mode 100644 index 3221710a4..000000000 Binary files a/tests/visual_tests/images/lines-4-600-600-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-600-600-1.0-cairo-reference.png b/tests/visual_tests/images/lines-4-600-600-1.0-cairo-reference.png deleted file mode 100644 index 94e994158..000000000 Binary files a/tests/visual_tests/images/lines-4-600-600-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-600-600-2.0-agg-reference.png b/tests/visual_tests/images/lines-4-600-600-2.0-agg-reference.png deleted file mode 100644 index a12cddea2..000000000 Binary files a/tests/visual_tests/images/lines-4-600-600-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-600-600-2.0-cairo-reference.png b/tests/visual_tests/images/lines-4-600-600-2.0-cairo-reference.png deleted file mode 100644 index 28b52655f..000000000 Binary files a/tests/visual_tests/images/lines-4-600-600-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-800-800-1.0-agg-reference.png b/tests/visual_tests/images/lines-4-800-800-1.0-agg-reference.png deleted file mode 100644 index 98dd66b64..000000000 Binary files a/tests/visual_tests/images/lines-4-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/lines-4-800-800-1.0-cairo-reference.png deleted file mode 100644 index 6387b5961..000000000 Binary files a/tests/visual_tests/images/lines-4-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-800-800-2.0-agg-reference.png b/tests/visual_tests/images/lines-4-800-800-2.0-agg-reference.png deleted file mode 100644 index a0f7db6db..000000000 Binary files a/tests/visual_tests/images/lines-4-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-4-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/lines-4-800-800-2.0-cairo-reference.png deleted file mode 100644 index dcf9dc107..000000000 Binary files a/tests/visual_tests/images/lines-4-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-200-200-1.0-agg-reference.png b/tests/visual_tests/images/lines-5-200-200-1.0-agg-reference.png deleted file mode 100644 index 7c11f46c2..000000000 Binary files a/tests/visual_tests/images/lines-5-200-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/lines-5-200-200-1.0-cairo-reference.png deleted file mode 100644 index 07714c5cb..000000000 Binary files a/tests/visual_tests/images/lines-5-200-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-200-200-2.0-agg-reference.png b/tests/visual_tests/images/lines-5-200-200-2.0-agg-reference.png deleted file mode 100644 index e7cd4b645..000000000 Binary files a/tests/visual_tests/images/lines-5-200-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/lines-5-200-200-2.0-cairo-reference.png deleted file mode 100644 index 7c27c3f57..000000000 Binary files a/tests/visual_tests/images/lines-5-200-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-400-400-1.0-agg-reference.png b/tests/visual_tests/images/lines-5-400-400-1.0-agg-reference.png deleted file mode 100644 index 7b130ff41..000000000 Binary files a/tests/visual_tests/images/lines-5-400-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-400-400-1.0-cairo-reference.png b/tests/visual_tests/images/lines-5-400-400-1.0-cairo-reference.png deleted file mode 100644 index b4cbcdd3e..000000000 Binary files a/tests/visual_tests/images/lines-5-400-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-400-400-2.0-agg-reference.png b/tests/visual_tests/images/lines-5-400-400-2.0-agg-reference.png deleted file mode 100644 index aa66314dd..000000000 Binary files a/tests/visual_tests/images/lines-5-400-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-400-400-2.0-cairo-reference.png b/tests/visual_tests/images/lines-5-400-400-2.0-cairo-reference.png deleted file mode 100644 index d29e6bbea..000000000 Binary files a/tests/visual_tests/images/lines-5-400-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-600-600-1.0-agg-reference.png b/tests/visual_tests/images/lines-5-600-600-1.0-agg-reference.png deleted file mode 100644 index 9b2e1d431..000000000 Binary files a/tests/visual_tests/images/lines-5-600-600-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-600-600-1.0-cairo-reference.png b/tests/visual_tests/images/lines-5-600-600-1.0-cairo-reference.png deleted file mode 100644 index b664e1fc4..000000000 Binary files a/tests/visual_tests/images/lines-5-600-600-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-600-600-2.0-agg-reference.png b/tests/visual_tests/images/lines-5-600-600-2.0-agg-reference.png deleted file mode 100644 index b3d541627..000000000 Binary files a/tests/visual_tests/images/lines-5-600-600-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-600-600-2.0-cairo-reference.png b/tests/visual_tests/images/lines-5-600-600-2.0-cairo-reference.png deleted file mode 100644 index 9a9467672..000000000 Binary files a/tests/visual_tests/images/lines-5-600-600-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-800-800-1.0-agg-reference.png b/tests/visual_tests/images/lines-5-800-800-1.0-agg-reference.png deleted file mode 100644 index 5a5660438..000000000 Binary files a/tests/visual_tests/images/lines-5-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/lines-5-800-800-1.0-cairo-reference.png deleted file mode 100644 index a485040d1..000000000 Binary files a/tests/visual_tests/images/lines-5-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-800-800-2.0-agg-reference.png b/tests/visual_tests/images/lines-5-800-800-2.0-agg-reference.png deleted file mode 100644 index 4ed73785a..000000000 Binary files a/tests/visual_tests/images/lines-5-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-5-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/lines-5-800-800-2.0-cairo-reference.png deleted file mode 100644 index 260832ba7..000000000 Binary files a/tests/visual_tests/images/lines-5-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-200-200-1.0-agg-reference.png b/tests/visual_tests/images/lines-6-200-200-1.0-agg-reference.png deleted file mode 100644 index 129ca1573..000000000 Binary files a/tests/visual_tests/images/lines-6-200-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/lines-6-200-200-1.0-cairo-reference.png deleted file mode 100644 index 28fdbe211..000000000 Binary files a/tests/visual_tests/images/lines-6-200-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-200-200-2.0-agg-reference.png b/tests/visual_tests/images/lines-6-200-200-2.0-agg-reference.png deleted file mode 100644 index 9bbc189e6..000000000 Binary files a/tests/visual_tests/images/lines-6-200-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/lines-6-200-200-2.0-cairo-reference.png deleted file mode 100644 index c2afe30d0..000000000 Binary files a/tests/visual_tests/images/lines-6-200-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-400-400-1.0-agg-reference.png b/tests/visual_tests/images/lines-6-400-400-1.0-agg-reference.png deleted file mode 100644 index acbf93262..000000000 Binary files a/tests/visual_tests/images/lines-6-400-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-400-400-1.0-cairo-reference.png b/tests/visual_tests/images/lines-6-400-400-1.0-cairo-reference.png deleted file mode 100644 index 4851c0e04..000000000 Binary files a/tests/visual_tests/images/lines-6-400-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-400-400-2.0-agg-reference.png b/tests/visual_tests/images/lines-6-400-400-2.0-agg-reference.png deleted file mode 100644 index d197ae230..000000000 Binary files a/tests/visual_tests/images/lines-6-400-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-400-400-2.0-cairo-reference.png b/tests/visual_tests/images/lines-6-400-400-2.0-cairo-reference.png deleted file mode 100644 index 33f80a8ed..000000000 Binary files a/tests/visual_tests/images/lines-6-400-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-600-600-1.0-agg-reference.png b/tests/visual_tests/images/lines-6-600-600-1.0-agg-reference.png deleted file mode 100644 index 3a1b412c3..000000000 Binary files a/tests/visual_tests/images/lines-6-600-600-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-600-600-1.0-cairo-reference.png b/tests/visual_tests/images/lines-6-600-600-1.0-cairo-reference.png deleted file mode 100644 index 9fc703c64..000000000 Binary files a/tests/visual_tests/images/lines-6-600-600-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-600-600-2.0-agg-reference.png b/tests/visual_tests/images/lines-6-600-600-2.0-agg-reference.png deleted file mode 100644 index b7760dc8d..000000000 Binary files a/tests/visual_tests/images/lines-6-600-600-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-600-600-2.0-cairo-reference.png b/tests/visual_tests/images/lines-6-600-600-2.0-cairo-reference.png deleted file mode 100644 index b5d89c925..000000000 Binary files a/tests/visual_tests/images/lines-6-600-600-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-800-800-1.0-agg-reference.png b/tests/visual_tests/images/lines-6-800-800-1.0-agg-reference.png deleted file mode 100644 index 8244cebe7..000000000 Binary files a/tests/visual_tests/images/lines-6-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/lines-6-800-800-1.0-cairo-reference.png deleted file mode 100644 index 01e2c600b..000000000 Binary files a/tests/visual_tests/images/lines-6-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-800-800-2.0-agg-reference.png b/tests/visual_tests/images/lines-6-800-800-2.0-agg-reference.png deleted file mode 100644 index eed17abf8..000000000 Binary files a/tests/visual_tests/images/lines-6-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-6-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/lines-6-800-800-2.0-cairo-reference.png deleted file mode 100644 index ea7672443..000000000 Binary files a/tests/visual_tests/images/lines-6-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-200-200-1.0-agg-reference.png b/tests/visual_tests/images/lines-7-200-200-1.0-agg-reference.png deleted file mode 100644 index c2a34ada6..000000000 Binary files a/tests/visual_tests/images/lines-7-200-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/lines-7-200-200-1.0-cairo-reference.png deleted file mode 100644 index 446088fa1..000000000 Binary files a/tests/visual_tests/images/lines-7-200-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-200-200-2.0-agg-reference.png b/tests/visual_tests/images/lines-7-200-200-2.0-agg-reference.png deleted file mode 100644 index 1e3200fe0..000000000 Binary files a/tests/visual_tests/images/lines-7-200-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/lines-7-200-200-2.0-cairo-reference.png deleted file mode 100644 index edfc3f61e..000000000 Binary files a/tests/visual_tests/images/lines-7-200-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-400-400-1.0-agg-reference.png b/tests/visual_tests/images/lines-7-400-400-1.0-agg-reference.png deleted file mode 100644 index 97f006456..000000000 Binary files a/tests/visual_tests/images/lines-7-400-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-400-400-1.0-cairo-reference.png b/tests/visual_tests/images/lines-7-400-400-1.0-cairo-reference.png deleted file mode 100644 index a9c152ee9..000000000 Binary files a/tests/visual_tests/images/lines-7-400-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-400-400-2.0-agg-reference.png b/tests/visual_tests/images/lines-7-400-400-2.0-agg-reference.png deleted file mode 100644 index dfd94ede9..000000000 Binary files a/tests/visual_tests/images/lines-7-400-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-400-400-2.0-cairo-reference.png b/tests/visual_tests/images/lines-7-400-400-2.0-cairo-reference.png deleted file mode 100644 index 017421349..000000000 Binary files a/tests/visual_tests/images/lines-7-400-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-600-600-1.0-agg-reference.png b/tests/visual_tests/images/lines-7-600-600-1.0-agg-reference.png deleted file mode 100644 index 234f8d67b..000000000 Binary files a/tests/visual_tests/images/lines-7-600-600-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-600-600-1.0-cairo-reference.png b/tests/visual_tests/images/lines-7-600-600-1.0-cairo-reference.png deleted file mode 100644 index d51d200c4..000000000 Binary files a/tests/visual_tests/images/lines-7-600-600-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-600-600-2.0-agg-reference.png b/tests/visual_tests/images/lines-7-600-600-2.0-agg-reference.png deleted file mode 100644 index 69df036b0..000000000 Binary files a/tests/visual_tests/images/lines-7-600-600-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-600-600-2.0-cairo-reference.png b/tests/visual_tests/images/lines-7-600-600-2.0-cairo-reference.png deleted file mode 100644 index a2f8f2440..000000000 Binary files a/tests/visual_tests/images/lines-7-600-600-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-800-800-1.0-agg-reference.png b/tests/visual_tests/images/lines-7-800-800-1.0-agg-reference.png deleted file mode 100644 index db362a813..000000000 Binary files a/tests/visual_tests/images/lines-7-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/lines-7-800-800-1.0-cairo-reference.png deleted file mode 100644 index 0befa8523..000000000 Binary files a/tests/visual_tests/images/lines-7-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-800-800-2.0-agg-reference.png b/tests/visual_tests/images/lines-7-800-800-2.0-agg-reference.png deleted file mode 100644 index 03a7e5939..000000000 Binary files a/tests/visual_tests/images/lines-7-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-7-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/lines-7-800-800-2.0-cairo-reference.png deleted file mode 100644 index 5585a65a6..000000000 Binary files a/tests/visual_tests/images/lines-7-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-multi-layout-1-800-800-1.0-agg-reference.png b/tests/visual_tests/images/lines-multi-layout-1-800-800-1.0-agg-reference.png deleted file mode 100644 index 29397fe87..000000000 Binary files a/tests/visual_tests/images/lines-multi-layout-1-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-multi-layout-1-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/lines-multi-layout-1-800-800-1.0-cairo-reference.png deleted file mode 100644 index 8b6188536..000000000 Binary files a/tests/visual_tests/images/lines-multi-layout-1-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-multi-layout-1-800-800-2.0-agg-reference.png b/tests/visual_tests/images/lines-multi-layout-1-800-800-2.0-agg-reference.png deleted file mode 100644 index 3ff1e3fb2..000000000 Binary files a/tests/visual_tests/images/lines-multi-layout-1-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-multi-layout-1-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/lines-multi-layout-1-800-800-2.0-cairo-reference.png deleted file mode 100644 index e51f5eedf..000000000 Binary files a/tests/visual_tests/images/lines-multi-layout-1-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-multi-layout-2-800-800-1.0-agg-reference.png b/tests/visual_tests/images/lines-multi-layout-2-800-800-1.0-agg-reference.png deleted file mode 100644 index 8ee78a87d..000000000 Binary files a/tests/visual_tests/images/lines-multi-layout-2-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-multi-layout-2-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/lines-multi-layout-2-800-800-1.0-cairo-reference.png deleted file mode 100644 index 29b59e816..000000000 Binary files a/tests/visual_tests/images/lines-multi-layout-2-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-multi-layout-2-800-800-2.0-agg-reference.png b/tests/visual_tests/images/lines-multi-layout-2-800-800-2.0-agg-reference.png deleted file mode 100644 index 618ea59ce..000000000 Binary files a/tests/visual_tests/images/lines-multi-layout-2-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-multi-layout-2-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/lines-multi-layout-2-800-800-2.0-cairo-reference.png deleted file mode 100644 index e449c912c..000000000 Binary files a/tests/visual_tests/images/lines-multi-layout-2-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-multi-layout-shield-800-800-1.0-agg-reference.png b/tests/visual_tests/images/lines-multi-layout-shield-800-800-1.0-agg-reference.png deleted file mode 100644 index 0f0aa637b..000000000 Binary files a/tests/visual_tests/images/lines-multi-layout-shield-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-multi-layout-shield-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/lines-multi-layout-shield-800-800-1.0-cairo-reference.png deleted file mode 100644 index b664fce63..000000000 Binary files a/tests/visual_tests/images/lines-multi-layout-shield-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-multi-layout-shield-800-800-2.0-agg-reference.png b/tests/visual_tests/images/lines-multi-layout-shield-800-800-2.0-agg-reference.png deleted file mode 100644 index 470e6a03c..000000000 Binary files a/tests/visual_tests/images/lines-multi-layout-shield-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-multi-layout-shield-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/lines-multi-layout-shield-800-800-2.0-cairo-reference.png deleted file mode 100644 index 0acebcc89..000000000 Binary files a/tests/visual_tests/images/lines-multi-layout-shield-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-200-200-1.0-agg-reference.png b/tests/visual_tests/images/lines-shield-200-200-1.0-agg-reference.png deleted file mode 100644 index b60e8c322..000000000 Binary files a/tests/visual_tests/images/lines-shield-200-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/lines-shield-200-200-1.0-cairo-reference.png deleted file mode 100644 index 0decf91b3..000000000 Binary files a/tests/visual_tests/images/lines-shield-200-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-200-200-2.0-agg-reference.png b/tests/visual_tests/images/lines-shield-200-200-2.0-agg-reference.png deleted file mode 100644 index 998264903..000000000 Binary files a/tests/visual_tests/images/lines-shield-200-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/lines-shield-200-200-2.0-cairo-reference.png deleted file mode 100644 index 877001bd2..000000000 Binary files a/tests/visual_tests/images/lines-shield-200-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-400-400-1.0-agg-reference.png b/tests/visual_tests/images/lines-shield-400-400-1.0-agg-reference.png deleted file mode 100644 index 17a3680e8..000000000 Binary files a/tests/visual_tests/images/lines-shield-400-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-400-400-1.0-cairo-reference.png b/tests/visual_tests/images/lines-shield-400-400-1.0-cairo-reference.png deleted file mode 100644 index 485b9740f..000000000 Binary files a/tests/visual_tests/images/lines-shield-400-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-400-400-2.0-agg-reference.png b/tests/visual_tests/images/lines-shield-400-400-2.0-agg-reference.png deleted file mode 100644 index 4b2a44f6c..000000000 Binary files a/tests/visual_tests/images/lines-shield-400-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-400-400-2.0-cairo-reference.png b/tests/visual_tests/images/lines-shield-400-400-2.0-cairo-reference.png deleted file mode 100644 index 740ef72c5..000000000 Binary files a/tests/visual_tests/images/lines-shield-400-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-600-600-1.0-agg-reference.png b/tests/visual_tests/images/lines-shield-600-600-1.0-agg-reference.png deleted file mode 100644 index bb4796188..000000000 Binary files a/tests/visual_tests/images/lines-shield-600-600-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-600-600-1.0-cairo-reference.png b/tests/visual_tests/images/lines-shield-600-600-1.0-cairo-reference.png deleted file mode 100644 index 59894ae29..000000000 Binary files a/tests/visual_tests/images/lines-shield-600-600-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-600-600-2.0-agg-reference.png b/tests/visual_tests/images/lines-shield-600-600-2.0-agg-reference.png deleted file mode 100644 index 5c9b8c2fa..000000000 Binary files a/tests/visual_tests/images/lines-shield-600-600-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-600-600-2.0-cairo-reference.png b/tests/visual_tests/images/lines-shield-600-600-2.0-cairo-reference.png deleted file mode 100644 index e3ccc4b8a..000000000 Binary files a/tests/visual_tests/images/lines-shield-600-600-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-800-800-1.0-agg-reference.png b/tests/visual_tests/images/lines-shield-800-800-1.0-agg-reference.png deleted file mode 100644 index 5ec187c2e..000000000 Binary files a/tests/visual_tests/images/lines-shield-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/lines-shield-800-800-1.0-cairo-reference.png deleted file mode 100644 index f1ac85344..000000000 Binary files a/tests/visual_tests/images/lines-shield-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-800-800-2.0-agg-reference.png b/tests/visual_tests/images/lines-shield-800-800-2.0-agg-reference.png deleted file mode 100644 index a0f0cf406..000000000 Binary files a/tests/visual_tests/images/lines-shield-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/lines-shield-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/lines-shield-800-800-2.0-cairo-reference.png deleted file mode 100644 index 17a9aef5e..000000000 Binary files a/tests/visual_tests/images/lines-shield-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-100-100-1.0-agg-reference.png b/tests/visual_tests/images/list-100-100-1.0-agg-reference.png deleted file mode 100644 index 68cf5e08a..000000000 Binary files a/tests/visual_tests/images/list-100-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-100-100-1.0-cairo-reference.png b/tests/visual_tests/images/list-100-100-1.0-cairo-reference.png deleted file mode 100644 index d0e750074..000000000 Binary files a/tests/visual_tests/images/list-100-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-100-100-2.0-agg-reference.png b/tests/visual_tests/images/list-100-100-2.0-agg-reference.png deleted file mode 100644 index a1fe25605..000000000 Binary files a/tests/visual_tests/images/list-100-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-100-100-2.0-cairo-reference.png b/tests/visual_tests/images/list-100-100-2.0-cairo-reference.png deleted file mode 100644 index 862acc1bf..000000000 Binary files a/tests/visual_tests/images/list-100-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-150-100-1.0-agg-reference.png b/tests/visual_tests/images/list-150-100-1.0-agg-reference.png deleted file mode 100644 index b0345c64f..000000000 Binary files a/tests/visual_tests/images/list-150-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-150-100-1.0-cairo-reference.png b/tests/visual_tests/images/list-150-100-1.0-cairo-reference.png deleted file mode 100644 index beab1bd13..000000000 Binary files a/tests/visual_tests/images/list-150-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-150-100-2.0-agg-reference.png b/tests/visual_tests/images/list-150-100-2.0-agg-reference.png deleted file mode 100644 index e78c813c9..000000000 Binary files a/tests/visual_tests/images/list-150-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-150-100-2.0-cairo-reference.png b/tests/visual_tests/images/list-150-100-2.0-cairo-reference.png deleted file mode 100644 index 0fe8475c3..000000000 Binary files a/tests/visual_tests/images/list-150-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-250-100-1.0-agg-reference.png b/tests/visual_tests/images/list-250-100-1.0-agg-reference.png deleted file mode 100644 index cf4b6836b..000000000 Binary files a/tests/visual_tests/images/list-250-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-250-100-1.0-cairo-reference.png b/tests/visual_tests/images/list-250-100-1.0-cairo-reference.png deleted file mode 100644 index 12a05ced7..000000000 Binary files a/tests/visual_tests/images/list-250-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-250-100-2.0-agg-reference.png b/tests/visual_tests/images/list-250-100-2.0-agg-reference.png deleted file mode 100644 index 738d0414c..000000000 Binary files a/tests/visual_tests/images/list-250-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-250-100-2.0-cairo-reference.png b/tests/visual_tests/images/list-250-100-2.0-cairo-reference.png deleted file mode 100644 index 1705df118..000000000 Binary files a/tests/visual_tests/images/list-250-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-300-100-1.0-agg-reference.png b/tests/visual_tests/images/list-300-100-1.0-agg-reference.png deleted file mode 100644 index 01e8a8ad6..000000000 Binary files a/tests/visual_tests/images/list-300-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-300-100-1.0-cairo-reference.png b/tests/visual_tests/images/list-300-100-1.0-cairo-reference.png deleted file mode 100644 index b5ece85c9..000000000 Binary files a/tests/visual_tests/images/list-300-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-300-100-2.0-agg-reference.png b/tests/visual_tests/images/list-300-100-2.0-agg-reference.png deleted file mode 100644 index 11575c2f8..000000000 Binary files a/tests/visual_tests/images/list-300-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-300-100-2.0-cairo-reference.png b/tests/visual_tests/images/list-300-100-2.0-cairo-reference.png deleted file mode 100644 index 4c9618aad..000000000 Binary files a/tests/visual_tests/images/list-300-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-400-100-1.0-agg-reference.png b/tests/visual_tests/images/list-400-100-1.0-agg-reference.png deleted file mode 100644 index 954810bda..000000000 Binary files a/tests/visual_tests/images/list-400-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-400-100-1.0-cairo-reference.png b/tests/visual_tests/images/list-400-100-1.0-cairo-reference.png deleted file mode 100644 index 083f94e7f..000000000 Binary files a/tests/visual_tests/images/list-400-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-400-100-2.0-agg-reference.png b/tests/visual_tests/images/list-400-100-2.0-agg-reference.png deleted file mode 100644 index e89de1fab..000000000 Binary files a/tests/visual_tests/images/list-400-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-400-100-2.0-cairo-reference.png b/tests/visual_tests/images/list-400-100-2.0-cairo-reference.png deleted file mode 100644 index 813fa53fb..000000000 Binary files a/tests/visual_tests/images/list-400-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-600-100-1.0-agg-reference.png b/tests/visual_tests/images/list-600-100-1.0-agg-reference.png deleted file mode 100644 index 1b978953d..000000000 Binary files a/tests/visual_tests/images/list-600-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-600-100-1.0-cairo-reference.png b/tests/visual_tests/images/list-600-100-1.0-cairo-reference.png deleted file mode 100644 index 586d921c4..000000000 Binary files a/tests/visual_tests/images/list-600-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-600-100-2.0-agg-reference.png b/tests/visual_tests/images/list-600-100-2.0-agg-reference.png deleted file mode 100644 index ee4be98dd..000000000 Binary files a/tests/visual_tests/images/list-600-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-600-100-2.0-cairo-reference.png b/tests/visual_tests/images/list-600-100-2.0-cairo-reference.png deleted file mode 100644 index 9bce8d5d4..000000000 Binary files a/tests/visual_tests/images/list-600-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-800-100-1.0-agg-reference.png b/tests/visual_tests/images/list-800-100-1.0-agg-reference.png deleted file mode 100644 index 67957f403..000000000 Binary files a/tests/visual_tests/images/list-800-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-800-100-1.0-cairo-reference.png b/tests/visual_tests/images/list-800-100-1.0-cairo-reference.png deleted file mode 100644 index 39cd6d79c..000000000 Binary files a/tests/visual_tests/images/list-800-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-800-100-2.0-agg-reference.png b/tests/visual_tests/images/list-800-100-2.0-agg-reference.png deleted file mode 100644 index 764fb6546..000000000 Binary files a/tests/visual_tests/images/list-800-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/list-800-100-2.0-cairo-reference.png b/tests/visual_tests/images/list-800-100-2.0-cairo-reference.png deleted file mode 100644 index 0b5d5b7a4..000000000 Binary files a/tests/visual_tests/images/list-800-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/map-background-image-compositing-512-512-1.0-agg-reference.png b/tests/visual_tests/images/map-background-image-compositing-512-512-1.0-agg-reference.png deleted file mode 100644 index 869b08b19..000000000 Binary files a/tests/visual_tests/images/map-background-image-compositing-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/map-background-image-compositing-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/map-background-image-compositing-512-512-1.0-cairo-reference.png deleted file mode 100644 index 860c14b4e..000000000 Binary files a/tests/visual_tests/images/map-background-image-compositing-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/map-background-image-compositing-512-512-2.0-agg-reference.png b/tests/visual_tests/images/map-background-image-compositing-512-512-2.0-agg-reference.png deleted file mode 100644 index 981f3a38c..000000000 Binary files a/tests/visual_tests/images/map-background-image-compositing-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/map-background-image-compositing-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/map-background-image-compositing-512-512-2.0-cairo-reference.png deleted file mode 100644 index e94a07f05..000000000 Binary files a/tests/visual_tests/images/map-background-image-compositing-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-collide-512-512-1.0-agg-reference.png b/tests/visual_tests/images/marker-collide-512-512-1.0-agg-reference.png deleted file mode 100644 index 6b901f466..000000000 Binary files a/tests/visual_tests/images/marker-collide-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-collide-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/marker-collide-512-512-1.0-cairo-reference.png deleted file mode 100644 index 37ef5a8ca..000000000 Binary files a/tests/visual_tests/images/marker-collide-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-collide-512-512-2.0-agg-reference.png b/tests/visual_tests/images/marker-collide-512-512-2.0-agg-reference.png deleted file mode 100644 index 362fab4e6..000000000 Binary files a/tests/visual_tests/images/marker-collide-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-collide-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/marker-collide-512-512-2.0-cairo-reference.png deleted file mode 100644 index 446b3992f..000000000 Binary files a/tests/visual_tests/images/marker-collide-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-interior-position-600-400-1.0-agg-reference.png b/tests/visual_tests/images/marker-interior-position-600-400-1.0-agg-reference.png deleted file mode 100644 index 5c1ce2919..000000000 Binary files a/tests/visual_tests/images/marker-interior-position-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-interior-position-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/marker-interior-position-600-400-1.0-cairo-reference.png deleted file mode 100644 index c86af3c71..000000000 Binary files a/tests/visual_tests/images/marker-interior-position-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-interior-position-600-400-2.0-agg-reference.png b/tests/visual_tests/images/marker-interior-position-600-400-2.0-agg-reference.png deleted file mode 100644 index 0d8d5cd94..000000000 Binary files a/tests/visual_tests/images/marker-interior-position-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-interior-position-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/marker-interior-position-600-400-2.0-cairo-reference.png deleted file mode 100644 index 8b2fc180e..000000000 Binary files a/tests/visual_tests/images/marker-interior-position-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-line-placement-many-vertices-600-400-1.0-agg-reference.png b/tests/visual_tests/images/marker-line-placement-many-vertices-600-400-1.0-agg-reference.png deleted file mode 100644 index 2b2ace4f7..000000000 Binary files a/tests/visual_tests/images/marker-line-placement-many-vertices-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-line-placement-many-vertices-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/marker-line-placement-many-vertices-600-400-1.0-cairo-reference.png deleted file mode 100644 index 51cec6366..000000000 Binary files a/tests/visual_tests/images/marker-line-placement-many-vertices-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-line-placement-many-vertices-600-400-2.0-agg-reference.png b/tests/visual_tests/images/marker-line-placement-many-vertices-600-400-2.0-agg-reference.png deleted file mode 100644 index 1e6c3edc7..000000000 Binary files a/tests/visual_tests/images/marker-line-placement-many-vertices-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-line-placement-many-vertices-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/marker-line-placement-many-vertices-600-400-2.0-cairo-reference.png deleted file mode 100644 index fb5194625..000000000 Binary files a/tests/visual_tests/images/marker-line-placement-many-vertices-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-multi-policy-600-400-1.0-agg-reference.png b/tests/visual_tests/images/marker-multi-policy-600-400-1.0-agg-reference.png deleted file mode 100644 index 05fb847e6..000000000 Binary files a/tests/visual_tests/images/marker-multi-policy-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-multi-policy-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/marker-multi-policy-600-400-1.0-cairo-reference.png deleted file mode 100644 index cc3a047b3..000000000 Binary files a/tests/visual_tests/images/marker-multi-policy-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-multi-policy-600-400-2.0-agg-reference.png b/tests/visual_tests/images/marker-multi-policy-600-400-2.0-agg-reference.png deleted file mode 100644 index 74b7b058f..000000000 Binary files a/tests/visual_tests/images/marker-multi-policy-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-multi-policy-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/marker-multi-policy-600-400-2.0-cairo-reference.png deleted file mode 100644 index b968e6038..000000000 Binary files a/tests/visual_tests/images/marker-multi-policy-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-hex-grid-257-256-1.0-agg-reference.png b/tests/visual_tests/images/marker-on-hex-grid-257-256-1.0-agg-reference.png deleted file mode 100644 index abd711e62..000000000 Binary files a/tests/visual_tests/images/marker-on-hex-grid-257-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-hex-grid-257-256-1.0-cairo-reference.png b/tests/visual_tests/images/marker-on-hex-grid-257-256-1.0-cairo-reference.png deleted file mode 100644 index 5bba76147..000000000 Binary files a/tests/visual_tests/images/marker-on-hex-grid-257-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-hex-grid-257-256-2.0-agg-reference.png b/tests/visual_tests/images/marker-on-hex-grid-257-256-2.0-agg-reference.png deleted file mode 100644 index 7589ff54e..000000000 Binary files a/tests/visual_tests/images/marker-on-hex-grid-257-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-hex-grid-257-256-2.0-cairo-reference.png b/tests/visual_tests/images/marker-on-hex-grid-257-256-2.0-cairo-reference.png deleted file mode 100644 index 8c96fdabf..000000000 Binary files a/tests/visual_tests/images/marker-on-hex-grid-257-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-hex-grid-400-600-1.0-agg-reference.png b/tests/visual_tests/images/marker-on-hex-grid-400-600-1.0-agg-reference.png deleted file mode 100644 index 18cd5662a..000000000 Binary files a/tests/visual_tests/images/marker-on-hex-grid-400-600-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-hex-grid-400-600-1.0-cairo-reference.png b/tests/visual_tests/images/marker-on-hex-grid-400-600-1.0-cairo-reference.png deleted file mode 100644 index 81cddf093..000000000 Binary files a/tests/visual_tests/images/marker-on-hex-grid-400-600-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-hex-grid-400-600-2.0-agg-reference.png b/tests/visual_tests/images/marker-on-hex-grid-400-600-2.0-agg-reference.png deleted file mode 100644 index 23e9a886d..000000000 Binary files a/tests/visual_tests/images/marker-on-hex-grid-400-600-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-hex-grid-400-600-2.0-cairo-reference.png b/tests/visual_tests/images/marker-on-hex-grid-400-600-2.0-cairo-reference.png deleted file mode 100644 index 5e3ce422b..000000000 Binary files a/tests/visual_tests/images/marker-on-hex-grid-400-600-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-hex-grid-600-400-1.0-agg-reference.png b/tests/visual_tests/images/marker-on-hex-grid-600-400-1.0-agg-reference.png deleted file mode 100644 index 687c7e7e3..000000000 Binary files a/tests/visual_tests/images/marker-on-hex-grid-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-hex-grid-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/marker-on-hex-grid-600-400-1.0-cairo-reference.png deleted file mode 100644 index baee5240f..000000000 Binary files a/tests/visual_tests/images/marker-on-hex-grid-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-hex-grid-600-400-2.0-agg-reference.png b/tests/visual_tests/images/marker-on-hex-grid-600-400-2.0-agg-reference.png deleted file mode 100644 index 055fb6f84..000000000 Binary files a/tests/visual_tests/images/marker-on-hex-grid-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-hex-grid-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/marker-on-hex-grid-600-400-2.0-cairo-reference.png deleted file mode 100644 index c7eefe5dd..000000000 Binary files a/tests/visual_tests/images/marker-on-hex-grid-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-600-400-1.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-600-400-1.0-agg-reference.png deleted file mode 100644 index 62749d4b3..000000000 Binary files a/tests/visual_tests/images/marker-on-line-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-600-400-1.0-cairo-reference.png deleted file mode 100644 index 8107a34b7..000000000 Binary files a/tests/visual_tests/images/marker-on-line-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-600-400-2.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-600-400-2.0-agg-reference.png deleted file mode 100644 index 2def55e04..000000000 Binary files a/tests/visual_tests/images/marker-on-line-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-600-400-2.0-cairo-reference.png deleted file mode 100644 index 1f431c90d..000000000 Binary files a/tests/visual_tests/images/marker-on-line-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-avoid-edges-512-512-1.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-and-avoid-edges-512-512-1.0-agg-reference.png deleted file mode 100644 index e93a253c7..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-avoid-edges-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-avoid-edges-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-and-avoid-edges-512-512-1.0-cairo-reference.png deleted file mode 100644 index 76888a567..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-avoid-edges-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-avoid-edges-512-512-2.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-and-avoid-edges-512-512-2.0-agg-reference.png deleted file mode 100644 index b20e8ddbd..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-avoid-edges-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-avoid-edges-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-and-avoid-edges-512-512-2.0-cairo-reference.png deleted file mode 100644 index 1406071eb..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-avoid-edges-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-line-placement-600-400-1.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-and-line-placement-600-400-1.0-agg-reference.png deleted file mode 100644 index 83210e8eb..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-line-placement-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-line-placement-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-and-line-placement-600-400-1.0-cairo-reference.png deleted file mode 100644 index ac06c35f5..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-line-placement-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-line-placement-600-400-2.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-and-line-placement-600-400-2.0-agg-reference.png deleted file mode 100644 index 8edfd0bbb..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-line-placement-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-line-placement-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-and-line-placement-600-400-2.0-cairo-reference.png deleted file mode 100644 index d7da391e9..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-line-placement-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-vertex-first-placement-600-400-1.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-and-vertex-first-placement-600-400-1.0-agg-reference.png deleted file mode 100644 index 9e3f82a4d..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-vertex-first-placement-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-vertex-first-placement-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-and-vertex-first-placement-600-400-1.0-cairo-reference.png deleted file mode 100644 index b66983134..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-vertex-first-placement-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-vertex-first-placement-600-400-2.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-and-vertex-first-placement-600-400-2.0-agg-reference.png deleted file mode 100644 index 13d4ad314..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-vertex-first-placement-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-vertex-first-placement-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-and-vertex-first-placement-600-400-2.0-cairo-reference.png deleted file mode 100644 index 0faaa7baf..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-vertex-first-placement-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-vertex-last-placement-600-400-1.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-and-vertex-last-placement-600-400-1.0-agg-reference.png deleted file mode 100644 index 153720f90..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-vertex-last-placement-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-vertex-last-placement-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-and-vertex-last-placement-600-400-1.0-cairo-reference.png deleted file mode 100644 index 411431dee..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-vertex-last-placement-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-vertex-last-placement-600-400-2.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-and-vertex-last-placement-600-400-2.0-agg-reference.png deleted file mode 100644 index 7b7d93ebf..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-vertex-last-placement-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-and-vertex-last-placement-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-and-vertex-last-placement-600-400-2.0-cairo-reference.png deleted file mode 100644 index d478e13d9..000000000 Binary files a/tests/visual_tests/images/marker-on-line-and-vertex-last-placement-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-spacing-eq-width-600-400-1.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-spacing-eq-width-600-400-1.0-agg-reference.png deleted file mode 100644 index 2f3579636..000000000 Binary files a/tests/visual_tests/images/marker-on-line-spacing-eq-width-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-spacing-eq-width-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-spacing-eq-width-600-400-1.0-cairo-reference.png deleted file mode 100644 index 98486161f..000000000 Binary files a/tests/visual_tests/images/marker-on-line-spacing-eq-width-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-spacing-eq-width-600-400-2.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-spacing-eq-width-600-400-2.0-agg-reference.png deleted file mode 100644 index 88fc51517..000000000 Binary files a/tests/visual_tests/images/marker-on-line-spacing-eq-width-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-spacing-eq-width-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-spacing-eq-width-600-400-2.0-cairo-reference.png deleted file mode 100644 index 001eed1f0..000000000 Binary files a/tests/visual_tests/images/marker-on-line-spacing-eq-width-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-spacing-eq-width-overlap-600-400-1.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-spacing-eq-width-overlap-600-400-1.0-agg-reference.png deleted file mode 100644 index 5396dac43..000000000 Binary files a/tests/visual_tests/images/marker-on-line-spacing-eq-width-overlap-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-spacing-eq-width-overlap-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-spacing-eq-width-overlap-600-400-1.0-cairo-reference.png deleted file mode 100644 index 0a19cabcf..000000000 Binary files a/tests/visual_tests/images/marker-on-line-spacing-eq-width-overlap-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-spacing-eq-width-overlap-600-400-2.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-spacing-eq-width-overlap-600-400-2.0-agg-reference.png deleted file mode 100644 index 8abddc98a..000000000 Binary files a/tests/visual_tests/images/marker-on-line-spacing-eq-width-overlap-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-spacing-eq-width-overlap-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-spacing-eq-width-overlap-600-400-2.0-cairo-reference.png deleted file mode 100644 index 7a7382581..000000000 Binary files a/tests/visual_tests/images/marker-on-line-spacing-eq-width-overlap-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-svg-no-box-600-400-1.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-svg-no-box-600-400-1.0-agg-reference.png deleted file mode 100644 index 7440348e0..000000000 Binary files a/tests/visual_tests/images/marker-on-line-svg-no-box-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-svg-no-box-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-svg-no-box-600-400-1.0-cairo-reference.png deleted file mode 100644 index c3b5c3b75..000000000 Binary files a/tests/visual_tests/images/marker-on-line-svg-no-box-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-svg-no-box-600-400-2.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-svg-no-box-600-400-2.0-agg-reference.png deleted file mode 100644 index e43ecac82..000000000 Binary files a/tests/visual_tests/images/marker-on-line-svg-no-box-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-svg-no-box-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-svg-no-box-600-400-2.0-cairo-reference.png deleted file mode 100644 index b3de11c19..000000000 Binary files a/tests/visual_tests/images/marker-on-line-svg-no-box-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-svg-with-box-600-400-1.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-svg-with-box-600-400-1.0-agg-reference.png deleted file mode 100644 index de22a5c3a..000000000 Binary files a/tests/visual_tests/images/marker-on-line-svg-with-box-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-svg-with-box-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-svg-with-box-600-400-1.0-cairo-reference.png deleted file mode 100644 index 3a7351af3..000000000 Binary files a/tests/visual_tests/images/marker-on-line-svg-with-box-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-svg-with-box-600-400-2.0-agg-reference.png b/tests/visual_tests/images/marker-on-line-svg-with-box-600-400-2.0-agg-reference.png deleted file mode 100644 index 48af255fa..000000000 Binary files a/tests/visual_tests/images/marker-on-line-svg-with-box-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-on-line-svg-with-box-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/marker-on-line-svg-with-box-600-400-2.0-cairo-reference.png deleted file mode 100644 index afbdd7413..000000000 Binary files a/tests/visual_tests/images/marker-on-line-svg-with-box-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-path-expression-500-100-1.0-agg-reference.png b/tests/visual_tests/images/marker-path-expression-500-100-1.0-agg-reference.png deleted file mode 100644 index 27595bf86..000000000 Binary files a/tests/visual_tests/images/marker-path-expression-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-path-expression-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/marker-path-expression-500-100-1.0-cairo-reference.png deleted file mode 100644 index ba70ac95d..000000000 Binary files a/tests/visual_tests/images/marker-path-expression-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-path-expression-500-100-2.0-agg-reference.png b/tests/visual_tests/images/marker-path-expression-500-100-2.0-agg-reference.png deleted file mode 100644 index ef92f7909..000000000 Binary files a/tests/visual_tests/images/marker-path-expression-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-path-expression-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/marker-path-expression-500-100-2.0-cairo-reference.png deleted file mode 100644 index 278fbb79e..000000000 Binary files a/tests/visual_tests/images/marker-path-expression-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-recenter-collide-256-128-1.0-agg-reference.png b/tests/visual_tests/images/marker-recenter-collide-256-128-1.0-agg-reference.png deleted file mode 100644 index bacd035b9..000000000 Binary files a/tests/visual_tests/images/marker-recenter-collide-256-128-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-recenter-collide-256-128-1.0-cairo-reference.png b/tests/visual_tests/images/marker-recenter-collide-256-128-1.0-cairo-reference.png deleted file mode 100644 index cea3366ae..000000000 Binary files a/tests/visual_tests/images/marker-recenter-collide-256-128-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-recenter-collide-256-128-2.0-agg-reference.png b/tests/visual_tests/images/marker-recenter-collide-256-128-2.0-agg-reference.png deleted file mode 100644 index 904dc76ec..000000000 Binary files a/tests/visual_tests/images/marker-recenter-collide-256-128-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-recenter-collide-256-128-2.0-cairo-reference.png b/tests/visual_tests/images/marker-recenter-collide-256-128-2.0-cairo-reference.png deleted file mode 100644 index b1e9a7964..000000000 Binary files a/tests/visual_tests/images/marker-recenter-collide-256-128-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-500-100-1.0-agg-reference.png b/tests/visual_tests/images/marker-svg-500-100-1.0-agg-reference.png deleted file mode 100644 index 99881f230..000000000 Binary files a/tests/visual_tests/images/marker-svg-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/marker-svg-500-100-1.0-cairo-reference.png deleted file mode 100644 index b182681ed..000000000 Binary files a/tests/visual_tests/images/marker-svg-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-500-100-2.0-agg-reference.png b/tests/visual_tests/images/marker-svg-500-100-2.0-agg-reference.png deleted file mode 100644 index 93084a3b4..000000000 Binary files a/tests/visual_tests/images/marker-svg-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/marker-svg-500-100-2.0-cairo-reference.png deleted file mode 100644 index 1a6f86f32..000000000 Binary files a/tests/visual_tests/images/marker-svg-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-empty-g-element-500-100-1.0-agg-reference.png b/tests/visual_tests/images/marker-svg-empty-g-element-500-100-1.0-agg-reference.png deleted file mode 100644 index 2f684d916..000000000 Binary files a/tests/visual_tests/images/marker-svg-empty-g-element-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-empty-g-element-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/marker-svg-empty-g-element-500-100-1.0-cairo-reference.png deleted file mode 100644 index 5cc30991a..000000000 Binary files a/tests/visual_tests/images/marker-svg-empty-g-element-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-empty-g-element-500-100-2.0-agg-reference.png b/tests/visual_tests/images/marker-svg-empty-g-element-500-100-2.0-agg-reference.png deleted file mode 100644 index 79d32f44f..000000000 Binary files a/tests/visual_tests/images/marker-svg-empty-g-element-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-empty-g-element-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/marker-svg-empty-g-element-500-100-2.0-cairo-reference.png deleted file mode 100644 index ba73f1f1b..000000000 Binary files a/tests/visual_tests/images/marker-svg-empty-g-element-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-opacity-500-100-1.0-agg-reference.png b/tests/visual_tests/images/marker-svg-opacity-500-100-1.0-agg-reference.png deleted file mode 100644 index fe9571114..000000000 Binary files a/tests/visual_tests/images/marker-svg-opacity-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-opacity-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/marker-svg-opacity-500-100-1.0-cairo-reference.png deleted file mode 100644 index fe9571114..000000000 Binary files a/tests/visual_tests/images/marker-svg-opacity-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-opacity-500-100-2.0-agg-reference.png b/tests/visual_tests/images/marker-svg-opacity-500-100-2.0-agg-reference.png deleted file mode 100644 index 88f7e6064..000000000 Binary files a/tests/visual_tests/images/marker-svg-opacity-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-opacity-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/marker-svg-opacity-500-100-2.0-cairo-reference.png deleted file mode 100644 index c428279c7..000000000 Binary files a/tests/visual_tests/images/marker-svg-opacity-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-opacity2-500-100-1.0-agg-reference.png b/tests/visual_tests/images/marker-svg-opacity2-500-100-1.0-agg-reference.png deleted file mode 100644 index 995ef9614..000000000 Binary files a/tests/visual_tests/images/marker-svg-opacity2-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-opacity2-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/marker-svg-opacity2-500-100-1.0-cairo-reference.png deleted file mode 100644 index 995ef9614..000000000 Binary files a/tests/visual_tests/images/marker-svg-opacity2-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-opacity2-500-100-2.0-agg-reference.png b/tests/visual_tests/images/marker-svg-opacity2-500-100-2.0-agg-reference.png deleted file mode 100644 index 12ae43054..000000000 Binary files a/tests/visual_tests/images/marker-svg-opacity2-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-svg-opacity2-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/marker-svg-opacity2-500-100-2.0-cairo-reference.png deleted file mode 100644 index 12ae43054..000000000 Binary files a/tests/visual_tests/images/marker-svg-opacity2-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-symbolizer-expressions-all-256-256-1.0-agg-reference.png b/tests/visual_tests/images/marker-symbolizer-expressions-all-256-256-1.0-agg-reference.png deleted file mode 100644 index 242b653a8..000000000 Binary files a/tests/visual_tests/images/marker-symbolizer-expressions-all-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-symbolizer-expressions-all-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/marker-symbolizer-expressions-all-256-256-1.0-cairo-reference.png deleted file mode 100644 index 72f53047f..000000000 Binary files a/tests/visual_tests/images/marker-symbolizer-expressions-all-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-symbolizer-expressions-all-256-256-2.0-agg-reference.png b/tests/visual_tests/images/marker-symbolizer-expressions-all-256-256-2.0-agg-reference.png deleted file mode 100644 index df0b04dad..000000000 Binary files a/tests/visual_tests/images/marker-symbolizer-expressions-all-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-symbolizer-expressions-all-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/marker-symbolizer-expressions-all-256-256-2.0-cairo-reference.png deleted file mode 100644 index 601f92ef0..000000000 Binary files a/tests/visual_tests/images/marker-symbolizer-expressions-all-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-vs-point-512-512-1.0-agg-reference.png b/tests/visual_tests/images/marker-vs-point-512-512-1.0-agg-reference.png deleted file mode 100644 index 35f4b5c52..000000000 Binary files a/tests/visual_tests/images/marker-vs-point-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-vs-point-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/marker-vs-point-512-512-1.0-cairo-reference.png deleted file mode 100644 index ef3e21e70..000000000 Binary files a/tests/visual_tests/images/marker-vs-point-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-vs-point-512-512-2.0-agg-reference.png b/tests/visual_tests/images/marker-vs-point-512-512-2.0-agg-reference.png deleted file mode 100644 index 4b3a2f95d..000000000 Binary files a/tests/visual_tests/images/marker-vs-point-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-vs-point-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/marker-vs-point-512-512-2.0-cairo-reference.png deleted file mode 100644 index eb0e817a7..000000000 Binary files a/tests/visual_tests/images/marker-vs-point-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-whole-multi-polygon-512-512-1.0-agg-reference.png b/tests/visual_tests/images/marker-whole-multi-polygon-512-512-1.0-agg-reference.png deleted file mode 100644 index dba619a54..000000000 Binary files a/tests/visual_tests/images/marker-whole-multi-polygon-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-whole-multi-polygon-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/marker-whole-multi-polygon-512-512-1.0-cairo-reference.png deleted file mode 100644 index 374bf069f..000000000 Binary files a/tests/visual_tests/images/marker-whole-multi-polygon-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-whole-multi-polygon-512-512-2.0-agg-reference.png b/tests/visual_tests/images/marker-whole-multi-polygon-512-512-2.0-agg-reference.png deleted file mode 100644 index c60457c18..000000000 Binary files a/tests/visual_tests/images/marker-whole-multi-polygon-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-whole-multi-polygon-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/marker-whole-multi-polygon-512-512-2.0-cairo-reference.png deleted file mode 100644 index bf163e839..000000000 Binary files a/tests/visual_tests/images/marker-whole-multi-polygon-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-257-256-1.0-agg-reference.png b/tests/visual_tests/images/marker-with-background-image-257-256-1.0-agg-reference.png deleted file mode 100644 index 2f84f5dd0..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-257-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-257-256-1.0-cairo-reference.png b/tests/visual_tests/images/marker-with-background-image-257-256-1.0-cairo-reference.png deleted file mode 100644 index 08836e9e9..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-257-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-257-256-2.0-agg-reference.png b/tests/visual_tests/images/marker-with-background-image-257-256-2.0-agg-reference.png deleted file mode 100644 index cda415be2..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-257-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-257-256-2.0-cairo-reference.png b/tests/visual_tests/images/marker-with-background-image-257-256-2.0-cairo-reference.png deleted file mode 100644 index 2348274d2..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-257-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-400-600-1.0-agg-reference.png b/tests/visual_tests/images/marker-with-background-image-400-600-1.0-agg-reference.png deleted file mode 100644 index b40eb4460..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-400-600-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-400-600-1.0-cairo-reference.png b/tests/visual_tests/images/marker-with-background-image-400-600-1.0-cairo-reference.png deleted file mode 100644 index 30456c63e..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-400-600-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-400-600-2.0-agg-reference.png b/tests/visual_tests/images/marker-with-background-image-400-600-2.0-agg-reference.png deleted file mode 100644 index 2391bcae7..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-400-600-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-400-600-2.0-cairo-reference.png b/tests/visual_tests/images/marker-with-background-image-400-600-2.0-cairo-reference.png deleted file mode 100644 index 79f229a2a..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-400-600-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-600-400-1.0-agg-reference.png b/tests/visual_tests/images/marker-with-background-image-600-400-1.0-agg-reference.png deleted file mode 100644 index 4975a7716..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/marker-with-background-image-600-400-1.0-cairo-reference.png deleted file mode 100644 index 2c15bd061..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-600-400-2.0-agg-reference.png b/tests/visual_tests/images/marker-with-background-image-600-400-2.0-agg-reference.png deleted file mode 100644 index b3c260988..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/marker-with-background-image-600-400-2.0-cairo-reference.png deleted file mode 100644 index 420389f09..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-257-256-1.0-agg-reference.png b/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-257-256-1.0-agg-reference.png deleted file mode 100644 index 05e8df84c..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-257-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-257-256-1.0-cairo-reference.png b/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-257-256-1.0-cairo-reference.png deleted file mode 100644 index 08836e9e9..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-257-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-257-256-2.0-agg-reference.png b/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-257-256-2.0-agg-reference.png deleted file mode 100644 index 086511cd7..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-257-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-257-256-2.0-cairo-reference.png b/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-257-256-2.0-cairo-reference.png deleted file mode 100644 index 2348274d2..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-257-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-400-600-1.0-agg-reference.png b/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-400-600-1.0-agg-reference.png deleted file mode 100644 index e7afffb7f..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-400-600-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-400-600-1.0-cairo-reference.png b/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-400-600-1.0-cairo-reference.png deleted file mode 100644 index 30456c63e..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-400-600-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-400-600-2.0-agg-reference.png b/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-400-600-2.0-agg-reference.png deleted file mode 100644 index c729a0e17..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-400-600-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-400-600-2.0-cairo-reference.png b/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-400-600-2.0-cairo-reference.png deleted file mode 100644 index 79f229a2a..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-400-600-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-600-400-1.0-agg-reference.png b/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-600-400-1.0-agg-reference.png deleted file mode 100644 index 61e7e0b2c..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-600-400-1.0-cairo-reference.png deleted file mode 100644 index 2c15bd061..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-600-400-2.0-agg-reference.png b/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-600-400-2.0-agg-reference.png deleted file mode 100644 index da676df5e..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-600-400-2.0-cairo-reference.png deleted file mode 100644 index 420389f09..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-and-hsla-transform-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-linear-comp-op-500-100-1.0-agg-reference.png b/tests/visual_tests/images/marker-with-background-image-linear-comp-op-500-100-1.0-agg-reference.png deleted file mode 100644 index 62e95c64a..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-linear-comp-op-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-linear-comp-op-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/marker-with-background-image-linear-comp-op-500-100-1.0-cairo-reference.png deleted file mode 100644 index 768f582e5..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-linear-comp-op-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-linear-comp-op-500-100-2.0-agg-reference.png b/tests/visual_tests/images/marker-with-background-image-linear-comp-op-500-100-2.0-agg-reference.png deleted file mode 100644 index 64524a9e8..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-linear-comp-op-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker-with-background-image-linear-comp-op-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/marker-with-background-image-linear-comp-op-500-100-2.0-cairo-reference.png deleted file mode 100644 index 141a2671c..000000000 Binary files a/tests/visual_tests/images/marker-with-background-image-linear-comp-op-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker_line_placement_on_points-500-100-1.0-agg-reference.png b/tests/visual_tests/images/marker_line_placement_on_points-500-100-1.0-agg-reference.png deleted file mode 100644 index fecda368f..000000000 Binary files a/tests/visual_tests/images/marker_line_placement_on_points-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker_line_placement_on_points-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/marker_line_placement_on_points-500-100-1.0-cairo-reference.png deleted file mode 100644 index ebb076c2b..000000000 Binary files a/tests/visual_tests/images/marker_line_placement_on_points-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker_line_placement_on_points-500-100-2.0-agg-reference.png b/tests/visual_tests/images/marker_line_placement_on_points-500-100-2.0-agg-reference.png deleted file mode 100644 index d71141b03..000000000 Binary files a/tests/visual_tests/images/marker_line_placement_on_points-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/marker_line_placement_on_points-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/marker_line_placement_on_points-500-100-2.0-cairo-reference.png deleted file mode 100644 index 1961133d4..000000000 Binary files a/tests/visual_tests/images/marker_line_placement_on_points-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/orientation-800-200-1.0-agg-reference.png b/tests/visual_tests/images/orientation-800-200-1.0-agg-reference.png deleted file mode 100644 index 5eaa3c15f..000000000 Binary files a/tests/visual_tests/images/orientation-800-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/orientation-800-200-1.0-cairo-reference.png b/tests/visual_tests/images/orientation-800-200-1.0-cairo-reference.png deleted file mode 100644 index b6723dd5b..000000000 Binary files a/tests/visual_tests/images/orientation-800-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/orientation-800-200-2.0-agg-reference.png b/tests/visual_tests/images/orientation-800-200-2.0-agg-reference.png deleted file mode 100644 index 1a9555e90..000000000 Binary files a/tests/visual_tests/images/orientation-800-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/orientation-800-200-2.0-cairo-reference.png b/tests/visual_tests/images/orientation-800-200-2.0-cairo-reference.png deleted file mode 100644 index 817f99dea..000000000 Binary files a/tests/visual_tests/images/orientation-800-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/point-symbolizer-expressions-256-256-1.0-agg-reference.png b/tests/visual_tests/images/point-symbolizer-expressions-256-256-1.0-agg-reference.png deleted file mode 100644 index eaac22271..000000000 Binary files a/tests/visual_tests/images/point-symbolizer-expressions-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/point-symbolizer-expressions-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/point-symbolizer-expressions-256-256-1.0-cairo-reference.png deleted file mode 100644 index 0cb383bb7..000000000 Binary files a/tests/visual_tests/images/point-symbolizer-expressions-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/point-symbolizer-expressions-256-256-2.0-agg-reference.png b/tests/visual_tests/images/point-symbolizer-expressions-256-256-2.0-agg-reference.png deleted file mode 100644 index 6cd7c31a5..000000000 Binary files a/tests/visual_tests/images/point-symbolizer-expressions-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/point-symbolizer-expressions-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/point-symbolizer-expressions-256-256-2.0-cairo-reference.png deleted file mode 100644 index f06181253..000000000 Binary files a/tests/visual_tests/images/point-symbolizer-expressions-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/point-symbolizer-expressions-all-256-256-1.0-agg-reference.png b/tests/visual_tests/images/point-symbolizer-expressions-all-256-256-1.0-agg-reference.png deleted file mode 100644 index 6c6fb5b67..000000000 Binary files a/tests/visual_tests/images/point-symbolizer-expressions-all-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/point-symbolizer-expressions-all-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/point-symbolizer-expressions-all-256-256-1.0-cairo-reference.png deleted file mode 100644 index ed86b4759..000000000 Binary files a/tests/visual_tests/images/point-symbolizer-expressions-all-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/point-symbolizer-expressions-all-256-256-2.0-agg-reference.png b/tests/visual_tests/images/point-symbolizer-expressions-all-256-256-2.0-agg-reference.png deleted file mode 100644 index 4660546cd..000000000 Binary files a/tests/visual_tests/images/point-symbolizer-expressions-all-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/point-symbolizer-expressions-all-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/point-symbolizer-expressions-all-256-256-2.0-cairo-reference.png deleted file mode 100644 index 8cf801c67..000000000 Binary files a/tests/visual_tests/images/point-symbolizer-expressions-all-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/point-symbolizer-overlap-placement-expr-500-500-1.0-agg-reference.png b/tests/visual_tests/images/point-symbolizer-overlap-placement-expr-500-500-1.0-agg-reference.png deleted file mode 100644 index ff046ca79..000000000 Binary files a/tests/visual_tests/images/point-symbolizer-overlap-placement-expr-500-500-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/point-symbolizer-overlap-placement-expr-500-500-1.0-cairo-reference.png b/tests/visual_tests/images/point-symbolizer-overlap-placement-expr-500-500-1.0-cairo-reference.png deleted file mode 100644 index 124833e46..000000000 Binary files a/tests/visual_tests/images/point-symbolizer-overlap-placement-expr-500-500-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/point-symbolizer-overlap-placement-expr-500-500-2.0-agg-reference.png b/tests/visual_tests/images/point-symbolizer-overlap-placement-expr-500-500-2.0-agg-reference.png deleted file mode 100644 index ad8ebe815..000000000 Binary files a/tests/visual_tests/images/point-symbolizer-overlap-placement-expr-500-500-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/point-symbolizer-overlap-placement-expr-500-500-2.0-cairo-reference.png b/tests/visual_tests/images/point-symbolizer-overlap-placement-expr-500-500-2.0-cairo-reference.png deleted file mode 100644 index 682833330..000000000 Binary files a/tests/visual_tests/images/point-symbolizer-overlap-placement-expr-500-500-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/polygon-symbolizer-expressions-256-256-1.0-agg-reference.png b/tests/visual_tests/images/polygon-symbolizer-expressions-256-256-1.0-agg-reference.png deleted file mode 100644 index 6bb2b2860..000000000 Binary files a/tests/visual_tests/images/polygon-symbolizer-expressions-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/polygon-symbolizer-expressions-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/polygon-symbolizer-expressions-256-256-1.0-cairo-reference.png deleted file mode 100644 index 605cde4ee..000000000 Binary files a/tests/visual_tests/images/polygon-symbolizer-expressions-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/polygon-symbolizer-expressions-256-256-2.0-agg-reference.png b/tests/visual_tests/images/polygon-symbolizer-expressions-256-256-2.0-agg-reference.png deleted file mode 100644 index 1c7f891ef..000000000 Binary files a/tests/visual_tests/images/polygon-symbolizer-expressions-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/polygon-symbolizer-expressions-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/polygon-symbolizer-expressions-256-256-2.0-cairo-reference.png deleted file mode 100644 index 8ddaa551a..000000000 Binary files a/tests/visual_tests/images/polygon-symbolizer-expressions-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/polygon-symbolizer-expressions-all-256-256-1.0-agg-reference.png b/tests/visual_tests/images/polygon-symbolizer-expressions-all-256-256-1.0-agg-reference.png deleted file mode 100644 index 929f4c6a9..000000000 Binary files a/tests/visual_tests/images/polygon-symbolizer-expressions-all-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/polygon-symbolizer-expressions-all-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/polygon-symbolizer-expressions-all-256-256-1.0-cairo-reference.png deleted file mode 100644 index 85e4e917f..000000000 Binary files a/tests/visual_tests/images/polygon-symbolizer-expressions-all-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/polygon-symbolizer-expressions-all-256-256-2.0-agg-reference.png b/tests/visual_tests/images/polygon-symbolizer-expressions-all-256-256-2.0-agg-reference.png deleted file mode 100644 index 138169585..000000000 Binary files a/tests/visual_tests/images/polygon-symbolizer-expressions-all-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/polygon-symbolizer-expressions-all-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/polygon-symbolizer-expressions-all-256-256-2.0-cairo-reference.png deleted file mode 100644 index cc66e4e81..000000000 Binary files a/tests/visual_tests/images/polygon-symbolizer-expressions-all-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/polygon-winding-order-300-300-1.0-agg-reference.png b/tests/visual_tests/images/polygon-winding-order-300-300-1.0-agg-reference.png deleted file mode 100644 index 5ae31e4c4..000000000 Binary files a/tests/visual_tests/images/polygon-winding-order-300-300-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/polygon-winding-order-300-300-1.0-cairo-reference.png b/tests/visual_tests/images/polygon-winding-order-300-300-1.0-cairo-reference.png deleted file mode 100644 index c44a04480..000000000 Binary files a/tests/visual_tests/images/polygon-winding-order-300-300-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/polygon-winding-order-300-300-2.0-agg-reference.png b/tests/visual_tests/images/polygon-winding-order-300-300-2.0-agg-reference.png deleted file mode 100644 index c9ad71215..000000000 Binary files a/tests/visual_tests/images/polygon-winding-order-300-300-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/polygon-winding-order-300-300-2.0-cairo-reference.png b/tests/visual_tests/images/polygon-winding-order-300-300-2.0-cairo-reference.png deleted file mode 100644 index a4622a1e5..000000000 Binary files a/tests/visual_tests/images/polygon-winding-order-300-300-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/postgis-inline-512-512-1.0-agg-reference.png b/tests/visual_tests/images/postgis-inline-512-512-1.0-agg-reference.png deleted file mode 100644 index 5f4ad0f38..000000000 Binary files a/tests/visual_tests/images/postgis-inline-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/postgis-inline-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/postgis-inline-512-512-1.0-cairo-reference.png deleted file mode 100644 index a2658d1c5..000000000 Binary files a/tests/visual_tests/images/postgis-inline-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/postgis-inline-512-512-2.0-agg-reference.png b/tests/visual_tests/images/postgis-inline-512-512-2.0-agg-reference.png deleted file mode 100644 index bf57f9610..000000000 Binary files a/tests/visual_tests/images/postgis-inline-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/postgis-inline-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/postgis-inline-512-512-2.0-cairo-reference.png deleted file mode 100644 index 92fa3c1bc..000000000 Binary files a/tests/visual_tests/images/postgis-inline-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/python-Format-reference.png b/tests/visual_tests/images/python-Format-reference.png deleted file mode 100644 index 95a0eea9f..000000000 Binary files a/tests/visual_tests/images/python-Format-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/python-IfElse-reference.png b/tests/visual_tests/images/python-IfElse-reference.png deleted file mode 100644 index d71da4f85..000000000 Binary files a/tests/visual_tests/images/python-IfElse-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/python-List-reference.png b/tests/visual_tests/images/python-List-reference.png deleted file mode 100644 index 2be43fc4f..000000000 Binary files a/tests/visual_tests/images/python-List-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/python-MyText-reference.png b/tests/visual_tests/images/python-MyText-reference.png deleted file mode 100644 index 775f4bce9..000000000 Binary files a/tests/visual_tests/images/python-MyText-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/python-TextNode-reference.png b/tests/visual_tests/images/python-TextNode-reference.png deleted file mode 100644 index db6bfa228..000000000 Binary files a/tests/visual_tests/images/python-TextNode-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha1-512-512-1.0-agg-reference.png b/tests/visual_tests/images/raster-color-to-alpha1-512-512-1.0-agg-reference.png deleted file mode 100644 index 8a5af3942..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha1-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha1-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/raster-color-to-alpha1-512-512-1.0-cairo-reference.png deleted file mode 100644 index b5a420b82..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha1-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha1-512-512-2.0-agg-reference.png b/tests/visual_tests/images/raster-color-to-alpha1-512-512-2.0-agg-reference.png deleted file mode 100644 index 8a5af3942..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha1-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha1-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/raster-color-to-alpha1-512-512-2.0-cairo-reference.png deleted file mode 100644 index b5a420b82..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha1-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha2-512-512-1.0-agg-reference.png b/tests/visual_tests/images/raster-color-to-alpha2-512-512-1.0-agg-reference.png deleted file mode 100644 index 316d8bd54..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha2-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha2-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/raster-color-to-alpha2-512-512-1.0-cairo-reference.png deleted file mode 100644 index 055892e15..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha2-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha2-512-512-2.0-agg-reference.png b/tests/visual_tests/images/raster-color-to-alpha2-512-512-2.0-agg-reference.png deleted file mode 100644 index 316d8bd54..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha2-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha2-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/raster-color-to-alpha2-512-512-2.0-cairo-reference.png deleted file mode 100644 index 055892e15..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha2-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha3-512-512-1.0-agg-reference.png b/tests/visual_tests/images/raster-color-to-alpha3-512-512-1.0-agg-reference.png deleted file mode 100644 index dd575b564..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha3-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha3-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/raster-color-to-alpha3-512-512-1.0-cairo-reference.png deleted file mode 100644 index 1dc7f8ae5..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha3-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha3-512-512-2.0-agg-reference.png b/tests/visual_tests/images/raster-color-to-alpha3-512-512-2.0-agg-reference.png deleted file mode 100644 index dd575b564..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha3-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha3-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/raster-color-to-alpha3-512-512-2.0-cairo-reference.png deleted file mode 100644 index 1dc7f8ae5..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha3-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha4-512-512-1.0-agg-reference.png b/tests/visual_tests/images/raster-color-to-alpha4-512-512-1.0-agg-reference.png deleted file mode 100644 index 1ec158dbc..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha4-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha4-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/raster-color-to-alpha4-512-512-1.0-cairo-reference.png deleted file mode 100644 index dec77cf5d..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha4-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha4-512-512-2.0-agg-reference.png b/tests/visual_tests/images/raster-color-to-alpha4-512-512-2.0-agg-reference.png deleted file mode 100644 index 1ec158dbc..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha4-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha4-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/raster-color-to-alpha4-512-512-2.0-cairo-reference.png deleted file mode 100644 index dec77cf5d..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha4-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha4b-512-512-1.0-agg-reference.png b/tests/visual_tests/images/raster-color-to-alpha4b-512-512-1.0-agg-reference.png deleted file mode 100644 index 0d27d72f1..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha4b-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha4b-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/raster-color-to-alpha4b-512-512-1.0-cairo-reference.png deleted file mode 100644 index fed820399..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha4b-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha4b-512-512-2.0-agg-reference.png b/tests/visual_tests/images/raster-color-to-alpha4b-512-512-2.0-agg-reference.png deleted file mode 100644 index 0d27d72f1..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha4b-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha4b-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/raster-color-to-alpha4b-512-512-2.0-cairo-reference.png deleted file mode 100644 index fed820399..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha4b-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha5-512-512-1.0-agg-reference.png b/tests/visual_tests/images/raster-color-to-alpha5-512-512-1.0-agg-reference.png deleted file mode 100644 index b75988967..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha5-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha5-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/raster-color-to-alpha5-512-512-1.0-cairo-reference.png deleted file mode 100644 index dec77cf5d..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha5-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha5-512-512-2.0-agg-reference.png b/tests/visual_tests/images/raster-color-to-alpha5-512-512-2.0-agg-reference.png deleted file mode 100644 index b75988967..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha5-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha5-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/raster-color-to-alpha5-512-512-2.0-cairo-reference.png deleted file mode 100644 index dec77cf5d..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha5-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha5b-512-512-1.0-agg-reference.png b/tests/visual_tests/images/raster-color-to-alpha5b-512-512-1.0-agg-reference.png deleted file mode 100644 index 78a99ee54..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha5b-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha5b-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/raster-color-to-alpha5b-512-512-1.0-cairo-reference.png deleted file mode 100644 index fed820399..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha5b-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha5b-512-512-2.0-agg-reference.png b/tests/visual_tests/images/raster-color-to-alpha5b-512-512-2.0-agg-reference.png deleted file mode 100644 index 78a99ee54..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha5b-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster-color-to-alpha5b-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/raster-color-to-alpha5b-512-512-2.0-cairo-reference.png deleted file mode 100644 index fed820399..000000000 Binary files a/tests/visual_tests/images/raster-color-to-alpha5b-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster_colorizer-512-512-1.0-agg-reference.png b/tests/visual_tests/images/raster_colorizer-512-512-1.0-agg-reference.png deleted file mode 100644 index dec77cf5d..000000000 Binary files a/tests/visual_tests/images/raster_colorizer-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster_colorizer-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/raster_colorizer-512-512-1.0-cairo-reference.png deleted file mode 100644 index dec77cf5d..000000000 Binary files a/tests/visual_tests/images/raster_colorizer-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster_colorizer-512-512-2.0-agg-reference.png b/tests/visual_tests/images/raster_colorizer-512-512-2.0-agg-reference.png deleted file mode 100644 index dec77cf5d..000000000 Binary files a/tests/visual_tests/images/raster_colorizer-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster_colorizer-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/raster_colorizer-512-512-2.0-cairo-reference.png deleted file mode 100644 index dec77cf5d..000000000 Binary files a/tests/visual_tests/images/raster_colorizer-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster_symbolizer-512-512-1.0-agg-reference.png b/tests/visual_tests/images/raster_symbolizer-512-512-1.0-agg-reference.png deleted file mode 100644 index 442400b9e..000000000 Binary files a/tests/visual_tests/images/raster_symbolizer-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster_symbolizer-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/raster_symbolizer-512-512-1.0-cairo-reference.png deleted file mode 100644 index 442400b9e..000000000 Binary files a/tests/visual_tests/images/raster_symbolizer-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster_symbolizer-512-512-2.0-agg-reference.png b/tests/visual_tests/images/raster_symbolizer-512-512-2.0-agg-reference.png deleted file mode 100644 index 442400b9e..000000000 Binary files a/tests/visual_tests/images/raster_symbolizer-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/raster_symbolizer-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/raster_symbolizer-512-512-2.0-cairo-reference.png deleted file mode 100644 index 442400b9e..000000000 Binary files a/tests/visual_tests/images/raster_symbolizer-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/rasterlite-globe-256-256-1.0-agg-reference.png b/tests/visual_tests/images/rasterlite-globe-256-256-1.0-agg-reference.png deleted file mode 100644 index d83fd2345..000000000 Binary files a/tests/visual_tests/images/rasterlite-globe-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/rasterlite-globe-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/rasterlite-globe-256-256-1.0-cairo-reference.png deleted file mode 100644 index d7dd2ff53..000000000 Binary files a/tests/visual_tests/images/rasterlite-globe-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/rasterlite-globe-256-256-2.0-agg-reference.png b/tests/visual_tests/images/rasterlite-globe-256-256-2.0-agg-reference.png deleted file mode 100644 index d83fd2345..000000000 Binary files a/tests/visual_tests/images/rasterlite-globe-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/rasterlite-globe-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/rasterlite-globe-256-256-2.0-cairo-reference.png deleted file mode 100644 index d7dd2ff53..000000000 Binary files a/tests/visual_tests/images/rasterlite-globe-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-1-750-250-1.0-agg-reference.png b/tests/visual_tests/images/repeat-labels-1-750-250-1.0-agg-reference.png deleted file mode 100644 index 7e6fbce59..000000000 Binary files a/tests/visual_tests/images/repeat-labels-1-750-250-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-1-750-250-1.0-cairo-reference.png b/tests/visual_tests/images/repeat-labels-1-750-250-1.0-cairo-reference.png deleted file mode 100644 index 1cdc0b8b3..000000000 Binary files a/tests/visual_tests/images/repeat-labels-1-750-250-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-1-750-250-2.0-agg-reference.png b/tests/visual_tests/images/repeat-labels-1-750-250-2.0-agg-reference.png deleted file mode 100644 index 9ee34cff9..000000000 Binary files a/tests/visual_tests/images/repeat-labels-1-750-250-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-1-750-250-2.0-cairo-reference.png b/tests/visual_tests/images/repeat-labels-1-750-250-2.0-cairo-reference.png deleted file mode 100644 index 3634ee8b5..000000000 Binary files a/tests/visual_tests/images/repeat-labels-1-750-250-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-2-750-250-1.0-agg-reference.png b/tests/visual_tests/images/repeat-labels-2-750-250-1.0-agg-reference.png deleted file mode 100644 index e6cb76f45..000000000 Binary files a/tests/visual_tests/images/repeat-labels-2-750-250-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-2-750-250-1.0-cairo-reference.png b/tests/visual_tests/images/repeat-labels-2-750-250-1.0-cairo-reference.png deleted file mode 100644 index e5adf19ef..000000000 Binary files a/tests/visual_tests/images/repeat-labels-2-750-250-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-2-750-250-2.0-agg-reference.png b/tests/visual_tests/images/repeat-labels-2-750-250-2.0-agg-reference.png deleted file mode 100644 index 31031ff89..000000000 Binary files a/tests/visual_tests/images/repeat-labels-2-750-250-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-2-750-250-2.0-cairo-reference.png b/tests/visual_tests/images/repeat-labels-2-750-250-2.0-cairo-reference.png deleted file mode 100644 index 2db09aeef..000000000 Binary files a/tests/visual_tests/images/repeat-labels-2-750-250-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-3-750-250-1.0-agg-reference.png b/tests/visual_tests/images/repeat-labels-3-750-250-1.0-agg-reference.png deleted file mode 100644 index 21265faea..000000000 Binary files a/tests/visual_tests/images/repeat-labels-3-750-250-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-3-750-250-1.0-cairo-reference.png b/tests/visual_tests/images/repeat-labels-3-750-250-1.0-cairo-reference.png deleted file mode 100644 index abe02a032..000000000 Binary files a/tests/visual_tests/images/repeat-labels-3-750-250-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-3-750-250-2.0-agg-reference.png b/tests/visual_tests/images/repeat-labels-3-750-250-2.0-agg-reference.png deleted file mode 100644 index 23bedec7b..000000000 Binary files a/tests/visual_tests/images/repeat-labels-3-750-250-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-3-750-250-2.0-cairo-reference.png b/tests/visual_tests/images/repeat-labels-3-750-250-2.0-cairo-reference.png deleted file mode 100644 index bbaf30fe7..000000000 Binary files a/tests/visual_tests/images/repeat-labels-3-750-250-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-4-750-250-1.0-agg-reference.png b/tests/visual_tests/images/repeat-labels-4-750-250-1.0-agg-reference.png deleted file mode 100644 index 4d491fe36..000000000 Binary files a/tests/visual_tests/images/repeat-labels-4-750-250-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-4-750-250-1.0-cairo-reference.png b/tests/visual_tests/images/repeat-labels-4-750-250-1.0-cairo-reference.png deleted file mode 100644 index 850c8a56c..000000000 Binary files a/tests/visual_tests/images/repeat-labels-4-750-250-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-4-750-250-2.0-agg-reference.png b/tests/visual_tests/images/repeat-labels-4-750-250-2.0-agg-reference.png deleted file mode 100644 index 1352e50a9..000000000 Binary files a/tests/visual_tests/images/repeat-labels-4-750-250-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/repeat-labels-4-750-250-2.0-cairo-reference.png b/tests/visual_tests/images/repeat-labels-4-750-250-2.0-cairo-reference.png deleted file mode 100644 index b89f835d9..000000000 Binary files a/tests/visual_tests/images/repeat-labels-4-750-250-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/road-casings-grouped-rendering-600-600-1.0-agg-reference.png b/tests/visual_tests/images/road-casings-grouped-rendering-600-600-1.0-agg-reference.png deleted file mode 100644 index 4822333f6..000000000 Binary files a/tests/visual_tests/images/road-casings-grouped-rendering-600-600-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/road-casings-grouped-rendering-600-600-1.0-cairo-reference.png b/tests/visual_tests/images/road-casings-grouped-rendering-600-600-1.0-cairo-reference.png deleted file mode 100644 index 62c147f99..000000000 Binary files a/tests/visual_tests/images/road-casings-grouped-rendering-600-600-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/road-casings-grouped-rendering-600-600-2.0-agg-reference.png b/tests/visual_tests/images/road-casings-grouped-rendering-600-600-2.0-agg-reference.png deleted file mode 100644 index b66af9b36..000000000 Binary files a/tests/visual_tests/images/road-casings-grouped-rendering-600-600-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/road-casings-grouped-rendering-600-600-2.0-cairo-reference.png b/tests/visual_tests/images/road-casings-grouped-rendering-600-600-2.0-cairo-reference.png deleted file mode 100644 index c4d299c78..000000000 Binary files a/tests/visual_tests/images/road-casings-grouped-rendering-600-600-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/road-casings-non-grouped-rendering-600-600-1.0-agg-reference.png b/tests/visual_tests/images/road-casings-non-grouped-rendering-600-600-1.0-agg-reference.png deleted file mode 100644 index c0b33befa..000000000 Binary files a/tests/visual_tests/images/road-casings-non-grouped-rendering-600-600-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/road-casings-non-grouped-rendering-600-600-1.0-cairo-reference.png b/tests/visual_tests/images/road-casings-non-grouped-rendering-600-600-1.0-cairo-reference.png deleted file mode 100644 index a5c0ea68c..000000000 Binary files a/tests/visual_tests/images/road-casings-non-grouped-rendering-600-600-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/road-casings-non-grouped-rendering-600-600-2.0-agg-reference.png b/tests/visual_tests/images/road-casings-non-grouped-rendering-600-600-2.0-agg-reference.png deleted file mode 100644 index 50ac3237a..000000000 Binary files a/tests/visual_tests/images/road-casings-non-grouped-rendering-600-600-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/road-casings-non-grouped-rendering-600-600-2.0-cairo-reference.png b/tests/visual_tests/images/road-casings-non-grouped-rendering-600-600-2.0-cairo-reference.png deleted file mode 100644 index 24175a6a9..000000000 Binary files a/tests/visual_tests/images/road-casings-non-grouped-rendering-600-600-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/rtl-point-200-200-1.0-agg-reference.png b/tests/visual_tests/images/rtl-point-200-200-1.0-agg-reference.png deleted file mode 100644 index 9a538eb6d..000000000 Binary files a/tests/visual_tests/images/rtl-point-200-200-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/rtl-point-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/rtl-point-200-200-1.0-cairo-reference.png deleted file mode 100644 index 927e14f7d..000000000 Binary files a/tests/visual_tests/images/rtl-point-200-200-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/rtl-point-200-200-2.0-agg-reference.png b/tests/visual_tests/images/rtl-point-200-200-2.0-agg-reference.png deleted file mode 100644 index e3f9b2f19..000000000 Binary files a/tests/visual_tests/images/rtl-point-200-200-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/rtl-point-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/rtl-point-200-200-2.0-cairo-reference.png deleted file mode 100644 index bf030b8ed..000000000 Binary files a/tests/visual_tests/images/rtl-point-200-200-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shield-on-line-and-avoid-edges-512-512-1.0-agg-reference.png b/tests/visual_tests/images/shield-on-line-and-avoid-edges-512-512-1.0-agg-reference.png deleted file mode 100644 index 28824f417..000000000 Binary files a/tests/visual_tests/images/shield-on-line-and-avoid-edges-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shield-on-line-and-avoid-edges-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/shield-on-line-and-avoid-edges-512-512-1.0-cairo-reference.png deleted file mode 100644 index 435a92c33..000000000 Binary files a/tests/visual_tests/images/shield-on-line-and-avoid-edges-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shield-on-line-and-avoid-edges-512-512-2.0-agg-reference.png b/tests/visual_tests/images/shield-on-line-and-avoid-edges-512-512-2.0-agg-reference.png deleted file mode 100644 index c6942273b..000000000 Binary files a/tests/visual_tests/images/shield-on-line-and-avoid-edges-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shield-on-line-and-avoid-edges-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/shield-on-line-and-avoid-edges-512-512-2.0-cairo-reference.png deleted file mode 100644 index 3a74eb1ec..000000000 Binary files a/tests/visual_tests/images/shield-on-line-and-avoid-edges-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shield-on-line-spacing-eq-width-600-400-1.0-agg-reference.png b/tests/visual_tests/images/shield-on-line-spacing-eq-width-600-400-1.0-agg-reference.png deleted file mode 100644 index 196850a28..000000000 Binary files a/tests/visual_tests/images/shield-on-line-spacing-eq-width-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shield-on-line-spacing-eq-width-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/shield-on-line-spacing-eq-width-600-400-1.0-cairo-reference.png deleted file mode 100644 index 991566b4b..000000000 Binary files a/tests/visual_tests/images/shield-on-line-spacing-eq-width-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shield-on-line-spacing-eq-width-600-400-2.0-agg-reference.png b/tests/visual_tests/images/shield-on-line-spacing-eq-width-600-400-2.0-agg-reference.png deleted file mode 100644 index 6ff0bf180..000000000 Binary files a/tests/visual_tests/images/shield-on-line-spacing-eq-width-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shield-on-line-spacing-eq-width-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/shield-on-line-spacing-eq-width-600-400-2.0-cairo-reference.png deleted file mode 100644 index d3d3b4387..000000000 Binary files a/tests/visual_tests/images/shield-on-line-spacing-eq-width-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shield-on-polygon-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/shield-on-polygon-500-100-1.0-cairo-reference.png deleted file mode 100644 index bcb680333..000000000 Binary files a/tests/visual_tests/images/shield-on-polygon-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shield-on-polygon-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/shield-on-polygon-500-100-2.0-cairo-reference.png deleted file mode 100644 index 8ebad2380..000000000 Binary files a/tests/visual_tests/images/shield-on-polygon-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shield-on-polygon-600-400-1.0-agg-reference.png b/tests/visual_tests/images/shield-on-polygon-600-400-1.0-agg-reference.png deleted file mode 100644 index 501c6d2cb..000000000 Binary files a/tests/visual_tests/images/shield-on-polygon-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shield-on-polygon-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/shield-on-polygon-600-400-1.0-cairo-reference.png deleted file mode 100644 index 4f6721bfb..000000000 Binary files a/tests/visual_tests/images/shield-on-polygon-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shield-on-polygon-600-400-2.0-agg-reference.png b/tests/visual_tests/images/shield-on-polygon-600-400-2.0-agg-reference.png deleted file mode 100644 index 3fe3f6278..000000000 Binary files a/tests/visual_tests/images/shield-on-polygon-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shield-on-polygon-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/shield-on-polygon-600-400-2.0-cairo-reference.png deleted file mode 100644 index cac53afa0..000000000 Binary files a/tests/visual_tests/images/shield-on-polygon-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-490-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-490-100-1.0-agg-reference.png deleted file mode 100644 index c63e8495a..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-490-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-490-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-490-100-1.0-cairo-reference.png deleted file mode 100644 index 8540f1cd7..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-490-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-490-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-490-100-2.0-agg-reference.png deleted file mode 100644 index 3fe4b0784..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-490-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-490-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-490-100-2.0-cairo-reference.png deleted file mode 100644 index 5f0363d78..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-490-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-495-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-495-100-1.0-agg-reference.png deleted file mode 100644 index eb93db1ba..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-495-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-495-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-495-100-1.0-cairo-reference.png deleted file mode 100644 index 5ac06962c..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-495-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-495-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-495-100-2.0-agg-reference.png deleted file mode 100644 index a156dbfb5..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-495-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-495-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-495-100-2.0-cairo-reference.png deleted file mode 100644 index eafecfa7f..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-495-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-497-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-497-100-1.0-agg-reference.png deleted file mode 100644 index e1ac93e13..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-497-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-497-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-497-100-1.0-cairo-reference.png deleted file mode 100644 index d0e1d06e4..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-497-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-497-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-497-100-2.0-agg-reference.png deleted file mode 100644 index 81fb56be9..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-497-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-497-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-497-100-2.0-cairo-reference.png deleted file mode 100644 index 814610b95..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-497-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-498-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-498-100-1.0-agg-reference.png deleted file mode 100644 index eb15fb59d..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-498-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-498-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-498-100-1.0-cairo-reference.png deleted file mode 100644 index b01ef6b5b..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-498-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-498-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-498-100-2.0-agg-reference.png deleted file mode 100644 index 4882b14be..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-498-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-498-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-498-100-2.0-cairo-reference.png deleted file mode 100644 index 79452098d..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-498-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-499-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-499-100-1.0-agg-reference.png deleted file mode 100644 index b9dc7bf14..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-499-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-499-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-499-100-1.0-cairo-reference.png deleted file mode 100644 index fd97178f6..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-499-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-499-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-499-100-2.0-agg-reference.png deleted file mode 100644 index 5ef96f080..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-499-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-499-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-499-100-2.0-cairo-reference.png deleted file mode 100644 index 4c6e7db4b..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-499-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-500-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-500-100-1.0-agg-reference.png deleted file mode 100644 index a4af5d6cf..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-500-100-1.0-cairo-reference.png deleted file mode 100644 index f7d43b080..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-500-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-500-100-2.0-agg-reference.png deleted file mode 100644 index de5a2a8bb..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-500-100-2.0-cairo-reference.png deleted file mode 100644 index b7e3124e1..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-501-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-501-100-1.0-agg-reference.png deleted file mode 100644 index 9bb1f77b6..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-501-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-501-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-501-100-1.0-cairo-reference.png deleted file mode 100644 index 2f40e34e0..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-501-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-501-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-501-100-2.0-agg-reference.png deleted file mode 100644 index d9c5c900a..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-501-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-501-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-501-100-2.0-cairo-reference.png deleted file mode 100644 index aaf457fbe..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-501-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-502-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-502-100-1.0-agg-reference.png deleted file mode 100644 index 891ee2916..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-502-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-502-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-502-100-1.0-cairo-reference.png deleted file mode 100644 index 04e0240c1..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-502-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-502-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-502-100-2.0-agg-reference.png deleted file mode 100644 index 0f7ae8ac9..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-502-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-502-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-502-100-2.0-cairo-reference.png deleted file mode 100644 index f25d876ab..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-502-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-505-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-505-100-1.0-agg-reference.png deleted file mode 100644 index 7f6b18855..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-505-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-505-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-505-100-1.0-cairo-reference.png deleted file mode 100644 index 750c6f5a5..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-505-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-505-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-505-100-2.0-agg-reference.png deleted file mode 100644 index 28bdff665..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-505-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-505-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-505-100-2.0-cairo-reference.png deleted file mode 100644 index 20f1fb430..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-505-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-510-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-510-100-1.0-agg-reference.png deleted file mode 100644 index 31240cd5e..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-510-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-510-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-510-100-1.0-cairo-reference.png deleted file mode 100644 index 9f1964a39..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-510-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-510-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-510-100-2.0-agg-reference.png deleted file mode 100644 index 2ec21cd30..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-510-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-1-510-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-1-510-100-2.0-cairo-reference.png deleted file mode 100644 index 66b66db0b..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-1-510-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-490-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-490-100-1.0-agg-reference.png deleted file mode 100644 index 04cb194c9..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-490-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-490-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-490-100-1.0-cairo-reference.png deleted file mode 100644 index d9d90f3df..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-490-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-490-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-490-100-2.0-agg-reference.png deleted file mode 100644 index b6ef565ff..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-490-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-490-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-490-100-2.0-cairo-reference.png deleted file mode 100644 index 0357ebe4e..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-490-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-495-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-495-100-1.0-agg-reference.png deleted file mode 100644 index ce25ce484..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-495-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-495-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-495-100-1.0-cairo-reference.png deleted file mode 100644 index e8222902e..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-495-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-495-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-495-100-2.0-agg-reference.png deleted file mode 100644 index 089d007a7..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-495-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-495-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-495-100-2.0-cairo-reference.png deleted file mode 100644 index 13837ce54..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-495-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-497-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-497-100-1.0-agg-reference.png deleted file mode 100644 index 6a38361cb..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-497-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-497-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-497-100-1.0-cairo-reference.png deleted file mode 100644 index 1432156b4..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-497-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-497-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-497-100-2.0-agg-reference.png deleted file mode 100644 index 8b1627d8f..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-497-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-497-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-497-100-2.0-cairo-reference.png deleted file mode 100644 index 18ef859cf..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-497-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-498-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-498-100-1.0-agg-reference.png deleted file mode 100644 index fc1aa23a2..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-498-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-498-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-498-100-1.0-cairo-reference.png deleted file mode 100644 index 011a3fcd7..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-498-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-498-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-498-100-2.0-agg-reference.png deleted file mode 100644 index e5e943611..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-498-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-498-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-498-100-2.0-cairo-reference.png deleted file mode 100644 index 3f85ea20f..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-498-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-499-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-499-100-1.0-agg-reference.png deleted file mode 100644 index 0a940c304..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-499-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-499-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-499-100-1.0-cairo-reference.png deleted file mode 100644 index 35ae4cc59..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-499-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-499-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-499-100-2.0-agg-reference.png deleted file mode 100644 index 796204cfb..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-499-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-499-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-499-100-2.0-cairo-reference.png deleted file mode 100644 index 68dbbe803..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-499-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-500-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-500-100-1.0-agg-reference.png deleted file mode 100644 index 21dcc56a9..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-500-100-1.0-cairo-reference.png deleted file mode 100644 index 332129218..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-500-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-500-100-2.0-agg-reference.png deleted file mode 100644 index b5c0de689..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-500-100-2.0-cairo-reference.png deleted file mode 100644 index 61e6294a1..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-501-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-501-100-1.0-agg-reference.png deleted file mode 100644 index adaadfc6b..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-501-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-501-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-501-100-1.0-cairo-reference.png deleted file mode 100644 index c04014ac7..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-501-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-501-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-501-100-2.0-agg-reference.png deleted file mode 100644 index 9e8cfe50f..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-501-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-501-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-501-100-2.0-cairo-reference.png deleted file mode 100644 index 82d20e051..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-501-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-502-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-502-100-1.0-agg-reference.png deleted file mode 100644 index 9776bdec1..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-502-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-502-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-502-100-1.0-cairo-reference.png deleted file mode 100644 index ed2913e1b..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-502-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-502-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-502-100-2.0-agg-reference.png deleted file mode 100644 index 343a4efb2..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-502-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-502-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-502-100-2.0-cairo-reference.png deleted file mode 100644 index 2f1e1decf..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-502-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-505-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-505-100-1.0-agg-reference.png deleted file mode 100644 index db5bbede3..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-505-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-505-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-505-100-1.0-cairo-reference.png deleted file mode 100644 index c6cb2877b..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-505-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-505-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-505-100-2.0-agg-reference.png deleted file mode 100644 index 399a28040..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-505-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-505-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-505-100-2.0-cairo-reference.png deleted file mode 100644 index e61f42b12..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-505-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-510-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-510-100-1.0-agg-reference.png deleted file mode 100644 index f6bb67da7..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-510-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-510-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-510-100-1.0-cairo-reference.png deleted file mode 100644 index 38e26d408..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-510-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-510-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-510-100-2.0-agg-reference.png deleted file mode 100644 index 37fa15bdf..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-510-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-2-510-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-2-510-100-2.0-cairo-reference.png deleted file mode 100644 index 71054f96e..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-2-510-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-490-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-490-100-1.0-agg-reference.png deleted file mode 100644 index 67b06ff85..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-490-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-490-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-490-100-1.0-cairo-reference.png deleted file mode 100644 index bbf5ed19f..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-490-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-490-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-490-100-2.0-agg-reference.png deleted file mode 100644 index 2960be8b4..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-490-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-490-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-490-100-2.0-cairo-reference.png deleted file mode 100644 index 37e1a33bb..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-490-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-495-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-495-100-1.0-agg-reference.png deleted file mode 100644 index f551db23c..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-495-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-495-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-495-100-1.0-cairo-reference.png deleted file mode 100644 index 67425b1b3..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-495-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-495-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-495-100-2.0-agg-reference.png deleted file mode 100644 index 8784ba2eb..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-495-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-495-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-495-100-2.0-cairo-reference.png deleted file mode 100644 index d5e1dc6e7..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-495-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-497-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-497-100-1.0-agg-reference.png deleted file mode 100644 index ddf5797c2..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-497-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-497-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-497-100-1.0-cairo-reference.png deleted file mode 100644 index 1f1b317e1..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-497-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-497-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-497-100-2.0-agg-reference.png deleted file mode 100644 index f9512e3c1..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-497-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-497-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-497-100-2.0-cairo-reference.png deleted file mode 100644 index cf540bbb5..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-497-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-498-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-498-100-1.0-agg-reference.png deleted file mode 100644 index 48077e574..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-498-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-498-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-498-100-1.0-cairo-reference.png deleted file mode 100644 index c6efc8bae..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-498-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-498-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-498-100-2.0-agg-reference.png deleted file mode 100644 index 156262c48..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-498-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-498-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-498-100-2.0-cairo-reference.png deleted file mode 100644 index 861af43a7..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-498-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-499-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-499-100-1.0-agg-reference.png deleted file mode 100644 index 2c50e3787..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-499-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-499-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-499-100-1.0-cairo-reference.png deleted file mode 100644 index 782d0c4d3..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-499-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-499-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-499-100-2.0-agg-reference.png deleted file mode 100644 index 9b533f1d7..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-499-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-499-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-499-100-2.0-cairo-reference.png deleted file mode 100644 index d104545ae..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-499-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-500-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-500-100-1.0-agg-reference.png deleted file mode 100644 index e5f75aa5d..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-500-100-1.0-cairo-reference.png deleted file mode 100644 index c801fdb06..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-500-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-500-100-2.0-agg-reference.png deleted file mode 100644 index b207454fc..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-500-100-2.0-cairo-reference.png deleted file mode 100644 index 232c7b983..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-501-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-501-100-1.0-agg-reference.png deleted file mode 100644 index 0685c3930..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-501-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-501-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-501-100-1.0-cairo-reference.png deleted file mode 100644 index 17db7bc0e..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-501-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-501-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-501-100-2.0-agg-reference.png deleted file mode 100644 index bb1ca2e7b..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-501-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-501-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-501-100-2.0-cairo-reference.png deleted file mode 100644 index d7db90d91..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-501-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-502-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-502-100-1.0-agg-reference.png deleted file mode 100644 index 396d415e8..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-502-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-502-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-502-100-1.0-cairo-reference.png deleted file mode 100644 index 7863f4ffb..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-502-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-502-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-502-100-2.0-agg-reference.png deleted file mode 100644 index 04b8c2e28..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-502-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-502-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-502-100-2.0-cairo-reference.png deleted file mode 100644 index a45da3a23..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-502-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-505-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-505-100-1.0-agg-reference.png deleted file mode 100644 index 43bdb6d45..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-505-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-505-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-505-100-1.0-cairo-reference.png deleted file mode 100644 index 6a6836f42..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-505-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-505-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-505-100-2.0-agg-reference.png deleted file mode 100644 index 7ab74e5c7..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-505-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-505-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-505-100-2.0-cairo-reference.png deleted file mode 100644 index 3ba010aae..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-505-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-510-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-510-100-1.0-agg-reference.png deleted file mode 100644 index f8e2438fb..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-510-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-510-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-510-100-1.0-cairo-reference.png deleted file mode 100644 index 2c36f36c6..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-510-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-510-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-510-100-2.0-agg-reference.png deleted file mode 100644 index 1e82301d9..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-510-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-3-510-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-3-510-100-2.0-cairo-reference.png deleted file mode 100644 index ec8a7b376..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-3-510-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-490-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-490-100-1.0-agg-reference.png deleted file mode 100644 index 980b19fd3..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-490-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-490-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-490-100-1.0-cairo-reference.png deleted file mode 100644 index 3066c10c9..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-490-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-490-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-490-100-2.0-agg-reference.png deleted file mode 100644 index 30b375d48..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-490-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-490-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-490-100-2.0-cairo-reference.png deleted file mode 100644 index fd4b64002..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-490-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-495-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-495-100-1.0-agg-reference.png deleted file mode 100644 index d2b820bc2..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-495-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-495-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-495-100-1.0-cairo-reference.png deleted file mode 100644 index 1f85ab75d..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-495-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-495-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-495-100-2.0-agg-reference.png deleted file mode 100644 index ff1d972d3..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-495-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-495-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-495-100-2.0-cairo-reference.png deleted file mode 100644 index e08f58531..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-495-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-497-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-497-100-1.0-agg-reference.png deleted file mode 100644 index 17e7606e5..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-497-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-497-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-497-100-1.0-cairo-reference.png deleted file mode 100644 index fc2753884..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-497-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-497-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-497-100-2.0-agg-reference.png deleted file mode 100644 index f8fb4cb8f..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-497-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-497-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-497-100-2.0-cairo-reference.png deleted file mode 100644 index cd74c2884..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-497-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-498-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-498-100-1.0-agg-reference.png deleted file mode 100644 index 19655b7c7..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-498-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-498-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-498-100-1.0-cairo-reference.png deleted file mode 100644 index 9732411b6..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-498-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-498-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-498-100-2.0-agg-reference.png deleted file mode 100644 index d18e52b1b..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-498-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-498-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-498-100-2.0-cairo-reference.png deleted file mode 100644 index 00aa4a4e2..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-498-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-499-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-499-100-1.0-agg-reference.png deleted file mode 100644 index 2b76ef7af..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-499-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-499-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-499-100-1.0-cairo-reference.png deleted file mode 100644 index 4dcda5c43..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-499-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-499-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-499-100-2.0-agg-reference.png deleted file mode 100644 index 9971e2e2c..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-499-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-499-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-499-100-2.0-cairo-reference.png deleted file mode 100644 index 383e4dad5..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-499-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-500-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-500-100-1.0-agg-reference.png deleted file mode 100644 index a5e96f141..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-500-100-1.0-cairo-reference.png deleted file mode 100644 index 74f2603bc..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-500-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-500-100-2.0-agg-reference.png deleted file mode 100644 index 7d3eecb6c..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-500-100-2.0-cairo-reference.png deleted file mode 100644 index 39f6a7ddc..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-501-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-501-100-1.0-agg-reference.png deleted file mode 100644 index e6cc3b253..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-501-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-501-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-501-100-1.0-cairo-reference.png deleted file mode 100644 index c09dc5e8b..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-501-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-501-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-501-100-2.0-agg-reference.png deleted file mode 100644 index a8849dd73..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-501-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-501-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-501-100-2.0-cairo-reference.png deleted file mode 100644 index 88573a711..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-501-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-502-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-502-100-1.0-agg-reference.png deleted file mode 100644 index c02d387e6..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-502-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-502-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-502-100-1.0-cairo-reference.png deleted file mode 100644 index f0f82bd08..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-502-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-502-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-502-100-2.0-agg-reference.png deleted file mode 100644 index d1ba30700..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-502-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-502-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-502-100-2.0-cairo-reference.png deleted file mode 100644 index f77a2ed22..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-502-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-505-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-505-100-1.0-agg-reference.png deleted file mode 100644 index a10d7981b..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-505-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-505-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-505-100-1.0-cairo-reference.png deleted file mode 100644 index fbc316d91..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-505-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-505-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-505-100-2.0-agg-reference.png deleted file mode 100644 index 521fd72b0..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-505-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-505-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-505-100-2.0-cairo-reference.png deleted file mode 100644 index 815c43628..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-505-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-510-100-1.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-510-100-1.0-agg-reference.png deleted file mode 100644 index ba0312fda..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-510-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-510-100-1.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-510-100-1.0-cairo-reference.png deleted file mode 100644 index 097951c65..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-510-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-510-100-2.0-agg-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-510-100-2.0-agg-reference.png deleted file mode 100644 index 8cbe39aa1..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-510-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/shieldsymbolizer-4-510-100-2.0-cairo-reference.png b/tests/visual_tests/images/shieldsymbolizer-4-510-100-2.0-cairo-reference.png deleted file mode 100644 index f5418fcf2..000000000 Binary files a/tests/visual_tests/images/shieldsymbolizer-4-510-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-100-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-100-100-1.0-agg-reference.png deleted file mode 100644 index 1c8424bf2..000000000 Binary files a/tests/visual_tests/images/simple-100-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-100-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-100-100-1.0-cairo-reference.png deleted file mode 100644 index 2490ad33c..000000000 Binary files a/tests/visual_tests/images/simple-100-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-100-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-100-100-2.0-agg-reference.png deleted file mode 100644 index b3d13d9ce..000000000 Binary files a/tests/visual_tests/images/simple-100-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-100-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-100-100-2.0-cairo-reference.png deleted file mode 100644 index 58089e4a0..000000000 Binary files a/tests/visual_tests/images/simple-100-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-150-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-150-100-1.0-agg-reference.png deleted file mode 100644 index 7cbce972e..000000000 Binary files a/tests/visual_tests/images/simple-150-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-150-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-150-100-1.0-cairo-reference.png deleted file mode 100644 index cd4ab503a..000000000 Binary files a/tests/visual_tests/images/simple-150-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-150-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-150-100-2.0-agg-reference.png deleted file mode 100644 index 31e4d13a5..000000000 Binary files a/tests/visual_tests/images/simple-150-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-150-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-150-100-2.0-cairo-reference.png deleted file mode 100644 index 48caeb441..000000000 Binary files a/tests/visual_tests/images/simple-150-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-250-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-250-100-1.0-agg-reference.png deleted file mode 100644 index fdb63c831..000000000 Binary files a/tests/visual_tests/images/simple-250-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-250-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-250-100-1.0-cairo-reference.png deleted file mode 100644 index e7c7a5de9..000000000 Binary files a/tests/visual_tests/images/simple-250-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-250-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-250-100-2.0-agg-reference.png deleted file mode 100644 index f29a48d69..000000000 Binary files a/tests/visual_tests/images/simple-250-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-250-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-250-100-2.0-cairo-reference.png deleted file mode 100644 index 14ecb6719..000000000 Binary files a/tests/visual_tests/images/simple-250-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-300-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-300-100-1.0-agg-reference.png deleted file mode 100644 index 6d15aab8e..000000000 Binary files a/tests/visual_tests/images/simple-300-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-300-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-300-100-1.0-cairo-reference.png deleted file mode 100644 index 9debca1a6..000000000 Binary files a/tests/visual_tests/images/simple-300-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-300-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-300-100-2.0-agg-reference.png deleted file mode 100644 index d54df749b..000000000 Binary files a/tests/visual_tests/images/simple-300-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-300-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-300-100-2.0-cairo-reference.png deleted file mode 100644 index 2d811afd9..000000000 Binary files a/tests/visual_tests/images/simple-300-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-400-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-400-100-1.0-agg-reference.png deleted file mode 100644 index 3a2fda103..000000000 Binary files a/tests/visual_tests/images/simple-400-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-400-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-400-100-1.0-cairo-reference.png deleted file mode 100644 index a8047e0b3..000000000 Binary files a/tests/visual_tests/images/simple-400-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-400-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-400-100-2.0-agg-reference.png deleted file mode 100644 index 060d334b9..000000000 Binary files a/tests/visual_tests/images/simple-400-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-400-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-400-100-2.0-cairo-reference.png deleted file mode 100644 index a777040e0..000000000 Binary files a/tests/visual_tests/images/simple-400-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-600-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-600-100-1.0-agg-reference.png deleted file mode 100644 index 362340428..000000000 Binary files a/tests/visual_tests/images/simple-600-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-600-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-600-100-1.0-cairo-reference.png deleted file mode 100644 index f58181bae..000000000 Binary files a/tests/visual_tests/images/simple-600-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-600-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-600-100-2.0-agg-reference.png deleted file mode 100644 index 5bfde2542..000000000 Binary files a/tests/visual_tests/images/simple-600-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-600-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-600-100-2.0-cairo-reference.png deleted file mode 100644 index 0de2346cc..000000000 Binary files a/tests/visual_tests/images/simple-600-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-800-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-800-100-1.0-agg-reference.png deleted file mode 100644 index 748d99713..000000000 Binary files a/tests/visual_tests/images/simple-800-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-800-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-800-100-1.0-cairo-reference.png deleted file mode 100644 index 273b9144f..000000000 Binary files a/tests/visual_tests/images/simple-800-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-800-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-800-100-2.0-agg-reference.png deleted file mode 100644 index aea49db6e..000000000 Binary files a/tests/visual_tests/images/simple-800-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-800-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-800-100-2.0-cairo-reference.png deleted file mode 100644 index 18b58de4e..000000000 Binary files a/tests/visual_tests/images/simple-800-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-E-500-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-E-500-100-1.0-agg-reference.png deleted file mode 100644 index a603ac506..000000000 Binary files a/tests/visual_tests/images/simple-E-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-E-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-E-500-100-1.0-cairo-reference.png deleted file mode 100644 index 87b75714d..000000000 Binary files a/tests/visual_tests/images/simple-E-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-E-500-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-E-500-100-2.0-agg-reference.png deleted file mode 100644 index 3dbbe28e4..000000000 Binary files a/tests/visual_tests/images/simple-E-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-E-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-E-500-100-2.0-cairo-reference.png deleted file mode 100644 index 72d479f80..000000000 Binary files a/tests/visual_tests/images/simple-E-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-N-500-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-N-500-100-1.0-agg-reference.png deleted file mode 100644 index 4873589aa..000000000 Binary files a/tests/visual_tests/images/simple-N-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-N-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-N-500-100-1.0-cairo-reference.png deleted file mode 100644 index 835301421..000000000 Binary files a/tests/visual_tests/images/simple-N-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-N-500-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-N-500-100-2.0-agg-reference.png deleted file mode 100644 index 12fdd9509..000000000 Binary files a/tests/visual_tests/images/simple-N-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-N-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-N-500-100-2.0-cairo-reference.png deleted file mode 100644 index 111057388..000000000 Binary files a/tests/visual_tests/images/simple-N-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-NE-500-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-NE-500-100-1.0-agg-reference.png deleted file mode 100644 index 396b33b99..000000000 Binary files a/tests/visual_tests/images/simple-NE-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-NE-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-NE-500-100-1.0-cairo-reference.png deleted file mode 100644 index 62586d5a5..000000000 Binary files a/tests/visual_tests/images/simple-NE-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-NE-500-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-NE-500-100-2.0-agg-reference.png deleted file mode 100644 index 433e4d341..000000000 Binary files a/tests/visual_tests/images/simple-NE-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-NE-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-NE-500-100-2.0-cairo-reference.png deleted file mode 100644 index 9cf8c8f30..000000000 Binary files a/tests/visual_tests/images/simple-NE-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-NW-500-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-NW-500-100-1.0-agg-reference.png deleted file mode 100644 index 74694ac04..000000000 Binary files a/tests/visual_tests/images/simple-NW-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-NW-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-NW-500-100-1.0-cairo-reference.png deleted file mode 100644 index f00df9582..000000000 Binary files a/tests/visual_tests/images/simple-NW-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-NW-500-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-NW-500-100-2.0-agg-reference.png deleted file mode 100644 index 7a01f658a..000000000 Binary files a/tests/visual_tests/images/simple-NW-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-NW-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-NW-500-100-2.0-cairo-reference.png deleted file mode 100644 index 9e44d12ac..000000000 Binary files a/tests/visual_tests/images/simple-NW-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-S-500-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-S-500-100-1.0-agg-reference.png deleted file mode 100644 index 197d82286..000000000 Binary files a/tests/visual_tests/images/simple-S-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-S-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-S-500-100-1.0-cairo-reference.png deleted file mode 100644 index 0d7edfd86..000000000 Binary files a/tests/visual_tests/images/simple-S-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-S-500-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-S-500-100-2.0-agg-reference.png deleted file mode 100644 index 92ad721cc..000000000 Binary files a/tests/visual_tests/images/simple-S-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-S-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-S-500-100-2.0-cairo-reference.png deleted file mode 100644 index c328512d6..000000000 Binary files a/tests/visual_tests/images/simple-S-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-SE-500-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-SE-500-100-1.0-agg-reference.png deleted file mode 100644 index dbbef4b9d..000000000 Binary files a/tests/visual_tests/images/simple-SE-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-SE-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-SE-500-100-1.0-cairo-reference.png deleted file mode 100644 index 5569a50ec..000000000 Binary files a/tests/visual_tests/images/simple-SE-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-SE-500-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-SE-500-100-2.0-agg-reference.png deleted file mode 100644 index d0e28aa90..000000000 Binary files a/tests/visual_tests/images/simple-SE-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-SE-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-SE-500-100-2.0-cairo-reference.png deleted file mode 100644 index 51a203d14..000000000 Binary files a/tests/visual_tests/images/simple-SE-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-SW-500-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-SW-500-100-1.0-agg-reference.png deleted file mode 100644 index b2775823a..000000000 Binary files a/tests/visual_tests/images/simple-SW-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-SW-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-SW-500-100-1.0-cairo-reference.png deleted file mode 100644 index 1d3a25489..000000000 Binary files a/tests/visual_tests/images/simple-SW-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-SW-500-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-SW-500-100-2.0-agg-reference.png deleted file mode 100644 index eeaca9941..000000000 Binary files a/tests/visual_tests/images/simple-SW-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-SW-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-SW-500-100-2.0-cairo-reference.png deleted file mode 100644 index 05f5e418b..000000000 Binary files a/tests/visual_tests/images/simple-SW-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-W-500-100-1.0-agg-reference.png b/tests/visual_tests/images/simple-W-500-100-1.0-agg-reference.png deleted file mode 100644 index af9bf7b8b..000000000 Binary files a/tests/visual_tests/images/simple-W-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-W-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/simple-W-500-100-1.0-cairo-reference.png deleted file mode 100644 index 31b1a34d5..000000000 Binary files a/tests/visual_tests/images/simple-W-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-W-500-100-2.0-agg-reference.png b/tests/visual_tests/images/simple-W-500-100-2.0-agg-reference.png deleted file mode 100644 index ed412e59a..000000000 Binary files a/tests/visual_tests/images/simple-W-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-W-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/simple-W-500-100-2.0-cairo-reference.png deleted file mode 100644 index a567df210..000000000 Binary files a/tests/visual_tests/images/simple-W-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-shield-600-400-1.0-agg-reference.png b/tests/visual_tests/images/simple-shield-600-400-1.0-agg-reference.png deleted file mode 100644 index 9c9e806d6..000000000 Binary files a/tests/visual_tests/images/simple-shield-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-shield-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/simple-shield-600-400-1.0-cairo-reference.png deleted file mode 100644 index baa7e2f0f..000000000 Binary files a/tests/visual_tests/images/simple-shield-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-shield-600-400-2.0-agg-reference.png b/tests/visual_tests/images/simple-shield-600-400-2.0-agg-reference.png deleted file mode 100644 index 7db8997b4..000000000 Binary files a/tests/visual_tests/images/simple-shield-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simple-shield-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/simple-shield-600-400-2.0-cairo-reference.png deleted file mode 100644 index baa7e2f0f..000000000 Binary files a/tests/visual_tests/images/simple-shield-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-douglas-peucker-500-1000-1.0-agg-reference.png b/tests/visual_tests/images/simplify-douglas-peucker-500-1000-1.0-agg-reference.png deleted file mode 100644 index 6f67be6ae..000000000 Binary files a/tests/visual_tests/images/simplify-douglas-peucker-500-1000-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-douglas-peucker-500-1000-1.0-cairo-reference.png b/tests/visual_tests/images/simplify-douglas-peucker-500-1000-1.0-cairo-reference.png deleted file mode 100644 index 6dfb11a34..000000000 Binary files a/tests/visual_tests/images/simplify-douglas-peucker-500-1000-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-douglas-peucker-500-1000-2.0-agg-reference.png b/tests/visual_tests/images/simplify-douglas-peucker-500-1000-2.0-agg-reference.png deleted file mode 100644 index 635fc0e20..000000000 Binary files a/tests/visual_tests/images/simplify-douglas-peucker-500-1000-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-douglas-peucker-500-1000-2.0-cairo-reference.png b/tests/visual_tests/images/simplify-douglas-peucker-500-1000-2.0-cairo-reference.png deleted file mode 100644 index 1e1d0f222..000000000 Binary files a/tests/visual_tests/images/simplify-douglas-peucker-500-1000-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-radial-distance-500-1000-1.0-agg-reference.png b/tests/visual_tests/images/simplify-radial-distance-500-1000-1.0-agg-reference.png deleted file mode 100644 index 2826debd0..000000000 Binary files a/tests/visual_tests/images/simplify-radial-distance-500-1000-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-radial-distance-500-1000-1.0-cairo-reference.png b/tests/visual_tests/images/simplify-radial-distance-500-1000-1.0-cairo-reference.png deleted file mode 100644 index 2318a1961..000000000 Binary files a/tests/visual_tests/images/simplify-radial-distance-500-1000-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-radial-distance-500-1000-2.0-agg-reference.png b/tests/visual_tests/images/simplify-radial-distance-500-1000-2.0-agg-reference.png deleted file mode 100644 index 9659f8e62..000000000 Binary files a/tests/visual_tests/images/simplify-radial-distance-500-1000-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-radial-distance-500-1000-2.0-cairo-reference.png b/tests/visual_tests/images/simplify-radial-distance-500-1000-2.0-cairo-reference.png deleted file mode 100644 index 8d4861eae..000000000 Binary files a/tests/visual_tests/images/simplify-radial-distance-500-1000-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-visvalingam-whyatt-500-1000-1.0-agg-reference.png b/tests/visual_tests/images/simplify-visvalingam-whyatt-500-1000-1.0-agg-reference.png deleted file mode 100644 index f7e600a88..000000000 Binary files a/tests/visual_tests/images/simplify-visvalingam-whyatt-500-1000-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-visvalingam-whyatt-500-1000-1.0-cairo-reference.png b/tests/visual_tests/images/simplify-visvalingam-whyatt-500-1000-1.0-cairo-reference.png deleted file mode 100644 index 7c8dec67d..000000000 Binary files a/tests/visual_tests/images/simplify-visvalingam-whyatt-500-1000-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-visvalingam-whyatt-500-1000-2.0-agg-reference.png b/tests/visual_tests/images/simplify-visvalingam-whyatt-500-1000-2.0-agg-reference.png deleted file mode 100644 index 5e836006f..000000000 Binary files a/tests/visual_tests/images/simplify-visvalingam-whyatt-500-1000-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-visvalingam-whyatt-500-1000-2.0-cairo-reference.png b/tests/visual_tests/images/simplify-visvalingam-whyatt-500-1000-2.0-cairo-reference.png deleted file mode 100644 index d07e7ed69..000000000 Binary files a/tests/visual_tests/images/simplify-visvalingam-whyatt-500-1000-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-zhao-saalfeld-500-1000-1.0-agg-reference.png b/tests/visual_tests/images/simplify-zhao-saalfeld-500-1000-1.0-agg-reference.png deleted file mode 100644 index ea8047549..000000000 Binary files a/tests/visual_tests/images/simplify-zhao-saalfeld-500-1000-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-zhao-saalfeld-500-1000-1.0-cairo-reference.png b/tests/visual_tests/images/simplify-zhao-saalfeld-500-1000-1.0-cairo-reference.png deleted file mode 100644 index d2f5e40e0..000000000 Binary files a/tests/visual_tests/images/simplify-zhao-saalfeld-500-1000-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-zhao-saalfeld-500-1000-2.0-agg-reference.png b/tests/visual_tests/images/simplify-zhao-saalfeld-500-1000-2.0-agg-reference.png deleted file mode 100644 index e147d00d9..000000000 Binary files a/tests/visual_tests/images/simplify-zhao-saalfeld-500-1000-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/simplify-zhao-saalfeld-500-1000-2.0-cairo-reference.png b/tests/visual_tests/images/simplify-zhao-saalfeld-500-1000-2.0-cairo-reference.png deleted file mode 100644 index 6e4bb1e9c..000000000 Binary files a/tests/visual_tests/images/simplify-zhao-saalfeld-500-1000-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-0,0-512-512-1.0-agg-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-0,0-512-512-1.0-agg-reference.png deleted file mode 100644 index bcc43e823..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-0,0-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-0,0-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-0,0-512-512-1.0-cairo-reference.png deleted file mode 100644 index 69a880e63..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-0,0-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-0,0-512-512-2.0-agg-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-0,0-512-512-2.0-agg-reference.png deleted file mode 100644 index bcc43e823..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-0,0-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-0,0-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-0,0-512-512-2.0-cairo-reference.png deleted file mode 100644 index 69a880e63..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-0,0-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-0,1-512-512-1.0-agg-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-0,1-512-512-1.0-agg-reference.png deleted file mode 100644 index c77aa91bd..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-0,1-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-0,1-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-0,1-512-512-1.0-cairo-reference.png deleted file mode 100644 index 7b1f0ac93..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-0,1-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-0,1-512-512-2.0-agg-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-0,1-512-512-2.0-agg-reference.png deleted file mode 100644 index c77aa91bd..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-0,1-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-0,1-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-0,1-512-512-2.0-cairo-reference.png deleted file mode 100644 index 7b1f0ac93..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-0,1-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-1,0-512-512-1.0-agg-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-1,0-512-512-1.0-agg-reference.png deleted file mode 100644 index 2067707cd..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-1,0-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-1,0-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-1,0-512-512-1.0-cairo-reference.png deleted file mode 100644 index d63f03d4f..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-1,0-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-1,0-512-512-2.0-agg-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-1,0-512-512-2.0-agg-reference.png deleted file mode 100644 index 2067707cd..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-1,0-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-1,0-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-1,0-512-512-2.0-cairo-reference.png deleted file mode 100644 index d63f03d4f..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-1,0-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-1,1-512-512-1.0-agg-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-1,1-512-512-1.0-agg-reference.png deleted file mode 100644 index 57571ab65..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-1,1-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-1,1-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-1,1-512-512-1.0-cairo-reference.png deleted file mode 100644 index 3c2bad37d..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-1,1-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-1,1-512-512-2.0-agg-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-1,1-512-512-2.0-agg-reference.png deleted file mode 100644 index 57571ab65..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-1,1-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/style-level-compositing-tiled-1,1-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/style-level-compositing-tiled-1,1-512-512-2.0-cairo-reference.png deleted file mode 100644 index 3c2bad37d..000000000 Binary files a/tests/visual_tests/images/style-level-compositing-tiled-1,1-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-allow-overlap-expr-500-500-1.0-agg-reference.png b/tests/visual_tests/images/text-allow-overlap-expr-500-500-1.0-agg-reference.png deleted file mode 100644 index f8ce913c9..000000000 Binary files a/tests/visual_tests/images/text-allow-overlap-expr-500-500-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-allow-overlap-expr-500-500-1.0-cairo-reference.png b/tests/visual_tests/images/text-allow-overlap-expr-500-500-1.0-cairo-reference.png deleted file mode 100644 index e04ebca91..000000000 Binary files a/tests/visual_tests/images/text-allow-overlap-expr-500-500-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-allow-overlap-expr-500-500-2.0-agg-reference.png b/tests/visual_tests/images/text-allow-overlap-expr-500-500-2.0-agg-reference.png deleted file mode 100644 index d37986a80..000000000 Binary files a/tests/visual_tests/images/text-allow-overlap-expr-500-500-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-allow-overlap-expr-500-500-2.0-cairo-reference.png b/tests/visual_tests/images/text-allow-overlap-expr-500-500-2.0-cairo-reference.png deleted file mode 100644 index 5b69fdfd2..000000000 Binary files a/tests/visual_tests/images/text-allow-overlap-expr-500-500-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bengali-800-100-1.0-agg-reference.png b/tests/visual_tests/images/text-bengali-800-100-1.0-agg-reference.png deleted file mode 100644 index e89f2426a..000000000 Binary files a/tests/visual_tests/images/text-bengali-800-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bengali-800-100-1.0-cairo-reference.png b/tests/visual_tests/images/text-bengali-800-100-1.0-cairo-reference.png deleted file mode 100644 index 01645c026..000000000 Binary files a/tests/visual_tests/images/text-bengali-800-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bengali-800-100-2.0-agg-reference.png b/tests/visual_tests/images/text-bengali-800-100-2.0-agg-reference.png deleted file mode 100644 index 605330fb6..000000000 Binary files a/tests/visual_tests/images/text-bengali-800-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bengali-800-100-2.0-cairo-reference.png b/tests/visual_tests/images/text-bengali-800-100-2.0-cairo-reference.png deleted file mode 100644 index 678a28bd2..000000000 Binary files a/tests/visual_tests/images/text-bengali-800-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1532-600-165-1.0-agg-reference.png b/tests/visual_tests/images/text-bug1532-600-165-1.0-agg-reference.png deleted file mode 100644 index 6bdaed7ca..000000000 Binary files a/tests/visual_tests/images/text-bug1532-600-165-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1532-600-165-1.0-cairo-reference.png b/tests/visual_tests/images/text-bug1532-600-165-1.0-cairo-reference.png deleted file mode 100644 index 7206b31ad..000000000 Binary files a/tests/visual_tests/images/text-bug1532-600-165-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1532-600-165-2.0-agg-reference.png b/tests/visual_tests/images/text-bug1532-600-165-2.0-agg-reference.png deleted file mode 100644 index fe208d4ba..000000000 Binary files a/tests/visual_tests/images/text-bug1532-600-165-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1532-600-165-2.0-cairo-reference.png b/tests/visual_tests/images/text-bug1532-600-165-2.0-cairo-reference.png deleted file mode 100644 index b312d2ace..000000000 Binary files a/tests/visual_tests/images/text-bug1532-600-165-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1533-600-600-1.0-agg-reference.png b/tests/visual_tests/images/text-bug1533-600-600-1.0-agg-reference.png deleted file mode 100644 index eadfb6316..000000000 Binary files a/tests/visual_tests/images/text-bug1533-600-600-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1533-600-600-1.0-cairo-reference.png b/tests/visual_tests/images/text-bug1533-600-600-1.0-cairo-reference.png deleted file mode 100644 index f356143e2..000000000 Binary files a/tests/visual_tests/images/text-bug1533-600-600-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1533-600-600-2.0-agg-reference.png b/tests/visual_tests/images/text-bug1533-600-600-2.0-agg-reference.png deleted file mode 100644 index ee5efc280..000000000 Binary files a/tests/visual_tests/images/text-bug1533-600-600-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1533-600-600-2.0-cairo-reference.png b/tests/visual_tests/images/text-bug1533-600-600-2.0-cairo-reference.png deleted file mode 100644 index a737786b7..000000000 Binary files a/tests/visual_tests/images/text-bug1533-600-600-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1820+0-600-300-1.0-agg-reference.png b/tests/visual_tests/images/text-bug1820+0-600-300-1.0-agg-reference.png deleted file mode 100644 index 13532ac5b..000000000 Binary files a/tests/visual_tests/images/text-bug1820+0-600-300-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1820+0-600-300-1.0-cairo-reference.png b/tests/visual_tests/images/text-bug1820+0-600-300-1.0-cairo-reference.png deleted file mode 100644 index 21e99ccff..000000000 Binary files a/tests/visual_tests/images/text-bug1820+0-600-300-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1820+0-600-300-2.0-agg-reference.png b/tests/visual_tests/images/text-bug1820+0-600-300-2.0-agg-reference.png deleted file mode 100644 index 565f39fdf..000000000 Binary files a/tests/visual_tests/images/text-bug1820+0-600-300-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1820+0-600-300-2.0-cairo-reference.png b/tests/visual_tests/images/text-bug1820+0-600-300-2.0-cairo-reference.png deleted file mode 100644 index c71c6410a..000000000 Binary files a/tests/visual_tests/images/text-bug1820+0-600-300-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1820+1-600-300-1.0-agg-reference.png b/tests/visual_tests/images/text-bug1820+1-600-300-1.0-agg-reference.png deleted file mode 100644 index 9f6185004..000000000 Binary files a/tests/visual_tests/images/text-bug1820+1-600-300-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1820+1-600-300-1.0-cairo-reference.png b/tests/visual_tests/images/text-bug1820+1-600-300-1.0-cairo-reference.png deleted file mode 100644 index 67fb09dd5..000000000 Binary files a/tests/visual_tests/images/text-bug1820+1-600-300-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1820+1-600-300-2.0-agg-reference.png b/tests/visual_tests/images/text-bug1820+1-600-300-2.0-agg-reference.png deleted file mode 100644 index a8ef1e940..000000000 Binary files a/tests/visual_tests/images/text-bug1820+1-600-300-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1820+1-600-300-2.0-cairo-reference.png b/tests/visual_tests/images/text-bug1820+1-600-300-2.0-cairo-reference.png deleted file mode 100644 index 6640fca0f..000000000 Binary files a/tests/visual_tests/images/text-bug1820+1-600-300-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1820-1-600-300-1.0-agg-reference.png b/tests/visual_tests/images/text-bug1820-1-600-300-1.0-agg-reference.png deleted file mode 100644 index 4dbae339b..000000000 Binary files a/tests/visual_tests/images/text-bug1820-1-600-300-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1820-1-600-300-1.0-cairo-reference.png b/tests/visual_tests/images/text-bug1820-1-600-300-1.0-cairo-reference.png deleted file mode 100644 index 11793b637..000000000 Binary files a/tests/visual_tests/images/text-bug1820-1-600-300-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1820-1-600-300-2.0-agg-reference.png b/tests/visual_tests/images/text-bug1820-1-600-300-2.0-agg-reference.png deleted file mode 100644 index 5ad7b5104..000000000 Binary files a/tests/visual_tests/images/text-bug1820-1-600-300-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug1820-1-600-300-2.0-cairo-reference.png b/tests/visual_tests/images/text-bug1820-1-600-300-2.0-cairo-reference.png deleted file mode 100644 index 224363dfd..000000000 Binary files a/tests/visual_tests/images/text-bug1820-1-600-300-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug2037-800-300-1.0-agg-reference.png b/tests/visual_tests/images/text-bug2037-800-300-1.0-agg-reference.png deleted file mode 100644 index 3503fa6ea..000000000 Binary files a/tests/visual_tests/images/text-bug2037-800-300-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug2037-800-300-1.0-cairo-reference.png b/tests/visual_tests/images/text-bug2037-800-300-1.0-cairo-reference.png deleted file mode 100644 index 702a4bd6e..000000000 Binary files a/tests/visual_tests/images/text-bug2037-800-300-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug2037-800-300-2.0-agg-reference.png b/tests/visual_tests/images/text-bug2037-800-300-2.0-agg-reference.png deleted file mode 100644 index c6cb44bab..000000000 Binary files a/tests/visual_tests/images/text-bug2037-800-300-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-bug2037-800-300-2.0-cairo-reference.png b/tests/visual_tests/images/text-bug2037-800-300-2.0-cairo-reference.png deleted file mode 100644 index 76a1a1545..000000000 Binary files a/tests/visual_tests/images/text-bug2037-800-300-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-charplacement-512-512-1.0-agg-reference.png b/tests/visual_tests/images/text-charplacement-512-512-1.0-agg-reference.png deleted file mode 100644 index 0ebb5254c..000000000 Binary files a/tests/visual_tests/images/text-charplacement-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-charplacement-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/text-charplacement-512-512-1.0-cairo-reference.png deleted file mode 100644 index b940f7b01..000000000 Binary files a/tests/visual_tests/images/text-charplacement-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-charplacement-512-512-2.0-agg-reference.png b/tests/visual_tests/images/text-charplacement-512-512-2.0-agg-reference.png deleted file mode 100644 index 5c62d1303..000000000 Binary files a/tests/visual_tests/images/text-charplacement-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-charplacement-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/text-charplacement-512-512-2.0-cairo-reference.png deleted file mode 100644 index ff270f009..000000000 Binary files a/tests/visual_tests/images/text-charplacement-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-data-binding-500-500-1.0-agg-reference.png b/tests/visual_tests/images/text-data-binding-500-500-1.0-agg-reference.png deleted file mode 100644 index 385f1d038..000000000 Binary files a/tests/visual_tests/images/text-data-binding-500-500-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-data-binding-500-500-1.0-cairo-reference.png b/tests/visual_tests/images/text-data-binding-500-500-1.0-cairo-reference.png deleted file mode 100644 index 01c14cc34..000000000 Binary files a/tests/visual_tests/images/text-data-binding-500-500-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-data-binding-500-500-2.0-agg-reference.png b/tests/visual_tests/images/text-data-binding-500-500-2.0-agg-reference.png deleted file mode 100644 index 6e0f4d3a3..000000000 Binary files a/tests/visual_tests/images/text-data-binding-500-500-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-data-binding-500-500-2.0-cairo-reference.png b/tests/visual_tests/images/text-data-binding-500-500-2.0-cairo-reference.png deleted file mode 100644 index 42b780d33..000000000 Binary files a/tests/visual_tests/images/text-data-binding-500-500-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-displacement-512-512-1.0-agg-reference.png b/tests/visual_tests/images/text-displacement-512-512-1.0-agg-reference.png deleted file mode 100644 index 0de9cb8b1..000000000 Binary files a/tests/visual_tests/images/text-displacement-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-displacement-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/text-displacement-512-512-1.0-cairo-reference.png deleted file mode 100644 index 29ee85a9b..000000000 Binary files a/tests/visual_tests/images/text-displacement-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-displacement-512-512-2.0-agg-reference.png b/tests/visual_tests/images/text-displacement-512-512-2.0-agg-reference.png deleted file mode 100644 index 217513708..000000000 Binary files a/tests/visual_tests/images/text-displacement-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-displacement-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/text-displacement-512-512-2.0-cairo-reference.png deleted file mode 100644 index 40f3faaf4..000000000 Binary files a/tests/visual_tests/images/text-displacement-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-expressionformat-color-800-100-1.0-agg-reference.png b/tests/visual_tests/images/text-expressionformat-color-800-100-1.0-agg-reference.png deleted file mode 100644 index 8ff7a7767..000000000 Binary files a/tests/visual_tests/images/text-expressionformat-color-800-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-expressionformat-color-800-100-1.0-cairo-reference.png b/tests/visual_tests/images/text-expressionformat-color-800-100-1.0-cairo-reference.png deleted file mode 100644 index c490ec3ad..000000000 Binary files a/tests/visual_tests/images/text-expressionformat-color-800-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-expressionformat-color-800-100-2.0-agg-reference.png b/tests/visual_tests/images/text-expressionformat-color-800-100-2.0-agg-reference.png deleted file mode 100644 index 9298e559d..000000000 Binary files a/tests/visual_tests/images/text-expressionformat-color-800-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-expressionformat-color-800-100-2.0-cairo-reference.png b/tests/visual_tests/images/text-expressionformat-color-800-100-2.0-cairo-reference.png deleted file mode 100644 index 58e388832..000000000 Binary files a/tests/visual_tests/images/text-expressionformat-color-800-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-font-features-1100-1100-1.0-agg-reference.png b/tests/visual_tests/images/text-font-features-1100-1100-1.0-agg-reference.png deleted file mode 100644 index 8f7383e66..000000000 Binary files a/tests/visual_tests/images/text-font-features-1100-1100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-font-features-1100-1100-1.0-cairo-reference.png b/tests/visual_tests/images/text-font-features-1100-1100-1.0-cairo-reference.png deleted file mode 100644 index d2126c324..000000000 Binary files a/tests/visual_tests/images/text-font-features-1100-1100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-font-features-1100-1100-2.0-agg-reference.png b/tests/visual_tests/images/text-font-features-1100-1100-2.0-agg-reference.png deleted file mode 100644 index dd957784b..000000000 Binary files a/tests/visual_tests/images/text-font-features-1100-1100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-font-features-1100-1100-2.0-cairo-reference.png b/tests/visual_tests/images/text-font-features-1100-1100-2.0-cairo-reference.png deleted file mode 100644 index c061af081..000000000 Binary files a/tests/visual_tests/images/text-font-features-1100-1100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halign-800-800-1.0-agg-reference.png b/tests/visual_tests/images/text-halign-800-800-1.0-agg-reference.png deleted file mode 100644 index 5abeaa344..000000000 Binary files a/tests/visual_tests/images/text-halign-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halign-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/text-halign-800-800-1.0-cairo-reference.png deleted file mode 100644 index 6d4831bfa..000000000 Binary files a/tests/visual_tests/images/text-halign-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halign-800-800-2.0-agg-reference.png b/tests/visual_tests/images/text-halign-800-800-2.0-agg-reference.png deleted file mode 100644 index 552c6f014..000000000 Binary files a/tests/visual_tests/images/text-halign-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halign-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/text-halign-800-800-2.0-cairo-reference.png deleted file mode 100644 index 09e2dff7b..000000000 Binary files a/tests/visual_tests/images/text-halign-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halign-adjust-800-800-1.0-agg-reference.png b/tests/visual_tests/images/text-halign-adjust-800-800-1.0-agg-reference.png deleted file mode 100644 index f029f88b8..000000000 Binary files a/tests/visual_tests/images/text-halign-adjust-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halign-adjust-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/text-halign-adjust-800-800-1.0-cairo-reference.png deleted file mode 100644 index 57ad2d43a..000000000 Binary files a/tests/visual_tests/images/text-halign-adjust-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halign-adjust-800-800-2.0-agg-reference.png b/tests/visual_tests/images/text-halign-adjust-800-800-2.0-agg-reference.png deleted file mode 100644 index e66754790..000000000 Binary files a/tests/visual_tests/images/text-halign-adjust-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halign-adjust-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/text-halign-adjust-800-800-2.0-cairo-reference.png deleted file mode 100644 index f3275dba1..000000000 Binary files a/tests/visual_tests/images/text-halign-adjust-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halign-adjust-multiline-800-800-1.0-agg-reference.png b/tests/visual_tests/images/text-halign-adjust-multiline-800-800-1.0-agg-reference.png deleted file mode 100644 index 2a8e1d4a9..000000000 Binary files a/tests/visual_tests/images/text-halign-adjust-multiline-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halign-adjust-multiline-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/text-halign-adjust-multiline-800-800-1.0-cairo-reference.png deleted file mode 100644 index 0d6121590..000000000 Binary files a/tests/visual_tests/images/text-halign-adjust-multiline-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halign-adjust-multiline-800-800-2.0-agg-reference.png b/tests/visual_tests/images/text-halign-adjust-multiline-800-800-2.0-agg-reference.png deleted file mode 100644 index 6a1d578fb..000000000 Binary files a/tests/visual_tests/images/text-halign-adjust-multiline-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halign-adjust-multiline-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/text-halign-adjust-multiline-800-800-2.0-cairo-reference.png deleted file mode 100644 index 27bf6a6bb..000000000 Binary files a/tests/visual_tests/images/text-halign-adjust-multiline-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halo-opacity-512-512-1.0-agg-reference.png b/tests/visual_tests/images/text-halo-opacity-512-512-1.0-agg-reference.png deleted file mode 100644 index b22ea4934..000000000 Binary files a/tests/visual_tests/images/text-halo-opacity-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halo-opacity-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/text-halo-opacity-512-512-1.0-cairo-reference.png deleted file mode 100644 index ada46a584..000000000 Binary files a/tests/visual_tests/images/text-halo-opacity-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halo-opacity-512-512-2.0-agg-reference.png b/tests/visual_tests/images/text-halo-opacity-512-512-2.0-agg-reference.png deleted file mode 100644 index be3b53dec..000000000 Binary files a/tests/visual_tests/images/text-halo-opacity-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halo-opacity-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/text-halo-opacity-512-512-2.0-cairo-reference.png deleted file mode 100644 index f958a83cc..000000000 Binary files a/tests/visual_tests/images/text-halo-opacity-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halo-rasterizer-600-400-1.0-agg-reference.png b/tests/visual_tests/images/text-halo-rasterizer-600-400-1.0-agg-reference.png deleted file mode 100644 index bc7ae75a0..000000000 Binary files a/tests/visual_tests/images/text-halo-rasterizer-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halo-rasterizer-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/text-halo-rasterizer-600-400-1.0-cairo-reference.png deleted file mode 100644 index e0456154d..000000000 Binary files a/tests/visual_tests/images/text-halo-rasterizer-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halo-rasterizer-600-400-2.0-agg-reference.png b/tests/visual_tests/images/text-halo-rasterizer-600-400-2.0-agg-reference.png deleted file mode 100644 index 16fa5b531..000000000 Binary files a/tests/visual_tests/images/text-halo-rasterizer-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halo-rasterizer-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/text-halo-rasterizer-600-400-2.0-cairo-reference.png deleted file mode 100644 index 9858aaaa6..000000000 Binary files a/tests/visual_tests/images/text-halo-rasterizer-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halo-transform-600-400-1.0-agg-reference.png b/tests/visual_tests/images/text-halo-transform-600-400-1.0-agg-reference.png deleted file mode 100644 index fb0852f6e..000000000 Binary files a/tests/visual_tests/images/text-halo-transform-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halo-transform-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/text-halo-transform-600-400-1.0-cairo-reference.png deleted file mode 100644 index e0456154d..000000000 Binary files a/tests/visual_tests/images/text-halo-transform-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halo-transform-600-400-2.0-agg-reference.png b/tests/visual_tests/images/text-halo-transform-600-400-2.0-agg-reference.png deleted file mode 100644 index c2dc225d2..000000000 Binary files a/tests/visual_tests/images/text-halo-transform-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-halo-transform-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/text-halo-transform-600-400-2.0-cairo-reference.png deleted file mode 100644 index 9858aaaa6..000000000 Binary files a/tests/visual_tests/images/text-halo-transform-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-iconic-font-1000-1000-1.0-agg-reference.png b/tests/visual_tests/images/text-iconic-font-1000-1000-1.0-agg-reference.png deleted file mode 100644 index 02ad3f1da..000000000 Binary files a/tests/visual_tests/images/text-iconic-font-1000-1000-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-iconic-font-1000-1000-1.0-cairo-reference.png b/tests/visual_tests/images/text-iconic-font-1000-1000-1.0-cairo-reference.png deleted file mode 100644 index d6d8308ce..000000000 Binary files a/tests/visual_tests/images/text-iconic-font-1000-1000-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-iconic-font-1000-1000-2.0-agg-reference.png b/tests/visual_tests/images/text-iconic-font-1000-1000-2.0-agg-reference.png deleted file mode 100644 index a846e12f9..000000000 Binary files a/tests/visual_tests/images/text-iconic-font-1000-1000-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-iconic-font-1000-1000-2.0-cairo-reference.png b/tests/visual_tests/images/text-iconic-font-1000-1000-2.0-cairo-reference.png deleted file mode 100644 index 32e2bb80c..000000000 Binary files a/tests/visual_tests/images/text-iconic-font-1000-1000-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-line-wrap-512-512-1.0-agg-reference.png b/tests/visual_tests/images/text-line-wrap-512-512-1.0-agg-reference.png deleted file mode 100644 index 4b79aeaa0..000000000 Binary files a/tests/visual_tests/images/text-line-wrap-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-line-wrap-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/text-line-wrap-512-512-1.0-cairo-reference.png deleted file mode 100644 index 17b7ff39d..000000000 Binary files a/tests/visual_tests/images/text-line-wrap-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-line-wrap-512-512-2.0-agg-reference.png b/tests/visual_tests/images/text-line-wrap-512-512-2.0-agg-reference.png deleted file mode 100644 index f8147d93e..000000000 Binary files a/tests/visual_tests/images/text-line-wrap-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-line-wrap-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/text-line-wrap-512-512-2.0-cairo-reference.png deleted file mode 100644 index fd03f9a97..000000000 Binary files a/tests/visual_tests/images/text-line-wrap-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-malayalam-800-100-1.0-agg-reference.png b/tests/visual_tests/images/text-malayalam-800-100-1.0-agg-reference.png deleted file mode 100644 index 95e9ad9b8..000000000 Binary files a/tests/visual_tests/images/text-malayalam-800-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-malayalam-800-100-1.0-cairo-reference.png b/tests/visual_tests/images/text-malayalam-800-100-1.0-cairo-reference.png deleted file mode 100644 index d5054a059..000000000 Binary files a/tests/visual_tests/images/text-malayalam-800-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-malayalam-800-100-2.0-agg-reference.png b/tests/visual_tests/images/text-malayalam-800-100-2.0-agg-reference.png deleted file mode 100644 index 32101e2c2..000000000 Binary files a/tests/visual_tests/images/text-malayalam-800-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-malayalam-800-100-2.0-cairo-reference.png b/tests/visual_tests/images/text-malayalam-800-100-2.0-cairo-reference.png deleted file mode 100644 index d52c49e6b..000000000 Binary files a/tests/visual_tests/images/text-malayalam-800-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-multi-layout-1-512-512-1.0-agg-reference.png b/tests/visual_tests/images/text-multi-layout-1-512-512-1.0-agg-reference.png deleted file mode 100644 index 1919fe4e5..000000000 Binary files a/tests/visual_tests/images/text-multi-layout-1-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-multi-layout-1-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/text-multi-layout-1-512-512-1.0-cairo-reference.png deleted file mode 100644 index 890b8ec5d..000000000 Binary files a/tests/visual_tests/images/text-multi-layout-1-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-multi-layout-1-512-512-2.0-agg-reference.png b/tests/visual_tests/images/text-multi-layout-1-512-512-2.0-agg-reference.png deleted file mode 100644 index d11b8e111..000000000 Binary files a/tests/visual_tests/images/text-multi-layout-1-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-multi-layout-1-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/text-multi-layout-1-512-512-2.0-cairo-reference.png deleted file mode 100644 index 2a2dae068..000000000 Binary files a/tests/visual_tests/images/text-multi-layout-1-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-multi-layout-2-512-512-1.0-agg-reference.png b/tests/visual_tests/images/text-multi-layout-2-512-512-1.0-agg-reference.png deleted file mode 100644 index b6fe6e75c..000000000 Binary files a/tests/visual_tests/images/text-multi-layout-2-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-multi-layout-2-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/text-multi-layout-2-512-512-1.0-cairo-reference.png deleted file mode 100644 index f9c31169a..000000000 Binary files a/tests/visual_tests/images/text-multi-layout-2-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-multi-layout-2-512-512-2.0-agg-reference.png b/tests/visual_tests/images/text-multi-layout-2-512-512-2.0-agg-reference.png deleted file mode 100644 index 7c1ad5aae..000000000 Binary files a/tests/visual_tests/images/text-multi-layout-2-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-multi-layout-2-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/text-multi-layout-2-512-512-2.0-cairo-reference.png deleted file mode 100644 index 2d2c2a66a..000000000 Binary files a/tests/visual_tests/images/text-multi-layout-2-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-overlap-512-512-1.0-agg-reference.png b/tests/visual_tests/images/text-overlap-512-512-1.0-agg-reference.png deleted file mode 100644 index 0e08b3912..000000000 Binary files a/tests/visual_tests/images/text-overlap-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-overlap-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/text-overlap-512-512-1.0-cairo-reference.png deleted file mode 100644 index a4859cefe..000000000 Binary files a/tests/visual_tests/images/text-overlap-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-overlap-512-512-2.0-agg-reference.png b/tests/visual_tests/images/text-overlap-512-512-2.0-agg-reference.png deleted file mode 100644 index 9cd91860d..000000000 Binary files a/tests/visual_tests/images/text-overlap-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-overlap-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/text-overlap-512-512-2.0-cairo-reference.png deleted file mode 100644 index 941944cfc..000000000 Binary files a/tests/visual_tests/images/text-overlap-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-spacing-512-512-1.0-agg-reference.png b/tests/visual_tests/images/text-spacing-512-512-1.0-agg-reference.png deleted file mode 100644 index fe886ed1e..000000000 Binary files a/tests/visual_tests/images/text-spacing-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-spacing-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/text-spacing-512-512-1.0-cairo-reference.png deleted file mode 100644 index af682e7bf..000000000 Binary files a/tests/visual_tests/images/text-spacing-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-spacing-512-512-2.0-agg-reference.png b/tests/visual_tests/images/text-spacing-512-512-2.0-agg-reference.png deleted file mode 100644 index 1e51dbff3..000000000 Binary files a/tests/visual_tests/images/text-spacing-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-spacing-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/text-spacing-512-512-2.0-cairo-reference.png deleted file mode 100644 index deb316980..000000000 Binary files a/tests/visual_tests/images/text-spacing-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-ttc-font-600-400-1.0-agg-reference.png b/tests/visual_tests/images/text-ttc-font-600-400-1.0-agg-reference.png deleted file mode 100644 index a36e04f58..000000000 Binary files a/tests/visual_tests/images/text-ttc-font-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-ttc-font-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/text-ttc-font-600-400-1.0-cairo-reference.png deleted file mode 100644 index c24309c2c..000000000 Binary files a/tests/visual_tests/images/text-ttc-font-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-ttc-font-600-400-2.0-agg-reference.png b/tests/visual_tests/images/text-ttc-font-600-400-2.0-agg-reference.png deleted file mode 100644 index 85f9cb441..000000000 Binary files a/tests/visual_tests/images/text-ttc-font-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-ttc-font-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/text-ttc-font-600-400-2.0-cairo-reference.png deleted file mode 100644 index c7d0f593e..000000000 Binary files a/tests/visual_tests/images/text-ttc-font-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-typographic-512-512-1.0-agg-reference.png b/tests/visual_tests/images/text-typographic-512-512-1.0-agg-reference.png deleted file mode 100644 index 491c6eb9e..000000000 Binary files a/tests/visual_tests/images/text-typographic-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-typographic-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/text-typographic-512-512-1.0-cairo-reference.png deleted file mode 100644 index f4de0c6c4..000000000 Binary files a/tests/visual_tests/images/text-typographic-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-typographic-512-512-2.0-agg-reference.png b/tests/visual_tests/images/text-typographic-512-512-2.0-agg-reference.png deleted file mode 100644 index aca6fd231..000000000 Binary files a/tests/visual_tests/images/text-typographic-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-typographic-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/text-typographic-512-512-2.0-cairo-reference.png deleted file mode 100644 index 5275784f2..000000000 Binary files a/tests/visual_tests/images/text-typographic-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-upright-800-800-1.0-agg-reference.png b/tests/visual_tests/images/text-upright-800-800-1.0-agg-reference.png deleted file mode 100644 index 0851665e2..000000000 Binary files a/tests/visual_tests/images/text-upright-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-upright-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/text-upright-800-800-1.0-cairo-reference.png deleted file mode 100644 index 6915d8c4a..000000000 Binary files a/tests/visual_tests/images/text-upright-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-upright-800-800-2.0-agg-reference.png b/tests/visual_tests/images/text-upright-800-800-2.0-agg-reference.png deleted file mode 100644 index 9e9b18788..000000000 Binary files a/tests/visual_tests/images/text-upright-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-upright-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/text-upright-800-800-2.0-cairo-reference.png deleted file mode 100644 index 2fff35631..000000000 Binary files a/tests/visual_tests/images/text-upright-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-vertical-alignment-800-800-1.0-agg-reference.png b/tests/visual_tests/images/text-vertical-alignment-800-800-1.0-agg-reference.png deleted file mode 100644 index bc2d024ae..000000000 Binary files a/tests/visual_tests/images/text-vertical-alignment-800-800-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-vertical-alignment-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/text-vertical-alignment-800-800-1.0-cairo-reference.png deleted file mode 100644 index be7bbbce5..000000000 Binary files a/tests/visual_tests/images/text-vertical-alignment-800-800-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-vertical-alignment-800-800-2.0-agg-reference.png b/tests/visual_tests/images/text-vertical-alignment-800-800-2.0-agg-reference.png deleted file mode 100644 index e8756f84f..000000000 Binary files a/tests/visual_tests/images/text-vertical-alignment-800-800-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/text-vertical-alignment-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/text-vertical-alignment-800-800-2.0-cairo-reference.png deleted file mode 100644 index 8722ec33b..000000000 Binary files a/tests/visual_tests/images/text-vertical-alignment-800-800-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-alpha-broken-assoc-alpha-gdal-600-400-1.0-agg-reference.png b/tests/visual_tests/images/tiff-alpha-broken-assoc-alpha-gdal-600-400-1.0-agg-reference.png deleted file mode 100644 index df3725329..000000000 Binary files a/tests/visual_tests/images/tiff-alpha-broken-assoc-alpha-gdal-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-alpha-broken-assoc-alpha-gdal-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-alpha-broken-assoc-alpha-gdal-600-400-1.0-cairo-reference.png deleted file mode 100644 index df3725329..000000000 Binary files a/tests/visual_tests/images/tiff-alpha-broken-assoc-alpha-gdal-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-alpha-broken-assoc-alpha-gdal-600-400-2.0-agg-reference.png b/tests/visual_tests/images/tiff-alpha-broken-assoc-alpha-gdal-600-400-2.0-agg-reference.png deleted file mode 100644 index df3725329..000000000 Binary files a/tests/visual_tests/images/tiff-alpha-broken-assoc-alpha-gdal-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-alpha-broken-assoc-alpha-gdal-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-alpha-broken-assoc-alpha-gdal-600-400-2.0-cairo-reference.png deleted file mode 100644 index df3725329..000000000 Binary files a/tests/visual_tests/images/tiff-alpha-broken-assoc-alpha-gdal-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-alpha-gdal-600-400-1.0-agg-reference.png b/tests/visual_tests/images/tiff-alpha-gdal-600-400-1.0-agg-reference.png deleted file mode 100644 index eb2a80da5..000000000 Binary files a/tests/visual_tests/images/tiff-alpha-gdal-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-alpha-gdal-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-alpha-gdal-600-400-1.0-cairo-reference.png deleted file mode 100644 index eb2a80da5..000000000 Binary files a/tests/visual_tests/images/tiff-alpha-gdal-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-alpha-gdal-600-400-2.0-agg-reference.png b/tests/visual_tests/images/tiff-alpha-gdal-600-400-2.0-agg-reference.png deleted file mode 100644 index eb2a80da5..000000000 Binary files a/tests/visual_tests/images/tiff-alpha-gdal-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-alpha-gdal-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-alpha-gdal-600-400-2.0-cairo-reference.png deleted file mode 100644 index eb2a80da5..000000000 Binary files a/tests/visual_tests/images/tiff-alpha-gdal-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-alpha-gradient-gdal-600-400-1.0-agg-reference.png b/tests/visual_tests/images/tiff-alpha-gradient-gdal-600-400-1.0-agg-reference.png deleted file mode 100644 index 2359d402c..000000000 Binary files a/tests/visual_tests/images/tiff-alpha-gradient-gdal-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-alpha-gradient-gdal-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-alpha-gradient-gdal-600-400-1.0-cairo-reference.png deleted file mode 100644 index 2359d402c..000000000 Binary files a/tests/visual_tests/images/tiff-alpha-gradient-gdal-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-alpha-gradient-gdal-600-400-2.0-agg-reference.png b/tests/visual_tests/images/tiff-alpha-gradient-gdal-600-400-2.0-agg-reference.png deleted file mode 100644 index 2359d402c..000000000 Binary files a/tests/visual_tests/images/tiff-alpha-gradient-gdal-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-alpha-gradient-gdal-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-alpha-gradient-gdal-600-400-2.0-cairo-reference.png deleted file mode 100644 index 2359d402c..000000000 Binary files a/tests/visual_tests/images/tiff-alpha-gradient-gdal-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal1-255-257-1.0-agg-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal1-255-257-1.0-agg-reference.png deleted file mode 100644 index a41d358f2..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal1-255-257-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal1-255-257-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal1-255-257-1.0-cairo-reference.png deleted file mode 100644 index a41d358f2..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal1-255-257-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal1-255-257-2.0-agg-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal1-255-257-2.0-agg-reference.png deleted file mode 100644 index a41d358f2..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal1-255-257-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal1-255-257-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal1-255-257-2.0-cairo-reference.png deleted file mode 100644 index a41d358f2..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal1-255-257-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal1-256-256-1.0-agg-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal1-256-256-1.0-agg-reference.png deleted file mode 100644 index ca88aa1c6..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal1-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal1-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal1-256-256-1.0-cairo-reference.png deleted file mode 100644 index ca88aa1c6..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal1-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal1-256-256-2.0-agg-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal1-256-256-2.0-agg-reference.png deleted file mode 100644 index ca88aa1c6..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal1-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal1-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal1-256-256-2.0-cairo-reference.png deleted file mode 100644 index ca88aa1c6..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal1-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal2-255-257-1.0-agg-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal2-255-257-1.0-agg-reference.png deleted file mode 100644 index aaf37ce1b..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal2-255-257-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal2-255-257-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal2-255-257-1.0-cairo-reference.png deleted file mode 100644 index aaf37ce1b..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal2-255-257-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal2-255-257-2.0-agg-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal2-255-257-2.0-agg-reference.png deleted file mode 100644 index aaf37ce1b..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal2-255-257-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal2-255-257-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal2-255-257-2.0-cairo-reference.png deleted file mode 100644 index aaf37ce1b..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal2-255-257-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal2-256-256-1.0-agg-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal2-256-256-1.0-agg-reference.png deleted file mode 100644 index 22fe4b8ee..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal2-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal2-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal2-256-256-1.0-cairo-reference.png deleted file mode 100644 index 22fe4b8ee..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal2-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal2-256-256-2.0-agg-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal2-256-256-2.0-agg-reference.png deleted file mode 100644 index 22fe4b8ee..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal2-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-edge-alignment-gdal2-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-edge-alignment-gdal2-256-256-2.0-cairo-reference.png deleted file mode 100644 index 22fe4b8ee..000000000 Binary files a/tests/visual_tests/images/tiff-edge-alignment-gdal2-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-gdal-600-400-1.0-agg-reference.png b/tests/visual_tests/images/tiff-nodata-edge-gdal-600-400-1.0-agg-reference.png deleted file mode 100644 index 1f25c9d26..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-gdal-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-gdal-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-nodata-edge-gdal-600-400-1.0-cairo-reference.png deleted file mode 100644 index 1f25c9d26..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-gdal-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-gdal-600-400-2.0-agg-reference.png b/tests/visual_tests/images/tiff-nodata-edge-gdal-600-400-2.0-agg-reference.png deleted file mode 100644 index 1f25c9d26..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-gdal-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-gdal-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-nodata-edge-gdal-600-400-2.0-cairo-reference.png deleted file mode 100644 index 1f25c9d26..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-gdal-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-gdal-969-793-1.0-agg-reference.png b/tests/visual_tests/images/tiff-nodata-edge-gdal-969-793-1.0-agg-reference.png deleted file mode 100644 index 16a62306c..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-gdal-969-793-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-gdal-969-793-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-nodata-edge-gdal-969-793-1.0-cairo-reference.png deleted file mode 100644 index 16a62306c..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-gdal-969-793-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-gdal-969-793-2.0-agg-reference.png b/tests/visual_tests/images/tiff-nodata-edge-gdal-969-793-2.0-agg-reference.png deleted file mode 100644 index 16a62306c..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-gdal-969-793-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-gdal-969-793-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-nodata-edge-gdal-969-793-2.0-cairo-reference.png deleted file mode 100644 index 16a62306c..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-gdal-969-793-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-rgba-500-100-1.0-agg-reference.png b/tests/visual_tests/images/tiff-nodata-edge-rgba-500-100-1.0-agg-reference.png deleted file mode 100644 index c9c2fbeab..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-rgba-500-100-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-rgba-500-100-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-nodata-edge-rgba-500-100-1.0-cairo-reference.png deleted file mode 100644 index eec8d04e1..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-rgba-500-100-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-rgba-500-100-2.0-agg-reference.png b/tests/visual_tests/images/tiff-nodata-edge-rgba-500-100-2.0-agg-reference.png deleted file mode 100644 index c9c2fbeab..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-rgba-500-100-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-rgba-500-100-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-nodata-edge-rgba-500-100-2.0-cairo-reference.png deleted file mode 100644 index eec8d04e1..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-rgba-500-100-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-rgba-512-512-1.0-agg-reference.png b/tests/visual_tests/images/tiff-nodata-edge-rgba-512-512-1.0-agg-reference.png deleted file mode 100644 index 811d36044..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-rgba-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-rgba-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-nodata-edge-rgba-512-512-1.0-cairo-reference.png deleted file mode 100644 index 5eb2c6cf2..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-rgba-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-rgba-512-512-2.0-agg-reference.png b/tests/visual_tests/images/tiff-nodata-edge-rgba-512-512-2.0-agg-reference.png deleted file mode 100644 index 811d36044..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-rgba-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-edge-rgba-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-nodata-edge-rgba-512-512-2.0-cairo-reference.png deleted file mode 100644 index 5eb2c6cf2..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-edge-rgba-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-rgb-512-512-1.0-agg-reference.png b/tests/visual_tests/images/tiff-nodata-rgb-512-512-1.0-agg-reference.png deleted file mode 100644 index d30d5a609..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-rgb-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-rgb-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-nodata-rgb-512-512-1.0-cairo-reference.png deleted file mode 100644 index 459783826..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-rgb-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-rgb-512-512-2.0-agg-reference.png b/tests/visual_tests/images/tiff-nodata-rgb-512-512-2.0-agg-reference.png deleted file mode 100644 index d30d5a609..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-rgb-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-rgb-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-nodata-rgb-512-512-2.0-cairo-reference.png deleted file mode 100644 index 459783826..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-rgb-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-rgba-512-512-1.0-agg-reference.png b/tests/visual_tests/images/tiff-nodata-rgba-512-512-1.0-agg-reference.png deleted file mode 100644 index 2a650f252..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-rgba-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-rgba-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-nodata-rgba-512-512-1.0-cairo-reference.png deleted file mode 100644 index f46fbc42e..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-rgba-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-rgba-512-512-2.0-agg-reference.png b/tests/visual_tests/images/tiff-nodata-rgba-512-512-2.0-agg-reference.png deleted file mode 100644 index 2a650f252..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-rgba-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-rgba-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-nodata-rgba-512-512-2.0-cairo-reference.png deleted file mode 100644 index f46fbc42e..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-rgba-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-tolerance-512-512-1.0-agg-reference.png b/tests/visual_tests/images/tiff-nodata-tolerance-512-512-1.0-agg-reference.png deleted file mode 100644 index 2910d7b34..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-tolerance-512-512-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-tolerance-512-512-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-nodata-tolerance-512-512-1.0-cairo-reference.png deleted file mode 100644 index 2910d7b34..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-tolerance-512-512-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-tolerance-512-512-2.0-agg-reference.png b/tests/visual_tests/images/tiff-nodata-tolerance-512-512-2.0-agg-reference.png deleted file mode 100644 index 2910d7b34..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-tolerance-512-512-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-nodata-tolerance-512-512-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-nodata-tolerance-512-512-2.0-cairo-reference.png deleted file mode 100644 index 2910d7b34..000000000 Binary files a/tests/visual_tests/images/tiff-nodata-tolerance-512-512-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal-256-256-1.0-agg-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal-256-256-1.0-agg-reference.png deleted file mode 100644 index b2214b3b2..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal-256-256-1.0-cairo-reference.png deleted file mode 100644 index b2214b3b2..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal-256-256-2.0-agg-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal-256-256-2.0-agg-reference.png deleted file mode 100644 index b2214b3b2..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal-256-256-2.0-cairo-reference.png deleted file mode 100644 index b2214b3b2..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal-969-793-1.0-agg-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal-969-793-1.0-agg-reference.png deleted file mode 100644 index b23e716ab..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal-969-793-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal-969-793-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal-969-793-1.0-cairo-reference.png deleted file mode 100644 index b23e716ab..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal-969-793-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal-969-793-2.0-agg-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal-969-793-2.0-agg-reference.png deleted file mode 100644 index b23e716ab..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal-969-793-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal-969-793-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal-969-793-2.0-cairo-reference.png deleted file mode 100644 index b23e716ab..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal-969-793-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal2-600-400-1.0-agg-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal2-600-400-1.0-agg-reference.png deleted file mode 100644 index faebe7ecd..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal2-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal2-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal2-600-400-1.0-cairo-reference.png deleted file mode 100644 index faebe7ecd..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal2-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal2-600-400-2.0-agg-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal2-600-400-2.0-agg-reference.png deleted file mode 100644 index faebe7ecd..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal2-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal2-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal2-600-400-2.0-cairo-reference.png deleted file mode 100644 index faebe7ecd..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal2-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal2-969-793-1.0-agg-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal2-969-793-1.0-agg-reference.png deleted file mode 100644 index b23e716ab..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal2-969-793-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal2-969-793-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal2-969-793-1.0-cairo-reference.png deleted file mode 100644 index b23e716ab..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal2-969-793-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal2-969-793-2.0-agg-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal2-969-793-2.0-agg-reference.png deleted file mode 100644 index b23e716ab..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal2-969-793-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-gdal2-969-793-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-opaque-edge-gdal2-969-793-2.0-cairo-reference.png deleted file mode 100644 index b23e716ab..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-gdal2-969-793-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-raster2-600-400-1.0-agg-reference.png b/tests/visual_tests/images/tiff-opaque-edge-raster2-600-400-1.0-agg-reference.png deleted file mode 100644 index 699b71c07..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-raster2-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-raster2-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-opaque-edge-raster2-600-400-1.0-cairo-reference.png deleted file mode 100644 index 64108e381..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-raster2-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-raster2-600-400-2.0-agg-reference.png b/tests/visual_tests/images/tiff-opaque-edge-raster2-600-400-2.0-agg-reference.png deleted file mode 100644 index 699b71c07..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-raster2-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-raster2-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-opaque-edge-raster2-600-400-2.0-cairo-reference.png deleted file mode 100644 index 64108e381..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-raster2-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-raster2-969-793-1.0-agg-reference.png b/tests/visual_tests/images/tiff-opaque-edge-raster2-969-793-1.0-agg-reference.png deleted file mode 100644 index b23e716ab..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-raster2-969-793-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-raster2-969-793-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-opaque-edge-raster2-969-793-1.0-cairo-reference.png deleted file mode 100644 index b23e716ab..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-raster2-969-793-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-raster2-969-793-2.0-agg-reference.png b/tests/visual_tests/images/tiff-opaque-edge-raster2-969-793-2.0-agg-reference.png deleted file mode 100644 index b23e716ab..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-raster2-969-793-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-opaque-edge-raster2-969-793-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-opaque-edge-raster2-969-793-2.0-cairo-reference.png deleted file mode 100644 index b23e716ab..000000000 Binary files a/tests/visual_tests/images/tiff-opaque-edge-raster2-969-793-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-reprojection-1-250-250-1.0-agg-reference.png b/tests/visual_tests/images/tiff-reprojection-1-250-250-1.0-agg-reference.png deleted file mode 100644 index 467284ea4..000000000 Binary files a/tests/visual_tests/images/tiff-reprojection-1-250-250-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-reprojection-1-250-250-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-reprojection-1-250-250-1.0-cairo-reference.png deleted file mode 100644 index ea9c53e9c..000000000 Binary files a/tests/visual_tests/images/tiff-reprojection-1-250-250-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-reprojection-1-250-250-2.0-agg-reference.png b/tests/visual_tests/images/tiff-reprojection-1-250-250-2.0-agg-reference.png deleted file mode 100644 index 467284ea4..000000000 Binary files a/tests/visual_tests/images/tiff-reprojection-1-250-250-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-reprojection-1-250-250-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-reprojection-1-250-250-2.0-cairo-reference.png deleted file mode 100644 index ea9c53e9c..000000000 Binary files a/tests/visual_tests/images/tiff-reprojection-1-250-250-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-reprojection-2-250-250-1.0-agg-reference.png b/tests/visual_tests/images/tiff-reprojection-2-250-250-1.0-agg-reference.png deleted file mode 100644 index 26438dcaa..000000000 Binary files a/tests/visual_tests/images/tiff-reprojection-2-250-250-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-reprojection-2-250-250-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-reprojection-2-250-250-1.0-cairo-reference.png deleted file mode 100644 index 26438dcaa..000000000 Binary files a/tests/visual_tests/images/tiff-reprojection-2-250-250-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-reprojection-2-250-250-2.0-agg-reference.png b/tests/visual_tests/images/tiff-reprojection-2-250-250-2.0-agg-reference.png deleted file mode 100644 index 26438dcaa..000000000 Binary files a/tests/visual_tests/images/tiff-reprojection-2-250-250-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-reprojection-2-250-250-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-reprojection-2-250-250-2.0-cairo-reference.png deleted file mode 100644 index 26438dcaa..000000000 Binary files a/tests/visual_tests/images/tiff-reprojection-2-250-250-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-resampling-600-400-1.0-agg-reference.png b/tests/visual_tests/images/tiff-resampling-600-400-1.0-agg-reference.png deleted file mode 100644 index cb6a7b939..000000000 Binary files a/tests/visual_tests/images/tiff-resampling-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-resampling-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/tiff-resampling-600-400-1.0-cairo-reference.png deleted file mode 100644 index 44906bee9..000000000 Binary files a/tests/visual_tests/images/tiff-resampling-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-resampling-600-400-2.0-agg-reference.png b/tests/visual_tests/images/tiff-resampling-600-400-2.0-agg-reference.png deleted file mode 100644 index cb6a7b939..000000000 Binary files a/tests/visual_tests/images/tiff-resampling-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff-resampling-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/tiff-resampling-600-400-2.0-cairo-reference.png deleted file mode 100644 index 44906bee9..000000000 Binary files a/tests/visual_tests/images/tiff-resampling-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff_colortable-256-256-1.0-agg-reference.png b/tests/visual_tests/images/tiff_colortable-256-256-1.0-agg-reference.png deleted file mode 100644 index b9ed3400d..000000000 Binary files a/tests/visual_tests/images/tiff_colortable-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff_colortable-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/tiff_colortable-256-256-1.0-cairo-reference.png deleted file mode 100644 index b9ed3400d..000000000 Binary files a/tests/visual_tests/images/tiff_colortable-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff_colortable-256-256-2.0-agg-reference.png b/tests/visual_tests/images/tiff_colortable-256-256-2.0-agg-reference.png deleted file mode 100644 index b9ed3400d..000000000 Binary files a/tests/visual_tests/images/tiff_colortable-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff_colortable-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/tiff_colortable-256-256-2.0-cairo-reference.png deleted file mode 100644 index b9ed3400d..000000000 Binary files a/tests/visual_tests/images/tiff_colortable-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff_colortable_custom_nodata-256-256-1.0-agg-reference.png b/tests/visual_tests/images/tiff_colortable_custom_nodata-256-256-1.0-agg-reference.png deleted file mode 100644 index 4d037012e..000000000 Binary files a/tests/visual_tests/images/tiff_colortable_custom_nodata-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff_colortable_custom_nodata-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/tiff_colortable_custom_nodata-256-256-1.0-cairo-reference.png deleted file mode 100644 index 4d037012e..000000000 Binary files a/tests/visual_tests/images/tiff_colortable_custom_nodata-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff_colortable_custom_nodata-256-256-2.0-agg-reference.png b/tests/visual_tests/images/tiff_colortable_custom_nodata-256-256-2.0-agg-reference.png deleted file mode 100644 index 4d037012e..000000000 Binary files a/tests/visual_tests/images/tiff_colortable_custom_nodata-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/tiff_colortable_custom_nodata-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/tiff_colortable_custom_nodata-256-256-2.0-cairo-reference.png deleted file mode 100644 index 4d037012e..000000000 Binary files a/tests/visual_tests/images/tiff_colortable_custom_nodata-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/vrt_colortable-256-256-1.0-agg-reference.png b/tests/visual_tests/images/vrt_colortable-256-256-1.0-agg-reference.png deleted file mode 100644 index 3fa463b51..000000000 Binary files a/tests/visual_tests/images/vrt_colortable-256-256-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/vrt_colortable-256-256-1.0-cairo-reference.png b/tests/visual_tests/images/vrt_colortable-256-256-1.0-cairo-reference.png deleted file mode 100644 index 3fa463b51..000000000 Binary files a/tests/visual_tests/images/vrt_colortable-256-256-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/vrt_colortable-256-256-2.0-agg-reference.png b/tests/visual_tests/images/vrt_colortable-256-256-2.0-agg-reference.png deleted file mode 100644 index 3fa463b51..000000000 Binary files a/tests/visual_tests/images/vrt_colortable-256-256-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/vrt_colortable-256-256-2.0-cairo-reference.png b/tests/visual_tests/images/vrt_colortable-256-256-2.0-cairo-reference.png deleted file mode 100644 index 3fa463b51..000000000 Binary files a/tests/visual_tests/images/vrt_colortable-256-256-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/whole-centroid-600-400-1.0-agg-reference.png b/tests/visual_tests/images/whole-centroid-600-400-1.0-agg-reference.png deleted file mode 100644 index ac7332948..000000000 Binary files a/tests/visual_tests/images/whole-centroid-600-400-1.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/whole-centroid-600-400-1.0-cairo-reference.png b/tests/visual_tests/images/whole-centroid-600-400-1.0-cairo-reference.png deleted file mode 100644 index 63f5d3d16..000000000 Binary files a/tests/visual_tests/images/whole-centroid-600-400-1.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/whole-centroid-600-400-2.0-agg-reference.png b/tests/visual_tests/images/whole-centroid-600-400-2.0-agg-reference.png deleted file mode 100644 index 5f6ebd7db..000000000 Binary files a/tests/visual_tests/images/whole-centroid-600-400-2.0-agg-reference.png and /dev/null differ diff --git a/tests/visual_tests/images/whole-centroid-600-400-2.0-cairo-reference.png b/tests/visual_tests/images/whole-centroid-600-400-2.0-cairo-reference.png deleted file mode 100644 index 6ed96a373..000000000 Binary files a/tests/visual_tests/images/whole-centroid-600-400-2.0-cairo-reference.png and /dev/null differ diff --git a/tests/visual_tests/styles/antimeridian-bbox.xml b/tests/visual_tests/styles/antimeridian-bbox.xml deleted file mode 100644 index fc50619b0..000000000 --- a/tests/visual_tests/styles/antimeridian-bbox.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - 1000,1000 - 200000.0,1087000.0,7007000.0,7173000.0 - - - - - mystyle - - -180,-47.2754736667,180,-34.0036943 - csv - -WKT,id, -"POINT (-176.662157383264883 -43.096109795145765)", -"POINT (-176.854671182715663 -42.903595931039007)", -"POINT (-177.252533072573982 -42.646910782400411)", -"POINT (-177.611892228793693 -42.415894147047872)", -"POINT (-178.099593973519461 -42.159208996768882)", -"POINT (-178.56162722744844 -41.735678488584703)", -"POINT (-178.72847257314487 -41.555998877995457)", -"POINT (-178.985157723427307 -41.222308171291367)", -"POINT (-179.152003072780786 -40.965623011559309)", -"POINT (-179.511362290676971 -40.490755465927869)", -"POINT (-179.80655022231997 -40.054390693250525)", -"POINT (179.923930360184784 -39.784871275110177)", -"POINT (179.75708500598833 -39.643694437033751)", -"POINT (179.346388748199729 -39.772037019858125)", -"POINT (179.025532296262895 -39.861876827647727)", -"POINT (178.563499004992451 -40.067224958370574)", -"POINT (178.281145326853419 -40.208401797959127)", -"POINT (178.02446016489057 -40.054390701181269)", -"POINT (177.677935196187519 -39.900379604399049)", -"POINT (177.485421324683159 -39.669362958813636)", -"POINT (177.331410227479353 -39.425512055075657)", -"POINT (177.215901904577578 -39.181661151299444)", -"POINT (177.023388033074042 -38.86080469896423)", -"POINT (176.76670287107433 -38.604119537111721)", -"POINT (176.535686225282944 -38.565616762876971)", -"POINT (176.317503837598906 -38.783799150566402)", -"POINT (176.176326998513417 -38.989147280139598)", -"POINT (175.932476094645182 -39.425512055467188)", -"POINT (175.701459448881849 -39.759202766009246)", -"POINT (175.52177983551357 -40.080059218446856)", -"POINT (175.149586350685809 -40.37524715469236)", -"POINT (174.880066930641647 -40.298241606113201)", -"POINT (174.700387317279876 -40.131396250851466)", -"POINT (174.469370671529759 -39.861876830812001)", -"POINT (174.418033639140958 -39.707865733646173)", -"POINT (174.212685509585867 -39.374175023120273)", -"POINT (174.148514219099951 -39.143158377371385)", -"POINT (174.05867441241972 -38.937810247816806)", -"POINT (173.930331831447972 -38.719627860165083)", -"POINT (173.699315185698993 -38.527113988707669)", -"POINT (173.327121700881207 -38.552782504902005)", -"POINT (172.993430990354909 -38.655456569679323)", -"POINT (172.839419893188989 -38.732462118262291)", -"POINT (172.659740279828696 -38.899307473525418)", -"POINT (172.45439215027406 -39.027650054497059)", -"POINT (172.197706988330737 -39.284335216440311)", -"POINT (172.018027374970359 -39.669362959355176)", -"POINT (-170.809757996124091 -39.258667337666161)", -"POINT (-171.092108440755396 -39.489683796643384)", -"POINT (-171.374459297976472 -39.72070029102813)", -"POINT (-171.669644665725599 -39.95171681078768)", -"POINT (-171.964830399850541 -40.195567616117053)", -"POINT (-172.208679740446428 -40.426584197598665)", -"POINT (-172.542368540167502 -40.631932262228219)", -"POINT (-172.696378898013165 -40.785943335635686)", -"POINT (-173.055736583802087 -41.068296973781855)", -"POINT (-173.273918197572641 -41.299313602634044)", -"POINT (-173.658944763471993 -41.645838554189496)", -"POINT (-173.504934101572132 -41.491827462434976)", -"POINT (-173.979800429072611 -41.992363516983445)", -"POINT (-174.108142742586438 -42.172043129406539)", -"POINT (-174.313490466537729 -42.377391260144812)", -"POINT (-174.608677910682047 -42.736750491079746)", -"POINT (-176.058947562102475 -43.429800480947527)", -"POINT (-174.955202379135329 -42.967767146816229)", -"POINT (-175.481406377455045 -43.160281038130286)", -"POINT (-175.802262571951218 -43.352794922023079)", -"POINT (-176.328466827030041 -43.339960685516779)", -"POINT (-176.508146353344472 -43.250120886092468)", - - - - - \ No newline at end of file diff --git a/tests/visual_tests/styles/building-symbolizer-opacity.xml b/tests/visual_tests/styles/building-symbolizer-opacity.xml deleted file mode 100644 index 5ddd40d4c..000000000 --- a/tests/visual_tests/styles/building-symbolizer-opacity.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - 512, 512 - - - - - ellipse - - csv - ../data/marker-multi-policy.csv - - - diff --git a/tests/visual_tests/styles/charspacing-lines.xml b/tests/visual_tests/styles/charspacing-lines.xml deleted file mode 100644 index c2dd336b2..000000000 --- a/tests/visual_tests/styles/charspacing-lines.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - 300, 300 - -0.05, -0.01, 0.95, 0.01 - - - - My Style - - csv - ../data/lines.csv - - - - - - diff --git a/tests/visual_tests/styles/charspacing.xml b/tests/visual_tests/styles/charspacing.xml deleted file mode 100644 index 4a90770c1..000000000 --- a/tests/visual_tests/styles/charspacing.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - 200, 400 - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - diff --git a/tests/visual_tests/styles/collision.xml b/tests/visual_tests/styles/collision.xml deleted file mode 100644 index 27cfa53c2..000000000 --- a/tests/visual_tests/styles/collision.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 600,400 - - - - - - - - line - text - - csv - -i|wkt -1|LINESTRING(-98.465624973178 64.664065539837, -84.403124973178 49.195315539837, -72.449999973178 40.757815539837, -61.199999973178 29.507815539837, -60.496874973178 22.476565539837, -58.387499973178 4.1953155398369, -52.059374973178 -7.7578094601631, -41.512499973178 -34.476559460163, -27.449999973178 -45.023434460163, -14.090624973178 -52.054684460163, 7.0031250268221 -61.195309460163) - - | - - - - - line - text - - csv - -i|wkt -1|LINESTRING(-55.574999973178 68.882815539837, -51.356249973178 42.164065539837, -57.684374973178 33.023440539837, -64.012499973178 21.773440539837, -63.309374973178 3.4921905398369, -45.731249973178 -46.429684460163, -16.903124973178 -50.648434460163, -2.8406249731779 -50.648434460163, 14.737500026822 -50.648434460163, 46.378125026822 -41.507809460163, 78.721875026822 -17.601559460163) -2|LINESTRING(-21.824999973178 69.585940539837, -108.30937497318 41.460940539837, -13.387499973178 24.585940539837, -108.30937497318 6.3046905398369, -19.012499973178 -2.1328094601631, -83.699999973178 -26.039059460163, 5.5968750268221 -26.039059460163, -30.262499973178 -63.304684460163, 40.050000026822 -19.710934460163, 62.550000026822 -61.195309460163) -3|LINESTRING(-73.856249973178 77.320315539837, -11.278124973178 -61.898434460163, -112.52812497318 61.148440539837, 31.612500026822 -61.898434460163, 56.925000026822 -13.382809460163) - - | - - - - diff --git a/tests/visual_tests/styles/colorize-alpha1.xml b/tests/visual_tests/styles/colorize-alpha1.xml deleted file mode 100644 index 7431d6638..000000000 --- a/tests/visual_tests/styles/colorize-alpha1.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - 512,512 - - - - - - - - countries - - ../../data/shp/ne_110m_admin_0_countries.shp - shape - - - - - style - - - x,y - -170,20 - -122,48 - -122.2,48.2 - -122.2,48.2 - -122.3,48.3 - -122.1,48.4 - -122.1,48.2 - -115,36 - 90,30 - 0,0 - 1,1 - 10,10 - -10,-10 - -20,-20 - - csv - - - - diff --git a/tests/visual_tests/styles/colorize-alpha2.xml b/tests/visual_tests/styles/colorize-alpha2.xml deleted file mode 100644 index 7301586a4..000000000 --- a/tests/visual_tests/styles/colorize-alpha2.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - 512,512 - - - - - - - - countries - - ../../data/shp/ne_110m_admin_0_countries.shp - shape - - - - - style - - - x,y - -170,20 - -122,48 - -122.2,48.2 - -122.2,48.2 - -122.3,48.3 - -122.1,48.4 - -122.1,48.2 - -115,36 - 90,30 - 0,0 - 1,1 - 10,10 - -10,-10 - -20,-20 - - csv - - - - diff --git a/tests/visual_tests/styles/colorize-alpha3.xml b/tests/visual_tests/styles/colorize-alpha3.xml deleted file mode 100644 index 12a7407c5..000000000 --- a/tests/visual_tests/styles/colorize-alpha3.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - 512,512 - - - - - - - - countries - - ../../data/shp/ne_110m_admin_0_countries.shp - shape - - - - - style - - - x,y - -170,20 - -122,48 - -122.2,48.2 - -122.2,48.2 - -122.3,48.3 - -122.1,48.4 - -122.1,48.2 - -115,36 - 90,30 - 0,0 - 1,1 - 10,10 - -10,-10 - -20,-20 - - csv - - - - diff --git a/tests/visual_tests/styles/colorize-alpha4.xml b/tests/visual_tests/styles/colorize-alpha4.xml deleted file mode 100644 index 8db16a8f6..000000000 --- a/tests/visual_tests/styles/colorize-alpha4.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - 256,256 - off - - - - - - - - countries - - ../../data/shp/ne_110m_admin_0_countries.shp - shape - - - - - style - - - x,y - -170,20 - -122,48 - -122.2,48.2 - -122.2,48.2 - -122.3,48.3 - -122.1,48.4 - -122.1,48.2 - -115,36 - 90,30 - 0,0 - 1,1 - 10,10 - -10,-10 - -20,-20 - - csv - - - - diff --git a/tests/visual_tests/styles/dots.xml b/tests/visual_tests/styles/dots.xml deleted file mode 100644 index 36dc356ad..000000000 --- a/tests/visual_tests/styles/dots.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - dots - - csv - 0,0,5,5 - -fill, opacity,height, width, wkt -green,.5, 40, 40, "POINT(2.5 2.5)" -red, .5, 20, 20, "MULTIPOINT((2 2.5),(2.5 2.5),(3 2.5))" -blue, .5, 45, 45, "POLYGON((1 1,4 1,4 4,1 4,1 1))" -red, .5, 3, 3, "LINESTRING(3 2.5,3.0472522909029145 2.5549083791557554,3.088039946704745 2.6192015984770367,3.120968717931644 2.692088134329871,3.1447426958020195 2.7725928396160553,3.1581869214177796 2.859569153953152,3.1602684919277424 2.9517139787160285,3.150115859191815 3.0475850341520374,3.1270360384124487 3.1456204818095705,3.090529469857131 3.2441605641461093,3.0403023058681398 3.3414709848078967,2.9762759274968564 3.435767728064507,2.898593529924341 3.525242994563949,2.8076236529182754 3.6080919132297717,2.7039605714802892 3.6825396759861526,2.588421502084629 3.7468687332550683,2.4620406210083243 3.799445683953957,2.3260599327010416 3.838747494110833,2.181917067429678 3.863386683229473,2.0312301280479197 3.872135127146751,1.8757797451792864 3.8639461402385225,1.7174885378702207 3.8379745183057543,1.5583982123914466 3.7935942461113443,1.4006445648882897 3.7304136000915884,1.246430683579882 3.648287406936956,1.0979986727928661 3.547326252181924,0.9576002439358948 3.4279024692786355,0.8274665372684367 3.290652778432585,0.7097775527295491 3.136477485296219,0.606631577958298 2.966536191967265,0.5200150067991092 2.7822400161197343,0.45177294193977735 2.5852403579882455,0.4035809708310185 2.3774142988020817,0.3769184946959401 2.160846757592015,0.37304397632518604 1.9378095755409703,0.3929724535957084 1.7107377376983552,0.4374556424314622 1.4822029804218395,0.5069649254805411 1.2548850688650404,0.6016774914054002 1.0315410617374736,0.7214658547096571 0.8149729099992633,0.8658909478409702 0.6079937617301794,1.0341989363401651 0.4133933667857521,1.2253218645141815 0.23390299172467044,1.437882193988065 0.07216026761394456,1.6702012510582676 -0.06932559950169326,1.920311551565356 -0.18820782357901678,2.185972924581849 -0.2823348101737011,2.4646923091307618 -0.34978128405768727,2.753747051974397 -0.38887736562393815,3.0502114897965984 -0.3982352072417812,3.350986556389679 -0.37677282398941525,3.6528321152745926 -0.3237347810995832,3.9524016810311693 -0.2387094327324748,4.246279158964359 -0.12164244300528804,4.531017203016431 0.027153639820840958,4.803176766446595 0.2069939418962261,5.0593673990838255 0.416820095021341,5.2962878292111855 0.6552034322979141,5.510766357600486 0.9203525899932274,5.6998005860669245 1.2101255063356857,5.860596003276281 1.5220457563037595,5.990602956471176 1.8533231098340628,6.087551549283583 2.200878149857013,6.149484022799466 2.5613707367678797,6.1747841994053125 2.9312320579468265,6.162203596480088 3.306699955329308,6.110883849442411 3.683857181350839,6.02037512070598 4.058672194373903,5.890650212364317 4.427042069440575,5.722114145495159 4.78483706933339,5.515609017373219 5.127946394875156,5.272413999093365 5.4523246125098,4.994240389582243 5.754038241781528,4.683221697131584 6.029311975608545,4.34189877581244 6.2745740024088335,3.9732001007988598 6.486499901292641,3.5804173231036964 6.662054589735392,3.16717629986471 6.798531817364951,2.737403850475655 6.893590719648262,2.2952905409040607 6.945288971186986,1.8452498478612391 6.952112109805218,1.3918741005021504 6.912998639345142,0.9398876394743532 6.827360560726954,0.4940976708866134 6.695099026966764,0.05934332565157785 6.516614868014918,-0.3595565377529124 6.292813784961579,-0.7578562271360596 6.0251060697957435,-1.1309362311473898 5.715400765898583,-1.474355768902115 5.3660942451696325,-1.783904285743506 4.980053239466529,-2.055651309423385 4.560592426208784,-2.285994090762115 4.1114467298642285,-2.4717024691612375 3.636738561911254,-2.6099604260809084 3.1409402810613676,-2.698403818583074 2.6288322123574606,-2.7351538200309866 2.105456617575501,-2.718845635708872 1.5760680595181986,-2.648652107097507 1.0460806487014485,-2.524301869365668 0.5210127020395867,-2.3460917818082168 0.006429378924498685)" - - - - - \ No newline at end of file diff --git a/tests/visual_tests/styles/dst-over-compositing.xml b/tests/visual_tests/styles/dst-over-compositing.xml deleted file mode 100644 index 8ebefe298..000000000 --- a/tests/visual_tests/styles/dst-over-compositing.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - 512,512 - - - - - - My Style - - csv - ../data/crossing-lines.csv - - - - diff --git a/tests/visual_tests/styles/expressionformat.xml b/tests/visual_tests/styles/expressionformat.xml deleted file mode 100644 index 596fb4a92..000000000 --- a/tests/visual_tests/styles/expressionformat.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/formatting-1.xml b/tests/visual_tests/styles/formatting-1.xml deleted file mode 100644 index d83012b9d..000000000 --- a/tests/visual_tests/styles/formatting-1.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/formatting-2.xml b/tests/visual_tests/styles/formatting-2.xml deleted file mode 100644 index 043dcafb9..000000000 --- a/tests/visual_tests/styles/formatting-2.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/formatting-3.xml b/tests/visual_tests/styles/formatting-3.xml deleted file mode 100644 index 8724228b1..000000000 --- a/tests/visual_tests/styles/formatting-3.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/formatting-4.xml b/tests/visual_tests/styles/formatting-4.xml deleted file mode 100644 index f8adcb16d..000000000 --- a/tests/visual_tests/styles/formatting-4.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/formatting-5.xml b/tests/visual_tests/styles/formatting-5.xml deleted file mode 100644 index 563682c51..000000000 --- a/tests/visual_tests/styles/formatting-5.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/formatting-6.xml b/tests/visual_tests/styles/formatting-6.xml deleted file mode 100644 index 38637f420..000000000 --- a/tests/visual_tests/styles/formatting-6.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/formatting-7.xml b/tests/visual_tests/styles/formatting-7.xml deleted file mode 100644 index 78b4f9ef9..000000000 --- a/tests/visual_tests/styles/formatting-7.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/formatting-8.xml b/tests/visual_tests/styles/formatting-8.xml deleted file mode 100644 index eea114cd1..000000000 --- a/tests/visual_tests/styles/formatting-8.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/formatting-expr-alignment.xml b/tests/visual_tests/styles/formatting-expr-alignment.xml deleted file mode 100644 index 27741bec7..000000000 --- a/tests/visual_tests/styles/formatting-expr-alignment.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - 500, 500 - - - - - - - My Style - - csv - -0.5, -0.5, 0.5, 0.5 - -lat,long,horizontal_alignment,vertical_alignment,dy,text - 0.25,-0.35,left,top,0 - 0.25,-0.12,middle,top,0 - 0.25, 0.11,right,top,0 - 0 ,-0.35,left,middle,0 - 0 ,-0.12,middle,middle,0 - 0 , 0.11,right,middle,0 --0.25,-0.35,left,bottom,0 --0.25,-0.12,middle,bottom,0 --0.25, 0.11,right,bottom,0 - 0.25, 0.35,right,auto,-0.0001 - 0 , 0.35,middle,auto,0 --0.25, 0.35,left,auto,0.0001 - - - - - - - diff --git a/tests/visual_tests/styles/formatting.xml b/tests/visual_tests/styles/formatting.xml deleted file mode 100644 index cdec59b5a..000000000 --- a/tests/visual_tests/styles/formatting.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - 256,256 - off - - - - My Style - - csv - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/functional-expressions-length.xml b/tests/visual_tests/styles/functional-expressions-length.xml deleted file mode 100644 index a462aff1d..000000000 --- a/tests/visual_tests/styles/functional-expressions-length.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - 512, 512 - - - - - - - - frame - - ogr - -15,-15,15,15 - 0 - - - - diff --git a/tests/visual_tests/styles/functional-expressions.xml b/tests/visual_tests/styles/functional-expressions.xml deleted file mode 100644 index f222f45a3..000000000 --- a/tests/visual_tests/styles/functional-expressions.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - 256,256 - - - - - - frame - - ogr - -10,-10,10,10 - 0 - - - - diff --git a/tests/visual_tests/styles/gdal-filter-factor.xml b/tests/visual_tests/styles/gdal-filter-factor.xml deleted file mode 100644 index 00e37402d..000000000 --- a/tests/visual_tests/styles/gdal-filter-factor.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - 600,400 - - - - - - test - - ../data/Yosemite_L9.tif - gdal - - - - diff --git a/tests/visual_tests/styles/geojson-geometry-collection.xml b/tests/visual_tests/styles/geojson-geometry-collection.xml deleted file mode 100644 index 5f4fbcf58..000000000 --- a/tests/visual_tests/styles/geojson-geometry-collection.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - 256,256 - - - - - - style - - geojson - -{ - "type": "FeatureCollection", - "features": [ - { - "type": "Feature", - "properties": {}, - "geometry": { - "type": "GeometryCollection", - "geometries": [ - { - "type": "MultiPoint", - "coordinates": [ [5,0], [0,5], [1,2.5], [4,2.5] ] - }, - { - "type": "LineString", - "coordinates": [ - [ - 0, - 5 - ], - [ - 5, - 0 - ] - ] - } - ] - } - } - ] -} - - - - diff --git a/tests/visual_tests/styles/geometry-transform-scale-patterns.xml b/tests/visual_tests/styles/geometry-transform-scale-patterns.xml deleted file mode 100644 index bc9bbad9a..000000000 --- a/tests/visual_tests/styles/geometry-transform-scale-patterns.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - 500,500 - - - - polygon - polygon-svg - line - line-svg - - csv - -1,-1,1,1 - - wkt - "LINESTRING (-1 0, 0 1, 1 0, 0 -1, -1 0)" - - - - - - - - diff --git a/tests/visual_tests/styles/geometry-transform-scale.xml b/tests/visual_tests/styles/geometry-transform-scale.xml deleted file mode 100644 index 17301e034..000000000 --- a/tests/visual_tests/styles/geometry-transform-scale.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - 500,500 - - - - polygon - line - marker - text - - csv - -1,-1,1,1 - - wkt - "LINESTRING (-1 0, 0 1, 1 0, 0 -1, -1 0)" - - - - - - - - diff --git a/tests/visual_tests/styles/geometry-transform-translate-patterns-svg.xml b/tests/visual_tests/styles/geometry-transform-translate-patterns-svg.xml deleted file mode 100644 index 8db8c1a21..000000000 --- a/tests/visual_tests/styles/geometry-transform-translate-patterns-svg.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - 200,200 - - - - - - - - polygon - - csv - -wkt -"POLYGON ((1 1, 4 1, 4 4, 1 4, 1 1), (2 2, 2 3, 3 3, 3 2, 2 2))" - - - - - - line - - csv - -wkt -"LINESTRING (0.5 0.5, 4.5 4.5)" - - - - - - point - - csv - -wkt -"POINT (1 4)" - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - diff --git a/tests/visual_tests/styles/geometry-transform-translate-patterns.xml b/tests/visual_tests/styles/geometry-transform-translate-patterns.xml deleted file mode 100644 index 611a05124..000000000 --- a/tests/visual_tests/styles/geometry-transform-translate-patterns.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - 200,200 - - - - - - - - polygon - - csv - -wkt -"POLYGON ((1 1, 4 1, 4 4, 1 4, 1 1), (2 2, 2 3, 3 3, 3 2, 2 2))" - - - - - - line - - csv - -wkt -"LINESTRING (0.5 0.5, 4.5 4.5)" - - - - - - point - - csv - -wkt -"POINT (1 4)" - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - diff --git a/tests/visual_tests/styles/geometry-transform-translate.xml b/tests/visual_tests/styles/geometry-transform-translate.xml deleted file mode 100644 index 0bf4e93e2..000000000 --- a/tests/visual_tests/styles/geometry-transform-translate.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - 200,200 - - - - - - - - polygon - - csv - -wkt -"POLYGON ((1 1, 1 4, 4 4, 4 1, 1 1), (2 2, 3 2, 3 3, 2 3, 2 2))" - - - - - - line - - csv - -wkt -"LINESTRING (0.5 0.5, 4.5 4.5)" - - - - - - point - - csv - -wkt -"POINT (1 4)" - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - diff --git a/tests/visual_tests/styles/group-symbolizer-1.xml b/tests/visual_tests/styles/group-symbolizer-1.xml deleted file mode 100644 index 3b37bd5fb..000000000 --- a/tests/visual_tests/styles/group-symbolizer-1.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 512,512 - - - - points - - csv - -lat,long,name1,ref1,name2,ref2 -0,0,One,1,Two,2 - - - - - - - - frame - - csv - -lat,long,nr --1,-1,0 --1,1,1 -1,-1,2 -1,1,3 - - - - - - - - center - - csv - -lat,long,nr -0,0,0 - - - - - - - diff --git a/tests/visual_tests/styles/group-symbolizer-2.xml b/tests/visual_tests/styles/group-symbolizer-2.xml deleted file mode 100644 index 9b3276cfa..000000000 --- a/tests/visual_tests/styles/group-symbolizer-2.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - 512,512 - - - - obstacle - - csv - -lat,long,nr -0.33,0.4,0 --0.33,0.4,1 - - - - - - - - grouped - - csv - -lat,long,name1,ref1,name2,ref2 --0.33,-0.33,One,1,Two,2 --0.33,0.33,One,1,Two,2 - - - - - - - - non-grouped - - csv - -lat,long,name1,ref1,name2,ref2 -0.33,-0.33,One,1,Two,2 -0.33,0.33,One,1,Two,2 - - - - - - - - frame - - csv - -lat,long,nr --1,-1,0 --1,1,1 -1,-1,2 -1,1,3 - - - - - - - - center - - csv - -lat,long,nr --0.33,-0.33,0 -0.33,-0.33,1 --0.33,0.33,2 -0.33,0.33,3 - - - - - - - diff --git a/tests/visual_tests/styles/group-symbolizer-3.xml b/tests/visual_tests/styles/group-symbolizer-3.xml deleted file mode 100644 index c3d8291e0..000000000 --- a/tests/visual_tests/styles/group-symbolizer-3.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - 512,256 - - - - obstacle - - csv - -lat,long -0.2,-0.35 -0.2,0.35 - - - - - - - - grouped - - csv - -lat,long,name1,ref1,name2,ref2,margin -0,-0.35,One,1,Two,2,0 -0,0.35,One,1,Two,2,30 - - - - - - - - frame - - csv - -lat,long,nr --0.5,-1,0 --0.5,1,1 -0.5,-1,2 -0.5,1,3 - - - - - - - center - - csv - -lat,long -0,-0.35 -0,0.35 - - - - - - - diff --git a/tests/visual_tests/styles/group-symbolizer-4.xml b/tests/visual_tests/styles/group-symbolizer-4.xml deleted file mode 100644 index a5dedddde..000000000 --- a/tests/visual_tests/styles/group-symbolizer-4.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - points - - csv - -lat,long,ref1,ref2,ref3,ref4,ref5,ref6,ref7,ref8,ref9,ref10 -0,0,1,2,3,4,5,6,7,8,9,10 - - - - - - - - frame - - csv - -lat,long,nr --1,-2,0 --1,2,1 -1,-2,2 -1,2,3 - - - - - - - diff --git a/tests/visual_tests/styles/group-symbolizer-line-1.xml b/tests/visual_tests/styles/group-symbolizer-line-1.xml deleted file mode 100644 index 17c1f55f8..000000000 --- a/tests/visual_tests/styles/group-symbolizer-line-1.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - 512,512 - - - - alpha - - csv - -wkt,name1,ref1,name2,ref2 -"LINESTRING(0 0, 10 2)",One,1,Two,2 - - - - - - - - beta - - csv - -wkt,name1,ref1,name2,ref2 -"LINESTRING(0 3, 10 5)",One,1,Two,2 - - - - - - - - gamma - - csv - -wkt,name1,ref1,name2,ref2 -"LINESTRING(0 6, 10 8)",One,1,Two,2 - - - - - - - diff --git a/tests/visual_tests/styles/group-symbolizer-line-2.xml b/tests/visual_tests/styles/group-symbolizer-line-2.xml deleted file mode 100644 index b883c6235..000000000 --- a/tests/visual_tests/styles/group-symbolizer-line-2.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - 512,512 - - - - - - alpha - - csv - -wkt,key1,key2 -"POINT(3.3 0)",foo,1 -"POINT(6.7 0)",bar,2 - - - - - - - - beta - - csv - -wkt,name1,ref1,name2,ref2 -"LINESTRING(0 -0.6, 10 -0.6)",One,1,Two,2 -"LINESTRING(0 -1.2, 10 -1.2)",One,1,Two,2 -"LINESTRING(0 -1.8, 10 -1.8)",One,1,Two,2 -"LINESTRING(0 -2.4, 10 -2.4)",One,1,Two,2 - - - - - - - - gamma - - csv - -wkt,name1,ref1,name2,ref2 -"LINESTRING(0 0.6, 10 0.6)",One,1,Two,2 -"LINESTRING(0 1.2, 10 1.2)",One,1,Two,2 -"LINESTRING(0 1.8, 10 1.8)",One,1,Two,2 -"LINESTRING(0 2.4, 10 2.4)",One,1,Two,2 - - - - - - - - - frame - - csv - -wkt,nr -"POINT(0 5)",1 -"POINT(0 -5)",2 -"POINT(10 5)",3 -"POINT(10 -5)",4 - - - - - - - diff --git a/tests/visual_tests/styles/halo-comp-op-on-satellite.xml b/tests/visual_tests/styles/halo-comp-op-on-satellite.xml deleted file mode 100644 index f55116915..000000000 --- a/tests/visual_tests/styles/halo-comp-op-on-satellite.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - 450,450 - - - - - raster - - ../data/satellite.png - 0,0,10,10 - gdal - - - - - - - labels - - x,y -2,1 -2,2 -2,3 -2,4 -2,5 -2,6 -2,7 -2,8 -2,9 -5,1 -5,2 -5,3 -5,4 -5,5 -5,6 -5,7 -5,8 -5,9 -8,1 -8,2 -8,3 -8,4 -8,5 -8,8 -8,6 -8,7 -8,8 -8,9 - - csv - - - - diff --git a/tests/visual_tests/styles/harfbuzz.xml b/tests/visual_tests/styles/harfbuzz.xml deleted file mode 100644 index 8f2fb086c..000000000 --- a/tests/visual_tests/styles/harfbuzz.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - 800, 200 - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/hb-fontsets.xml b/tests/visual_tests/styles/hb-fontsets.xml deleted file mode 100644 index 70173e677..000000000 --- a/tests/visual_tests/styles/hb-fontsets.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - 800, 200 - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - - - - - - - - - - - diff --git a/tests/visual_tests/styles/image-filters-galore.xml b/tests/visual_tests/styles/image-filters-galore.xml deleted file mode 100644 index 7ca2bc01b..000000000 --- a/tests/visual_tests/styles/image-filters-galore.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - 512,512 - - - - - - - countries-outline - countries - countries-mask - - ../../data/shp/ne_110m_admin_0_countries.shp - shape - - - - diff --git a/tests/visual_tests/styles/image-filters-multi-blur-inflate.xml b/tests/visual_tests/styles/image-filters-multi-blur-inflate.xml deleted file mode 100644 index 0422d659e..000000000 --- a/tests/visual_tests/styles/image-filters-multi-blur-inflate.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - 512,512 - - - - - - - countries-outline - countries - countries-over - - ../../data/shp/ne_110m_admin_0_countries.shp - shape - - - - diff --git a/tests/visual_tests/styles/image-filters-multi-blur.xml b/tests/visual_tests/styles/image-filters-multi-blur.xml deleted file mode 100644 index 71192ae6d..000000000 --- a/tests/visual_tests/styles/image-filters-multi-blur.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - 512,512 - - - - - - - countries-outline - countries - countries-over - - ../../data/shp/ne_110m_admin_0_countries.shp - shape - - - - diff --git a/tests/visual_tests/styles/jalign-auto.xml b/tests/visual_tests/styles/jalign-auto.xml deleted file mode 100644 index fda1c0885..000000000 --- a/tests/visual_tests/styles/jalign-auto.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - 200, 200 - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/khmer.xml b/tests/visual_tests/styles/khmer.xml deleted file mode 100644 index 5bf3626be..000000000 --- a/tests/visual_tests/styles/khmer.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - 800, 200 - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - diff --git a/tests/visual_tests/styles/kurdish-text-ogr.xml b/tests/visual_tests/styles/kurdish-text-ogr.xml deleted file mode 100644 index c5bc92572..000000000 --- a/tests/visual_tests/styles/kurdish-text-ogr.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - 512,512 - - - - - - style - - ../data/kurdish.geojson - ogr - 0 - - - \ No newline at end of file diff --git a/tests/visual_tests/styles/kurdish-text.xml b/tests/visual_tests/styles/kurdish-text.xml deleted file mode 100644 index dea9029e5..000000000 --- a/tests/visual_tests/styles/kurdish-text.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - 512,512 - - - - - - style - - ../data/kurdish.geojson - geojson - - - \ No newline at end of file diff --git a/tests/visual_tests/styles/line-offset.xml b/tests/visual_tests/styles/line-offset.xml deleted file mode 100644 index acdb7d700..000000000 --- a/tests/visual_tests/styles/line-offset.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - 900, 250 - - - My Style - - csv - -5.192, 50.189, -5.174, 50.195 - ../data/line-offset.csv - - - - - diff --git a/tests/visual_tests/styles/line-opacity-multi-render.xml b/tests/visual_tests/styles/line-opacity-multi-render.xml deleted file mode 100644 index 37bda8e7d..000000000 --- a/tests/visual_tests/styles/line-opacity-multi-render.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - 512,512 - - - - - polygon - - csv - - -wkt -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494))" -"POLYGON((-14452779.6317309 -7962451.4552494,-14452779.6317309 12037548.5447506,5547220.36826906 12037548.5447506,5547220.36826906 -7962451.4552494,-14452779.6317309 -7962451.4552494)) - - - - - diff --git a/tests/visual_tests/styles/line-pattern-smooth-and-offset.xml b/tests/visual_tests/styles/line-pattern-smooth-and-offset.xml deleted file mode 100755 index 86286459e..000000000 --- a/tests/visual_tests/styles/line-pattern-smooth-and-offset.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - 512,512 - - - - - - style - - shape - ../data/line.shp - - - diff --git a/tests/visual_tests/styles/line-pattern-symbolizer-opacity.xml b/tests/visual_tests/styles/line-pattern-symbolizer-opacity.xml deleted file mode 100644 index 44a490e6f..000000000 --- a/tests/visual_tests/styles/line-pattern-symbolizer-opacity.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - 512,512 - - - My Style - - csv - ../data/line-offset.csv - - - - - - diff --git a/tests/visual_tests/styles/line-pattern-symbolizer.xml b/tests/visual_tests/styles/line-pattern-symbolizer.xml deleted file mode 100644 index d770d54f9..000000000 --- a/tests/visual_tests/styles/line-pattern-symbolizer.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - 900, 250 - - - My Style - - csv - -5.192, 50.189, -5.174, 50.195 - ../data/line-offset.csv - - - - - - diff --git a/tests/visual_tests/styles/line-smooth-and-offset.xml b/tests/visual_tests/styles/line-smooth-and-offset.xml deleted file mode 100755 index 87203ce9c..000000000 --- a/tests/visual_tests/styles/line-smooth-and-offset.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - 512,512 - - - - - - style - - shape - ../data/line.shp - - - diff --git a/tests/visual_tests/styles/line-symbolizer-expressions-all.xml b/tests/visual_tests/styles/line-symbolizer-expressions-all.xml deleted file mode 100644 index da5bc73fd..000000000 --- a/tests/visual_tests/styles/line-symbolizer-expressions-all.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - 256,256 - - - - - - - - - - frame - - csv - -wkt|name -Polygon((-180.0 -125.0, -180.0 125.0, 180.0 125.0, 180.0 -125.0, -180.0 -125.0))|bounds - - - - - - - - bug - - csv - -id|value|wkt -stroke|#ff0000|LineString(-160 -120,160 -120,160 -100) -stroke-width|5|LineString(-160 -90,160 -90,160 -70) -stroke-opacity|0.5|LineString(-160 -60,160 -60,160 -40) -offset|3|LineString(-160 -30,160 -30,160 -10) -stroke-dasharray|3,3|LineString(-160 0,160 0,160 20) -stroke-linejoin|bevel|LineString(-160 30,160 30,160 50) -stroke-linecap|round|LineString(-160 60,160 60,160 80) -comp-op|minus|LineString(-160 90,160 90,160 110) - - - - - diff --git a/tests/visual_tests/styles/line-symbolizer-expressions.xml b/tests/visual_tests/styles/line-symbolizer-expressions.xml deleted file mode 100644 index 2e224b8e5..000000000 --- a/tests/visual_tests/styles/line-symbolizer-expressions.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - 256,256 - - - - - - - - - - frame - - csv - -wkt|name -Polygon((-180.0 -125.0, -180.0 125.0, 180.0 125.0, 180.0 -125.0, -180.0 -125.0))|bounds - - - - - - - - bug - - csv - -id|value|wkt -stroke|#ff0000|LineString(-160 -120,160 -120,160 -100) -stroke-width|5|LineString(-160 -90,160 -90,160 -70) -stroke-opacity|0.5|LineString(-160 -60,160 -60,160 -40) -offset|3|LineString(-160 -30,160 -30,160 -10) - - - - - diff --git a/tests/visual_tests/styles/line_break.xml b/tests/visual_tests/styles/line_break.xml deleted file mode 100644 index 0e56506e0..000000000 --- a/tests/visual_tests/styles/line_break.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - 800, 800 - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/lines-1.xml b/tests/visual_tests/styles/lines-1.xml deleted file mode 100644 index 11dae3909..000000000 --- a/tests/visual_tests/styles/lines-1.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - 800, 800; 600, 600; 400, 400; 200, 200 - -0.05, -0.01, 0.95, 0.01 - - - - My Style - - csv - ../data/lines.csv - - - - - - diff --git a/tests/visual_tests/styles/lines-2.xml b/tests/visual_tests/styles/lines-2.xml deleted file mode 100644 index 43a48717e..000000000 --- a/tests/visual_tests/styles/lines-2.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - 800, 800; 600, 600; 400, 400; 200, 200 - -0.05, -0.01, 0.95, 0.01 - - - - My Style - - csv - ../data/lines.csv - - - - - - diff --git a/tests/visual_tests/styles/lines-3.xml b/tests/visual_tests/styles/lines-3.xml deleted file mode 100644 index 475ef9344..000000000 --- a/tests/visual_tests/styles/lines-3.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - 800, 800; 600, 600; 400, 400; 200, 200 - -0.05, -0.01, 0.95, 0.01 - - - - My Style - - csv - ../data/lines.csv - - - - - - diff --git a/tests/visual_tests/styles/lines-4.xml b/tests/visual_tests/styles/lines-4.xml deleted file mode 100644 index bc20e7900..000000000 --- a/tests/visual_tests/styles/lines-4.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - 800, 800; 600, 600; 400, 400; 200, 200 - -0.05, -0.01, 0.95, 0.01 - - - - lines - text - - csv - ../data/lines2.csv - - - - - - - - diff --git a/tests/visual_tests/styles/lines-5.xml b/tests/visual_tests/styles/lines-5.xml deleted file mode 100644 index 55ff6593e..000000000 --- a/tests/visual_tests/styles/lines-5.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - 800, 800; 600, 600; 400, 400; 200, 200 - -0.05, -0.01, 0.95, 0.01 - - - - lines - text - - csv - ../data/lines2.csv - - - - - - - - diff --git a/tests/visual_tests/styles/lines-6.xml b/tests/visual_tests/styles/lines-6.xml deleted file mode 100644 index 644954c97..000000000 --- a/tests/visual_tests/styles/lines-6.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 800, 800; 600, 600; 400, 400; 200, 200 - -0.05, -0.01, 0.95, 0.01 - - - - lines - text - - csv - ../data/lines2.csv - - - - - - - - - - - - - diff --git a/tests/visual_tests/styles/lines-7.xml b/tests/visual_tests/styles/lines-7.xml deleted file mode 100644 index 08a6861a3..000000000 --- a/tests/visual_tests/styles/lines-7.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 800, 800; 600, 600; 400, 400; 200, 200 - -1.2, -1.2, 1.2, 1.2 - - - - lines - text - - csv - -wkt,nr -"LINESTRING(-1.000 -1.000, -0.958 -0.646, -0.917 -0.331, -0.875 -0.055, -0.833 0.185, -0.792 0.390, -0.750 0.562, -0.708 0.703, -0.667 0.815, -0.625 0.898, -0.583 0.956, -0.542 0.989, -0.500 1.000, -0.458 0.990, -0.417 0.961, -0.375 0.914, -0.333 0.852, -0.292 0.776, -0.250 0.688, -0.208 0.589, -0.167 0.481, -0.125 0.367, -0.083 0.248, -0.042 0.125, 0.000 0.000, 0.042 -0.125, 0.083 -0.248, 0.125 -0.367, 0.167 -0.481, 0.208 -0.589, 0.250 -0.688, 0.292 -0.776, 0.333 -0.852, 0.375 -0.914, 0.417 -0.961, 0.458 -0.990, 0.500 -1.000, 0.542 -0.989, 0.583 -0.956, 0.625 -0.898, 0.667 -0.815, 0.708 -0.703, 0.750 -0.562, 0.792 -0.390, 0.833 -0.185, 0.875 0.055, 0.917 0.331, 0.958 0.646, 1.000 1.000)",1 - - - - - - - - - diff --git a/tests/visual_tests/styles/lines-multi-layout-1.xml b/tests/visual_tests/styles/lines-multi-layout-1.xml deleted file mode 100644 index 635603be7..000000000 --- a/tests/visual_tests/styles/lines-multi-layout-1.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 800, 800 - -0.05, -0.01, 0.95, 0.01 - - - - lines - text - - csv - ../data/lines2.csv - - - - - - - - diff --git a/tests/visual_tests/styles/lines-multi-layout-2.xml b/tests/visual_tests/styles/lines-multi-layout-2.xml deleted file mode 100644 index 3a3addc37..000000000 --- a/tests/visual_tests/styles/lines-multi-layout-2.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 800, 800 - -1.2, -1.2, 1.2, 1.2 - - - - lines - text - - csv - -wkt,nr -"LINESTRING(1.000 1.000, 0.958 0.646, 0.917 0.331, 0.875 0.055, 0.833 -0.185, 0.792 -0.390, 0.750 -0.562, 0.708 -0.703, 0.667 -0.815, 0.625 -0.898, 0.583 -0.956, 0.542 -0.989, 0.500 -1.000, 0.458 -0.990, 0.417 -0.961, 0.375 -0.914, 0.333 -0.852, 0.292 -0.776, 0.250 -0.688, 0.208 -0.589, 0.167 -0.481, 0.125 -0.367, 0.083 -0.248, 0.042 -0.125, 0.000 0.000, -0.042 0.125, -0.083 0.248, -0.125 0.367, -0.167 0.481, -0.208 0.589, -0.250 0.688, -0.292 0.776, -0.333 0.852, -0.375 0.914, -0.417 0.961, -0.458 0.990, -0.500 1.000, -0.542 0.989, -0.583 0.956, -0.625 0.898, -0.667 0.815, -0.708 0.703, -0.750 0.562, -0.792 0.390, -0.833 0.185, -0.875 -0.055, -0.917 -0.331, -0.958 -0.646, -1.000 -1.000)",1 - - - - - - - - - diff --git a/tests/visual_tests/styles/lines-multi-layout-shield.xml b/tests/visual_tests/styles/lines-multi-layout-shield.xml deleted file mode 100644 index 686838c09..000000000 --- a/tests/visual_tests/styles/lines-multi-layout-shield.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 800, 800 - -0.05, -0.01, 0.95, 0.01 - - - - lines - text - - csv - ../data/lines.csv - - - - - - - - diff --git a/tests/visual_tests/styles/lines-shield.xml b/tests/visual_tests/styles/lines-shield.xml deleted file mode 100644 index 9c29df7b9..000000000 --- a/tests/visual_tests/styles/lines-shield.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - 800, 800; 600, 600; 400, 400; 200, 200 - -0.05, -0.01, 0.95, 0.01 - - - - My Style - - csv - ../data/lines.csv - - - - - - diff --git a/tests/visual_tests/styles/list.xml b/tests/visual_tests/styles/list.xml deleted file mode 100644 index d62e2a1c0..000000000 --- a/tests/visual_tests/styles/list.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - 800, 100; 600, 100; 400, 100; 300, 100; 250, 100; 150, 100; 100, 100 - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/map-background-image-compositing.xml b/tests/visual_tests/styles/map-background-image-compositing.xml deleted file mode 100644 index 69550bebb..000000000 --- a/tests/visual_tests/styles/map-background-image-compositing.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - 512,512 - - - - - - ellipse - - csv - -x,y -2.5,2.5 - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - diff --git a/tests/visual_tests/styles/marker-collide.xml b/tests/visual_tests/styles/marker-collide.xml deleted file mode 100644 index ffec1841c..000000000 --- a/tests/visual_tests/styles/marker-collide.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - 512,512 - - - - - - - - - - line - text - point-placement - - csv - -i|wkt -1|LINESTRING(-98.465624973178 64.664065539837, -84.403124973178 49.195315539837, -72.449999973178 40.757815539837, -61.199999973178 29.507815539837, -60.496874973178 22.476565539837, -58.387499973178 4.1953155398369, -52.059374973178 -7.7578094601631, -41.512499973178 -34.476559460163, -27.449999973178 -45.023434460163, -14.090624973178 -52.054684460163, 7.0031250268221 -61.195309460163) - - | - - - - - line - text - point-placement - - csv - -i|wkt -1|LINESTRING(-55.574999973178 68.882815539837, -51.356249973178 42.164065539837, -57.684374973178 33.023440539837, -64.012499973178 21.773440539837, -63.309374973178 3.4921905398369, -45.731249973178 -46.429684460163, -16.903124973178 -50.648434460163, -2.8406249731779 -50.648434460163, 14.737500026822 -50.648434460163, 46.378125026822 -41.507809460163, 78.721875026822 -17.601559460163) -2|LINESTRING(-21.824999973178 69.585940539837, -108.30937497318 41.460940539837, -13.387499973178 24.585940539837, -108.30937497318 6.3046905398369, -19.012499973178 -2.1328094601631, -83.699999973178 -26.039059460163, 5.5968750268221 -26.039059460163, -30.262499973178 -63.304684460163, 40.050000026822 -19.710934460163, 62.550000026822 -61.195309460163) -3|LINESTRING(-73.856249973178 77.320315539837, -11.278124973178 -61.898434460163, -112.52812497318 61.148440539837, 31.612500026822 -61.898434460163, 56.925000026822 -13.382809460163) - - | - - - - diff --git a/tests/visual_tests/styles/marker-interior-position.xml b/tests/visual_tests/styles/marker-interior-position.xml deleted file mode 100644 index 6fdd44897..000000000 --- a/tests/visual_tests/styles/marker-interior-position.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - 600,400 - - - - - - poly - - csv - -1 -1 11 11 - - id|name|wkt - 1|Example|Polygon((0 10, 0 0, 1 0, 1 7, 6 7, 6 0, 10 0, 10 10, 0 10)) - - - - diff --git a/tests/visual_tests/styles/marker-line-placement-many-vertices.xml b/tests/visual_tests/styles/marker-line-placement-many-vertices.xml deleted file mode 100644 index 6c9d155d2..000000000 --- a/tests/visual_tests/styles/marker-line-placement-many-vertices.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - 600, 400 - - - My Style - - csv - - name,wkt - one,"LINESTRING(-11910145.81 4703881.8, -11910145.81 4703423.84,-11910160.59 4703432.16,-11910166.19 4703437.59,-11910173.45 4703446.41,-11910177.3 4703450.97,-11910192.16 4703462.59,-11910204.85 4703471.78,-11910212.45 4703479.48,-11910221.64 4703489.36,-11910226.1 4703494.08,-11910237.21 4703504.49,-11910243.24 4703510.09,-11910248.05 4703515.34,-11910252.77 4703519.28,-11910270.35 4703533.17,-11910287.15 4703551.01,-11910297.38 4703561.96,-11910305.77 4703571.92,-11910310.15 4703577.61,-11910316.36 4703584.26,-11910322.14 4703588.67,-11910331.31 4703595.72,-11910344.33 4703608.96,-11910351.24 4703615.98,-11910355.65 4703620.48,-11910366.33 4703631.8,-11910372.95 4703639.49,-11910377.01 4703645.05,-11910379.94 4703647.91,-11910384.5 4703651.34,-11910393.1 4703660.65,-11910398.84 4703665.75,-11910405.07 4703670.16,-11910407.65 4703673.09,-11910410.87 4703677.79,-11910414.38 4703681.34,-11910417.73 4703687.09,-11910420.81 4703692.48,-11910429.84 4703699.54,-11910432.91 4703703.67,-11910437.32 4703710.88,-11910442.36 4703715.78,-11910449.22 4703720.33,-11910451.95 4703722.55,-11910455.8 4703727.74,-11910464.26 4703732.86,-11910471.12 4703737.82,-11910478.04 4703746.84,-11910491.9 4703763.57,-11910498.05 4703770.49,-11910507.08 4703782.24,-11910519.18 4703795.54,-11910521.99 4703802.82,-11910526.6 4703809.54,-11910530.8 4703813.87,-11910535.7 4703823.8,-11910540.95 4703834.86,-11910543.54 4703839.76,-11910548.78 4703853.41,-11910550.39 4703856.97,-11910553.61 4703860.69,-11910555.77 4703869.08,-11910558.86 4703875.87,-11910561.37 4703879.51,-11910566.84 4703882.72,-11910571.38 4703883.63,-11910576.21 4703884.4,-11910580.05 4703884.4,-11910584.18 4703885.38,-11910593.08 4703887.55,-11910599.16 4703891.19,-11910605.39 4703894.13,-11910609.37 4703895.74,-11910612.17 4703896.01,-11910617.49 4703893.15,-11910623.37 4703888.19,-11910634.42 4703883.42,-11910644.28 4703881.75,-11910653.52 4703881.8)" - - - - - - diff --git a/tests/visual_tests/styles/marker-multi-policy.xml b/tests/visual_tests/styles/marker-multi-policy.xml deleted file mode 100644 index 7c77c3ec4..000000000 --- a/tests/visual_tests/styles/marker-multi-policy.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 600,400 - - - - - - - boundary - each - whole - largest - - csv - ../data/marker-multi-policy.csv - | - - - diff --git a/tests/visual_tests/styles/marker-on-hex-grid.xml b/tests/visual_tests/styles/marker-on-hex-grid.xml deleted file mode 100644 index 1f6684222..000000000 --- a/tests/visual_tests/styles/marker-on-hex-grid.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - 600,400; 400,600; 257,256 - - - - 1 - - shape - ../data/hex.shp - - - - diff --git a/tests/visual_tests/styles/marker-on-line-and-avoid-edges.xml b/tests/visual_tests/styles/marker-on-line-and-avoid-edges.xml deleted file mode 100644 index 812a00a4f..000000000 --- a/tests/visual_tests/styles/marker-on-line-and-avoid-edges.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - 512,512 - - - - - line - point-placement - - csv - ../data/marker-on-line.csv - | - - - diff --git a/tests/visual_tests/styles/marker-on-line-and-line-placement.xml b/tests/visual_tests/styles/marker-on-line-and-line-placement.xml deleted file mode 100644 index 936ff7a9e..000000000 --- a/tests/visual_tests/styles/marker-on-line-and-line-placement.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - 600,400 - - - - - line - point-placement - - csv - -10, 0, 15, 20 - ../data/marker-on-line.csv - | - - - diff --git a/tests/visual_tests/styles/marker-on-line-and-vertex-first-placement.xml b/tests/visual_tests/styles/marker-on-line-and-vertex-first-placement.xml deleted file mode 100644 index 9e1084f9d..000000000 --- a/tests/visual_tests/styles/marker-on-line-and-vertex-first-placement.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - 600,400 - - - - - lines - markers - - csv - -1, -1, 11, 4 - - wkt, placement - "LINESTRING(0 0)", "vertex-first" - "LINESTRING(0 1, 10 1)", "vertex-first" - "LINESTRING(0 2, 2 3, 4 2, 6 3, 8 2, 10 3)", "vertex-first" - - - - diff --git a/tests/visual_tests/styles/marker-on-line-and-vertex-last-placement.xml b/tests/visual_tests/styles/marker-on-line-and-vertex-last-placement.xml deleted file mode 100644 index fd89c57d2..000000000 --- a/tests/visual_tests/styles/marker-on-line-and-vertex-last-placement.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - 600,400 - - - - - lines - markers - - csv - -1, -1, 11, 4 - - wkt, placement - "LINESTRING(0 0)", "vertex-last" - "LINESTRING(0 1, 10 1)", "vertex-last" - "LINESTRING(0 2, 2 3, 4 2, 6 3, 8 2, 10 3)", "vertex-last" - - - - diff --git a/tests/visual_tests/styles/marker-on-line-spacing-eq-width-overlap.xml b/tests/visual_tests/styles/marker-on-line-spacing-eq-width-overlap.xml deleted file mode 100644 index 21294b5cc..000000000 --- a/tests/visual_tests/styles/marker-on-line-spacing-eq-width-overlap.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - 600,400 - - - alpha - - csv - - wkt - "LINESTRING(0 0, 10 2)" - - - - - beta - - csv - - wkt - "LINESTRING(0 2, 10 4)" - - - - - gamma - - csv - - wkt - "LINESTRING(0 4, 10 6)" - - - - - - - - diff --git a/tests/visual_tests/styles/marker-on-line-spacing-eq-width.xml b/tests/visual_tests/styles/marker-on-line-spacing-eq-width.xml deleted file mode 100644 index c4962ce9b..000000000 --- a/tests/visual_tests/styles/marker-on-line-spacing-eq-width.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - 600,400 - - - alpha - - csv - - wkt - "LINESTRING(0 0, 10 2)" - - - - - beta - - csv - - wkt - "LINESTRING(0 2, 10 4)" - - - - - gamma - - csv - - wkt - "LINESTRING(0 4, 10 6)" - - - - - - - - diff --git a/tests/visual_tests/styles/marker-on-line-svg-no-box.xml b/tests/visual_tests/styles/marker-on-line-svg-no-box.xml deleted file mode 100644 index a6ba56083..000000000 --- a/tests/visual_tests/styles/marker-on-line-svg-no-box.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - 600,400 - - - alpha - - csv - - wkt - "LINESTRING(0 0, 10 2)" - - - - - beta - - csv - - wkt - "LINESTRING(0 2, 10 4)" - - - - - gamma - - csv - - wkt - "LINESTRING(0 4, 10 6)" - - - - - - - diff --git a/tests/visual_tests/styles/marker-on-line-svg-with-box.xml b/tests/visual_tests/styles/marker-on-line-svg-with-box.xml deleted file mode 100644 index ceb1c4586..000000000 --- a/tests/visual_tests/styles/marker-on-line-svg-with-box.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - 600,400 - - - alpha - - csv - - wkt - "LINESTRING(0 0, 10 2)" - - - - - beta - - csv - - wkt - "LINESTRING(0 2, 10 4)" - - - - - gamma - - csv - - wkt - "LINESTRING(0 4, 10 6)" - - - - - - - diff --git a/tests/visual_tests/styles/marker-on-line.xml b/tests/visual_tests/styles/marker-on-line.xml deleted file mode 100644 index 6c8732435..000000000 --- a/tests/visual_tests/styles/marker-on-line.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - 600,400 - - - - - line - point-placement - - csv - -10, 0, 15, 20 - ../data/marker-on-line.csv - | - - - diff --git a/tests/visual_tests/styles/marker-path-expression.xml b/tests/visual_tests/styles/marker-path-expression.xml deleted file mode 100644 index 561edc287..000000000 --- a/tests/visual_tests/styles/marker-path-expression.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - ellipse - - csv - -x,y,FILENAME,FILETYPE -2.5,2.5,rect2,svg - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - \ No newline at end of file diff --git a/tests/visual_tests/styles/marker-recenter-collide.xml b/tests/visual_tests/styles/marker-recenter-collide.xml deleted file mode 100644 index 9ace272ee..000000000 --- a/tests/visual_tests/styles/marker-recenter-collide.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - 256,128 - - - - - - point - - csv - -1,-0.5,1,0.5 - - lat,lon,offset - 0,-0.35,10 - 0,0.35,0 - - - - - diff --git a/tests/visual_tests/styles/marker-svg-empty-g-element.xml b/tests/visual_tests/styles/marker-svg-empty-g-element.xml deleted file mode 100644 index 8fe2464c2..000000000 --- a/tests/visual_tests/styles/marker-svg-empty-g-element.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - svg - - csv - -x,y -2.5,2.5 - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - \ No newline at end of file diff --git a/tests/visual_tests/styles/marker-svg-opacity.xml b/tests/visual_tests/styles/marker-svg-opacity.xml deleted file mode 100644 index 43a00467b..000000000 --- a/tests/visual_tests/styles/marker-svg-opacity.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - ellipse - - csv - -x,y,id -1,1,1 -2,2,2 -3,3,3 -4,4,4 - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - \ No newline at end of file diff --git a/tests/visual_tests/styles/marker-svg-opacity2.xml b/tests/visual_tests/styles/marker-svg-opacity2.xml deleted file mode 100644 index 620b491d3..000000000 --- a/tests/visual_tests/styles/marker-svg-opacity2.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - svg - - csv - -x,y -2.5,2.5 - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - \ No newline at end of file diff --git a/tests/visual_tests/styles/marker-svg.xml b/tests/visual_tests/styles/marker-svg.xml deleted file mode 100644 index a2252a0c1..000000000 --- a/tests/visual_tests/styles/marker-svg.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - ellipse - - csv - -x,y,id -1,1,1 -2,2,2 -3,3,3 -4,4,4 - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - \ No newline at end of file diff --git a/tests/visual_tests/styles/marker-symbolizer-expressions-all.xml b/tests/visual_tests/styles/marker-symbolizer-expressions-all.xml deleted file mode 100644 index 273d553d5..000000000 --- a/tests/visual_tests/styles/marker-symbolizer-expressions-all.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - 256,256 - - - - - - - - - - frame - - csv - -wkt|name -Polygon((-180.0 -125.0, -180.0 125.0, 180.0 125.0, 180.0 -125.0, -180.0 -125.0))|bounds - - - - - - - - bug - - csv - -id|value|wkt -file|../../data/images/crosshair16x16.png|Point(-130 -70) -allow-overlap|true|Point(0 -70) -opacity|.5|Point(130 -70) -transform|1.2|Point(-130 30) -ignore-placement|true|Point(0 30) -comp-op|src-over|Point(130 30) - - - - - diff --git a/tests/visual_tests/styles/marker-vs-point.xml b/tests/visual_tests/styles/marker-vs-point.xml deleted file mode 100644 index 4bcc7d082..000000000 --- a/tests/visual_tests/styles/marker-vs-point.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - 512,512 - - - - - - - - markers - - csv - -x,y --2.5,3 --2.5,0 --2.5,-3 - - - - - - points - - csv - -x,y -2.5,3 -2.5,0 -2.5,-3 - - - - - - - - - - frame - - csv - -x,y --5,-5 -5,-5 --5,5 -5,5 - - - - - diff --git a/tests/visual_tests/styles/marker-whole-multi-polygon.xml b/tests/visual_tests/styles/marker-whole-multi-polygon.xml deleted file mode 100644 index 4b95c31f1..000000000 --- a/tests/visual_tests/styles/marker-whole-multi-polygon.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - 512,512 - - - - style - - ../../data/shp/world_merc - shape - - - diff --git a/tests/visual_tests/styles/marker-with-background-image-and-hsla-transform.xml b/tests/visual_tests/styles/marker-with-background-image-and-hsla-transform.xml deleted file mode 100644 index fd1cb679c..000000000 --- a/tests/visual_tests/styles/marker-with-background-image-and-hsla-transform.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - 600,400; 400,600; 257,256 - - - - - - ellipse - - csv - -x,y -2.5,2.5 - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - diff --git a/tests/visual_tests/styles/marker-with-background-image-linear-comp-op.xml b/tests/visual_tests/styles/marker-with-background-image-linear-comp-op.xml deleted file mode 100644 index 58df8a1e8..000000000 --- a/tests/visual_tests/styles/marker-with-background-image-linear-comp-op.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - ellipse - - csv - -x,y -2.5,2.5 - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - \ No newline at end of file diff --git a/tests/visual_tests/styles/marker-with-background-image.xml b/tests/visual_tests/styles/marker-with-background-image.xml deleted file mode 100644 index 316450ce3..000000000 --- a/tests/visual_tests/styles/marker-with-background-image.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - 600,400; 400,600; 257,256 - - - - - - ellipse - - csv - -x,y -2.5,2.5 - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - diff --git a/tests/visual_tests/styles/marker_line_placement_on_points.xml b/tests/visual_tests/styles/marker_line_placement_on_points.xml deleted file mode 100644 index 6fe866689..000000000 --- a/tests/visual_tests/styles/marker_line_placement_on_points.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 1 - - csv - - x,y,id - 0,0,1 - 5,0,1 - 5,5,1 - 0,5,1 - 2.5,2.5,2 - 2.5,3,3 - 2.5,2,3 - 3,2.5,3 - 2,2.5,3 - - - - \ No newline at end of file diff --git a/tests/visual_tests/styles/orientation.xml b/tests/visual_tests/styles/orientation.xml deleted file mode 100644 index aaf34575c..000000000 --- a/tests/visual_tests/styles/orientation.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - 800, 200 - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/point-symbolizer-expressions-all.xml b/tests/visual_tests/styles/point-symbolizer-expressions-all.xml deleted file mode 100644 index d5953435e..000000000 --- a/tests/visual_tests/styles/point-symbolizer-expressions-all.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - 256,256 - - - - - - - - - - frame - - csv - -wkt|name -Polygon((-180.0 -125.0, -180.0 125.0, 180.0 125.0, 180.0 -125.0, -180.0 -125.0))|bounds - - - - - - - - bug - - csv - -id|value|wkt -file|../../data/images/crosshair16x16.png|Point(-130 -70) -allow-overlap|true|Point(0 -70) -opacity|.5|Point(130 -70) -transform|1.2|Point(-130 30) -ignore-placement|true|Point(0 30) -comp-op|src-over|Point(130 30) - - - - - diff --git a/tests/visual_tests/styles/point-symbolizer-expressions.xml b/tests/visual_tests/styles/point-symbolizer-expressions.xml deleted file mode 100644 index 838d4f641..000000000 --- a/tests/visual_tests/styles/point-symbolizer-expressions.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - 256,256 - - - - - - - - - - frame - - csv - -wkt|name -Polygon((-180.0 -125.0, -180.0 125.0, 180.0 125.0, 180.0 -125.0, -180.0 -125.0))|bounds - - - - - - - - bug - - csv - -id|value|wkt -file|../../data/images/crosshair16x16.png|Point(-130 -70) - - - - - diff --git a/tests/visual_tests/styles/point-symbolizer-overlap-placement-expr.xml b/tests/visual_tests/styles/point-symbolizer-overlap-placement-expr.xml deleted file mode 100644 index 7594edee9..000000000 --- a/tests/visual_tests/styles/point-symbolizer-overlap-placement-expr.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - 500, 500 - - - - - - - My Style - - csv - -0.5, -0.5, 0.5, 0.5 - -lat,long,overlap,placement - 0.33,-0.36,noexpr-true,noexpr-false - 0.33,-0.34,noexpr-true,noexpr-false - 0.33,-0.13,noexpr-false,noexpr-false - 0.33,-0.11,noexpr-false,noexpr-false - 0.33, 0.10,noexpr-true,noexpr-false - 0.33, 0.12,noexpr-false,noexpr-false - 0.33, 0.34,noexpr-false,noexpr-false - 0.33, 0.36,noexpr-true,noexpr-false - - 0.11,-0.36,true,false - 0.11,-0.34,true,false - 0.11,-0.13,false,false - 0.11,-0.11,false,false - 0.11, 0.10,true,false - 0.11, 0.12,false,false - 0.11, 0.34,false,false - 0.11, 0.36,true,false - --0.11,-0.36,noexpr-false,noexpr-true --0.11,-0.34,noexpr-false,noexpr-true --0.11,-0.13,noexpr-false,noexpr-false --0.11,-0.11,noexpr-false,noexpr-false --0.11, 0.10,noexpr-false,noexpr-true --0.11, 0.12,noexpr-false,noexpr-false --0.11, 0.34,noexpr-false,noexpr-false --0.11, 0.36,noexpr-false,noexpr-true - --0.33,-0.36,false,true --0.33,-0.34,false,true --0.33,-0.13,false,false --0.33,-0.11,false,false --0.33, 0.10,false,true --0.33, 0.12,false,false --0.33, 0.34,false,false --0.33, 0.36,false,true - - - - - - - diff --git a/tests/visual_tests/styles/polygon-symbolizer-expressions-all.xml b/tests/visual_tests/styles/polygon-symbolizer-expressions-all.xml deleted file mode 100644 index e81f9a678..000000000 --- a/tests/visual_tests/styles/polygon-symbolizer-expressions-all.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - 256,256 - - - - - - - - - - frame - - csv - -wkt|name -Polygon((-180.0 -125.0, -180.0 125.0, 180.0 125.0, 180.0 -125.0, -180.0 -125.0))|bounds - - - - - - - - bug - - csv - -id|value|wkt -fill|#0000ff|Polygon((-160 -120,-20 -120,-40 -80,-100 -90,-160 -120)) -fill-opacity|0.5|Polygon((-160 -70,-20 -70,-40 -30,-100 -40,-160 -70)) -gamma|1.0|Polygon((-160 -20,-20 -20,-40 20,-100 10,-160 -20)) -comp-op|minus|Polygon((-160 30,-20 30,-40 70,-100 60,-160 30)) - - - - - diff --git a/tests/visual_tests/styles/polygon-symbolizer-expressions.xml b/tests/visual_tests/styles/polygon-symbolizer-expressions.xml deleted file mode 100644 index 48920ddb6..000000000 --- a/tests/visual_tests/styles/polygon-symbolizer-expressions.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - 256,256 - - - - - - - - - - frame - - csv - -wkt|name -Polygon((-180.0 -125.0, -180.0 125.0, 180.0 125.0, 180.0 -125.0, -180.0 -125.0))|bounds - - - - - - - - bug - - csv - -id|value|wkt -fill|#0000ff|Polygon((-160 -120,-20 -120,-40 -80,-100 -90,-160 -120)) -fill-opacity|0.5|Polygon((-160 -70,-20 -70,-40 -30,-100 -40,-160 -70)) -gamma|1.0|Polygon((-160 -20,-20 -20,-40 20,-100 10,-160 -20)) - - - - - diff --git a/tests/visual_tests/styles/polygon-winding-order.xml b/tests/visual_tests/styles/polygon-winding-order.xml deleted file mode 100644 index 36eeb4276..000000000 --- a/tests/visual_tests/styles/polygon-winding-order.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - 300,300 - - - - - - - - frame - - csv - -wkt|name -Polygon((-75.0 -75.0, -75.0 75.0, 35.0 75.0, 35.0 -75.0, -75.0 -75.0))|bounds - - - - - - - - polygon - - geojson - { -"type": "FeatureCollection", -"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, - -"features": [ -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": - [ [ [ 30, -20 ], [ -70, -20 ], [ -70, -70 ], [ 30, -70 ], [ 30, -20 ] ], - [ [ -60, -30 ], [ -30, -30 ], [ -30, -60 ], [ -60, -60 ], [ -60, -30 ] ], - [ [ -10, -30 ], [ -10, -60 ], [ 20, -60 ], [ 20, -30 ], [ -10, -30 ] ] - ] } }, -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": - [ [ [ -70, 70 ], [ 30, 70 ], [ 30, 20 ], [ -70, 20 ], [ -70, 70 ] ], - [ [ -60, 60 ], [ -30, 60 ], [ -30, 30 ], [ -60, 30 ], [ -60, 60 ] ], - [ [ 20, 30 ], [ 20, 60 ], [ -10, 60 ], [ -10, 30 ], [ 20, 30 ] ] - ] } } -] -} - - - diff --git a/tests/visual_tests/styles/postgis-inline.xml b/tests/visual_tests/styles/postgis-inline.xml deleted file mode 100644 index 38df0ef85..000000000 --- a/tests/visual_tests/styles/postgis-inline.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 512,512 - - - - carto_tests - - - template_postgis - true - - - - - - - - diff --git a/tests/visual_tests/styles/raster-color-to-alpha1.xml b/tests/visual_tests/styles/raster-color-to-alpha1.xml deleted file mode 100644 index 8207a683a..000000000 --- a/tests/visual_tests/styles/raster-color-to-alpha1.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - 512,512 - - - - - style - - - ../../data/raster/nodata-edge.tif - gdal - - - - diff --git a/tests/visual_tests/styles/raster-color-to-alpha2.xml b/tests/visual_tests/styles/raster-color-to-alpha2.xml deleted file mode 100644 index c9846411f..000000000 --- a/tests/visual_tests/styles/raster-color-to-alpha2.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - 512,512 - - - - - style - - - ../../data/raster/river_merc.tiff - gdal - - - - diff --git a/tests/visual_tests/styles/raster-color-to-alpha3.xml b/tests/visual_tests/styles/raster-color-to-alpha3.xml deleted file mode 100644 index 94e5bb365..000000000 --- a/tests/visual_tests/styles/raster-color-to-alpha3.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - 512,512 - - - - - style - - - ../../data/raster/transp.tiff - gdal - - - - diff --git a/tests/visual_tests/styles/raster-color-to-alpha4.xml b/tests/visual_tests/styles/raster-color-to-alpha4.xml deleted file mode 100644 index 7c801030c..000000000 --- a/tests/visual_tests/styles/raster-color-to-alpha4.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - 512,512 - - - - - - DISCRETE RAINBOW - - ../../data/raster/dataraster.tif - gdal - 1 - - - - diff --git a/tests/visual_tests/styles/raster-color-to-alpha4b.xml b/tests/visual_tests/styles/raster-color-to-alpha4b.xml deleted file mode 100644 index 7df4721ac..000000000 --- a/tests/visual_tests/styles/raster-color-to-alpha4b.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - 512,512 - - - - - - DISCRETE RAINBOW - - ../../data/raster/dataraster.tif - raster - 1 - - - - diff --git a/tests/visual_tests/styles/raster-color-to-alpha5.xml b/tests/visual_tests/styles/raster-color-to-alpha5.xml deleted file mode 100644 index e6acda42b..000000000 --- a/tests/visual_tests/styles/raster-color-to-alpha5.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 512,512 - - - - - - DISCRETE RAINBOW - - ../../data/raster/dataraster.tif - gdal - 1 - - - - diff --git a/tests/visual_tests/styles/raster-color-to-alpha5b.xml b/tests/visual_tests/styles/raster-color-to-alpha5b.xml deleted file mode 100644 index 6a4e73926..000000000 --- a/tests/visual_tests/styles/raster-color-to-alpha5b.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 512,512 - - - - - - DISCRETE RAINBOW - - ../../data/raster/dataraster.tif - raster - 1 - - - - diff --git a/tests/visual_tests/styles/raster_colorizer.xml b/tests/visual_tests/styles/raster_colorizer.xml deleted file mode 100644 index 6954118b4..000000000 --- a/tests/visual_tests/styles/raster_colorizer.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - 512,512 - - - - - - - - - - - - - - DISCRETE RAINBOW - - ../../data/raster/dataraster.tif - gdal - 1 - - - - diff --git a/tests/visual_tests/styles/raster_symbolizer.xml b/tests/visual_tests/styles/raster_symbolizer.xml deleted file mode 100644 index 48bfa0ba4..000000000 --- a/tests/visual_tests/styles/raster_symbolizer.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 512,512 - - - - - - - - ramped - - - ../../data/raster/dataraster.tif - gdal - 1 - - - - diff --git a/tests/visual_tests/styles/rasterlite-globe.xml b/tests/visual_tests/styles/rasterlite-globe.xml deleted file mode 100644 index 209a3da97..000000000 --- a/tests/visual_tests/styles/rasterlite-globe.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - 256,256 - -180 0 0 85.0511287798066 - - - - 1 - - rasterlite - globe - ../../data/rasterlite/globe.sqlite - - - - diff --git a/tests/visual_tests/styles/repeat-labels-1.xml b/tests/visual_tests/styles/repeat-labels-1.xml deleted file mode 100644 index a84350fcb..000000000 --- a/tests/visual_tests/styles/repeat-labels-1.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - 750,250 - - - - - - - - - - - - line - marker - shield - text - - csv - -12, -4, 12, 4 - ../data/repeat-labels.csv - - - - diff --git a/tests/visual_tests/styles/repeat-labels-2.xml b/tests/visual_tests/styles/repeat-labels-2.xml deleted file mode 100644 index 8d9452e11..000000000 --- a/tests/visual_tests/styles/repeat-labels-2.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - 750,250 - - - - - - - - - - - - line - marker - shield - text - - csv - -12, -4, 12, 4 - ../data/repeat-labels.csv - - - - diff --git a/tests/visual_tests/styles/repeat-labels-3.xml b/tests/visual_tests/styles/repeat-labels-3.xml deleted file mode 100644 index 84f64eb23..000000000 --- a/tests/visual_tests/styles/repeat-labels-3.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - 750,250 - - - - - - - - - - - - line - marker - shield - text - - csv - -12, -4, 12, 4 - ../data/repeat-labels.csv - - - - diff --git a/tests/visual_tests/styles/repeat-labels-4.xml b/tests/visual_tests/styles/repeat-labels-4.xml deleted file mode 100644 index 3a3505f54..000000000 --- a/tests/visual_tests/styles/repeat-labels-4.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - 750,250 - - - - - - - - - - - - line - marker - shield - text - - csv - -12, -4, 12, 4 - ../data/repeat-labels.csv - - - - diff --git a/tests/visual_tests/styles/road-casings-grouped-rendering.xml b/tests/visual_tests/styles/road-casings-grouped-rendering.xml deleted file mode 100644 index ddaa021fd..000000000 --- a/tests/visual_tests/styles/road-casings-grouped-rendering.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - 600,600 - 1477001.12245,6890242.37746,1480004.49012,6892244.62256 - - - - - - - - casing - bridge - fill - marking - - ../data/grouped-rendering.sqlite - (SELECT fid, geometry, type, tunnel, bridge, oneway, class, z_order, CAST((z_order / 10.0) AS INTEGER) AS z -FROM roads ORDER BY z_order) AS road - sqlite - - - - diff --git a/tests/visual_tests/styles/road-casings-non-grouped-rendering.xml b/tests/visual_tests/styles/road-casings-non-grouped-rendering.xml deleted file mode 100644 index 5287ed5ba..000000000 --- a/tests/visual_tests/styles/road-casings-non-grouped-rendering.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - 600,600 - 1477001.12245,6890242.37746,1480004.49012,6892244.62256 - - - - - - - - casing - bridge - fill - marking - - ../data/grouped-rendering.sqlite - (SELECT fid, geometry, type, tunnel, bridge, oneway, class, z_order, CAST((z_order / 10.0) AS INTEGER) AS z -FROM roads ORDER BY z_order) AS road - sqlite - - - - diff --git a/tests/visual_tests/styles/rtl-point.xml b/tests/visual_tests/styles/rtl-point.xml deleted file mode 100644 index 8406f5581..000000000 --- a/tests/visual_tests/styles/rtl-point.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - 200, 200 - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/shield-on-line-and-avoid-edges.xml b/tests/visual_tests/styles/shield-on-line-and-avoid-edges.xml deleted file mode 100644 index e6d9d7b21..000000000 --- a/tests/visual_tests/styles/shield-on-line-and-avoid-edges.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - 512,512 - - - - - line - point-placement - - csv - ../data/marker-on-line.csv - | - - - diff --git a/tests/visual_tests/styles/shield-on-line-spacing-eq-width.xml b/tests/visual_tests/styles/shield-on-line-spacing-eq-width.xml deleted file mode 100644 index 25a151b22..000000000 --- a/tests/visual_tests/styles/shield-on-line-spacing-eq-width.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - 600,400 - - - alpha - - csv - - wkt,halo-opacity,text-opacity,opacity - "LINESTRING(0 0, 10 2)",.1,.1,.1 - - - - - beta - - csv - - wkt,halo-opacity,text-opacity,opacity - "LINESTRING(0 2, 10 4)",1,1,1 - - - - - gamma - - csv - - wkt,halo-opacity,text-opacity,opacity - "LINESTRING(0 4, 10 6)",1,1,1 - - - - - - - - diff --git a/tests/visual_tests/styles/shield-on-polygon.xml b/tests/visual_tests/styles/shield-on-polygon.xml deleted file mode 100644 index da92ef1ec..000000000 --- a/tests/visual_tests/styles/shield-on-polygon.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - 600,400 - - - - -180,-85.05112877980659,180,85.05112877980659 - 0,0,2 - png - 0 - 22 - - - - - - - countries-outline - countries - - ../../data/shp/new_zealand/ne_50m_land.shp - - - - - - - places - - ../../data/shp/new_zealand/ne_50m_populated_places_simple.shp - - - - - diff --git a/tests/visual_tests/styles/shieldsymbolizer-1.xml b/tests/visual_tests/styles/shieldsymbolizer-1.xml deleted file mode 100644 index 848ca0ede..000000000 --- a/tests/visual_tests/styles/shieldsymbolizer-1.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 490, 100; 495, 100; 497, 100; 498, 100; 499, 100; 500, 100; 501, 100; 502, 100; 505, 100; 510, 100 - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/shieldsymbolizer-2.xml b/tests/visual_tests/styles/shieldsymbolizer-2.xml deleted file mode 100644 index 9f4473bcf..000000000 --- a/tests/visual_tests/styles/shieldsymbolizer-2.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 490, 100; 495, 100; 497, 100; 498, 100; 499, 100; 500, 100; 501, 100; 502, 100; 505, 100; 510, 100 - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/shieldsymbolizer-3.xml b/tests/visual_tests/styles/shieldsymbolizer-3.xml deleted file mode 100644 index 67c60f54c..000000000 --- a/tests/visual_tests/styles/shieldsymbolizer-3.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 490, 100; 495, 100; 497, 100; 498, 100; 499, 100; 500, 100; 501, 100; 502, 100; 505, 100; 510, 100 - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/shieldsymbolizer-4.xml b/tests/visual_tests/styles/shieldsymbolizer-4.xml deleted file mode 100644 index 6693ba00a..000000000 --- a/tests/visual_tests/styles/shieldsymbolizer-4.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 490, 100; 495, 100; 497, 100; 498, 100; 499, 100; 500, 100; 501, 100; 502, 100; 505, 100; 510, 100 - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/simple-E.xml b/tests/visual_tests/styles/simple-E.xml deleted file mode 100644 index 799a3d65c..000000000 --- a/tests/visual_tests/styles/simple-E.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/simple-N.xml b/tests/visual_tests/styles/simple-N.xml deleted file mode 100644 index 5b9b79d15..000000000 --- a/tests/visual_tests/styles/simple-N.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/simple-NE.xml b/tests/visual_tests/styles/simple-NE.xml deleted file mode 100644 index aee999c0e..000000000 --- a/tests/visual_tests/styles/simple-NE.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/simple-NW.xml b/tests/visual_tests/styles/simple-NW.xml deleted file mode 100644 index bf4d35ffe..000000000 --- a/tests/visual_tests/styles/simple-NW.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/simple-S.xml b/tests/visual_tests/styles/simple-S.xml deleted file mode 100644 index a868ea30a..000000000 --- a/tests/visual_tests/styles/simple-S.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/simple-SE.xml b/tests/visual_tests/styles/simple-SE.xml deleted file mode 100644 index 5c411a0e2..000000000 --- a/tests/visual_tests/styles/simple-SE.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/simple-SW.xml b/tests/visual_tests/styles/simple-SW.xml deleted file mode 100644 index bc0712931..000000000 --- a/tests/visual_tests/styles/simple-SW.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/simple-W.xml b/tests/visual_tests/styles/simple-W.xml deleted file mode 100644 index f687644ca..000000000 --- a/tests/visual_tests/styles/simple-W.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/simple-shield.xml b/tests/visual_tests/styles/simple-shield.xml deleted file mode 100644 index 3ea2f6442..000000000 --- a/tests/visual_tests/styles/simple-shield.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - 600,400 - - - - My Style - - csv - -lat,long,name,nr,color,type,empty-string -0,0,Test one,1,#ff0000,svg, -0,0.1,Test two,2,red,svg, -0,0.2,Test three,3,#00ff00,svg, -0,0.3,Test four,4,green,svg, -0,0.4,Test five,5,#0000ff,svg, -0,0.5,Test six,6,blue,svg, -0,0.6,Test seven,7,#000000,svg, -0,0.7,Test eight,8,black,svg, -0,0.8,Test nine,9,#ffffff,svg, -0,0.9,Test ten,10,white,svg, - - - - - - - diff --git a/tests/visual_tests/styles/simple.xml b/tests/visual_tests/styles/simple.xml deleted file mode 100644 index 7105f7cc8..000000000 --- a/tests/visual_tests/styles/simple.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - 800, 100; 600, 100; 400, 100; 300, 100; 250, 100; 150, 100; 100, 100 - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/simplify-douglas-peucker.xml b/tests/visual_tests/styles/simplify-douglas-peucker.xml deleted file mode 100644 index 2553c3829..000000000 --- a/tests/visual_tests/styles/simplify-douglas-peucker.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - 500, 1000 - - - - lines - - sqlite - ../../data/sqlite/world.sqlite - true - - (SELECT *, 'douglas-peucker' as algorithm, 2 as simplify, -375 as ty FROM world_merc UNION ALL - SELECT *, 'douglas-peucker' as algorithm, 4 as simplify, -125 as ty FROM world_merc UNION ALL - SELECT *, 'douglas-peucker' as algorithm, 8 as simplify, 125 as ty FROM world_merc UNION ALL - SELECT *, 'douglas-peucker' as algorithm, 16 as simplify, 375 as ty FROM world_merc) - - - - diff --git a/tests/visual_tests/styles/simplify-radial-distance.xml b/tests/visual_tests/styles/simplify-radial-distance.xml deleted file mode 100644 index 3ad3e3ec8..000000000 --- a/tests/visual_tests/styles/simplify-radial-distance.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - 500, 1000 - - - - lines - - sqlite - ../../data/sqlite/world.sqlite - true - - (SELECT *, 'radial-distance' as algorithm, 10 as simplify, -375 as ty FROM world_merc UNION ALL - SELECT *, 'radial-distance' as algorithm, 40 as simplify, -125 as ty FROM world_merc UNION ALL - SELECT *, 'radial-distance' as algorithm, 160 as simplify, 125 as ty FROM world_merc UNION ALL - SELECT *, 'radial-distance' as algorithm, 640 as simplify, 375 as ty FROM world_merc) - - - - diff --git a/tests/visual_tests/styles/simplify-visvalingam-whyatt.xml b/tests/visual_tests/styles/simplify-visvalingam-whyatt.xml deleted file mode 100644 index 623857e45..000000000 --- a/tests/visual_tests/styles/simplify-visvalingam-whyatt.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - 500, 1000 - - - - lines - - sqlite - ../../data/sqlite/world.sqlite - true - - (SELECT *, 'visvalingam-whyatt' as algorithm, 10 as simplify, -375 as ty FROM world_merc UNION ALL - SELECT *, 'visvalingam-whyatt' as algorithm, 20 as simplify, -125 as ty FROM world_merc UNION ALL - SELECT *, 'visvalingam-whyatt' as algorithm, 40 as simplify, 125 as ty FROM world_merc UNION ALL - SELECT *, 'visvalingam-whyatt' as algorithm, 80 as simplify, 375 as ty FROM world_merc) - - - - diff --git a/tests/visual_tests/styles/simplify-zhao-saalfeld.xml b/tests/visual_tests/styles/simplify-zhao-saalfeld.xml deleted file mode 100644 index 3f46226d2..000000000 --- a/tests/visual_tests/styles/simplify-zhao-saalfeld.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - 500, 1000 - - - - lines - - sqlite - ../../data/sqlite/world.sqlite - true - - (SELECT *, 'zhao-saalfeld' as algorithm, 1 as simplify, -375 as ty FROM world_merc UNION ALL - SELECT *, 'zhao-saalfeld' as algorithm, 2 as simplify, -125 as ty FROM world_merc UNION ALL - SELECT *, 'zhao-saalfeld' as algorithm, 4 as simplify, 125 as ty FROM world_merc UNION ALL - SELECT *, 'zhao-saalfeld' as algorithm, 10 as simplify, 375 as ty FROM world_merc) - - - - diff --git a/tests/visual_tests/styles/style-level-compositing-tiled-0,0.xml b/tests/visual_tests/styles/style-level-compositing-tiled-0,0.xml deleted file mode 100644 index e88d964c5..000000000 --- a/tests/visual_tests/styles/style-level-compositing-tiled-0,0.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - 512,512 - -20037508.342,0,0,20037508.342 - - - - style - - ../../data/shp/world_merc - shape - - - - - - mask - - - wkt,name - "Polygon((-10000000 -5000000, -10000000 10000000, -5000000 10000000, -5000000 -5000000, -10000000 -5000000))","bounds" - - csv - - - diff --git a/tests/visual_tests/styles/style-level-compositing-tiled-0,1.xml b/tests/visual_tests/styles/style-level-compositing-tiled-0,1.xml deleted file mode 100644 index e88a99ed2..000000000 --- a/tests/visual_tests/styles/style-level-compositing-tiled-0,1.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - 512,512 - -20037508.342,-20037508.342,0,0 - - - - style - - ../../data/shp/world_merc - shape - - - - - - mask - - - wkt,name - "Polygon((-10000000 -5000000, -10000000 10000000, -5000000 10000000, -5000000 -5000000, -10000000 -5000000))","bounds" - - csv - - - diff --git a/tests/visual_tests/styles/style-level-compositing-tiled-1,0.xml b/tests/visual_tests/styles/style-level-compositing-tiled-1,0.xml deleted file mode 100644 index a0d4257df..000000000 --- a/tests/visual_tests/styles/style-level-compositing-tiled-1,0.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - 512,512 - 0,0,20037508.342,20037508.342 - - - - style - - ../../data/shp/world_merc - shape - - - - - - mask - - - wkt,name - "Polygon((-10000000 -5000000, -10000000 10000000, -5000000 10000000, -5000000 -5000000, -10000000 -5000000))","bounds" - - csv - - - diff --git a/tests/visual_tests/styles/style-level-compositing-tiled-1,1.xml b/tests/visual_tests/styles/style-level-compositing-tiled-1,1.xml deleted file mode 100644 index 4b158c4c5..000000000 --- a/tests/visual_tests/styles/style-level-compositing-tiled-1,1.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - 512,512 - 0,-20037508.342,20037508.342,0 - - - - style - - ../../data/shp/world_merc - shape - - - - - - mask - - - wkt,name - "Polygon((-10000000 -5000000, -10000000 10000000, -5000000 10000000, -5000000 -5000000, -10000000 -5000000))","bounds" - - csv - - - diff --git a/tests/visual_tests/styles/text-allow-overlap-expr.xml b/tests/visual_tests/styles/text-allow-overlap-expr.xml deleted file mode 100644 index ec447c9b2..000000000 --- a/tests/visual_tests/styles/text-allow-overlap-expr.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - 500, 500 - - - - - - - My Style - - csv - -0.5, -0.5, 0.5, 0.5 - -lat,long,test,text - 0.25,-0.35,noexpr-true,ABC - 0.25,-0.35,noexpr-true,XYZ - 0.25,-0.12,noexpr-false,ABC - 0.25,-0.12,noexpr-false,XYZ - 0.25, 0.11,noexpr-true,ABC - 0.25, 0.11,noexpr-false,XYZ - 0.25, 0.35,noexpr-false,ABC - 0.25, 0.35,noexpr-true,XYZ - 0 ,-0.35,true,ABC - 0 ,-0.35,true,XYZ - 0 ,-0.12,false,ABC - 0 ,-0.12,false,XYZ - 0 , 0.11,true,ABC - 0 , 0.11,false,XYZ - 0 , 0.35,false,ABC - 0 , 0.35,true,XYZ - - - - - - - diff --git a/tests/visual_tests/styles/text-bengali.xml b/tests/visual_tests/styles/text-bengali.xml deleted file mode 100644 index 9e9e9d37b..000000000 --- a/tests/visual_tests/styles/text-bengali.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - 800, 100 - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - diff --git a/tests/visual_tests/styles/text-bug1532.xml b/tests/visual_tests/styles/text-bug1532.xml deleted file mode 100644 index 4076756a3..000000000 --- a/tests/visual_tests/styles/text-bug1532.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 600, 165 - - - My Style - - csv - 0.0121962878686,0.14886974508,0.906367305121,0.389927385014 - ../data/bug1532.csv - - - - - - diff --git a/tests/visual_tests/styles/text-bug1533.xml b/tests/visual_tests/styles/text-bug1533.xml deleted file mode 100644 index 7e3e19f6d..000000000 --- a/tests/visual_tests/styles/text-bug1533.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - 600, 600 - - - My Style - - csv - 0.011974068267,-0.211219329615,0.906589524723,0.389705170555 - ../data/bug1533.csv - - - - - - diff --git a/tests/visual_tests/styles/text-bug1820+0.xml b/tests/visual_tests/styles/text-bug1820+0.xml deleted file mode 100644 index 2220d6051..000000000 --- a/tests/visual_tests/styles/text-bug1820+0.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - 600, 300 - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/text-bug1820+1.xml b/tests/visual_tests/styles/text-bug1820+1.xml deleted file mode 100644 index 22088cc98..000000000 --- a/tests/visual_tests/styles/text-bug1820+1.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - 600, 300 - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/text-bug1820-1.xml b/tests/visual_tests/styles/text-bug1820-1.xml deleted file mode 100644 index c65002cea..000000000 --- a/tests/visual_tests/styles/text-bug1820-1.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - 600, 300 - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/text-bug2037.xml b/tests/visual_tests/styles/text-bug2037.xml deleted file mode 100644 index 9d2cec01c..000000000 --- a/tests/visual_tests/styles/text-bug2037.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - 800, 300 - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - diff --git a/tests/visual_tests/styles/text-charplacement.xml b/tests/visual_tests/styles/text-charplacement.xml deleted file mode 100644 index 3eb09d16c..000000000 --- a/tests/visual_tests/styles/text-charplacement.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - 512,512 - - - - road - - ../data/charplacement - shape - - - diff --git a/tests/visual_tests/styles/text-data-binding.xml b/tests/visual_tests/styles/text-data-binding.xml deleted file mode 100644 index 5a4253b9b..000000000 --- a/tests/visual_tests/styles/text-data-binding.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - 500, 500 - - - - text - - sqlite - ../data/text-data-binding.sqlite - text_layer - -1,-1,1,1 - - - - circular - - sqlite - ../data/text-data-binding.sqlite - circular_layer - -1,-1,1,1 - - - - - diff --git a/tests/visual_tests/styles/text-displacement.xml b/tests/visual_tests/styles/text-displacement.xml deleted file mode 100644 index 9f6a3679b..000000000 --- a/tests/visual_tests/styles/text-displacement.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - 512,512 - - - - road - - ../data/displacement - shape - - - diff --git a/tests/visual_tests/styles/text-expressionformat-color.xml b/tests/visual_tests/styles/text-expressionformat-color.xml deleted file mode 100644 index 63befbf7d..000000000 --- a/tests/visual_tests/styles/text-expressionformat-color.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - 800, 100 - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - - - diff --git a/tests/visual_tests/styles/text-font-features.xml b/tests/visual_tests/styles/text-font-features.xml deleted file mode 100644 index 901eebc5a..000000000 --- a/tests/visual_tests/styles/text-font-features.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - -]> - - - 1100, 1100 - - - My Style - - csv - -1,-1,1,1 - - id, wkt, dx, features, text - 1, "POINT(-0.95 0.9)", 270, "liga 1, dlig 1", "first" - 2, "POINT(-0.95 0.9)", 350, "smcp 1", "The first" - 3, "POINT(-0.95 0.9)", 500, "sups[1:] 1", "1st" - 4, "POINT(-0.95 0.9)", 560, "frac 1, numr 1, dnom 1", "1/2 1/3 1/4" - 5, "POINT(-0.95 0.9)", 750, "zero 1, onum 1", "0123456789" - 6, "POINT(-0.95 0.9)", 950, "", "" - - - - - diff --git a/tests/visual_tests/styles/text-halign-adjust-multiline.xml b/tests/visual_tests/styles/text-halign-adjust-multiline.xml deleted file mode 100644 index 0afef8839..000000000 --- a/tests/visual_tests/styles/text-halign-adjust-multiline.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - 800, 800 - -0.05, -0.01, 0.95, 0.01 - - - - My Style - - csv - ../data/lines2.csv - - - - - - diff --git a/tests/visual_tests/styles/text-halign-adjust.xml b/tests/visual_tests/styles/text-halign-adjust.xml deleted file mode 100644 index 13b4020a1..000000000 --- a/tests/visual_tests/styles/text-halign-adjust.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - 800, 800 - -0.05, -0.01, 0.95, 0.01 - - - - My Style - - csv - ../data/lines2.csv - - - - - - diff --git a/tests/visual_tests/styles/text-halign.xml b/tests/visual_tests/styles/text-halign.xml deleted file mode 100644 index 668f12eee..000000000 --- a/tests/visual_tests/styles/text-halign.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 800, 800 - -0.05, -0.01, 0.95, 0.01 - - - - My Style - - csv - ../data/lines2.csv - - - - - - diff --git a/tests/visual_tests/styles/text-halo-opacity.xml b/tests/visual_tests/styles/text-halo-opacity.xml deleted file mode 100644 index f9a7127fa..000000000 --- a/tests/visual_tests/styles/text-halo-opacity.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - 512,512 - - - - - - labels - - csv - -id,x,y -1,1.5,4.5 -2,1.5,3.5 -3,1.5,2.5 -4,1.5,1.5 - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - diff --git a/tests/visual_tests/styles/text-halo-rasterizer.xml b/tests/visual_tests/styles/text-halo-rasterizer.xml deleted file mode 100644 index c014fe8c7..000000000 --- a/tests/visual_tests/styles/text-halo-rasterizer.xml +++ /dev/null @@ -1,227 +0,0 @@ - - - 600,400 - - - - - - labels - - csv - -id,x,y -0.1,1.5,4.5 -0.3,1.5,4 -0.5,1.5,3.5 -0.7,1.5,3 -1,1.5,2.5 -1.5,1.5,2 -2.5,1.5,1.5 -4,1.5,1 - -100.1,3.5,4.5 -100.3,3.5,4 -100.5,3.5,3.5 -100.7,3.5,3 -101,3.5,2.5 -101.5,3.5,2 -102.5,3.5,1.5 -104,3.5,1 - - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - diff --git a/tests/visual_tests/styles/text-halo-transform.xml b/tests/visual_tests/styles/text-halo-transform.xml deleted file mode 100644 index c7493bb4e..000000000 --- a/tests/visual_tests/styles/text-halo-transform.xml +++ /dev/null @@ -1,243 +0,0 @@ - - - 600,400 - - - - - - labels - - csv - -id,x,y -0.1,1.5,4.5 -0.3,1.5,4 -0.5,1.5,3.5 -0.7,1.5,3 -1,1.5,2.5 -1.5,1.5,2 -2.5,1.5,1.5 -4,1.5,1 - -100.1,3.5,4.5 -100.3,3.5,4 -100.5,3.5,3.5 -100.7,3.5,3 -101,3.5,2.5 -101.5,3.5,2 -102.5,3.5,1.5 -104,3.5,1 - - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - diff --git a/tests/visual_tests/styles/text-iconic-font.xml b/tests/visual_tests/styles/text-iconic-font.xml deleted file mode 100644 index 5b025ee07..000000000 --- a/tests/visual_tests/styles/text-iconic-font.xml +++ /dev/null @@ -1,252 +0,0 @@ - - - - - 1000, 1000 - - - My Style - - csv - -1, -1, 15, 15 - - wkt, text - "POINT( 0 0)", "" - "POINT( 0 1)", "" - "POINT( 0 2)", "" - "POINT( 0 3)", "" - "POINT( 0 4)", "" - "POINT( 0 5)", "" - "POINT( 0 6)", "" - "POINT( 0 7)", "" - "POINT( 0 8)", "" - "POINT( 0 9)", "" - "POINT( 0 10)", "" - "POINT( 0 11)", "" - "POINT( 0 12)", "" - "POINT( 0 13)", "" - "POINT( 0 14)", "" - "POINT( 1 0)", "" - "POINT( 1 1)", "" - "POINT( 1 2)", "" - "POINT( 1 3)", "" - "POINT( 1 4)", "" - "POINT( 1 5)", "" - "POINT( 1 6)", "" - "POINT( 1 7)", "" - "POINT( 1 8)", "" - "POINT( 1 9)", "" - "POINT( 1 10)", "" - "POINT( 1 11)", "" - "POINT( 1 12)", "" - "POINT( 1 13)", "" - "POINT( 1 14)", "" - "POINT( 2 0)", "" - "POINT( 2 1)", "" - "POINT( 2 2)", "" - "POINT( 2 3)", "" - "POINT( 2 4)", "" - "POINT( 2 5)", "" - "POINT( 2 6)", "" - "POINT( 2 7)", "" - "POINT( 2 8)", "" - "POINT( 2 9)", "" - "POINT( 2 10)", "" - "POINT( 2 11)", "" - "POINT( 2 12)", "" - "POINT( 2 13)", "" - "POINT( 2 14)", "" - "POINT( 3 0)", "" - "POINT( 3 1)", "" - "POINT( 3 2)", "" - "POINT( 3 3)", "" - "POINT( 3 4)", "" - "POINT( 3 5)", "" - "POINT( 3 6)", "" - "POINT( 3 7)", "" - "POINT( 3 8)", "" - "POINT( 3 9)", "" - "POINT( 3 10)", "" - "POINT( 3 11)", "" - "POINT( 3 12)", "" - "POINT( 3 13)", "" - "POINT( 3 14)", "" - "POINT( 4 0)", "" - "POINT( 4 1)", "" - "POINT( 4 2)", "" - "POINT( 4 3)", "" - "POINT( 4 4)", "" - "POINT( 4 5)", "" - "POINT( 4 6)", "" - "POINT( 4 7)", "" - "POINT( 4 8)", "" - "POINT( 4 9)", "" - "POINT( 4 10)", "" - "POINT( 4 11)", "" - "POINT( 4 12)", "" - "POINT( 4 13)", "" - "POINT( 4 14)", "" - "POINT( 5 0)", "" - "POINT( 5 1)", "" - "POINT( 5 2)", "" - "POINT( 5 3)", "" - "POINT( 5 4)", "" - "POINT( 5 5)", "" - "POINT( 5 6)", "" - "POINT( 5 7)", "" - "POINT( 5 8)", "" - "POINT( 5 9)", "" - "POINT( 5 10)", "" - "POINT( 5 11)", "" - "POINT( 5 12)", "" - "POINT( 5 13)", "" - "POINT( 5 14)", "" - "POINT( 6 0)", "" - "POINT( 6 1)", "" - "POINT( 6 2)", "" - "POINT( 6 3)", "" - "POINT( 6 4)", "" - "POINT( 6 5)", "" - "POINT( 6 6)", "" - "POINT( 6 7)", "" - "POINT( 6 8)", "" - "POINT( 6 9)", "" - "POINT( 6 10)", "" - "POINT( 6 11)", "" - "POINT( 6 12)", "" - "POINT( 6 13)", "" - "POINT( 6 14)", "" - "POINT( 7 0)", "" - "POINT( 7 1)", "" - "POINT( 7 2)", "" - "POINT( 7 3)", "" - "POINT( 7 4)", "" - "POINT( 7 5)", "" - "POINT( 7 6)", "" - "POINT( 7 7)", "" - "POINT( 7 8)", "" - "POINT( 7 9)", "" - "POINT( 7 10)", "" - "POINT( 7 11)", "" - "POINT( 7 12)", "" - "POINT( 7 13)", "" - "POINT( 7 14)", "" - "POINT( 8 0)", "" - "POINT( 8 1)", "" - "POINT( 8 2)", "" - "POINT( 8 3)", "" - "POINT( 8 4)", "" - "POINT( 8 5)", "" - "POINT( 8 6)", "" - "POINT( 8 7)", "" - "POINT( 8 8)", "" - "POINT( 8 9)", "" - "POINT( 8 10)", "" - "POINT( 8 11)", "" - "POINT( 8 12)", "" - "POINT( 8 13)", "" - "POINT( 8 14)", "" - "POINT( 9 0)", "" - "POINT( 9 1)", "" - "POINT( 9 2)", "" - "POINT( 9 3)", "" - "POINT( 9 4)", "" - "POINT( 9 5)", "" - "POINT( 9 6)", "" - "POINT( 9 7)", "" - "POINT( 9 8)", "" - "POINT( 9 9)", "" - "POINT( 9 10)", "" - "POINT( 9 11)", "" - "POINT( 9 12)", "" - "POINT( 9 13)", "" - "POINT( 9 14)", "" - "POINT(10 0)", "" - "POINT(10 1)", "" - "POINT(10 2)", "" - "POINT(10 3)", "" - "POINT(10 4)", "" - "POINT(10 5)", "" - "POINT(10 6)", "" - "POINT(10 7)", "" - "POINT(10 8)", "" - "POINT(10 9)", "" - "POINT(10 10)", "" - "POINT(10 11)", "" - "POINT(10 12)", "" - "POINT(10 13)", "" - "POINT(10 14)", "" - "POINT(11 0)", "" - "POINT(11 1)", "" - "POINT(11 2)", "" - "POINT(11 3)", "" - "POINT(11 4)", "" - "POINT(11 5)", "" - "POINT(11 6)", "" - "POINT(11 7)", "" - "POINT(11 8)", "" - "POINT(11 9)", "" - "POINT(11 10)", "" - "POINT(11 11)", "" - "POINT(11 12)", "" - "POINT(11 13)", "" - "POINT(11 14)", "" - "POINT(12 0)", "" - "POINT(12 1)", "" - "POINT(12 2)", "" - "POINT(12 3)", "" - "POINT(12 4)", "" - "POINT(12 5)", "" - "POINT(12 6)", "" - "POINT(12 7)", "" - "POINT(12 8)", "" - "POINT(12 9)", "" - "POINT(12 10)", "" - "POINT(12 11)", "" - "POINT(12 12)", "" - "POINT(12 13)", "" - "POINT(12 14)", "" - "POINT(13 0)", "" - "POINT(13 1)", "" - "POINT(13 2)", "" - "POINT(13 3)", "" - "POINT(13 4)", "" - "POINT(13 5)", "" - "POINT(13 6)", "" - "POINT(13 7)", "" - "POINT(13 8)", "" - "POINT(13 9)", "" - "POINT(13 10)", "" - "POINT(13 11)", "" - "POINT(13 12)", "" - "POINT(13 13)", "" - "POINT(13 14)", "" - "POINT(14 0)", "" - "POINT(14 1)", "" - "POINT(14 2)", "" - "POINT(14 3)", "" - "POINT(14 4)", "" - "POINT(14 5)", "" - "POINT(14 6)", "" - "POINT(14 7)", "" - "POINT(14 8)", "" - "POINT(14 9)", "" - "POINT(14 10)", "" - "POINT(14 11)", "" - "POINT(14 12)", "" - "POINT(14 13)", "" - "POINT(14 14)", "" - - - - - diff --git a/tests/visual_tests/styles/text-line-wrap.xml b/tests/visual_tests/styles/text-line-wrap.xml deleted file mode 100644 index ab47aecdc..000000000 --- a/tests/visual_tests/styles/text-line-wrap.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - 512,512 - - - - - 1 - - - - { - "type": "FeatureCollection", - - "features": [ - - { "type": "Feature", - "properties": { - "label": "this,that", - "wrap-character":",", - "repeat-wrap-character":true - }, - "geometry" : { "type": "Point", "coordinates": [ 2.5, 2.5 ] } - }, - { "type": "Feature", - "properties": { - "label": "this-that", - "wrap-character":"-", - "repeat-wrap-character":true - }, - "geometry" : { "type": "Point", "coordinates": [ 0, 5 ] } - } - ] - } - - - geojson - - - - - - - - - frame - - csv - -x,y --1,-1 -6,-1 --1,6 -6,6 - - - - - diff --git a/tests/visual_tests/styles/text-malayalam.xml b/tests/visual_tests/styles/text-malayalam.xml deleted file mode 100644 index 689f884ac..000000000 --- a/tests/visual_tests/styles/text-malayalam.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - 800, 100 - - - - My Style - - csv - -0.05, -0.01, 0.95, 0.01 - ../data/points.csv - - - - diff --git a/tests/visual_tests/styles/text-multi-layout-1.xml b/tests/visual_tests/styles/text-multi-layout-1.xml deleted file mode 100644 index a3341fbd2..000000000 --- a/tests/visual_tests/styles/text-multi-layout-1.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - 512, 512 - - - - obstacle - - csv - -1,-1,1,1 - -lat,long,nr --0.5,0.5,0 -0.5,-0.5,1 -0.5,0.5,2 --0.5,-0.5,3 -0.08,0,4 --0.08,0,5 - - - - - - - - points - - csv - -lat,long,nr,ref --0.45,-0.45,0,first -0.45,-0.45,1,second -0.45,0.45,2,third --0.45,0.45,3,fourth -0,0,4,fifth - - - - - - - - diff --git a/tests/visual_tests/styles/text-multi-layout-2.xml b/tests/visual_tests/styles/text-multi-layout-2.xml deleted file mode 100644 index 156f09990..000000000 --- a/tests/visual_tests/styles/text-multi-layout-2.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - 512, 512 - - - - points - - csv - -1,-1,1,1 - -lat,long -0,0 - - - - - - - - diff --git a/tests/visual_tests/styles/text-overlap.xml b/tests/visual_tests/styles/text-overlap.xml deleted file mode 100644 index db1859e38..000000000 --- a/tests/visual_tests/styles/text-overlap.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - 512,512 - - - - road - - ../data/overlap - shape - - - diff --git a/tests/visual_tests/styles/text-spacing.xml b/tests/visual_tests/styles/text-spacing.xml deleted file mode 100644 index 6f4527962..000000000 --- a/tests/visual_tests/styles/text-spacing.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - 512,512 - - - - road - - ../data/textspacing - shape - - - diff --git a/tests/visual_tests/styles/text-ttc-font.xml b/tests/visual_tests/styles/text-ttc-font.xml deleted file mode 100644 index 693aacaf5..000000000 --- a/tests/visual_tests/styles/text-ttc-font.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - 600,400 - - - - - - labels - - csv - -id,x,y -1,1.5,4.5 -2,1.5,4 -3,1.5,3.5 -4,1.5,3 -5,1.5,2.5 -6,1.5,2 -7,1.5,1.5 -8,1.5,1 - -1,3.5,4.5 -2,3.5,4 -3,3.5,3.5 -4,3.5,3 -5,3.5,2.5 -6.5,3.5,2 -7,3.5,1.5 -8,3.5,1 - - - - - - - - - - - frame - - csv - -x,y -0,0 -5,0 -0,5 -5,5 - - - - - diff --git a/tests/visual_tests/styles/text-typographic.xml b/tests/visual_tests/styles/text-typographic.xml deleted file mode 100644 index 912d20238..000000000 --- a/tests/visual_tests/styles/text-typographic.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - 512,512 - - - - - lines - texts - - csv - -id,wkt -1,"LINESTRING(0 0, 1 0, 1 1, 2 1, 2 2, 3 2, 3 3, 4 3, 4 4, 5 4, 5 5, 6 5, 6 6, 7 6, 7 7, 8 7, 8 8, 9 8, 9 9, 10 9, 10 10)" -2,"LINESTRING(10 10, 10 9, 9 9, 9 8, 8 8, 8 7, 7 7, 7 6, 6 6, 6 5, 5 5, 5 4, 4 4, 4 3, 3 3, 3 2, 2 2, 2 1, 1 1, 1 0, 0 0)" - - - - diff --git a/tests/visual_tests/styles/text-upright.xml b/tests/visual_tests/styles/text-upright.xml deleted file mode 100644 index ca4c66063..000000000 --- a/tests/visual_tests/styles/text-upright.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - 800, 800 - -1.05, -1.05, 1.05, 1.05 - - - - lines - text - - csv - - id, wkt, upright - 0, "LINESTRING(1 0, 0 -1, -1 0, 0 1, 1 0)", "[default]" - 1, "LINESTRING(0.9 0, 0 -0.9, -0.9 0, 0 0.9, 0.9 0)", "auto" - 2, "LINESTRING(0.8 0, 0 -0.8, -0.8 0, 0 0.8, 0.8 0)", "auto-down" - 3, "LINESTRING(0.7 0, 0 -0.7, -0.7 0, 0 0.7, 0.7 0)", "left" - 4, "LINESTRING(0.6 0, 0 -0.6, -0.6 0, 0 0.6, 0.6 0)", "right" - 5, "LINESTRING(0.5 0, 0 -0.5, -0.5 0, 0 0.5, 0.5 0)", "left_only" - 6, "LINESTRING(0.4 0, 0 -0.4, -0.4 0, 0 0.4, 0.4 0)", "right_only" - - - - - - - - - diff --git a/tests/visual_tests/styles/text-vertical-alignment.xml b/tests/visual_tests/styles/text-vertical-alignment.xml deleted file mode 100644 index df8bc12a4..000000000 --- a/tests/visual_tests/styles/text-vertical-alignment.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 800, 800 - -0.05, -0.01, 0.95, 0.01 - - - - My Style - - csv - ../data/lines2.csv - - - - - - diff --git a/tests/visual_tests/styles/tiff-alpha-broken-assoc-alpha-gdal.xml b/tests/visual_tests/styles/tiff-alpha-broken-assoc-alpha-gdal.xml deleted file mode 100644 index 128fb05a5..000000000 --- a/tests/visual_tests/styles/tiff-alpha-broken-assoc-alpha-gdal.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - 600,400 - - - - - white - - - - ../../data/raster/white-alpha-assoc-alpha-wrong.tiff - gdal - - - - diff --git a/tests/visual_tests/styles/tiff-alpha-broken-assoc-alpha-raster.xml b/tests/visual_tests/styles/tiff-alpha-broken-assoc-alpha-raster.xml deleted file mode 100644 index 2059b5da1..000000000 --- a/tests/visual_tests/styles/tiff-alpha-broken-assoc-alpha-raster.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - 600,400 - off - - - - - white - - - - ../../data/raster/white-alpha-assoc-alpha-wrong.tiff - raster - 1001859.9561,5922814.94334,1021141.75555,5942096.74279 - - - - diff --git a/tests/visual_tests/styles/tiff-alpha-gdal.xml b/tests/visual_tests/styles/tiff-alpha-gdal.xml deleted file mode 100644 index ec4694331..000000000 --- a/tests/visual_tests/styles/tiff-alpha-gdal.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - 600,400 - - - - - white - - ../../data/raster/white-alpha-assoc-alpha-correct.tiff - gdal - - - - diff --git a/tests/visual_tests/styles/tiff-alpha-gradient-gdal.xml b/tests/visual_tests/styles/tiff-alpha-gradient-gdal.xml deleted file mode 100644 index cc5bb5c23..000000000 --- a/tests/visual_tests/styles/tiff-alpha-gradient-gdal.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - 600,400 - - - - - transp - - ../../data/raster/transp.tiff - gdal - - - - diff --git a/tests/visual_tests/styles/tiff-alpha-gradient-raster.xml b/tests/visual_tests/styles/tiff-alpha-gradient-raster.xml deleted file mode 100644 index 2fa8f9724..000000000 --- a/tests/visual_tests/styles/tiff-alpha-gradient-raster.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - 256,256 - off - - - - - transp - - ../../data/raster/transp.tiff - raster - 0,0,256,256 - - - - diff --git a/tests/visual_tests/styles/tiff-alpha-raster.xml b/tests/visual_tests/styles/tiff-alpha-raster.xml deleted file mode 100644 index 33f7a11d7..000000000 --- a/tests/visual_tests/styles/tiff-alpha-raster.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - 600,400 - off - - - - - white - - ../../data/raster/white-alpha-assoc-alpha-correct.tiff - raster - 1001859.9561,5922814.94334,1021141.75555,5942096.74279 - - - - diff --git a/tests/visual_tests/styles/tiff-edge-alignment-gdal1.xml b/tests/visual_tests/styles/tiff-edge-alignment-gdal1.xml deleted file mode 100644 index 8d45e2b33..000000000 --- a/tests/visual_tests/styles/tiff-edge-alignment-gdal1.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - 256,256; 255,257 - -13267022.12540147,4618019.500877209,-13247454.246160466,4637587.380118214 - - - - - - test - - ../data/Yosemite_L9.tif - gdal - - - - diff --git a/tests/visual_tests/styles/tiff-edge-alignment-gdal2.xml b/tests/visual_tests/styles/tiff-edge-alignment-gdal2.xml deleted file mode 100644 index 9299c651a..000000000 --- a/tests/visual_tests/styles/tiff-edge-alignment-gdal2.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - 256,256; 255,257 - -13267022.12540147,4598451.621636203,-13247454.246160466,4618019.500877209 - - - - - - test - - ../data/Yosemite_L9.tif - gdal - - - - diff --git a/tests/visual_tests/styles/tiff-nodata-edge-gdal.xml b/tests/visual_tests/styles/tiff-nodata-edge-gdal.xml deleted file mode 100644 index ae6b6b9f6..000000000 --- a/tests/visual_tests/styles/tiff-nodata-edge-gdal.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - 600,400; 969,793 - - - - - style - - - ../../data/raster/nodata-edge.tif - gdal - - - - diff --git a/tests/visual_tests/styles/tiff-nodata-edge-raster.xml b/tests/visual_tests/styles/tiff-nodata-edge-raster.xml deleted file mode 100644 index 9babcfd34..000000000 --- a/tests/visual_tests/styles/tiff-nodata-edge-raster.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - 600,400 - off - - - - - style - - - - ../../data/raster/nodata-edge.tif - raster - -12329035.765216826,4508650.398543958,-12328653.027947057,4508957.346255356 - - - - diff --git a/tests/visual_tests/styles/tiff-nodata-edge-rgba.xml b/tests/visual_tests/styles/tiff-nodata-edge-rgba.xml deleted file mode 100644 index 49cb546fb..000000000 --- a/tests/visual_tests/styles/tiff-nodata-edge-rgba.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - 512,512 - - - - heat - - ../data/aerial_rgba.tiff - gdal - 255 - 5 - - - diff --git a/tests/visual_tests/styles/tiff-nodata-rgb.xml b/tests/visual_tests/styles/tiff-nodata-rgb.xml deleted file mode 100644 index d877fff57..000000000 --- a/tests/visual_tests/styles/tiff-nodata-rgb.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - 512,512 - - - - heat - - - ../data/heat_rgb.tif - gdal - 255 - - - diff --git a/tests/visual_tests/styles/tiff-nodata-rgba.xml b/tests/visual_tests/styles/tiff-nodata-rgba.xml deleted file mode 100644 index 87baa122d..000000000 --- a/tests/visual_tests/styles/tiff-nodata-rgba.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - 512,512 - - - - heat - - - ../data/heat_nodata.tif - gdal - - - diff --git a/tests/visual_tests/styles/tiff-nodata-tolerance.xml b/tests/visual_tests/styles/tiff-nodata-tolerance.xml deleted file mode 100644 index 85f05a3d9..000000000 --- a/tests/visual_tests/styles/tiff-nodata-tolerance.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - 512,512 - - - - - - test - - ../data/Yosemite_L9.tif - gdal - 255 - 100 - - - - diff --git a/tests/visual_tests/styles/tiff-opaque-edge-gdal.xml b/tests/visual_tests/styles/tiff-opaque-edge-gdal.xml deleted file mode 100644 index 7e322aeac..000000000 --- a/tests/visual_tests/styles/tiff-opaque-edge-gdal.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - 256,256; 969,793 - - - - - - test - - - - ../../data/raster/river_wgs.tiff - gdal - - - - diff --git a/tests/visual_tests/styles/tiff-opaque-edge-gdal2.xml b/tests/visual_tests/styles/tiff-opaque-edge-gdal2.xml deleted file mode 100644 index d47af67dd..000000000 --- a/tests/visual_tests/styles/tiff-opaque-edge-gdal2.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - 600,400; 969,793 - - - - testmerc - - - - ../../data/raster/river_merc.tiff - gdal - - - diff --git a/tests/visual_tests/styles/tiff-opaque-edge-raster.xml b/tests/visual_tests/styles/tiff-opaque-edge-raster.xml deleted file mode 100644 index 35d9370d4..000000000 --- a/tests/visual_tests/styles/tiff-opaque-edge-raster.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - 256,256 - off - - - - - - test - - ../../data/raster/river_wgs.tiff - raster - 0,0,256,210 - - - - diff --git a/tests/visual_tests/styles/tiff-opaque-edge-raster2.xml b/tests/visual_tests/styles/tiff-opaque-edge-raster2.xml deleted file mode 100644 index 20ad342c4..000000000 --- a/tests/visual_tests/styles/tiff-opaque-edge-raster2.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - 600,400; 969,793 - - - - testmerc - - - - ../../data/raster/river_merc.tiff - -8249238.098993212,-486119.1339340762,-8024337.037783274,-302066.9754826002 - raster - - - diff --git a/tests/visual_tests/styles/tiff-reprojection-1.xml b/tests/visual_tests/styles/tiff-reprojection-1.xml deleted file mode 100644 index 004f1756a..000000000 --- a/tests/visual_tests/styles/tiff-reprojection-1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - 250, 250 - - - - heat - - ../data/heat.tif - gdal - - - diff --git a/tests/visual_tests/styles/tiff-reprojection-2.xml b/tests/visual_tests/styles/tiff-reprojection-2.xml deleted file mode 100644 index 5a90d9bfd..000000000 --- a/tests/visual_tests/styles/tiff-reprojection-2.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - 250,250 - off - - - - - samp1 - - ../data/lower_columbia.tif - gdal - - - - diff --git a/tests/visual_tests/styles/tiff-resampling.xml b/tests/visual_tests/styles/tiff-resampling.xml deleted file mode 100644 index 9fe66cb87..000000000 --- a/tests/visual_tests/styles/tiff-resampling.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - 600,400 - - - - - - style - - ../data/snow-cover.tif - gdal - - - - diff --git a/tests/visual_tests/styles/tiff_colortable.xml b/tests/visual_tests/styles/tiff_colortable.xml deleted file mode 100644 index f6da4928d..000000000 --- a/tests/visual_tests/styles/tiff_colortable.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - 256,256 - - - - 2011_5km_vrt_nodata_style - - ../../data/raster/dataraster.tif - gdal - - - diff --git a/tests/visual_tests/styles/tiff_colortable_custom_nodata.xml b/tests/visual_tests/styles/tiff_colortable_custom_nodata.xml deleted file mode 100644 index eb30b12b7..000000000 --- a/tests/visual_tests/styles/tiff_colortable_custom_nodata.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - 256,256 - - - - 2011_5km_vrt_nodata_style - - ../../data/raster/dataraster.tif - 20 - gdal - - - diff --git a/tests/visual_tests/styles/vrt_colortable.xml b/tests/visual_tests/styles/vrt_colortable.xml deleted file mode 100644 index 4897a0a66..000000000 --- a/tests/visual_tests/styles/vrt_colortable.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - 256,256 - - - - 2011_5km_vrt_nodata_style - - ../../data/raster/dataraster.vrt - gdal - - - diff --git a/tests/visual_tests/styles/whole-centroid.xml b/tests/visual_tests/styles/whole-centroid.xml deleted file mode 100644 index d87c01d2f..000000000 --- a/tests/visual_tests/styles/whole-centroid.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - 600,400 - - - - - boundary - whole - - csv - 736908, 4390316, 2060771, 5942346 - ../data/whole-centroid.csv - | - - - diff --git a/tests/visual_tests/test.py b/tests/visual_tests/test.py deleted file mode 100755 index 23a056800..000000000 --- a/tests/visual_tests/test.py +++ /dev/null @@ -1,292 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import sys -import mapnik -#mapnik.logger.set_severity(mapnik.severity_type.None) -#mapnik.logger.set_severity(mapnik.severity_type.Debug) -import shutil -import os.path -from compare import compare, compare_grids -import platform -import glob - -try: - import json -except ImportError: - import simplejson as json - -visual_output_dir = "/tmp/mapnik-visual-images" - -defaults = { - 'status': True, - 'sizes': [(500, 100)], - 'scales':[1.0,2.0], - 'agg': True, - 'cairo': mapnik.has_cairo(), - 'grid': mapnik.has_grid_renderer() -} - -cairo_threshold = 0 -agg_threshold = 0 -grid_threshold = 0 - -def render_cairo(m, output, scale_factor): - mapnik.render_to_file(m, output, 'ARGB32', scale_factor) - # open and re-save as png8 to save space - new_im = mapnik.Image.open(output) - new_im.save(output, 'png8:m=h') - -def render_grid(m, output, scale_factor): - grid = mapnik.Grid(m.width, m.height) - mapnik.render_layer(m, grid, layer=0, scale_factor=scale_factor) - utf1 = grid.encode('utf', resolution=4) - open(output,'wb').write(json.dumps(utf1, indent=1)) - -def render_agg(m, output, scale_factor): - mapnik.render_to_file(m, output, 'png8:m=h', scale_factor), - -renderers = [ - { 'name': 'agg', - 'render': render_agg, - 'compare': lambda actual, reference: compare(actual, reference, alpha=True), - 'threshold': agg_threshold, - 'filetype': 'png', - 'dir': 'images' - }, - { 'name': 'cairo', - 'render': render_cairo, - 'compare': lambda actual, reference: compare(actual, reference, alpha=True), - 'threshold': cairo_threshold, - 'filetype': 'png', - 'dir': 'images' - }, - { 'name': 'grid', - 'render': render_grid, - 'compare': lambda actual, reference: compare_grids(actual, reference, alpha=False), - 'threshold': grid_threshold, - 'filetype': 'json', - 'dir': 'grids' - } -] - -dirname = os.path.dirname(__file__) - -class Reporting: - DIFF = 1 - NOT_FOUND = 2 - OTHER = 3 - REPLACE = 4 - def __init__(self, quiet, overwrite_failures = False): - self.quiet = quiet - self.passed = 0 - self.failed = 0 - self.overwrite_failures = overwrite_failures - self.errors = [ #(type, actual, expected, diff, message) - ] - - def result_fail(self, actual, expected, diff): - self.failed += 1 - if self.quiet: - if platform.uname()[0] == 'Windows': - sys.stderr.write('.') - else: - sys.stderr.write('\x1b[31m.\x1b[0m') - else: - print '\x1b[31m✘\x1b[0m (\x1b[34m%u different pixels\x1b[0m)' % diff - - if self.overwrite_failures: - self.errors.append((self.REPLACE, actual, expected, diff, None)) - contents = open(actual, 'r').read() - open(expected, 'wb').write(contents) - else: - self.errors.append((self.DIFF, actual, expected, diff, None)) - - def result_pass(self, actual, expected, diff): - self.passed += 1 - if self.quiet: - if platform.uname()[0] == 'Windows': - sys.stderr.write('.') - else: - sys.stderr.write('\x1b[32m.\x1b[0m') - else: - if platform.uname()[0] == 'Windows': - print '\x1b[32m✓\x1b[0m' - else: - print '✓' - - def updating(self, actual, expected): - self.passed += 1 - if self.quiet: - sys.stderr.write('\x1b[33m.\x1b[0m') - else: - print '\x1b[33m✓\x1b[0m (\x1b[34mUpdating\x1b[0m)' - contents = open(actual, 'r').read() - open(expected, 'wb').write(contents) - - - def not_found(self, actual, expected): - self.failed += 1 - self.errors.append((self.NOT_FOUND, actual, expected, 0, None)) - if self.quiet: - sys.stderr.write('\x1b[33m.\x1b[0m') - else: - print '\x1b[33m?\x1b[0m (\x1b[34mReference file not found, creating\x1b[0m)' - contents = open(actual, 'r').read() - open(expected, 'wb').write(contents) - - def other_error(self, expected, message): - self.failed += 1 - self.errors.append((self.OTHER, None, expected, 0, message)) - if self.quiet: - sys.stderr.write('\x1b[31m.\x1b[0m') - else: - print '\x1b[31m✘\x1b[0m (\x1b[34m%s\x1b[0m)' % message - - def make_html_item(self,actual,expected,diff): - item = ''' -
- ''' % (expected,expected,'%') - item += '
%s
' % (diff) - item += ''' -
- - - -
- ''' % (actual,actual,'%') - return item - - def summary(self): - if len(self.errors) == 0: - print '\nAll %s visual tests passed: \x1b[1;32m✓ \x1b[0m' % self.passed - return 0 - sortable_errors = [] - print "\nVisual rendering: %s failed / %s passed" % (len(self.errors), self.passed) - for idx, error in enumerate(self.errors): - if error[0] == self.OTHER: - print str(idx+1) + ") \x1b[31mfailure to run test:\x1b[0m %s (\x1b[34m%s\x1b[0m)" % (error[2],error[4]) - elif error[0] == self.NOT_FOUND: - print str(idx+1) + ") Generating reference image: '%s'" % error[2] - continue - elif error[0] == self.DIFF: - print str(idx+1) + ") \x1b[34m%s different pixels\x1b[0m:\n\t%s (\x1b[31mactual\x1b[0m)\n\t%s (\x1b[32mexpected\x1b[0m)" % (error[3], error[1], error[2]) - if '.png' in error[1]: # ignore grids - sortable_errors.append((error[3],error)) - elif error[0] == self.REPLACE: - print str(idx+1) + ") \x1b[31mreplaced reference with new version:\x1b[0m %s" % error[2] - if len(sortable_errors): - # drop failure results in folder - vdir = os.path.join(visual_output_dir,'visual-test-results') - if not os.path.exists(vdir): - os.makedirs(vdir) - html_template = open(os.path.join(dirname,'html_report_template.html'),'r').read() - name = 'comparison.html' - failures_realpath = os.path.join(vdir,name) - html_out = open(failures_realpath,'w+') - sortable_errors.sort(reverse=True) - html_body = '' - for item in sortable_errors: - # copy images into single directory - actual = item[1][1] - expected = item[1][2] - diff = item[0] - actual_new = os.path.join(vdir,os.path.basename(actual)) - shutil.copy(actual,actual_new) - expected_new = os.path.join(vdir,os.path.basename(expected)) - shutil.copy(expected,expected_new) - html_body += self.make_html_item(os.path.relpath(actual_new,vdir),os.path.relpath(expected_new,vdir),diff) - html_out.write(html_template.replace('{{RESULTS}}',html_body)) - print 'View failures by opening %s' % failures_realpath - return 1 - -def render(filename, config, scale_factor, reporting): - m = mapnik.Map(*config['sizes'][0]) - - try: - mapnik.load_map(m, os.path.join(dirname, "styles", filename), True) - - if not (m.parameters['status'] if ('status' in m.parameters) else config['status']): - return - except Exception, e: - if 'Could not create datasource' in str(e) \ - or 'Bad connection' in str(e): - return m - reporting.other_error(filename, repr(e)) - return m - - sizes = config['sizes']; - if 'sizes' in m.parameters: - sizes = [[int(i) for i in size.split(',')] for size in m.parameters['sizes'].split(';')] - - for size in sizes: - m.width, m.height = size - - if 'bbox' in m.parameters: - bbox = mapnik.Box2d.from_string(str(m.parameters['bbox'])) - m.zoom_to_box(bbox) - else: - m.zoom_all() - - name = filename[0:-4] - postfix = "%s-%d-%d-%s" % (name, m.width, m.height, scale_factor) - for renderer in renderers: - if config.get(renderer['name'], True): - expected = os.path.join(dirname, renderer['dir'], '%s-%s-reference.%s' % - (postfix, renderer['name'], renderer['filetype'])) - actual = os.path.join(visual_output_dir, '%s-%s.%s' % - (postfix, renderer['name'], renderer['filetype'])) - if not quiet: - print "\"%s\" with %s..." % (postfix, renderer['name']), - try: - renderer['render'](m, actual, scale_factor) - if not os.path.exists(expected): - reporting.not_found(actual, expected) - elif os.environ.get('UPDATE'): - reporting.updating(actual, expected) - else: - diff = renderer['compare'](actual, expected) - if diff > renderer['threshold']: - reporting.result_fail(actual, expected, diff) - else: - reporting.result_pass(actual, expected, diff) - except Exception, e: - reporting.other_error(expected, repr(e)) - return m - -if __name__ == "__main__": - if '-q' in sys.argv: - quiet = True - sys.argv.remove('-q') - else: - quiet = False - - if '--overwrite' in sys.argv: - overwrite_failures = True - sys.argv.remove('--overwrite') - else: - overwrite_failures = False - - files = None - if len(sys.argv) > 1: - files = [name + ".xml" for name in sys.argv[1:]] - else: - files = [os.path.basename(file) for file in glob.glob(os.path.join(dirname, "styles/*.xml"))] - - if not os.path.exists(visual_output_dir): - os.makedirs(visual_output_dir) - - reporting = Reporting(quiet, overwrite_failures) - try: - for filename in files: - config = dict(defaults) - for scale_factor in config['scales']: - m = render(filename, config, scale_factor, reporting) - #mapnik.save_map(m, os.path.join(dirname, 'xml_output', "%s-out.xml" % filename)) - except KeyboardInterrupt: - pass - sys.exit(reporting.summary()) diff --git a/tests/visual_tests/test_python.py b/tests/visual_tests/test_python.py deleted file mode 100755 index 4fd7c2cbe..000000000 --- a/tests/visual_tests/test_python.py +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/env python -import mapnik -import os.path -from compare import compare - -dirname = os.path.dirname(__file__) -visual_output_dir = "/tmp/mapnik-visual-images" - -class MyText(mapnik.FormattingNode): - def __init__(self): - mapnik.FormattingNode.__init__(self) - self.expr = mapnik.Expression("[name]") - self.expr_nr = mapnik.Expression("[nr]") - - def apply(self, properties, feature, output): - colors = [mapnik.Color('red'), - mapnik.Color('green'), - mapnik.Color('blue')] - text = self.expr.evaluate(feature) - if int(feature['nr']) > 5: - i = 0 - my_properties = mapnik.CharProperties(properties) - for char in text: - my_properties.fill = colors[i % len(colors)] - output.append(my_properties, char) - i += 1 - else: - output.append(properties, text) - - def add_expressions(self, output): - output.insert(self.expr) - output.insert(self.expr_nr) - - -class IfElse(mapnik.FormattingNode): - def __init__(self, condition, if_node, else_node): - mapnik.FormattingNode.__init__(self) - self.condition = mapnik.Expression(condition) - self.if_node = if_node - self.else_node = else_node - - def apply(self, properties, feature, output): - c = self.condition.evaluate(feature) - if c: - self.if_node.apply(properties, feature, output) - else: - self.else_node.apply(properties, feature, output) - - def add_expressions(self, output): - output.insert(self.condition) - self.if_node.add_expressions(output) - self.else_node.add_expressions(output) - -m = mapnik.Map(600, 100) -m.background = mapnik.Color('white') - -text = mapnik.TextSymbolizer() -text.placements.defaults.displacement = (0, 5) -text.placements.defaults.format.face_name = 'DejaVu Sans Book' - -point = mapnik.PointSymbolizer() - -rule = mapnik.Rule() -rule.symbols.append(text) -rule.symbols.append(point) - -style = mapnik.Style() -style.rules.append(rule) - -m.append_style('Style', style) - - -layer = mapnik.Layer('Layer') -layer.datasource = mapnik.Datasource(**{'type':'csv','file':os.path.join(dirname,"data/points.csv")}) -layer.styles.append('Style') -m.layers.append(layer) - -bbox = mapnik.Box2d(-0.05, -0.01, 0.95, 0.01) -m.zoom_to_box(bbox) - -formatnode = mapnik.FormattingFormat() -formatnode.child = mapnik.FormattingText("[name]") -formatnode.fill = mapnik.Color("green") - -format_trees = [ - ('TextNode', mapnik.FormattingText("[name]")), - ('MyText', MyText()), - ('IfElse', IfElse("[nr] != 5", - mapnik.FormattingText("[name]"), - mapnik.FormattingText("'SPECIAL!'"))), - ('Format', formatnode), - ('List', mapnik.FormattingList([ - mapnik.FormattingText("[name]+'\n'"), - MyText() - ]) - ) -] - - -for format_tree in format_trees: - text.placements.defaults.format_tree = format_tree[1] - actual = os.path.join(visual_output_dir, 'python-%s.png' % format_tree[0]) - expected = os.path.join(dirname,"images", 'python-%s-reference.png' % format_tree[0]) - mapnik.render_to_file(m, actual, 'png8:m=h') - diff = compare(actual,expected) - if diff > 0: - print 'comparision failed between:\n %s (actual)\n %s (expected)' % (actual,expected) diff --git a/tests/visual_tests/xml_output/.gitignore b/tests/visual_tests/xml_output/.gitignore deleted file mode 100644 index 6722cd96e..000000000 --- a/tests/visual_tests/xml_output/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.xml diff --git a/utils/geometry_to_wkb/Jamroot b/utils/geometry_to_wkb/Jamroot index 92c6686a7..edb1527ae 100644 --- a/utils/geometry_to_wkb/Jamroot +++ b/utils/geometry_to_wkb/Jamroot @@ -1,12 +1,12 @@ ###################################################################### -MAPNIK_INCLUDE_DIR = "/opt/mapnik/include" ; +MAPNIK_INCLUDE_DIR = "/Users/artem/Projects/mapnik/include" ; MAPNIK_LIB_DIR = "/opt/mapnik/lib" ; -BOOST_INCLUDE_DIR = "/opt/boost_1_48_0/include" ; - +BOOST_INCLUDE_DIR = "/opt/boost/include" ; +ICU_DIR = "/opt/icu" ; lib mapnik : : mapnik $(MAPNIK_LIB_DIR) ; -lib icu : : icuuc /usr/local/lib ; +lib icu : : icuuc $(ICU_DIR)/lib ; exe to_wkb : main.cpp @@ -14,6 +14,6 @@ exe to_wkb : .//icu : $(MAPNIK_INCLUDE_DIR) - $(BOOST_INCLUDE_DIR) + $(BOOST_INCLUDE_DIR) + $(ICU_DIR)/include ; - diff --git a/utils/geometry_to_wkb/main.cpp b/utils/geometry_to_wkb/main.cpp index 0ab4875bc..71ac5b3b1 100644 --- a/utils/geometry_to_wkb/main.cpp +++ b/utils/geometry_to_wkb/main.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,12 +26,12 @@ #include #include +#include +#include #include #include - - int main (int argc, char ** argv ) { @@ -81,21 +81,17 @@ int main (int argc, char ** argv ) while(f) { std::cerr << *f << std::endl; - mapnik::geometry_container const& paths = f->paths(); - for (mapnik::geometry_type const& geom : paths) + mapnik::geometry::geometry const& geom = f->get_geometry(); + // NDR { - // NDR - { - mapnik::util::wkb_buffer_ptr wkb = mapnik::util::to_wkb(geom,mapnik::util::wkbNDR); - std::cerr << mapnik::util::to_hex(wkb->buffer(),wkb->size()) << std::endl; - } - // XDR - { - mapnik::util::wkb_buffer_ptr wkb = mapnik::util::to_wkb(geom,mapnik::util::wkbXDR); - std::cerr << mapnik::util::to_hex(wkb->buffer(),wkb->size()) << std::endl; - } + mapnik::util::wkb_buffer_ptr wkb = mapnik::util::to_wkb(geom,mapnik::wkbNDR); + std::cerr << mapnik::util::detail::to_hex(wkb->buffer(),wkb->size()) << std::endl; + } + // XDR + { + mapnik::util::wkb_buffer_ptr wkb = mapnik::util::to_wkb(geom,mapnik::wkbXDR); + std::cerr << mapnik::util::detail::to_hex(wkb->buffer(),wkb->size()) << std::endl; } - f = fs->next(); } } diff --git a/utils/mapnik-config/build.py b/utils/mapnik-config/build.py index 31fd9ed31..60974e789 100644 --- a/utils/mapnik-config/build.py +++ b/utils/mapnik-config/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -29,7 +29,7 @@ Import('env') config_env = env.Clone() -config_variables = '''#!/bin/bash +config_variables = '''#!/usr/bin/env bash ## variables @@ -50,6 +50,9 @@ CONFIG_MAPNIK_INCLUDE="${CONFIG_PREFIX}/include -I${CONFIG_PREFIX}/include/mapni CONFIG_DEP_INCLUDES="%(dep_includes)s" CONFIG_CXXFLAGS="%(cxxflags)s" CONFIG_CXX='%(cxx)s' +CONFIG_MAPNIK_GDAL_DATA='%(mapnik_bundled_gdal_data)s' +CONFIG_MAPNIK_PROJ_LIB='%(mapnik_bundled_proj_data)s' +CONFIG_MAPNIK_ICU_DATA='%(mapnik_bundled_icu_data)s' ''' @@ -64,12 +67,12 @@ cxxflags = ' '.join(config_env['LIBMAPNIK_CXXFLAGS']) defines = ' '.join(config_env['LIBMAPNIK_DEFINES']) -dep_includes = ''.join([' -I%s' % i for i in config_env['CPPPATH'] if not i.startswith('#')]) +dep_includes = ''.join([' -I${NODE_CONFIG_PREFIX:-""}%s' % i for i in config_env['CPPPATH'] if not i.startswith('#')]) dep_includes += ' ' if config_env['HAS_CAIRO']: - dep_includes += ''.join([' -I%s' % i for i in env['CAIRO_CPPPATHS'] if not i.startswith('#')]) + dep_includes += ''.join([' -I${NODE_CONFIG_PREFIX:-""}%s' % i for i in env['CAIRO_CPPPATHS'] if not i.startswith('#')]) ldflags = ''.join([' -L%s' % i for i in config_env['LIBPATH'] if not i.startswith('#')]) ldflags += config_env['LIBMAPNIK_LINKFLAGS'] @@ -107,6 +110,15 @@ if lib_root in inputpluginspath: lib_path = "${CONFIG_PREFIX}/" + config_env['LIBDIR_SCHEMA'] +mapnik_bundled_gdal_data = '' +mapnik_bundled_proj_data = '' +mapnik_bundled_icu_data = '' + +if config_env.get('MAPNIK_BUNDLED_SHARE_DIRECTORY'): + mapnik_bundled_gdal_data = 'lib/mapnik/share/gdal' + mapnik_bundled_proj_data = 'lib/mapnik/share/proj' + mapnik_bundled_icu_data = 'lib/mapnik/share/icu' + configuration = { "git_revision": git_revision, "git_describe": git_describe, @@ -121,7 +133,10 @@ configuration = { "input_plugins": inputpluginspath, "defines":defines, "cxxflags":cxxflags, - "cxx":env['CXX'] + "cxx":env['CXX'], + "mapnik_bundled_gdal_data":mapnik_bundled_gdal_data, + "mapnik_bundled_proj_data":mapnik_bundled_proj_data, + "mapnik_bundled_icu_data":mapnik_bundled_icu_data, } ## if we are statically linking depedencies diff --git a/utils/mapnik-config/mapnik-config.template.sh b/utils/mapnik-config/mapnik-config.template.sh index a71fdf642..27dc32cdf 100755 --- a/utils/mapnik-config/mapnik-config.template.sh +++ b/utils/mapnik-config/mapnik-config.template.sh @@ -27,6 +27,9 @@ Known values for OPTION are: --cflags all include paths, compiler flags, and pre-processor defines (for back-compatibility) --cxx c++ compiler used to build mapnik (new in 2.2.0) --all-flags all compile and link flags (new in 2.2.0) + --gdal-data path to GDAL_DATA directory, if known (relevant only for packaged builds of Mapnik) (new in 3.0.0) + --proj-lib path to PROJ_LIB directory, if known (relevant only for packaged builds of Mapnik) (new in 3.0.0) + --icu-data path to ICU_DATA directory, if known (relevant only for packaged builds of Mapnik) (new in 3.0.0) EOF exit $1 @@ -128,6 +131,18 @@ while test $# -gt 0; do echo -I${CONFIG_MAPNIK_INCLUDE} ${CONFIG_DEP_INCLUDES} ${CONFIG_MAPNIK_DEFINES} ${CONFIG_CXXFLAGS} -L${CONFIG_MAPNIK_LIBPATH} -l${CONFIG_MAPNIK_LIBNAME} ${CONFIG_MAPNIK_LDFLAGS} ${CONFIG_DEP_LIBS} ;; + --gdal-data) + if [[ ${CONFIG_MAPNIK_GDAL_DATA:-unset} != "unset" ]]; then echo ${CONFIG_PREFIX}/${CONFIG_MAPNIK_GDAL_DATA}; fi; + ;; + + --proj-lib) + if [[ ${CONFIG_MAPNIK_PROJ_LIB:-unset} != "unset" ]]; then echo ${CONFIG_PREFIX}/${CONFIG_MAPNIK_PROJ_LIB}; fi; + ;; + + --icu-data) + if [[ ${CONFIG_MAPNIK_ICU_DATA:-unset} != "unset" ]]; then echo ${CONFIG_PREFIX}/${CONFIG_MAPNIK_ICU_DATA}; fi; + ;; + *) # push to stderr any invalid options echo "unknown option $1" 1>&2; diff --git a/utils/nik2img/nik2img.cpp b/utils/nik2img/nik2img.cpp index fe410be7f..e223cf086 100644 --- a/utils/nik2img/nik2img.cpp +++ b/utils/nik2img/nik2img.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include @@ -12,7 +11,6 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" -#include #include #include #pragma GCC diagnostic pop @@ -111,7 +109,7 @@ int main (int argc,char** argv) mapnik::Map map(600,400); mapnik::load_map(map,xml_file,true); map.zoom_all(); - mapnik::image_32 im(map.width(),map.height()); + mapnik::image_rgba8 im(map.width(),map.height()); mapnik::request req(map.width(),map.height(),map.get_current_extent()); req.set_buffer_size(map.buffer_size()); mapnik::attributes vars; @@ -136,11 +134,11 @@ int main (int argc,char** argv) vars[name] = tr.transcode(param.second.get().c_str()); } } - } + } } - mapnik::agg_renderer ren(map,req,vars,im,scale_factor,0,0); + mapnik::agg_renderer ren(map,req,vars,im,scale_factor,0,0); ren.apply(); - mapnik::save_to_file(im.data(),img_file); + mapnik::save_to_file(im,img_file); if (auto_open) { std::ostringstream s; diff --git a/utils/ogrindex/build.py b/utils/ogrindex/build.py index 4e115f9df..68a4c0452 100644 --- a/utils/ogrindex/build.py +++ b/utils/ogrindex/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os import glob @@ -32,7 +32,7 @@ source = Split( """ ) -headers = ['#plugins/input/ogr'] + env['CPPPATH'] +headers = ['#plugins/input/ogr'] + env['CPPPATH'] program_env['LIBS'] = [env['PLUGINS']['ogr']['lib']] diff --git a/utils/ogrindex/ogrindex.cpp b/utils/ogrindex/ogrindex.cpp index 66c94c192..3e7fd503c 100644 --- a/utils/ogrindex/ogrindex.cpp +++ b/utils/ogrindex/ogrindex.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,6 @@ #include #include -#include #include #include diff --git a/utils/performance/build.py b/utils/performance/build.py deleted file mode 100644 index 8fb7d6b32..000000000 --- a/utils/performance/build.py +++ /dev/null @@ -1,32 +0,0 @@ -# -# This file is part of Mapnik (c++ mapping toolkit) -# -# Copyright (C) 2013 Artem Pavlenko -# -# Mapnik 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 -# -# - - -import os -Import ('env') - -TARGET = 'mapnik-speed-check' - -if 'uninstall' not in COMMAND_LINE_TARGETS: - env.Install(os.path.join(env['INSTALL_PREFIX'],'bin'), TARGET) - env.Alias('install', os.path.join(env['INSTALL_PREFIX'],'bin')) - -env['create_uninstall_target'](env, os.path.join(env['INSTALL_PREFIX'],'bin',TARGET)) diff --git a/utils/performance/mapnik-speed-check b/utils/performance/mapnik-speed-check deleted file mode 100755 index 44cf0bc84..000000000 --- a/utils/performance/mapnik-speed-check +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python - -import sys -import mapnik -#import mapnik -from timeit import Timer, time - -if not len(sys.argv) >= 3: - sys.exit('usage: mapnik-speed-check [minx,miny,maxx,maxy]') - -m = mapnik.Map(256,256) -stylesheet = sys.argv[1] - -TOTAL_TIME = 0 - -def load(): - global TOTAL_TIME - global stylesheet - start = time.time() - m = mapnik.Map(256,256) - mapnik.load_map(m,stylesheet) - TOTAL_TIME += (time.time() - start) - -def init(stylesheet): - mapnik.load_map(m,stylesheet) - m.zoom_all() - -def render(): - global TOTAL_TIME - start = time.time() - im = mapnik.Image(m.width,m.height) - mapnik.render(m,im) - TOTAL_TIME += (time.time() - start) - -def f_(set): - min_ = str(min(set)*1000)[:6] - avg = str((sum(set)/len(set))*1000)[:6] - print 'min: %sms | avg: %sms | total: %ss' % (min_,avg,str(TOTAL_TIME)[:6]) - -if __name__=='__main__': - # if passed, set up bbox - - #test_ = "load()" - test_ = "render()" - init(stylesheet) - - if len(sys.argv) == 4: - bbox = sys.argv[3] - if ',' in bbox: - parts = bbox.split(',') - else: - parts = bbox.split(' ') - env = mapnik.Box2d(*map(float,parts)) - m.zoom_to_box(env) - - # load once - making sure mmap'd shapefiles are loaded - eval(test_) - TOTAL_TIME = 0 - - # now actually run the test - t = Timer(test_, "from __main__ import %s" % test_.replace('()','')) - iterations = int(sys.argv[2]) - f_(t.repeat(iterations,1)) \ No newline at end of file diff --git a/utils/pgsql2sqlite/build.py b/utils/pgsql2sqlite/build.py index a150e02a6..45d90035b 100644 --- a/utils/pgsql2sqlite/build.py +++ b/utils/pgsql2sqlite/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os diff --git a/utils/pgsql2sqlite/main.cpp b/utils/pgsql2sqlite/main.cpp index 63d9b50a3..39ced62be 100644 --- a/utils/pgsql2sqlite/main.cpp +++ b/utils/pgsql2sqlite/main.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/utils/pgsql2sqlite/pgsql2sqlite.hpp b/utils/pgsql2sqlite/pgsql2sqlite.hpp index 146c0f0f9..5c5a640c3 100644 --- a/utils/pgsql2sqlite/pgsql2sqlite.hpp +++ b/utils/pgsql2sqlite/pgsql2sqlite.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,6 +29,8 @@ #include #include #include +#include +#include #include "connection_manager.hpp" #include "cursorresultset.hpp" @@ -387,21 +389,18 @@ void pgsql2sqlite(Connection conn, if (oid == geometry_oid) { mapnik::Feature feat(ctx,pkid); - if (geometry_utils::from_wkb(feat.paths(),buf,size,wkbGeneric) - && feat.num_geometries() > 0) + mapnik::geometry::geometry geom = geometry_utils::from_wkb(buf, size, wkbGeneric); + if (!mapnik::geometry::is_empty(geom)) { - geometry_type const& geom=feat.get_geometry(0); - box2d bbox = geom.envelope(); + box2d bbox = mapnik::geometry::envelope(geom); if (bbox.valid()) { sqlite::record_type rec; - rec.push_back(sqlite::value_type(pkid)); rec.push_back(sqlite::value_type(bbox.minx())); rec.push_back(sqlite::value_type(bbox.maxx())); rec.push_back(sqlite::value_type(bbox.miny())); rec.push_back(sqlite::value_type(bbox.maxy())); - spatial_index.insert_record(rec); empty_geom = false; } diff --git a/utils/pgsql2sqlite/sqlite.cpp b/utils/pgsql2sqlite/sqlite.cpp index 61ef5b3d2..95c67b8cf 100644 --- a/utils/pgsql2sqlite/sqlite.cpp +++ b/utils/pgsql2sqlite/sqlite.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/utils/pgsql2sqlite/sqlite.hpp b/utils/pgsql2sqlite/sqlite.hpp index fcafe21f9..07d2128a3 100644 --- a/utils/pgsql2sqlite/sqlite.hpp +++ b/utils/pgsql2sqlite/sqlite.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/utils/shapeindex/build.py b/utils/shapeindex/build.py index b769cda24..9f7de7445 100644 --- a/utils/shapeindex/build.py +++ b/utils/shapeindex/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os import glob @@ -33,7 +33,7 @@ source = Split( """ ) -headers = ['#plugins/input/shape'] + env['CPPPATH'] +headers = ['#plugins/input/shape'] + env['CPPPATH'] boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND'] boost_system = 'boost_system%s' % env['BOOST_APPEND'] @@ -52,4 +52,4 @@ if 'uninstall' not in COMMAND_LINE_TARGETS: env.Install(os.path.join(env['INSTALL_PREFIX'],'bin'), shapeindex) env.Alias('install', os.path.join(env['INSTALL_PREFIX'],'bin')) -env['create_uninstall_target'](env, os.path.join(env['INSTALL_PREFIX'],'bin','shapeindex')) \ No newline at end of file +env['create_uninstall_target'](env, os.path.join(env['INSTALL_PREFIX'],'bin','shapeindex')) diff --git a/utils/shapeindex/quadtree.hpp b/utils/shapeindex/quadtree.hpp index 0ad2fd6dd..440ce5051 100644 --- a/utils/shapeindex/quadtree.hpp +++ b/utils/shapeindex/quadtree.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/utils/shapeindex/shapeindex.cpp b/utils/shapeindex/shapeindex.cpp index 18b237a5a..435daba71 100644 --- a/utils/shapeindex/shapeindex.cpp +++ b/utils/shapeindex/shapeindex.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,7 +32,6 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" -#include #include #include #pragma GCC diagnostic pop @@ -110,18 +109,18 @@ int main (int argc,char** argv) clog << "max tree depth:" << depth << endl; clog << "split ratio:" << ratio << endl; - vector::const_iterator itr = shape_files.begin(); - if (itr == shape_files.end()) + //vector::const_iterator itr = shape_files.begin(); + if (shape_files.size() == 0) { clog << "no shape files to index" << endl; return 0; } - while (itr != shape_files.end()) + for (auto const& filename : shape_files) { - clog << "processing " << *itr << endl; - std::string shapename (*itr++); + clog << "processing " << filename << endl; + std::string shapename (filename); boost::algorithm::ireplace_last(shapename,".shp",""); - std::string shapename_full (shapename+".shp"); + std::string shapename_full (shapename + ".shp"); if (! mapnik::util::exists (shapename_full)) { @@ -165,17 +164,23 @@ int main (int argc,char** argv) box2d item_ext; if (shape_type==shape_io::shape_null) { - // still need to increment pos, or the pos counter - // won't indicate EOF until too late. - pos+=4+content_length; - continue; + if (pos >= file_length) + { + break; + } + else + { + // still need to increment pos, or the pos counter + // won't indicate EOF until too late. + pos+=4+content_length; + continue; + } } else if (shape_type==shape_io::shape_point) { double x=shp.read_double(); double y=shp.read_double(); item_ext=box2d(x,y,x,y); - } else if (shape_type==shape_io::shape_pointm) { @@ -184,7 +189,6 @@ int main (int argc,char** argv) // skip m shp.read_double(); item_ext=box2d(x,y,x,y); - } else if (shape_type==shape_io::shape_pointz) { @@ -192,31 +196,39 @@ int main (int argc,char** argv) double y=shp.read_double(); // skip z shp.read_double(); - //skip m if exists - if ( content_length == 8 + 36) + // According to ESRI shapefile doc + // A PointZ consists of a triplet of double-precision coordinates in the order X, Y, Z plus a + // measure. + // PointZ + // { + // Double X // X coordinate + // Double Y // Y coordinate + // Double Z // Z coordinate + // Double M // Measure + // } + // But OGR creates shapefiles with M missing so we need to skip M only if present + // NOTE: content_length is in 16-bit words + if ( content_length == 18) { shp.read_double(); } item_ext=box2d(x,y,x,y); } - else { shp.read_envelope(item_ext); shp.skip(2*content_length-4*8-4); } - tree.insert(offset,item_ext); - if (verbose) { + if (verbose) + { clog << "record number " << record_number << " box=" << item_ext << endl; } pos+=4+content_length; ++count; - if (pos>=file_length) { - break; - } + if (pos >= file_length) break; } clog << " number shapes=" << count << endl; diff --git a/utils/stats/mapdef_stats.py b/utils/stats/mapdef_stats.py deleted file mode 100755 index 29c79f17a..000000000 --- a/utils/stats/mapdef_stats.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python - -import sys -from mapnik import * -if __name__ == "__main__": - if len(sys.argv) != 2: - print "usage : ./mapdef_stats.py " - sys.exit(0) - - m = Map(100,100) - styles = [] - num_rules = 0 - num_sym = 0 - load_map(m,sys.argv[1]) - for l in m.layers: - print "Layer:%s" % l.name - for s in l.styles: - print " Style:%s" % s - styles.append(s) - style = m.find_style(s) - num_rules += len(style.rules) - for r in style.rules: - print " Filter: %s" % r.filter - num_sym += len(r.symbols) - - print "Total number of layers %s" % len(m.layers) - print "Total number of styles %s" % len(set(styles)) # unique styles - print "Total number of rules %s" % num_rules - print "Total number of symbolizers %s" % num_sym diff --git a/utils/svg2png/build.py b/utils/svg2png/build.py index 71725ff3a..2f3adcbb2 100644 --- a/utils/svg2png/build.py +++ b/utils/svg2png/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os import glob diff --git a/utils/svg2png/svg2png.cpp b/utils/svg2png/svg2png.cpp index ab3c6285b..7e3aca532 100644 --- a/utils/svg2png/svg2png.cpp +++ b/utils/svg2png/svg2png.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -51,6 +50,92 @@ #include // for xmlInitParser(), xmlCleanupParser() +struct main_marker_visitor +{ + main_marker_visitor(std::string & svg_name, + int & return_value, + bool verbose, + bool auto_open) + : svg_name_(svg_name), + return_value_(return_value), + verbose_(verbose), + auto_open_(auto_open) {} + + void operator() (mapnik::marker_null const&) + { + std::clog << "svg2png error: '" << svg_name_ << "' is not a valid vector!\n"; + return_value_ = -1; + } + + void operator() (mapnik::marker_rgba8 const&) + { + std::clog << "svg2png error: '" << svg_name_ << "' is not a valid vector!\n"; + return_value_ = -1; + } + + void operator() (mapnik::marker_svg const& marker) + { + using pixfmt = agg::pixfmt_rgba32_pre; + using renderer_base = agg::renderer_base; + using renderer_solid = agg::renderer_scanline_aa_solid; + agg::rasterizer_scanline_aa<> ras_ptr; + agg::scanline_u8 sl; + + double opacity = 1; + int w = marker.width(); + int h = marker.height(); + if (verbose_) + { + std::clog << "found width of '" << w << "' and height of '" << h << "'\n"; + } + // 10 pixel buffer to avoid edge clipping of 100% svg's + mapnik::image_rgba8 im(w+0,h+0); + agg::rendering_buffer buf(im.bytes(), im.width(), im.height(), im.row_size()); + pixfmt pixf(buf); + renderer_base renb(pixf); + + mapnik::box2d const& bbox = marker.get_data()->bounding_box(); + mapnik::coord c = bbox.center(); + // center the svg marker on '0,0' + agg::trans_affine mtx = agg::trans_affine_translation(-c.x,-c.y); + // render the marker at the center of the marker box + mtx.translate(0.5 * im.width(), 0.5 * im.height()); + + mapnik::svg::vertex_stl_adapter stl_storage(marker.get_data()->source()); + mapnik::svg::svg_path_adapter svg_path(stl_storage); + mapnik::svg::svg_renderer_agg, + renderer_solid, + agg::pixfmt_rgba32_pre > svg_renderer_this(svg_path, + marker.get_data()->attributes()); + + svg_renderer_this.render(ras_ptr, sl, renb, mtx, opacity, bbox); + + boost::algorithm::ireplace_last(svg_name_,".svg",".png"); + demultiply_alpha(im); + mapnik::save_to_file(im,svg_name_,"png"); + if (auto_open_) + { + std::ostringstream s; +#ifdef DARWIN + s << "open " << svg_name_; +#else + s << "xdg-open " << svg_name_; +#endif + int ret = system(s.str().c_str()); + if (ret != 0) + return_value_ = ret; + } + std::clog << "rendered to: " << svg_name_ << "\n"; + + } + + private: + std::string & svg_name_; + int & return_value_; + bool verbose_; + bool auto_open_; +}; int main (int argc,char** argv) { @@ -128,74 +213,9 @@ int main (int argc,char** argv) std::clog << "found: " << svg_name << "\n"; } - boost::optional marker_ptr = - mapnik::marker_cache::instance().find(svg_name, false); - if (!marker_ptr) - { - std::clog << "svg2png error: could not open: '" << svg_name << "'\n"; - return_value = -1; - continue; - } - mapnik::marker marker = **marker_ptr; - if (!marker.is_vector()) - { - std::clog << "svg2png error: '" << svg_name << "' is not a valid vector!\n"; - return_value = -1; - continue; - } - - using pixfmt = agg::pixfmt_rgba32_pre; - using renderer_base = agg::renderer_base; - using renderer_solid = agg::renderer_scanline_aa_solid; - agg::rasterizer_scanline_aa<> ras_ptr; - agg::scanline_u8 sl; - - double opacity = 1; - int w = marker.width(); - int h = marker.height(); - if (verbose) - { - std::clog << "found width of '" << w << "' and height of '" << h << "'\n"; - } - // 10 pixel buffer to avoid edge clipping of 100% svg's - mapnik::image_32 im(w+0,h+0); - agg::rendering_buffer buf(im.raw_data(), im.width(), im.height(), im.width() * 4); - pixfmt pixf(buf); - renderer_base renb(pixf); - - mapnik::box2d const& bbox = (*marker.get_vector_data())->bounding_box(); - mapnik::coord c = bbox.center(); - // center the svg marker on '0,0' - agg::trans_affine mtx = agg::trans_affine_translation(-c.x,-c.y); - // render the marker at the center of the marker box - mtx.translate(0.5 * im.width(), 0.5 * im.height()); - - mapnik::svg::vertex_stl_adapter stl_storage((*marker.get_vector_data())->source()); - mapnik::svg::svg_path_adapter svg_path(stl_storage); - mapnik::svg::svg_renderer_agg, - renderer_solid, - agg::pixfmt_rgba32_pre > svg_renderer_this(svg_path, - (*marker.get_vector_data())->attributes()); - - svg_renderer_this.render(ras_ptr, sl, renb, mtx, opacity, bbox); - - boost::algorithm::ireplace_last(svg_name,".svg",".png"); - im.demultiply(); - mapnik::save_to_file(im.data(),svg_name,"png"); - if (auto_open) - { - std::ostringstream s; -#ifdef DARWIN - s << "open " << svg_name; -#else - s << "xdg-open " << svg_name; -#endif - int ret = system(s.str().c_str()); - if (ret != 0) - return_value = ret; - } - std::clog << "rendered to: " << svg_name << "\n"; + std::shared_ptr marker = mapnik::marker_cache::instance().find(svg_name, false); + main_marker_visitor visitor(svg_name, return_value, verbose, auto_open); + mapnik::util::apply_visitor(visitor, *marker); } } catch (...) diff --git a/utils/upgrade_map_xml/build.py b/utils/upgrade_map_xml/build.py deleted file mode 100644 index 648130f0a..000000000 --- a/utils/upgrade_map_xml/build.py +++ /dev/null @@ -1,31 +0,0 @@ -# -# This file is part of Mapnik (c++ mapping toolkit) -# -# Copyright (C) 2013 Artem Pavlenko -# -# Mapnik 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 -# -# - -import os -Import ('env') - -target = os.path.join(env['INSTALL_PREFIX'],'bin') - -if 'uninstall' not in COMMAND_LINE_TARGETS: - env.Install(target,'upgrade_map_xml.py') - env.Alias('install', os.path.join(env['INSTALL_PREFIX'],'bin')) - -env['create_uninstall_target'](env, os.path.join(target,'upgrade_map_xml.py')) diff --git a/utils/upgrade_map_xml/upgrade_map_xml.py b/utils/upgrade_map_xml/upgrade_map_xml.py deleted file mode 100755 index 45561a7d3..000000000 --- a/utils/upgrade_map_xml/upgrade_map_xml.py +++ /dev/null @@ -1,275 +0,0 @@ -#!/usr/bin/env python - -import os -import re -import sys -import optparse -import tempfile - -__version__ = '0.1.0' - -HAS_LXML = False - -try: - import lxml.etree as etree - HAS_LXML = True -except ImportError: - try: - import elementtree.ElementTree as etree - except ImportError: - import xml.etree.ElementTree as etree - -def color_text(color, text): - if os.name == 'nt': - return text - return "\033[9%sm%s\033[0m" % (color,text) - -def indent(elem, level=0): - """ http://infix.se/2007/02/06/gentlemen-indent-your-xml - """ - i = "\n" + level*" " - if len(elem): - if not elem.text or not elem.text.strip(): - elem.text = i + " " - for e in elem: - indent(e, level+1) - if not e.tail or not e.tail.strip(): - e.tail = i + " " - if not e.tail or not e.tail.strip(): - e.tail = i - else: - if level and (not elem.tail or not elem.tail.strip()): - elem.tail = i - -def name2expr(sym): - if 'name' not in sym.attrib: return - name = sym.attrib['name'] - if re.match('^\[.*\]',name) is None \ - and '[' not in name \ - and ']' not in name \ - and not name.startswith("'") \ - and not name.endswith("'") \ - and re.match("^\'.*\'",name) is None: - print>>sys.stderr,"Fixing %s" % name - name = '[%s]' % name - sym.attrib.pop('name') - sym.text = name - -def handle_attr_changes(sym): - # http://www.w3schools.com/css/pr_text_text-transform.asp - # http://code.google.com/p/mapnik-utils/issues/detail?id=32&colspec=ID%20Type%20Status%20Priority%20Component%20Owner%20Summary - text_convert = sym.attrib.get('text_convert',sym.attrib.get('text_transform',sym.attrib.get('text_transform'))) - if text_convert: - # note: css supports text-transform:capitalize but Mapnik does not (yet) - t_ = {'tolower':'lowercase','toupper':'uppercase','none':'none'} - new = t_.get(text_convert) - if new: - sym.attrib['text-transform'] = new - else: - sym.attrib['text-transform'] = text_convert - if sym.attrib.get('text_convert'): - sym.attrib.pop('text_convert') - if sym.attrib.get('text_transform'): - sym.attrib.pop('text_transform') - - # https://github.com/mapnik/mapnik/issues/807 - justify_alignment = sym.attrib.get('justify_alignment',sym.attrib.get('justify-alignment')) - if justify_alignment and justify_alignment == "middle": - sym.attrib['justify-alignment'] = 'center' - - minimum_distance = sym.attrib.get('min_distance') - if minimum_distance: - sym.attrib['minimum-distance'] = minimum_distance - sym.attrib.pop('min_distance') - - minimum_padding = sym.attrib.get('min_padding') - if minimum_padding: - sym.attrib['minimum-padding'] = minimum_padding - sym.attrib.pop('min_padding') - -def fixup_sym_with_image(sym): - if sym.attrib.get('width'): - sym.attrib.pop('width') - if sym.attrib.get('height'): - sym.attrib.pop('height') - if sym.attrib.get('type'): - sym.attrib.pop('type') - -def fixup_sym_attributes(sym): - if len(sym.findall('CssParameter')): - # copy, so we don't loose after clear() - attrib = dict(sym.attrib) - for css in sym.findall('CssParameter'): - key = css.attrib.get('name') - value = css.text - attrib[key] = value - sym.clear() # remove CssParameter elements - for k,v in attrib.items(): # insert attributes instead - sym.attrib[k] = v - -def underscore2dash(elem): - for i in elem.attrib.items(): - if '_' in i[0]: - new = i[0].replace('_','-') - old = i[0] - elem.attrib[new] = i[1] - elem.attrib.pop(old) - print>>sys.stderr,"Changing %s to %s" % (old,new) - - -def upgrade(input_xml,output_xml=None,indent_xml=True): - - if not os.path.exists(input_xml): - sys.stderr.write('input xml "%s" does not exist' % input_xml) - sys.exit(1) - - pre_read = open(input_xml,'r') - if '!ENTITY' in pre_read.read() and not HAS_LXML: - sys.stderr.write('\nSorry, it appears the xml you are trying to upgrade has entities, which requires lxml (python bindings to libxml2)\n') - sys.stderr.write('Install lxml with: "easy_install lxml" or download from http://codespeak.net/lxml/\n') - - sys.exit(1) - - try: - tree = etree.parse(input_xml) - except: - print 'Could not parse "%s" invalid XML' % input_xml - return - - if hasattr(tree,'xinclude'): - tree.xinclude() - root = tree.getroot() - - # rename 'bgcolor' to 'background-color' - if root.attrib.get('bgcolor'): - root.attrib['background-color'] = root.attrib.get('bgcolor') - root.attrib.pop('bgcolor') - - # underscores to spaces for - underscore2dash(root) - - root.set('minimum-version', '0.7.2') - - # underscores to spaces for - fontset = root.findall('FontSet') or root.findall('*/FontSet') - for f in fontset: - font = f.findall('Font') - for f_ in font: - underscore2dash(f_) - - # underscores to spaces for - layers = root.findall('Layer') or root.findall('*/Layer') - for l in layers: - underscore2dash(l) - - - styles = root.findall('Style') or root.findall('*/Style') - if not len(styles): - sys.stderr.write('### Warning, no styles encountered and nothing able to be upgraded!\n') - else: - for style in styles: - for rule in style.findall('Rule'): - for sym in rule.findall('TextSymbolizer') or []: - name2expr(sym) - handle_attr_changes(sym) - fixup_sym_attributes(sym) - underscore2dash(sym) - for sym in rule.findall('ShieldSymbolizer') or []: - name2expr(sym) - handle_attr_changes(sym) - fixup_sym_attributes(sym) - underscore2dash(sym) - fixup_sym_with_image(sym) - for sym in rule.findall('PointSymbolizer') or []: - fixup_sym_with_image(sym) - fixup_sym_attributes(sym) - underscore2dash(sym) - for sym in rule.findall('PolygonPatternSymbolizer') or []: - fixup_sym_with_image(sym) - fixup_sym_attributes(sym) - underscore2dash(sym) - for sym in rule.findall('LinePatternSymbolizer') or []: - fixup_sym_with_image(sym) - fixup_sym_attributes(sym) - underscore2dash(sym) - for sym in rule.findall('LineSymbolizer') or []: - fixup_sym_attributes(sym) - underscore2dash(sym) - for sym in rule.findall('PolygonSymbolizer') or []: - fixup_sym_attributes(sym) - underscore2dash(sym) - for sym in rule.findall('RasterSymbolizer') or []: - fixup_sym_attributes(sym) - underscore2dash(sym) - for sym in rule.findall('BuildingSymbolizer') or []: - fixup_sym_attributes(sym) - underscore2dash(sym) - for sym in rule.findall('MarkersSymbolizer') or []: - fixup_sym_attributes(sym) - underscore2dash(sym) - - if indent_xml: - indent(root) - - if output_xml: - tree.write(output_xml) - else: - tree.write(input_xml) - -parser = optparse.OptionParser(usage="""%prog [options] - -Upgrade a Mapnik XML stylesheet to Mapnik 2.0 - -Full help: - $ %prog -h (or --help for possible options) - -Read 'map.xml' and write new 'map2.xml' - $ %prog map.xml map2.xml - -Update 'map.xml' in place (*Careful*) - $ %prog map.xml --in-place - -""", version='%prog ' + __version__) - -parser.add_option('--indent', - dest='indent_xml', - action='store_true', - default=False, - help='Indent the resulting XML') - -parser.add_option('--in-place', - dest='update_in_place', - action='store_true', - default=False, - help='Update and overwrite the map in place') - -if __name__ == "__main__": - - (options, args) = parser.parse_args() - if not len(args) > 0: - parser.error("Please provide the path to a map.xml and a new xml to write") - - input_xml = args[0] - output_xml = None - - if len(args) < 3 and not options.update_in_place: - if len(args) == 2: - output_xml = args[1] - - if (len(args) == 1) or (input_xml == output_xml): - parser.error(color_text(1,'\n\nAre you sure you want to overwrite "%s"?\nIf so, then pass --in-place to confirm.\nOtherwise pass a different filename to write an upgraded copy to.\n' % input_xml)) - - print 'Upgrading "%s" to "%s"...' % (input_xml,output_xml) - upgrade(input_xml,output_xml=output_xml,indent_xml=options.indent_xml) - - elif len(args) == 1: - print 'Upgrading "%s"...' % (input_xml) - upgrade(input_xml,output_xml=output_xml,indent_xml=options.indent_xml) - - elif len(args) > 1: # assume a list of inputs - found = [] - for input_xml in args: - if os.path.exists(input_xml) and input_xml not in found: - print 'Upgrading "%s" in place...' % input_xml - found.append(input_xml) - upgrade(input_xml,output_xml=None,indent_xml=options.indent_xml) diff --git a/utils/upgrade_map_xml/upgrade_map_xml_keep_ent.py b/utils/upgrade_map_xml/upgrade_map_xml_keep_ent.py deleted file mode 100755 index 74330de9c..000000000 --- a/utils/upgrade_map_xml/upgrade_map_xml_keep_ent.py +++ /dev/null @@ -1,194 +0,0 @@ -#!/usr/bin/env python -import os -import sys -from lxml import etree -from lxml import objectify -import re -import StringIO - -# APPROACH: -# There is no way get the original DOCTYPE declaration with lxml, thus -# first I have to get it with regular expressions, after updating -# the xml it is appended under the xml declaration -# -# A dummy_map tree is created to resolve some layers entities. -# -# That is, the script looks into the includes folder and resolves the layer -# entities manually to append them at the end of the xml tree -# and update them. - -# NOTE: It will only resolve entities that are declared like -# -# -# If your entity name starts with `layer', the script will try to -# find a file where to extract from the layers to be updated -dummy_map = """ - -%s - -""" - -def name2expr(sym): - if 'name' not in sym.attrib: return - name = sym.attrib['name'] - if re.match('^\[.*\]$',name) is None \ - and '[' not in name \ - and ']' not in name \ - and not name.startswith("'") \ - and not name.endswith("'") \ - and re.match("^\'.*\'",name) is None: - print >> sys.stderr,"Fixing %s" % name - name = '[%s]' % name - sym.attrib.pop('name') - sym._setText(name) - -def fixup_pointsym(sym): - if sym.attrib.get('width'): - sym.attrib.pop('width') - if sym.attrib.get('height'): - sym.attrib.pop('height') - if sym.attrib.get('type'): - sym.attrib.pop('type') - -def fixup_sym_attributes(sym): - if not hasattr(sym,'CssParameter'): - return - attrib = {} - for css in sym.CssParameter: - key = css.attrib.get('name') - value = css.text - attrib[key] = value - sym.clear() # remove CssParameter elements - for k,v in attrib.items(): # insert attributes instead - sym.attrib[k] = v - - -if __name__ == "__main__": - - # Required parameters: - # map_xml_file: outdated stylesheet file - # output_file: new stylesheet file - # includes folder - - if len(sys.argv) < 4: - print >> sys.stderr,'Usage: %s ' % sys.argv[0] - sys.exit(1) - xml = sys.argv[1] - - if sys.argv[3] is not None: - includes_folder = sys.argv[3] - - # Get the good doctype with the unresolved external entities - # since it is forever lost once the xml is parsed - file = open(xml, 'r') - xml_string = file.read() - file.close() - match = re.match(r'(?ims).*DOCTYPE.*\[.*\]\>', xml_string) - good_doctype = "" - if match: - good_doctype = match.group() - - # Two trees. One with the unresolved entities... - parser = objectify.makeparser(resolve_entities=False) - # tree = objectify.parse(xml, parser=parser) - # root = tree.getroot() - - # ...and another with the entities resolved. - # This dummy tree expands the entities that I found and puts them - # in a dictionary (entity) => resolved_entity - # NOTE: `findall' makes the script very slow - - # First get the entities declared in the header - temp_xml = ''.join([good_doctype, dummy_map % '']) - expanded_tree = objectify.parse(StringIO.StringIO(temp_xml)) - expanded_tree_string = etree.tostring(expanded_tree, - pretty_print=True, - xml_declaration=True, - encoding="utf-8") - match = re.match(r'(?ims).*DOCTYPE.*\[.*\]\>', expanded_tree_string) - resolved_doctype = "" - if match: - resolved_doctype = match.group() - - doctype_entities = {} - # e.g.: - # - for line in StringIO.StringIO(resolved_doctype).readlines(): - entity_kv = re.match(r'(?ims)(.*ENTITY.*?(?P\b[a-z09].*?\b) .*\"(?P.*)\").*', line) - # Only consider internal entities - if (entity_kv is not None) and not (re.search("%", line)): - doctype_entities[''.join(['&',entity_kv.groupdict()['entity_key']])] = entity_kv.groupdict()['entity_value'] - - layer_entities = [] - for entity in doctype_entities: - if re.search('layer', entity): - layer_entities.append(entity) - - - # Remove the layer entities - fixed_xml_string = xml_string - for layer in layer_entities: - pattern = '(?ims)%s;' % layer - fixed_xml_string = re.sub(pattern, '', fixed_xml_string) - print "removed ", layer - - # Tree to be updated to be mapnik compliant - tree = objectify.parse(StringIO.StringIO(fixed_xml_string), parser=parser) - root = tree.getroot() - - for layer in layer_entities: - file = open("%s/%s" % (includes_folder, doctype_entities[layer])) - layer_xml_string = file.read() - file.close() - - print "Found this layer:", layer - # Parse without resolving entities - layer_xml = ''.join([good_doctype, dummy_map % layer_xml_string]) - layer_tree = objectify.parse(StringIO.StringIO(layer_xml), parser=parser) - layer_root = layer_tree.getroot() - layer_children = layer_root.getchildren() - # Append this layer's styles and layers to the tree to be updated - # print layer_children - root.extend(layer_children) - - # Update the styles - for style in root.Style: - if len(style.Rule): - # fix [name] thing - for rule in style.Rule: - if hasattr(rule,'TextSymbolizer'): - for sym in rule.TextSymbolizer: - name2expr(sym) - if hasattr(rule,'ShieldSymbolizer'): - for sym in rule.ShieldSymbolizer: - name2expr(sym) - if hasattr(rule,'PointSymbolizer'): - for sym in rule.PointSymbolizer: - fixup_pointsym(sym) - if hasattr(rule,'LineSymbolizer') : - for sym in rule.LineSymbolizer: - fixup_sym_attributes(sym) - if hasattr(rule,'PolygonSymbolizer') : - for sym in rule.PolygonSymbolizer: - fixup_sym_attributes(sym) - if hasattr(rule,'RasterSymbolizer') : - for sym in rule.RasterSymbolizer: - fixup_sym_attributes(sym) - if hasattr(rule,'BuildingSymbolizer') : - for sym in rule.BuildingSymbolizer: - fixup_sym_attributes(sym) - - updated_xml = etree.tostring(tree, - pretty_print=True, - xml_declaration=True, - encoding="utf-8", - standalone=True) - - # Insert the original doctype declaration - fixed_updated_xml = re.sub(r'(?ims)^.*DOCTYPE.*\[.*\]\>', good_doctype, updated_xml) - - output_file = open(sys.argv[2], 'w') - output_file.write(fixed_updated_xml) - output_file.close() - - # print fixed_updated_xml